Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: PHP :: Parse error

  1. #1
    Join Date
    Apr 2004
    Location
    Peterborough
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP :: Parse error

    Hello

    A friend of mine, quite funny called Andy as well - lol - he said he's getting a Parse Error in PHP - does anyone know how to fix this

    PHP Code:
    <?php
     
    /*
     
    $Id: specials.php,v 1.41 2003/06/29 22:50:52 hpdl Exp $
     
     
     
    osCommerce, Open Source E-Commerce Solutions
     
    http://www.oscommerce.com
     
     
     
    Copyright (c) 2003 osCommerce
     
     
     
    Released under the GNU General Public License
     
    */
     
     
     
    require('includes/application_top.php');
     
     
     
    require(
    DIR_WS_CLASSES 'currencies.php');
     
    $currencies = new currencies();
     
     
     
    $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
     
     
     
    if (
    tep_not_null($action)) {
     
        switch (
    $action) {
     
         case 
    'setflag':
     
             
    tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);
     
     
     
             
    tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' $HTTP_GET_VARS['page'] . '&' '') . 'sID=' $HTTP_GET_VARS['id'], 'NONSSL'));
     
             break;
     
         case 
    'insert':
     
            
    $products_id tep_db_prepare_input($HTTP_POST_VARS['products_id']);
     
            
    $products_price tep_db_prepare_input($HTTP_POST_VARS['products_price']);
     
            
    $specials_price tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
     
            
    $day tep_db_prepare_input($HTTP_POST_VARS['day']);
     
            
    $month tep_db_prepare_input($HTTP_POST_VARS['month']);
     
            
    $year tep_db_prepare_input($HTTP_POST_VARS['year']);
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
             
    $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
     
            
    $price_query tep_db_query("select customers_group_price from " TABLE_PRODUCTS_GROUPS" WHERE products_id = ".(int)$products_id " AND customers_group_id = ".(int)$customers_group);
     
            while (
    $gprices tep_db_fetch_array($price_query)) {
     
                 
    $products_price=$gprices['customers_group_price'];
     
             }
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
            
    if (substr($specials_price, -1) == '%') {
     
             
    $new_special_insert_query tep_db_query("select products_id, products_price from " TABLE_PRODUCTS " where products_id = '" . (int)$products_id "'");
     
             
    $new_special_insert tep_db_fetch_array($new_special_insert_query);
     
     
     
             
    $products_price $new_special_insert['products_price'];
     
             
    $specials_price = ($products_price - (($specials_price 100) * $products_price));
     
             }
     
     
     
            
    $expires_date '';
     
            if (
    tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
     
             
    $expires_date $year;
     
             
    $expires_date .= (strlen($month) == 1) ? '0' $month $month;
     
             
    $expires_date .= (strlen($day) == 1) ? '0' $day $day;
     
             }
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
    // Next line was original code
     
    //         tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1')");
     
             
    tep_db_query("insert into " TABLE_SPECIALS " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" (int)$products_id "', '" tep_db_input($specials_price) . "', now(), '" tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
             
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page']));
     
             break;
     
         case 
    'update':
     
            
    $specials_id tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
     
            
    $products_price tep_db_prepare_input($HTTP_POST_VARS['products_price']);
     
            
    $specials_price tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
     
            
    $day tep_db_prepare_input($HTTP_POST_VARS['day']);
     
            
    $month tep_db_prepare_input($HTTP_POST_VARS['month']);
     
            
    $year tep_db_prepare_input($HTTP_POST_VARS['year']);
     
     
     
            if (
    substr($specials_price, -1) == '%'$specials_price = ($products_price - (($specials_price 100) * $products_price));
     
     
     
            
    $expires_date '';
     
            if (
    tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
     
             
    $expires_date $year;
     
             
    $expires_date .= (strlen($month) == 1) ? '0' $month $month;
     
             
    $expires_date .= (strlen($day) == 1) ? '0' $day $day;
     
             }
     
     
     
             
    tep_db_query("update " TABLE_SPECIALS " set specials_new_products_price = '" tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id "'");
     
     
     
             
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page''&sID=' $specials_id));
     
             break;
     
         case 
    'deleteconfirm':
     
            
    $specials_id tep_db_prepare_input($HTTP_GET_VARS['sID']);
     
     
     
             
    tep_db_query("delete from " TABLE_SPECIALS " where specials_id = '" . (int)$specials_id "'");
     
     
     
             
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page']));
     
             break;
     
         }
     
    }
     
    ?>
     
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
     
    <html <?php echo HTML_PARAMS?>>
     
    <head>
     
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>">
     
    <title><?php echo TITLE?></title>
     
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
     
    <script language="javascript" src="includes/general.js"></script>
     
    <?php
     
    if ( ($action == 'new') || ($action == 'edit') ) {
     
    ?>
     
    <link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
     
    <script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
     
    <?php
     
    }
     
    ?>
     
    </head>
     
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
     
    <div id="popupcalendar" class="text"></div>
     
    <!-- header //-->
     
    <?php require(DIR_WS_INCLUDES 'header.php'); ?>
     
    <!-- header_eof //-->
     
     
     
    <!-- body //-->
     
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
     
    <tr>
     
        <td width="<?php echo BOX_WIDTH?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH?>" cellspacing="1" cellpadding="1" class="columnLeft">
     
    <!-- left_navigation //-->
     
    <?php require(DIR_WS_INCLUDES 'column_left.php'); ?>
     
    <!-- left_navigation_eof //-->
     
         </table></td>
     
    <!-- body_text //-->
     
        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     
         <tr>
     
            <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     
             <tr>
     
                <td class="pageHeading"><?php echo HEADING_TITLE?></td>
     
                <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif'HEADING_IMAGE_WIDTHHEADING_IMAGE_HEIGHT); ?></td>
     
             </tr>
     
             </table></td>
     
         </tr>
     
    <?php
     
    if ( ($action == 'new') || ($action == 'edit') ) {
     
        
    $form_action 'insert';
     
        if ( (
    $action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
     
         
    $form_action 'update';
     
     
     
         
    $product_query tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_SPECIALS " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'"'");
     
         
    $product tep_db_fetch_array($product_query);
     
     
     
         
    $sInfo = new objectInfo($product);
     
        } else {
     
         
    $sInfo = new objectInfo(array());
     
     
     
    // create an array of products on special, which will be excluded from the pull down menu of products
     
    // (when creating a new product on special)
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
    // Next lines were original code
     
    /*
     
         $specials_array = array();
     
         $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
     
         while ($specials = tep_db_fetch_array($specials_query)) {
     
             $specials_array[] = $specials['products_id'];
     
         }
     
         }
     
    */
     
        
    $specials_array = array();
     
        
    $specials_query tep_db_query("select p.products_id, s.customers_group_id from " TABLE_PRODUCTS " p, " TABLE_SPECIALS " s where s.products_id = p.products_id");
     
        while (
    $specials tep_db_fetch_array($specials_query)) {
     
         
    $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
     
         }
     
     
     
         
    $customers_groups_query tep_db_query("select distinct customers_group_name, customers_group_id from " TABLE_CUSTOMERS " order by customers_group_id ");
     
         
    $input_groups=array();
     
         
    $all_groups=array();
     
        while (
    $existing_groups tep_db_fetch_array($customers_groups_query)) {
     
             
    $input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
     
             
    $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
     
         }
     
     
     
         if(isset(
    $HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!=0){
     
             
    $customer_group_price_query tep_db_query("select customers_group_price from " TABLE_PRODUCTS_GROUPS " where products_id = '" $sInfo->products_id "' and customers_group_id = '" $sInfo->customers_group_id "'");
     
             if (
    $customer_group_price tep_db_fetch_array($customer_group_price_query)) {
     
             
    $sInfo->products_price $customer_group_price['customers_group_price'];
     
             }
     
         }
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
    ?>
     
         <tr><form name="new_special" <?php echo 'action="' tep_href_link(FILENAME_SPECIALStep_get_all_get_params(array('action''info''sID')) . 'action=' $form_action'NONSSL') . '"'?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id'$HTTP_GET_VARS['sID']); ?>
     
             <td><br><table border="0" cellspacing="0" cellpadding="2">
     
             <tr>
     
                <td class="main"><?php echo TEXT_SPECIALS_PRODUCT?>&nbsp;</td>
     
                <td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name ' <small>(' $currencies->format($sInfo->products_price) . ')</small>' tep_draw_products_pull_down('products_id''style="font-size:10px"'$specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price '')); ?></td>
     
             </tr>
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
             <tr>
     
                <td class="main"><?php echo TEXT_SPECIALS_GROUPS?>&nbsp;</td>
     
                <td class="main"><?php echo tep_draw_pull_down_menu('customers_group'$input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?> </td>
     
             </tr>
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
             <tr>
     
                <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE?>&nbsp;</td>
     
                <td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price '')); ?></td>
     
             </tr>
     
             <tr>
     
                <td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE?>&nbsp;</td>
     
                <td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date82) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date52) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date04) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES 'cal_date_up.gif''Calendar''22''17''align="absmiddle" name="BTN_date"'); ?></a></td>
     
             </tr>
     
             </table></td>
     
         </tr>
     
         <tr>
     
             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
     
             <tr>
     
                <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP?></td>
     
                <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif'IMAGE_INSERT) : tep_image_submit('button_update.gif'IMAGE_UPDATE)). '&nbsp;&nbsp;&nbsp;<a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' $HTTP_GET_VARS['sID'] : '')) . '">' tep_image_button('button_cancel.gif'IMAGE_CANCEL) . '</a>'?></td>
     
             </tr>
     
             </table></td>
     
         </form></tr>
     
    <?php
     
    } else {
     
    ?>
     
         <tr>
     
             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
     
             <tr>
     
                <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
     
                 <tr class="dataTableHeadingRow">
     
                    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS?></td>
     
                    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE?></td>
     
                    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS?></td>
     
                    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION?>&nbsp;</td>
     
                 </tr>
     
    <?php
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
    // Next line was original code
     
    //     $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
     
         
    $all_groups=array();
     
         
    $customers_groups_query tep_db_query("select distinct customers_group_name, customers_group_id from " TABLE_CUSTOMERS " order by customers_group_id ");
     
        while (
    $existing_groups tep_db_fetch_array($customers_groups_query)) {
     
         
    $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
     
         }
     
     
     
        
    $specials_query_raw "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " TABLE_PRODUCTS " p, " TABLE_SPECIALS " s, " TABLE_PRODUCTS_DESCRIPTION " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id "' and p.products_id = s.products_id order by pd.products_name";
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
        
    $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS$specials_query_raw$specials_query_numrows);
     
        
    $specials_query tep_db_query($specials_query_raw);
     
        while (
    $specials tep_db_fetch_array($specials_query)) {
     
         if ((!isset(
    $HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
     
            
    $products_query tep_db_query("select products_image from " TABLE_PRODUCTS " where products_id = '" . (int)$specials['products_id'] . "'");
     
            
    $products tep_db_fetch_array($products_query);
     
            
    $sInfo_array array_merge($specials$products);
     
            
    $sInfo = new objectInfo($sInfo_array);
     
         }
     
     
     
         if (isset(
    $sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
     
         echo 
    '                 <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . ''">' "n";
     
         } else {
     
         echo 
    '                 <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . ''">' "n";
     
         }
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
         
    $scustomer_group_price_query tep_db_query("select customers_group_price from " TABLE_PRODUCTS_GROUPS " where products_id = '" $specials['products_id']. "' and customers_group_id = '" $sInfo->customers_group_id "'");
     
         if (
    $scustomer_group_price tep_db_fetch_array($scustomer_group_price_query))
     
             
    $sInfo->products_price=$specials['products_price']=$scustomer_group_price['customers_group_price'];
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
    ?>
     
                    <td class="dataTableContent"><?php echo $specials['products_name']; ?></td>
     
    // BOF - Separate_Pricing_Per_Customer_v3.5
     
    // Next line was original code
     
    //                 <td class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price']); ?></span></td>
     
                    <td class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price'])." (".$all_groups[$specials['customers_group_id']].")"?></span></td>
     
    // EOF - Separate_Pricing_Per_Customer_v3.5
     
                    <td class="dataTableContent" align="right">
     
    <?php
     
         
    if ($specials['status'] == '1') {
     
            echo 
    tep_image(DIR_WS_IMAGES 'icon_status_green.gif'IMAGE_ICON_STATUS_GREEN1010) . '&nbsp;&nbsp;<a href="' tep_href_link(FILENAME_SPECIALS'action=setflag&flag=0&id=' $specials['specials_id'], 'NONSSL') . '">' tep_image(DIR_WS_IMAGES 'icon_status_red_light.gif'IMAGE_ICON_STATUS_RED_LIGHT1010) . '</a>';
     
         } else {
     
            echo 
    '<a href="' tep_href_link(FILENAME_SPECIALS'action=setflag&flag=1&id=' $specials['specials_id'], 'NONSSL') . '">' tep_image(DIR_WS_IMAGES 'icon_status_green_light.gif'IMAGE_ICON_STATUS_GREEN_LIGHT1010) . '</a>&nbsp;&nbsp;' tep_image(DIR_WS_IMAGES 'icon_status_red.gif'IMAGE_ICON_STATUS_RED1010);
     
         }
     
    ?></td>
     
                    <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES 'icon_arrow_right.gif'''); } else { echo '<a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID=' $specials['specials_id']) . '">' tep_image(DIR_WS_IMAGES 'icon_info.gif'IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
     
         </tr>
     
    <?php
     
         
    }
     
    ?>
     
                 <tr>
     
                    <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
     
                     <tr>
     
                         <td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrowsMAX_DISPLAY_SEARCH_RESULTS$HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
     
                         <td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrowsMAX_DISPLAY_SEARCH_RESULTSMAX_DISPLAY_PAGE_LINKS$HTTP_GET_VARS['page']); ?></td>
     
                     </tr>
     
    <?php
     
    if (empty($action)) {
     
    ?>
     
                     <tr>
     
                         <td colspan="2" align="right"><?php echo '<a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&action=new') . '">' tep_image_button('button_new_product.gif'IMAGE_NEW_PRODUCT) . '</a>'?></td>
     
                     </tr>
     
    <?php
     
    }
     
    ?>
     
                     </table></td>
     
                 </tr>
     
                 </table></td>
     
    <?php
     
    $heading 
    = array();
     
    $contents = array();
     
     
     
    switch (
    $action) {
     
        case 
    'delete':
     
         
    $heading[] = array('text' => '<b>' TEXT_INFO_HEADING_DELETE_SPECIALS '</b>');
     
     
     
         
    $contents = array('form' => tep_draw_form('specials'FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID=' $sInfo->specials_id '&action=deleteconfirm'));
     
         
    $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
     
         
    $contents[] = array('text' => '<br><b>' $sInfo->products_name '</b>');
     
         
    $contents[] = array('align' => 'center''text' => '<br>' tep_image_submit('button_delete.gif'IMAGE_DELETE) . '&nbsp;<a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID=' $sInfo->specials_id) . '">' tep_image_button('button_cancel.gif'IMAGE_CANCEL) . '</a>');
     
         break;
     
         default:
     
         if (
    is_object($sInfo)) {
     
            
    $heading[] = array('text' => '<b>' $sInfo->products_name '</b>');
     
     
     
            
    $contents[] = array('align' => 'center''text' => '<a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID=' $sInfo->specials_id '&action=edit') . '">' tep_image_button('button_edit.gif'IMAGE_EDIT) . '</a> <a href="' tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID=' $sInfo->specials_id '&action=delete') . '">' tep_image_button('button_delete.gif'IMAGE_DELETE) . '</a>');
     
            
    $contents[] = array('text' => '<br>' TEXT_INFO_DATE_ADDED ' ' tep_date_short($sInfo->specials_date_added));
     
            
    $contents[] = array('text' => '' TEXT_INFO_LAST_MODIFIED ' ' tep_date_short($sInfo->specials_last_modified));
     
            
    $contents[] = array('align' => 'center''text' => '<br>' tep_info_image($sInfo->products_image$sInfo->products_nameSMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT));
     
            
    $contents[] = array('text' => '<br>' TEXT_INFO_ORIGINAL_PRICE ' ' $currencies->format($sInfo->products_price));
     
            
    $contents[] = array('text' => '' TEXT_INFO_NEW_PRICE ' ' $currencies->format($sInfo->specials_new_products_price));
     
            
    $contents[] = array('text' => '' TEXT_INFO_PERCENTAGE ' ' number_format(100 - (($sInfo->specials_new_products_price $sInfo->products_price) * 100)) . '%');
     
     
     
            
    $contents[] = array('text' => '<br>' TEXT_INFO_EXPIRES_DATE ' <b>' tep_date_short($sInfo->expires_date) . '</b>');
     
            
    $contents[] = array('text' => '' TEXT_INFO_STATUS_CHANGE ' ' tep_date_short($sInfo->date_status_change));
     
         }
     
         break;
     
    }
     
    if ( (
    tep_not_null($heading)) && (tep_not_null($contents)) ) {
     
        echo 
    '             <td width="25%" valign="top">' "n";
     
     
     
        
    $box = new box;
     
        echo 
    $box->infoBox($heading$contents);
     
     
     
        echo 
    '             </td>' "n";
     
    }
     
    }
     
    ?>
     
             </tr>
     
             </table></td>
     
         </tr>
     
         </table></td>
     
    <!-- body_text_eof //-->
     
    </tr>
     
    </table>
     
    <!-- body_eof //-->
     
     
     
    <!-- footer //-->
     
    <?php require(DIR_WS_INCLUDES 'footer.php'); ?>
     
    <!-- footer_eof //-->
     
    </body>
     
    </html>
     
    <?php require(DIR_WS_INCLUDES 'application_bottom.php'); ?>
    Thanks
    Last edited by Warren Ashcroft; 13th August 2005 at 11:02 PM.

  2. #2
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Instead of [CODETAG] you can use [PHPTAG] for PHP code (remove the word TAG).

    Can you post the exact error message?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Apr 2004
    Location
    Peterborough
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh ok

    PHP Code:
    <?php

      
    /*

        $Id: specials.php,v  1.41 2003/06/29 22:50:52 hpdl Exp $

       

        osCommerce, Open  Source E-Commerce Solutions

         http://www.oscommerce.com

       

        Copyright (c) 2003  osCommerce

       

        Released under the  GNU General Public License

      */

       

         
    require('includes/application_top.php');

       

         require(
    DIR_WS_CLASSES 'currencies.php');

        
    $currencies = new  currencies();

       

        
    $action =  (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] :  '');

       

        if  (
    tep_not_null($action)) {

          switch (
    $action)  {

            case  
    'setflag':

               
    tep_set_specials_status($HTTP_GET_VARS['id'],  $HTTP_GET_VARS['flag']);

       

               
    tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ?  'page=' $HTTP_GET_VARS['page'] . '&' '') . 'sID=' .  $HTTP_GET_VARS['id'], 'NONSSL'));

               break;

            case  
    'insert':

              
    $products_id =  tep_db_prepare_input($HTTP_POST_VARS['products_id']);

              
    $products_price  =  tep_db_prepare_input($HTTP_POST_VARS['products_price']);

              
    $specials_price  =  tep_db_prepare_input($HTTP_POST_VARS['specials_price']);

              
    $day =  tep_db_prepare_input($HTTP_POST_VARS['day']);

              
    $month =  tep_db_prepare_input($HTTP_POST_VARS['month']);

              
    $year =  tep_db_prepare_input($HTTP_POST_VARS['year']);

      
    // BOF -  Separate_Pricing_Per_Customer_v3.5

               
    $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);

              
    $price_query =  tep_db_query("select customers_group_price from " TABLE_PRODUCTS_GROUPS"  WHERE products_id = ".(int)$products_id " AND customers_group_id  =  ".(int)$customers_group);

              while (
    $gprices  =  tep_db_fetch_array($price_query)) {

                   
    $products_price=$gprices['customers_group_price'];

               }

      
    // EOF -  Separate_Pricing_Per_Customer_v3.5

              
    if  (substr($specials_price, -1) == '%') {

                 
    $new_special_insert_query tep_db_query("select products_id, products_price  from " TABLE_PRODUCTS " where products_id = '" . (int)$products_id .  "'");

                 
    $new_special_insert =  tep_db_fetch_array($new_special_insert_query);

       

                 
    $products_price =  $new_special_insert['products_price'];

                 
    $specials_price = ($products_price - (($specials_price 100) *  $products_price));

               }

       

              
    $expires_date =  '';

              if  (
    tep_not_null($day) && tep_not_null($month) &&  tep_not_null($year)) {

                
    $expires_date  $year;

                
    $expires_date  .= (strlen($month) == 1) ? '0' $month $month;

                
    $expires_date  .= (strlen($day) == 1) ? '0' $day $day;

               }

      
    // BOF -  Separate_Pricing_Per_Customer_v3.5

      // Next line was  original code

      //         tep_db_query("insert into " . TABLE_SPECIALS . " (products_id,  specials_new_products_price, specials_date_added, expires_date, status) values  ('" . (int)$products_id "', '" . tep_db_input($specials_price) . "', now(), '" .  tep_db_input($expires_date) . "', '1')");

               
    tep_db_query("insert into " TABLE_SPECIALS " (products_id,  specials_new_products_price, specials_date_added, expires_date, status,  customers_group_id) values ('" (int)$products_id "', '" .  tep_db_input($specials_price) . "', now(), '" tep_db_input($expires_date) .  "', '1', ".(int)$customers_group.")");

      
    // EOF -  Separate_Pricing_Per_Customer_v3.5

               
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' .  $HTTP_GET_VARS['page']));

               break;

            case  
    'update':

              
    $specials_id =  tep_db_prepare_input($HTTP_POST_VARS['specials_id']);

              
    $products_price  =  tep_db_prepare_input($HTTP_POST_VARS['products_price']);

              
    $specials_price  =  tep_db_prepare_input($HTTP_POST_VARS['specials_price']);

              
    $day =  tep_db_prepare_input($HTTP_POST_VARS['day']);

              
    $month =  tep_db_prepare_input($HTTP_POST_VARS['month']);

              
    $year =  tep_db_prepare_input($HTTP_POST_VARS['year']);

       

              if  (
    substr($specials_price, -1) == '%'$specials_price = ($products_price -  (($specials_price 100) * $products_price));

       

              
    $expires_date =  '';

              if  (
    tep_not_null($day) && tep_not_null($month) &&  tep_not_null($year)) {

                
    $expires_date  $year;

                
    $expires_date  .= (strlen($month) == 1) ? '0' $month $month;

                
    $expires_date  .= (strlen($day) == 1) ? '0' $day $day;

               }

       

               
    tep_db_query("update " TABLE_SPECIALS " set specials_new_products_price = '"  tep_db_input($specials_price) . "', specials_last_modified = now(),  expires_date = '" tep_db_input($expires_date) . "' where specials_id = '" .  (int)$specials_id "'");

       

               
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page']  '&sID=' $specials_id));

               break;

            case  
    'deleteconfirm':

              
    $specials_id =  tep_db_prepare_input($HTTP_GET_VARS['sID']);

       

               
    tep_db_query("delete from " TABLE_SPECIALS " where specials_id = '" .  (int)$specials_id "'");

       

               
    tep_redirect(tep_href_link(FILENAME_SPECIALS'page=' .  $HTTP_GET_VARS['page']));

               break;

           }

         }

      
    ?>

      <!doctype html  public "-//W3C//DTD HTML 4.01 Transitional//EN">

      <html <?php echo  HTML_PARAMS?>>

      <head>

      <meta  http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;  ?>">

      <title><?php  echo TITLE?></title>

      <link  rel="stylesheet" type="text/css"  href="includes/stylesheet.css">

      <script  language="javascript"  src="includes/general.js"></script>

      <?php

        
    if ( ($action ==  'new') || ($action == 'edit') ) {

      
    ?>

      <link  rel="stylesheet" type="text/css"  href="includes/javascript/calendar.css">

      <script  language="JavaScript"  src="includes/javascript/calendarcode.js"></script>

      <?php

         
    }

      
    ?>

      </head>

      <body  marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0"  rightmargin="0" bgcolor="#FFFFFF"  onload="SetFocus();">

      <div  id="popupcalendar" class="text"></div>

      <!-- header  //-->

      <?php  require(DIR_WS_INCLUDES 'header.php'); ?>

      <!-- header_eof  //-->

       

      <!-- body  //-->

      <table border="0"  width="100%" cellspacing="2" cellpadding="2">

         <tr>

          <td  width="<?php echo BOX_WIDTH?>" valign="top"><table border="0"  width="<?php echo BOX_WIDTH?>" cellspacing="1" cellpadding="1"  class="columnLeft">

      <!-- left_navigation  //-->

      <?php  require(DIR_WS_INCLUDES 'column_left.php'); ?>

      <!--  left_navigation_eof //-->

           </table></td>

      <!-- body_text  //-->

          <td width="100%"  valign="top"><table border="0" width="100%" cellspacing="0"  cellpadding="2">

             <tr>

              <td  width="100%"><table border="0" width="100%" cellspacing="0"  cellpadding="0">

                 <tr>

                  <td  class="pageHeading"><?php echo HEADING_TITLE;  ?></td>

                  <td  class="pageHeading" align="right"><?php echo  tep_draw_separator('pixel_trans.gif'HEADING_IMAGE_WIDTH,  HEADING_IMAGE_HEIGHT); ?></td>

                 </tr>

               </table></td>

             </tr>

      <?php

        
    if ( ($action ==  'new') || ($action == 'edit') ) {

          
    $form_action =  'insert';

          if ( (
    $action ==  'edit') && isset($HTTP_GET_VARS['sID']) ) {

            
    $form_action =  'update';

       

            
    $product_query =  tep_db_query("select p.products_id, pd.products_name, p.products_price,  s.specials_new_products_price, s.expires_date from " TABLE_PRODUCTS " p, " .  TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_SPECIALS " s where p.products_id  = pd.products_id and pd.language_id = '" . (int)$languages_id "' and  p.products_id = s.products_id and s.specials_id = '" .  (int)$HTTP_GET_VARS['sID'"'");

            
    $product =  tep_db_fetch_array($product_query);

       

            
    $sInfo = new  objectInfo($product);

          } else  {

            
    $sInfo = new  objectInfo(array());

       

      
    // create an array of  products on special, which will be excluded from the pull down menu of  products

      // (when creating a new  product on special)

      // BOF -  Separate_Pricing_Per_Customer_v3.5

      // Next lines were  original code

      /*

            $specials_array =  array();

            $specials_query =  tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " .  TABLE_SPECIALS . " s where s.products_id =  p.products_id");

            while ($specials  = tep_db_fetch_array($specials_query)) {

               $specials_array[] = $specials['products_id'];

             }

           }

       */

          
    $specials_array =  array();

          
    $specials_query =  tep_db_query("select p.products_id, s.customers_group_id from " .   TABLE_PRODUCTS " p, " TABLE_SPECIALS " s where s.products_id =  p.products_id");

          while (
    $specials =  tep_db_fetch_array($specials_query)) {

              
    $specials_array[] =  (int)$specials['products_id'].":".(int)$specials['customers_group_id'];

           }

       

           
    $customers_groups_query tep_db_query("select distinct customers_group_name,  customers_group_id from " TABLE_CUSTOMERS " order by customers_group_id  ");

           
    $input_groups=array();

           
    $all_groups=array();

          while  (
    $existing_groups =  tep_db_fetch_array($customers_groups_query))  {

               
    $input_groups[$sde++]=array("id"=>$existing_groups['customers_group_id'],  "text"=>  $existing_groups['customers_group_name']);

               
    $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

           }

       

           if(isset(
    $HTTP_GET_VARS['sID']) &&  $sInfo->customers_group_id!=0){

               
    $customer_group_price_query tep_db_query("select customers_group_price from "  TABLE_PRODUCTS_GROUPS " where products_id = '" $sInfo->products_id "'  and customers_group_id =  '" $sInfo->customers_group_id .  "'");

                if  (
    $customer_group_price tep_db_fetch_array($customer_group_price_query))  {

                   
    $sInfo->products_price =  $customer_group_price['customers_group_price'];

                 }

           }

      
    // EOF -  Separate_Pricing_Per_Customer_v3.5

      
    ?>

             <tr><form name="new_special" <?php echo 'action="' .  tep_href_link(FILENAME_SPECIALStep_get_all_get_params(array('action''info',  'sID')) . 'action=' $form_action'NONSSL') . '"'?>  method="post"><?php if ($form_action == 'update') echo  tep_draw_hidden_field('specials_id'$HTTP_GET_VARS['sID']);  ?>

               <td><br><table border="0" cellspacing="0"  cellpadding="2">

                 <tr>

                  <td  class="main"><?php echo TEXT_SPECIALS_PRODUCT;  ?>&nbsp;</td>

                  <td  class="main"><?php echo (isset($sInfo->products_name)) ?  $sInfo->products_name ' <small>(' .  $currencies->format($sInfo->products_price) . ')</small>' :  tep_draw_products_pull_down('products_id''style="font-size:10px"',  $specials_array); echo tep_draw_hidden_field('products_price',  (isset($sInfo->products_price) ? $sInfo->products_price ''));  ?></td>

                 </tr>

      // BOF -  Separate_Pricing_Per_Customer_v3.5

                 <tr>

                  <td  class="main"><?php echo TEXT_SPECIALS_GROUPS;  ?>&nbsp;</td>

                  <td  class="main"><?php echo tep_draw_pull_down_menu('customers_group',  $input_groups,  (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:''));?>  </td>

                 </tr>

      // EOF -  Separate_Pricing_Per_Customer_v3.5

                 <tr>

                  <td  class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE;  ?>&nbsp;</td>

                  <td  class="main"><?php echo tep_draw_input_field('specials_price',  (isset($sInfo->specials_new_products_price) ?  $sInfo->specials_new_products_price ''));  ?></td>

                 </tr>

                 <tr>

                  <td  class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE;  ?>&nbsp;</td>

                  <td  class="main"><?php echo tep_draw_input_field('day',  (isset($sInfo->expires_date) ? substr($sInfo->expires_date82) : ''),  'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month',  (isset($sInfo->expires_date) ? substr($sInfo->expires_date52) : ''),  'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year',  (isset($sInfo->expires_date) ? substr($sInfo->expires_date04) : ''),  'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink"  href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date',  'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);"  onclick="calSwapImg('BTN_date',  'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return  false;"><?php echo tep_image(DIR_WS_IMAGES 'cal_date_up.gif',  'Calendar''22''17''align="absmiddle" name="BTN_date"');  ?></a></td>

                 </tr>

               </table></td>

             </tr>

             <tr>

               <td><table border="0" width="100%" cellspacing="0"  cellpadding="2">

                 <tr>

                  <td  class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP;  ?></td>

                  <td  class="main" align="right" valign="top"><br><?php echo  (($form_action == 'insert') ? tep_image_submit('button_insert.gif',  IMAGE_INSERT) : tep_image_submit('button_update.gif'IMAGE_UPDATE)).  '&nbsp;&nbsp;&nbsp;<a href="' tep_href_link(FILENAME_SPECIALS,  'page=' $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID='  $HTTP_GET_VARS['sID'] : '')) . '">' tep_image_button('button_cancel.gif',  IMAGE_CANCEL) . '</a>'?></td>

                 </tr>

               </table></td>

             </form></tr>

      <?php

        
    } else  {

      
    ?>

             <tr>

               <td><table border="0" width="100%" cellspacing="0"  cellpadding="0">

                 <tr>

                  <td  valign="top"><table border="0" width="100%" cellspacing="0"  cellpadding="2">

                    <tr  class="dataTableHeadingRow">

                      <td  class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS;  ?></td>

                      <td  class="dataTableHeadingContent" align="right"><?php echo  TABLE_HEADING_PRODUCTS_PRICE?></td>

                      <td  class="dataTableHeadingContent" align="right"><?php echo  TABLE_HEADING_STATUS?></td>

                      <td  class="dataTableHeadingContent" align="right"><?php echo  TABLE_HEADING_ACTION?>&nbsp;</td>

                     </tr>

      <?php

      
    // BOF -  Separate_Pricing_Per_Customer_v3.5

      // Next line was  original code

      //     $specials_query_raw = "select p.products_id, pd.products_name, p.products_price,  s.specials_id, s.specials_new_products_price, s.specials_date_added,  s.specials_last_modified, s.expires_date, s.date_status_change, s.status from "  . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION  . " pd where p.products_id = pd.products_id and pd.language_id = '" .  (int)$languages_id . "' and p.products_id = s.products_id order by  pd.products_name";

           
    $all_groups=array();

           
    $customers_groups_query tep_db_query("select distinct customers_group_name,  customers_group_id from " TABLE_CUSTOMERS " order by customers_group_id  ");

          while  (
    $existing_groups =  tep_db_fetch_array($customers_groups_query))  {

             
    $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];

           }

       

          
    $specials_query_raw  "select p.products_id, pd.products_name, p.products_price, s.specials_id,  s.customers_group_id, s.specials_new_products_price, s.specials_date_added,  s.specials_last_modified, s.expires_date, s.date_status_change, s.status from "  TABLE_PRODUCTS " p, " TABLE_SPECIALS " s, " TABLE_PRODUCTS_DESCRIPTION .  " pd where p.products_id = pd.products_id and pd.language_id = '" .  (int)$languages_id "' and p.products_id = s.products_id order by  pd.products_name";

      
    // EOF -  Separate_Pricing_Per_Customer_v3.5

          
    $specials_split =  new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS,  $specials_query_raw$specials_query_numrows);

          
    $specials_query =  tep_db_query($specials_query_raw);

          while (
    $specials =  tep_db_fetch_array($specials_query)) {

            if  ((!isset(
    $HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) &&  ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo))  {

              
    $products_query  tep_db_query("select products_image from " TABLE_PRODUCTS " where  products_id = '" . (int)$specials['products_id'] .  "'");

              
    $products =  tep_db_fetch_array($products_query);

              
    $sInfo_array =  array_merge($specials$products);

              
    $sInfo = new  objectInfo($sInfo_array);

             }

       

            if (isset(
    $sInfo)  && is_object($sInfo) && ($specials['specials_id'] ==  $sInfo->specials_id)) {

              echo 
    '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . ''">' "n";

            } else  {

              echo 
    '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . ''">' "n";

             }

      
    // BOF -  Separate_Pricing_Per_Customer_v3.5

             
    $scustomer_group_price_query tep_db_query("select customers_group_price from "  TABLE_PRODUCTS_GROUPS " where products_id = '" $specials['products_id']. "'  and customers_group_id =  '" $sInfo->customers_group_id .  "'");

            if  (
    $scustomer_group_price =  tep_db_fetch_array($scustomer_group_price_query))

                 
    $sInfo->products_price=$specials['products_price']=$scustomer_group_price['customers_group_price'];

      
    // EOF -  Separate_Pricing_Per_Customer_v3.5

      
    ?>

                      <td   class="dataTableContent"><?php echo $specials['products_name'];  ?></td>

      // BOF -  Separate_Pricing_Per_Customer_v3.5

      // Next line was  original code

      //                 <td  class="dataTableContent" align="right"><span  class="oldPrice"><?php echo  $currencies->format($specials['products_price']); ?></span> <span  class="specialPrice"><?php echo  $currencies->format($specials['specials_new_products_price']);  ?></span></td>

                      <td   class="dataTableContent" align="right"><span class="oldPrice"><?php  echo $currencies->format($specials['products_price']); ?></span>  <span class="specialPrice"><?php echo  $currencies->format($specials['specials_new_products_price'])."  (".$all_groups[$specials['customers_group_id']].")";  ?></span></td>

      // EOF -  Separate_Pricing_Per_Customer_v3.5

                      <td   class="dataTableContent" align="right">

      <?php

            
    if  ($specials['status'] == '1') {

              echo  
    tep_image(DIR_WS_IMAGES 'icon_status_green.gif'IMAGE_ICON_STATUS_GREEN10,  10) . '&nbsp;&nbsp;<a href="' tep_href_link(FILENAME_SPECIALS,  'action=setflag&flag=0&id=' $specials['specials_id'], 'NONSSL') .  '">' tep_image(DIR_WS_IMAGES 'icon_status_red_light.gif',  IMAGE_ICON_STATUS_RED_LIGHT1010) .  '</a>';

            } else  {

              echo 
    '<a  href="' tep_href_link(FILENAME_SPECIALS'action=setflag&flag=1&id=' .  $specials['specials_id'], 'NONSSL') . '">' tep_image(DIR_WS_IMAGES .  'icon_status_green_light.gif'IMAGE_ICON_STATUS_GREEN_LIGHT1010) .  '</a>&nbsp;&nbsp;' tep_image(DIR_WS_IMAGES .  'icon_status_red.gif'IMAGE_ICON_STATUS_RED10,  10);

             }

      
    ?></td>

                      <td  class="dataTableContent" align="right"><?php if (isset($sInfo) &&  is_object($sInfo) && ($specials['specials_id'] ==  $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES .  'icon_arrow_right.gif'''); } else { echo '<a href="' .  tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID='  $specials['specials_id']) . '">' tep_image(DIR_WS_IMAGES 'icon_info.gif',  IMAGE_ICON_INFO) . '</a>'; }  ?>&nbsp;</td>

             </tr>

      <?php

           
    }

      
    ?>

                     <tr>

                      <td  colspan="4"><table border="0" width="100%"  cellpadding="0"cellspacing="2">

                         <tr>

                           <td class="smallText" valign="top"><?php echo  $specials_split->display_count($specials_query_numrows,  MAX_DISPLAY_SEARCH_RESULTS$HTTP_GET_VARS['page'],  TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>

                           <td class="smallText" align="right"><?php echo  $specials_split->display_links($specials_query_numrows,  MAX_DISPLAY_SEARCH_RESULTSMAX_DISPLAY_PAGE_LINKS$HTTP_GET_VARS['page']);  ?></td>

                         </tr>

      <?php

        
    if (empty($action))  {

      
    ?>

                         <tr>

                           <td colspan="2" align="right"><?php echo '<a href="' .  tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] .  '&action=new') . '">' tep_image_button('button_new_product.gif',  IMAGE_NEW_PRODUCT) . '</a>'?></td>

                         </tr>

      <?php

         
    }

      
    ?>

                       </table></td>

                     </tr>

                   </table></td>

      <?php

        $heading 
    =  array();

        
    $contents =  array();

       

        switch (
    $action)  {

          case  
    'delete':

            
    $heading[] =  array('text' => '<b>' TEXT_INFO_HEADING_DELETE_SPECIALS .  '</b>');

       

            
    $contents =  array('form' => tep_draw_form('specials'FILENAME_SPECIALS'page=' .  $HTTP_GET_VARS['page'] . '&sID=' $sInfo->specials_id .  '&action=deleteconfirm'));

            
    $contents[] =  array('text' => TEXT_INFO_DELETE_INTRO);

            
    $contents[] =  array('text' => '<br><b>' $sInfo->products_name .  '</b>');

            
    $contents[] =  array('align' => 'center''text' => '<br>' .  tep_image_submit('button_delete.gif'IMAGE_DELETE) . '&nbsp;<a href="' .  tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID='  $sInfo->specials_id) . '">' tep_image_button('button_cancel.gif',  IMAGE_CANCEL) . '</a>');

             break;

           default:

            if  (
    is_object($sInfo)) {

              
    $heading[] =  array('text' => '<b>' $sInfo->products_name .  '</b>');

       

              
    $contents[] =  array('align' => 'center''text' => '<a href="' .  tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID='  $sInfo->specials_id '&action=edit') . '">' .  tep_image_button('button_edit.gif'IMAGE_EDIT) . '</a> <a href="' .  tep_href_link(FILENAME_SPECIALS'page=' $HTTP_GET_VARS['page'] . '&sID='  $sInfo->specials_id '&action=delete') . '">' .  tep_image_button('button_delete.gif'IMAGE_DELETE) .  '</a>');

              
    $contents[] =  array('text' => '<br>' TEXT_INFO_DATE_ADDED ' ' .  tep_date_short($sInfo->specials_date_added));

              
    $contents[] =  array('text' => '' TEXT_INFO_LAST_MODIFIED ' ' .  tep_date_short($sInfo->specials_last_modified));

              
    $contents[] =  array('align' => 'center''text' => '<br>' .  tep_info_image($sInfo->products_image$sInfo->products_name,  SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT));

              
    $contents[] =  array('text' => '<br>' TEXT_INFO_ORIGINAL_PRICE ' ' .  $currencies->format($sInfo->products_price));

              
    $contents[] =  array('text' => '' TEXT_INFO_NEW_PRICE ' ' .  $currencies->format($sInfo->specials_new_products_price));

              
    $contents[] =  array('text' => '' TEXT_INFO_PERCENTAGE ' ' number_format(100 -  (($sInfo->specials_new_products_price $sInfo->products_price) * 100)) .  '%');

       

              
    $contents[] =  array('text' => '<br>' TEXT_INFO_EXPIRES_DATE ' <b>' .  tep_date_short($sInfo->expires_date) .  '</b>');

              
    $contents[] =  array('text' => '' TEXT_INFO_STATUS_CHANGE ' ' .  tep_date_short($sInfo->date_status_change));

             }

             break;

         }

        if (  (
    tep_not_null($heading)) && (tep_not_null($contents)) )  {

          echo 
    '             <td width="25%" valign="top">' "n";

       

          
    $box = new  box;

          echo  
    $box->infoBox($heading$contents);

       

          echo 
    '             </td>' "n";

         }

      }

      
    ?>

                 </tr>

               </table></td>

             </tr>

           </table></td>

      <!-- body_text_eof  //-->

         </tr>

      </table>

      <!-- body_eof  //-->

       

      <!-- footer  //-->

      <?php  require(DIR_WS_INCLUDES 'footer.php'); ?>

      <!-- footer_eof  //-->

      </body>

      </html>

      <?php  require(DIR_WS_INCLUDES 'application_bottom.php');  ?>

  4. #4
    Join Date
    Apr 2004
    Location
    Peterborough
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's ok i fixed that one - apparantly he installed an earlier version of the software - lol - idiot

    Now he's getting this -

    Parse error: parse error, unexpected T_STRING in /home2/andy2005/public_html/vas/includes/languages/english/index.php on line 15

    PHP Code:

    <?php
    /*
      $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com

      Copyright (c) 2003 osCommerce

      Released under the GNU General Public License
    */

    define('TEXT_MAIN''Welcome to Vas Electronics Online</b>We sell components for VCRs, DVDs and loads more - we accept Paypal, Cash, Cheque.

    define('
    TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
    define('
    TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
    define('
    TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

    if ( ($category_depth == '
    products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
      define('
    HEADING_TITLE', 'Let\'s See What We Have Here');
      
    define('TABLE_HEADING_IMAGE''');
      
    define('TABLE_HEADING_MODEL''Model');
      
    define('TABLE_HEADING_PRODUCTS''Product Name');
      
    define('TABLE_HEADING_MANUFACTURER''Manufacturer');
      
    define('TABLE_HEADING_QUANTITY''Quantity');
      
    define('TABLE_HEADING_PRICE''Price');
      
    define('TABLE_HEADING_WEIGHT''Weight');
      
    define('TABLE_HEADING_BUY_NOW''Buy Now');
      
    define('TEXT_NO_PRODUCTS''There are no products to list in this category.');
      
    define('TEXT_NO_PRODUCTS2''There is no product available from this manufacturer.');
      
    define('TEXT_NUMBER_OF_PRODUCTS''Number of Products: ');
      
    define('TEXT_SHOW''<b>Show:</b>');
      
    define('TEXT_BUY''Buy 1 \'');
      
    define('TEXT_NOW''\' now');
      
    define('TEXT_ALL_CATEGORIES''All Categories');
      
    define('TEXT_ALL_MANUFACTURERS''All Manufacturers');
    } elseif (
    $category_depth == 'top') {
      
    define('HEADING_TITLE''Welcome to Vas Electronics Online');
    } elseif (
    $category_depth == 'nested') {
      
    define('HEADING_TITLE''Categories');
    }
    ?>
    If he copies from a test link somewhere else using exactly the same programme - is it ok to copy - same files etc just a test directory to make sure main one doesn't get screwed up.

  5. #5
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    PHP Code:
    define('TEXT_MAIN''Welcome to Vas Electronics Online</b>We sell components for VCRs, DVDs and loads more - we accept Paypal, Cash, Cheque. 


    Should be:
    PHP Code:
    define('TEXT_MAIN''Welcome to Vas Electronics Online</b>We sell components for VCRs, DVDs and loads more - we accept Paypal, Cash, Cheque.'); 



    PHP Code:
    define('HEADING_TITLE''Let's See What We Have Here'); 


    Should be:
    PHP Code:
    define('HEADING_TITLE''Let\'s See What We Have Here'); 
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  6. #6
    Join Date
    Apr 2004
    Location
    Peterborough
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Fab thank's - i'll let him know

    is there any software that can correct these sort of things?

  7. #7
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    No, if there was - developers would be jobless
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  8. #8
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    For completeness I would like add that:
    PHP Code:
    define('HEADING_TITLE''Let\'s See What We Have Here'); 
    could work just as well like this:
    PHP Code:
    define('HEADING_TITLE'"Let's See What We Have Here"); 
    It also may be useful to know that, while:
    PHP Code:
    $variable "hello";
    echo(
    "$variable"); 
    would output: hello
    PHP Code:
    $variable "hello";
    echo(
    '$variable'); 
    would output: $variable

  9. #9
    Join Date
    Apr 2004
    Location
    Peterborough
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks guys though he has another one - copied from lines 107 to 156

    Parse error: parse error, unexpected T_STRING in /home2/andy2005/public_html/vas/admin/includes/languages/english.php on line 136

    Code:
    // notifications box text in includes/boxes/products_notifications.php
    define('BOX_HEADING_NOTIFICATIONS', 'Notifications');
    define('BOX_NOTIFICATIONS_NOTIFY', 'Notify me of updates to <b>%s</b>');
    define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'Do not notify me of updates to <b>%s</b>');
    
    // manufacturer box text
    define('BOX_HEADING_MANUFACTURER_INFO', 'Manufacturer Info');
    define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s Homepage');
    define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Other products');
    
    // languages box text in includes/boxes/languages.php
    define('BOX_HEADING_LANGUAGES', 'Languages');
    
    // currencies box text in includes/boxes/currencies.php
    define('BOX_HEADING_CURRENCIES', 'Currencies');
    
    // information box text in includes/boxes/information.php
    define('BOX_HEADING_INFORMATION', 'Information');
    define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
    define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
    define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
    define('BOX_INFORMATION_CONTACT', 'Contact Us');
    
    // tell a friend box text in includes/boxes/tell_a_friend.php
    define('BOX_HEADING_TELL_A_FRIEND', 'Tell A Friend');
    define('BOX_TELL_A_FRIEND_TEXT', 'Tell someone you know about this product.');
    
    // checkout procedure text
    define('CHECKOUT_BAR_DELIVERY', 'Delivery Information');
    define('CHECKOUT_BAR_PAYMENT', 'Payment Information');
    define('CHECKOUT_BAR_CONFIRMATION', 'Confirmation');
    define('CHECKOUT_BAR_FINISHED', 'Finished');
    
    <?php
    /*
      $Id: english.php,v 1.114 2003/07/09 18:13:39 dgw_ Exp $
      adapted for Separate Pricing Per Customer 2005/02/12
    
      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com
    
      Copyright (c) 2003 osCommerce
    
      Released under the GNU General Public License
    */
    
    // look in your $PATH_LOCALE/locale directory for available locales
    // or type locale -a on the server.
    // Examples:
    // on RedHat try 'en_US'
    // on FreeBSD try 'en_US.ISO_8859-1'
    // on Windows try 'en', or 'English'

  10. #10
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Why is there a <?php tag between two blocks of PHP code?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP: Custom error handling
    By nick in forum Code Sharing
    Replies: 6
    Last Post: 11th February 2006, 11:53 PM
  2. Replies: 16
    Last Post: 2nd December 2005, 04:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •