[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> specials.php (source)

   1  <?php
   2  /*

   3  $Id: specials.php 14 2006-07-28 17:42:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13    require ('includes/application_top.php');
  14  
  15    require (DIR_WS_CLASSES . 'currencies.php');
  16    $currencies = new currencies();
  17  // BOF: MOD - Separate Pricing Per Customer 

  18        $customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
  19      while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
  20           $input_groups[] = array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
  21          $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
  22      }
  23  // EOF: MOD - Separate Pricing Per Customer

  24  
  25    $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
  26  
  27    if (tep_not_null($action)) {
  28      switch ($action) {
  29        case 'setflag':
  30          tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);
  31  
  32          tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));
  33          break;
  34        case 'insert':
  35          $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
  36          $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
  37          $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
  38          $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
  39          $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
  40          $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
  41  // BOF: MOD - Separate Pricing Per Customer

  42          $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
  43          $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);
  44          while ($gprices = tep_db_fetch_array($price_query)) {
  45              $products_price = $gprices['customers_group_price'];
  46          }
  47  // EOF: MOD - Separate Pricing Per Customer

  48          if (substr($specials_price, -1) == '%') {
  49  /* BOF: Bugfix 0000061

  50            $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); //why another select here? why not use Post Vars?

  51            $new_special_insert = tep_db_fetch_array($new_special_insert_query);

  52  

  53            $products_price = $new_special_insert['products_price'];

  54  // EOF: Bugfix 0000061

  55  */
  56            $specials_price = ($products_price - (($specials_price / 100) * $products_price));
  57          }
  58  
  59          $expires_date = '';
  60          if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
  61            $expires_date = $year;
  62            $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
  63            $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
  64          }
  65  // BOF: MOD - Separate Pricing Per Customer

  66  /*      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')"); */

  67          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 . ")");
  68  // EOF: MOD - Separate Pricing Per Customer

  69          tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
  70          break;
  71        case 'update':
  72          $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
  73          $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
  74          $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
  75          $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
  76          $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
  77          $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
  78  
  79          if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));
  80  
  81          $expires_date = '';
  82          if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
  83            $expires_date = $year;
  84            $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
  85            $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
  86          }
  87  
  88          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 . "'");
  89  
  90          tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));
  91          break;
  92        case 'deleteconfirm':
  93          $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);
  94  
  95          tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");
  96  
  97          tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
  98          break;
  99      }
 100    }
 101  ?>
 102  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
 103  <html <?php echo HTML_PARAMS; ?>>
 104  <head>
 105  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 106  <title><?php echo TITLE; ?></title>
 107  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 108  <script language="javascript" src="includes/general.js"></script>
 109  <?php
 110    if ( ($action == 'new') || ($action == 'edit') ) {
 111  ?>
 112  <link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
 113  <script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
 114  <?php
 115    }
 116  ?>
 117  </head>
 118  <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
 119  <div id="popupcalendar" class="text"></div>
 120  <!-- header //-->
 121  <?php require (DIR_WS_INCLUDES . 'header.php'); ?>
 122  <!-- header_eof //-->
 123  
 124  <!-- body //-->
 125  <table border="0" width="100%" cellspacing="2" cellpadding="2">
 126    <tr>
 127      <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
 128  <!-- left_navigation //-->
 129  <?php require (DIR_WS_INCLUDES . 'column_left.php'); ?>
 130  <!-- left_navigation_eof //-->
 131      </table></td>
 132  <!-- body_text //-->
 133      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 134        <tr>
 135          <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
 136            <tr>
 137              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
 138              <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 139            </tr>
 140          </table></td>
 141        </tr>
 142  <?php
 143    if ( ($action == 'new') || ($action == 'edit') ) {
 144      $form_action = 'insert';
 145      if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
 146        $form_action = 'update';
 147  // BOF: MOD - Separate Pricing Per Customer

 148  // LINE CHANGED: Bugfix 0000061

 149  //    $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date, s.customers_group_id 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'] . "'");

 150        $product_query = tep_db_query("select p.products_id, pd.products_name, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price, s.specials_new_products_price, s.expires_date, s.customers_group_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id, customers_group_id) 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'] . "'");
 151  // EOF: MOD - Separate Pricing Per Customer

 152        $product = tep_db_fetch_array($product_query);
 153  
 154        $sInfo = new objectInfo($product);
 155      } else {
 156        $sInfo = new objectInfo(array());
 157  
 158  // create an array of products on special, which will be excluded from the pull down menu of products

 159  // (when creating a new product on special)

 160  // BOF: MOD - Separate Pricing Per Customer

 161  /*      $specials_array = array();

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

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

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

 165        }

 166      } 

 167  */
 168        $specials_array = array();
 169        $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");
 170        while ($specials = tep_db_fetch_array($specials_query)) {
 171          $specials_array[] = (int)$specials['products_id'].":".(int)$specials['customers_group_id'];
 172        }
 173  
 174        if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!= '0'){
 175          $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 . "'");
 176            if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
 177              $sInfo->products_price = $customer_group_price['customers_group_price'];
 178            }
 179        }
 180  // EOF: MOD - Separate Pricing Per Customer

 181      }
 182  ?>
 183        <tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_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']); ?>
 184          <td><br><table border="0" cellspacing="0" cellpadding="2">
 185            <tr>
 186              <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?>&nbsp;</td>
 187              <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>
 188            </tr>
 189  <?php php // BOF: MOD - Separate Pricing per Customer ?>
 190            <tr>
 191              <td class="main"><?php echo TEXT_SPECIALS_GROUPS; ?>&nbsp;</td>
 192              <td class="main"><?php if (isset($sInfo->customers_group_id)) {
 193              for ($x=0; $x<count($input_groups); $x++) {
 194              if ($input_groups[$x]['id'] == $sInfo->customers_group_id) {
 195              echo $input_groups[$x]['text'];
 196              }
 197              } // end for loop

 198              } else {
 199           echo tep_draw_pull_down_menu('customers_group', $input_groups, (isset($sInfo->customers_group_id)?$sInfo->customers_group_id:'')); 
 200           } ?> </td>
 201            </tr>
 202  <?php php // EOF: MOD - Separate Pricing per Customer ?>
 203            <tr>
 204              <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?>&nbsp;</td>
 205              <td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
 206            </tr>
 207            <tr>
 208              <td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?>&nbsp;</td>
 209              <td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), '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>
 210            </tr>
 211          </table></td>
 212        </tr>
 213        <tr>
 214          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 215            <tr>
 216              <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
 217              <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>
 218            </tr>
 219          </table></td>
 220        </form></tr>
 221  <?php
 222    } else {
 223  ?>
 224        <tr>
 225          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
 226            <tr>
 227              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 228                <tr class="dataTableHeadingRow">
 229                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
 230                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
 231                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
 232                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
 233                </tr>
 234  <?php
 235  // BOF: MOD - Separate Pricing per Customer

 236  /*    $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"; */

 237      $all_groups = array();
 238      $customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
 239      while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
 240        $all_groups[$existing_groups['customers_group_id']] = $existing_groups['customers_group_name'];
 241      }
 242  
 243      $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"; 
 244     
 245      $customers_group_prices_query = tep_db_query("select s.products_id, s.customers_group_id, pg.customers_group_price from " . TABLE_SPECIALS . " s LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id, customers_group_id) ");
 246  
 247      while ($_customers_group_prices = tep_db_fetch_array($customers_group_prices_query)) {
 248        $customers_group_prices[] = $_customers_group_prices;
 249      } 
 250      $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
 251      $specials_query = tep_db_query($specials_query_raw);
 252  // BOF: MOD - Separate Pricing per Customer

 253      $no_of_rows_in_specials = tep_db_num_rows($specials_query);
 254      while ($specials = tep_db_fetch_array($specials_query)) {
 255        for ($y = 0; $y < $no_of_rows_in_specials; $y++) {
 256          if ( tep_not_null($customers_group_prices[$y]['customers_group_price']) && $customers_group_prices[$y]['products_id'] == $specials['products_id'] && $customers_group_prices[$y]['customers_group_id'] == $specials['customers_group_id']) {
 257            $specials['products_price'] = $customers_group_prices[$y]['customers_group_price'] ;
 258          } // end if (tep_not_null($customers_group_prices[$y]['customers_group_price'] etcetera

 259        } // end for loop

 260  // EOF: MOD - Separate Pricing Per Customer

 261        if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
 262          $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
 263          $products = tep_db_fetch_array($products_query);
 264          $sInfo_array = array_merge($specials, $products);
 265          $sInfo = new objectInfo($sInfo_array);
 266        }
 267  
 268        if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
 269          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";
 270        } else {
 271          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";
 272        }
 273  ?>
 274                  <td class="dataTableContent"><?php echo $specials['products_name']; ?></td>
 275  <?php /* LINE MOD Separate Pricing Per Customer added "$all_groups[$specials['customers_group_id']]" */ ?>
 276                  <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>
 277                  <td  class="dataTableContent" align="right">
 278  <?php
 279        if ($specials['status'] == '1') {
 280          echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 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_LIGHT, 10, 10) . '</a>';
 281        } else {
 282          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_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
 283        }
 284  ?></td>
 285                  <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>
 286        </tr>
 287  <?php
 288      }
 289  ?>
 290                <tr>
 291                  <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
 292                    <tr>
 293                      <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>
 294                      <td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
 295                    </tr>
 296  <?php
 297    if (empty($action)) {
 298  ?>
 299                    <tr>
 300                      <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>
 301                    </tr>
 302  <?php
 303    }
 304  ?>
 305                  </table></td>
 306                </tr>
 307              </table></td>
 308  <?php
 309    $heading = array();
 310    $contents = array();
 311  
 312    switch ($action) {
 313      case 'delete':
 314        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');
 315  
 316        $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));
 317        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
 318        $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
 319        $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>');
 320        break;
 321      default:
 322        if (is_object($sInfo)) {
 323          $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');
 324  
 325          $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>');
 326          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));
 327          $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));
 328          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
 329          $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));
 330          $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
 331          $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');
 332  
 333          $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
 334          $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
 335        }
 336        break;
 337    }
 338    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
 339      echo '            <td width="25%" valign="top">' . "\n";
 340  
 341      $box = new box;
 342      echo $box->infoBox($heading, $contents);
 343  
 344      echo '            </td>' . "\n";
 345    }
 346  }
 347  ?>
 348            </tr>
 349          </table></td>
 350        </tr>
 351      </table></td>
 352  <!-- body_text_eof //-->
 353    </tr>
 354  </table>
 355  <!-- body_eof //-->
 356  
 357  <!-- footer //-->
 358  <?php require (DIR_WS_INCLUDES . 'footer.php'); ?>
 359  <!-- footer_eof //-->
 360  </body>
 361  </html>
 362  <?php require (DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7