[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 featured.php

Zen Cart 源代码 featured.php




下载文件

文件名: featured.php
文件类型: PHP文件
文件大小: 26.73 KiB
MD5: 1c131d1c8eae802326a30cd2fd6ec02a

featured.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  *  $Id: featured.php 17534 2010-09-08 19:50:34Z wilt $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12.   require(DIR_WS_CLASSES . 'currencies.php');
  13.   $currencies = new currencies();
  14.  
  15.   $action = (isset($_GET['action']) ? $_GET['action'] : '');
  16.  
  17.   if (zen_not_null($action)) {
  18.     switch ($action) {
  19.       case 'setflag':
  20.         zen_set_featured_status($_GET['id'], $_GET['flag']);
  21.  
  22.         zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . $_GET['id'], 'NONSSL'));
  23.         break;
  24.       case 'insert':
  25.         if ($_POST['products_id'] < 1) {
  26.           $messageStack->add_session(ERROR_NOTHING_SELECTED, 'caution');
  27.         } else {
  28.         $products_id = zen_db_prepare_input($_POST['products_id']);
  29.  
  30.         $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
  31.         $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));
  32.  
  33.         $db->Execute("insert into " . TABLE_FEATURED . "
  34.                    (products_id, featured_date_added, expires_date, status, featured_date_available)
  35.                    values ('" . (int)$products_id . "',
  36.                            now(),
  37.                            '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')");
  38.  
  39.         $new_featured = $db->Execute("select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$products_id . "'");
  40.         } // nothing selected to add
  41.         if ($_GET['go_back'] == 'ON'){
  42.           zen_redirect(zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $products_id . '&current_category_id=' . $_GET['current_category_id']));
  43.         } else {
  44.           zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . $new_featured->fields['featured_id']));
  45.         }
  46.         break;
  47.       case 'update':
  48.         $featured_id = zen_db_prepare_input($_POST['featured_id']);
  49.  
  50.         $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
  51.         $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));
  52.  
  53.         $db->Execute("update " . TABLE_FEATURED . "
  54.                      set featured_last_modified = now(),
  55.                          expires_date = '" . zen_db_input($expires_date) . "',
  56.                          featured_date_available = '" . zen_db_input($featured_date_available) . "'
  57.                      where featured_id = '" . (int)$featured_id . "'");
  58.  
  59.         zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . (int)$featured_id));
  60.         break;
  61.       case 'deleteconfirm':
  62.         // demo active test
  63.         if (zen_admin_demo()) {
  64.           $_GET['action']= '';
  65.           $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  66.           zen_redirect(zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page']));
  67.         }
  68.         $featured_id = zen_db_prepare_input($_GET['fID']);
  69.  
  70.         $db->Execute("delete from " . TABLE_FEATURED . "
  71.                      where featured_id = '" . (int)$featured_id . "'");
  72.  
  73.         zen_redirect(zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page']));
  74.         break;
  75.       case 'pre_add_confirmation':
  76.       // check for blank or existing featured
  77.         $skip_featured = false;
  78.         if (empty($_POST['pre_add_products_id'])) {
  79.           $skip_featured = true;
  80.           $messageStack->add_session(WARNING_FEATURED_PRE_ADD_EMPTY, 'caution');
  81.         }
  82.  
  83.         if ($skip_featured == false) {
  84.           $sql = "select products_id from " . TABLE_PRODUCTS . " where products_id='" . (int)$_POST['pre_add_products_id'] . "'";
  85.           $check_featured = $db->Execute($sql);
  86.           if ($check_featured->RecordCount() < 1) {
  87.             $skip_featured = true;
  88.             $messageStack->add_session(WARNING_FEATURED_PRE_ADD_BAD_PRODUCTS_ID, 'caution');
  89.           }
  90.         }
  91.  
  92.         if ($skip_featured == false) {
  93.           $sql = "select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$_POST['pre_add_products_id'] . "'";
  94.           $check_featured = $db->Execute($sql);
  95.           if ($check_featured->RecordCount() > 0) {
  96.             $skip_featured = true;
  97.             $messageStack->add_session(WARNING_FEATURED_PRE_ADD_DUPLICATE, 'caution');
  98.           }
  99.         }
  100.  
  101.         if ($skip_featured == true) {
  102.           zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . ((int)$check_featured->fields['featured_id'] > 0 ? 'fID=' . (int)$check_featured->fields['featured_id'] : '')));
  103.         }
  104.       // add empty featured
  105.  
  106.         $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
  107.         $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));
  108.  
  109.         $products_id = zen_db_prepare_input($_POST['pre_add_products_id']);
  110.         $db->Execute("insert into " . TABLE_FEATURED . "
  111.                    (products_id, featured_date_added, expires_date, status, featured_date_available)
  112.                    values ('" . (int)$products_id . "',
  113.                            now(),
  114.                            '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')");
  115.  
  116.         $new_featured = $db->Execute("select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$products_id . "'");
  117.  
  118.         $messageStack->add_session(SUCCESS_FEATURED_PRE_ADD, 'success');
  119.         zen_redirect(zen_href_link(FILENAME_FEATURED, 'action=edit' . '&fID=' . $new_featured->fields['featured_id'] . '&manual=1'));
  120.         break;
  121.  
  122.     }
  123.   }
  124. ?>
  125. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  126. <html <?php echo HTML_PARAMS; ?>>
  127. <head>
  128. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  129. <title><?php echo TITLE; ?></title>
  130. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  131. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  132. <script language="javascript" src="includes/menu.js"></script>
  133. <script language="javascript" src="includes/general.js"></script>
  134. <?php
  135.   if ( ($action == 'new') || ($action == 'edit') ) {
  136. ?>
  137. <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
  138. <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
  139. <?php
  140.   }
  141. ?>
  142. <script type="text/javascript">
  143.   <!--
  144.   function init()
  145.   {
  146.     cssjsmenu('navbar');
  147.     if (document.getElementById)
  148.     {
  149.       var kill = document.getElementById('hoverJS');
  150.       kill.disabled = true;
  151.     }
  152.   }
  153.   // -->
  154. </script>
  155. </head>
  156. <body onload="init()">
  157. <div id="spiffycalendar" class="text"></div>
  158. <!-- header //-->
  159. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  160. <!-- header_eof //-->
  161.  
  162. <!-- body //-->
  163. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  164.   <tr>
  165. <!-- body_text //-->
  166.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  167.  
  168.       <tr>
  169.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  170.          <tr><?php echo zen_draw_form('search', FILENAME_FEATURED, '', 'get'); ?>
  171.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  172.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
  173.             <td class="smallText" align="right">
  174. <?php
  175. // show reset search
  176.   if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
  177.     echo '<a href="' . zen_href_link(FILENAME_FEATURED) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
  178.   }
  179.   echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
  180.   if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
  181.     $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
  182.     echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
  183.   }
  184. ?>
  185.             </td>
  186.           </form></tr>
  187.           <tr>
  188.             <td colspan="3" class="main"><?php echo TEXT_STATUS_WARNING; ?></td>
  189.           </tr>
  190.         </table></td>
  191.       </tr>
  192.  
  193. <?php
  194.   if (empty($action)) {
  195. ?>
  196.                     <td align="center"><?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, ((isset($_GET['page']) && $_GET['page'] > 0) ? 'page=' . $_GET['page'] . '&' : '') . 'action=new') . '">' . zen_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
  197. <?php
  198.   }
  199. ?>
  200. <?php
  201.   if ( ($action == 'new') || ($action == 'edit') ) {
  202.     $form_action = 'insert';
  203.     if ( ($action == 'edit') && isset($_GET['fID']) ) {
  204.       $form_action = 'update';
  205.  
  206.       $product = $db->Execute("select p.products_id, pd.products_name, p.products_price, p.products_priced_by_attribute,
  207.                                      f.expires_date, f.featured_date_available
  208.                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
  209.                                         TABLE_FEATURED . " f
  210.                               where p.products_id = pd.products_id
  211.                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
  212.                               and p.products_id = f.products_id
  213.                               and f.featured_id = '" . (int)$_GET['fID'] . "'");
  214.  
  215.       $fInfo = new objectInfo($product->fields);
  216.  
  217.       if ($fInfo->products_priced_by_attribute == '1') {
  218.         $fInfo->products_price = zen_get_products_base_price($product->fields['products_id']);
  219.       }
  220.  
  221.     } else {
  222.       $fInfo = new objectInfo(array());
  223.  
  224. // create an array of featured products, which will be excluded from the pull down menu of products
  225. // (when creating a new featured product)
  226.       $featured_array = array();
  227.       $featured = $db->Execute("select p.products_id, p.products_model
  228.                                from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " f
  229.                                where f.products_id = p.products_id");
  230.  
  231.       while (!$featured->EOF) {
  232.         $featured_array[] = $featured->fields['products_id'];
  233.         $featured->MoveNext();
  234.       }
  235.  
  236. // do not include things that cannot go in the cart
  237.       $not_for_cart = $db->Execute("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCT_TYPES . " pt on p.products_type= pt.type_id where pt.allow_add_to_cart = 'N'");
  238.  
  239.       while (!$not_for_cart->EOF) {
  240.         $featured_array[] = $not_for_cart->fields['products_id'];
  241.         $not_for_cart->MoveNext();
  242.       }
  243.     }
  244. ?>
  245. <script language="javascript">
  246. var StartDate = new ctlSpiffyCalendarBox("StartDate", "new_featured", "start", "btnDate1","<?php echo (($fInfo->featured_date_available == '0001-01-01') ? '' : zen_date_short($fInfo->featured_date_available)); ?>",scBTNMODE_CUSTOMBLUE);
  247. var EndDate = new ctlSpiffyCalendarBox("EndDate", "new_featured", "end", "btnDate2","<?php echo (($fInfo->expires_date == '0001-01-01') ? '' : zen_date_short($fInfo->expires_date)); ?>",scBTNMODE_CUSTOMBLUE);
  248. </script>
  249.  
  250.       <tr>
  251.       <?php echo zen_draw_form('new_featured', FILENAME_FEATURED, zen_get_all_get_params(array('action', 'info', 'fID')) . 'action=' . $form_action . '&go_back=' . $_GET['go_back']); ?><?php if ($form_action == 'update') echo zen_draw_hidden_field('featured_id', $_GET['fID']); ?>
  252.         <td><br><table border="0" cellspacing="0" cellpadding="2">
  253.           <tr>
  254.             <td class="main"><?php echo TEXT_FEATURED_PRODUCT; ?>&nbsp;</td>
  255.             <td class="main"><?php echo (isset($fInfo->products_name)) ? $fInfo->products_name . ' <small>(' . $currencies->format($fInfo->products_price) . ')</small>' : zen_draw_products_pull_down('products_id', 'size="15" style="font-size:12px"', $featured_array, true, $_GET['add_products_id'], true); echo zen_draw_hidden_field('products_price', (isset($fInfo->products_price) ? $fInfo->products_price : '')); ?></td>
  256.           </tr>
  257.           <tr>
  258.             <td class="main"><?php echo TEXT_FEATURED_AVAILABLE_DATE; ?>&nbsp;</td>
  259.             <td class="main"><script language="javascript">StartDate.writeControl(); StartDate.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script></td>
  260.           </tr>
  261.           <tr>
  262.             <td class="main"><?php echo TEXT_FEATURED_EXPIRES_DATE; ?>&nbsp;</td>
  263.             <td class="main"><script language="javascript">EndDate.writeControl(); EndDate.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script></td>
  264.           </tr>
  265.         </table></td>
  266.       </tr>
  267.       <tr>
  268.         <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  269.           <tr>
  270.             <td colspan="2" class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? zen_image_submit('button_insert.gif', IMAGE_INSERT) : zen_image_submit('button_update.gif', IMAGE_UPDATE)). ((int)$_GET['manual'] == 0 ? '&nbsp;&nbsp;&nbsp;<a href="' . ($_GET['go_back'] == 'ON' ? zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $_GET['add_products_id'] . '&current_category_id=' . $_GET['current_category_id']) : zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . (isset($_GET['fID']) ? '&fID=' . $_GET['fID'] : ''))) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' : ''); ?></td>
  271.           </tr>
  272.         </table></td>
  273.       </form></tr>
  274. <?php
  275.   } else {
  276. ?>
  277.       <tr>
  278.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  279.           <tr>
  280.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  281.               <tr class="dataTableHeadingRow">
  282.                 <td class="dataTableHeadingContent" align="right"><?php echo 'ID#'; ?>&nbsp;</td>
  283.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
  284.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
  285.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_AVAILABLE_DATE; ?></td>
  286.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EXPIRES_DATE; ?></td>
  287.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
  288.                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  289.               </tr>
  290. <?php
  291. // create search filter
  292.   $search = '';
  293.   if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
  294.     $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
  295.     $search = " and (pd.products_name like '%" . $keywords . "%' or pd.products_description like '%" . $keywords . "%' or p.products_model like '%" . $keywords . "%')";
  296.   }
  297.  
  298. // order of display
  299.   $order_by = " order by pd.products_name ";
  300.   $featured_query_raw = "select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_priced_by_attribute, f.featured_id, f.featured_date_added, f.featured_last_modified, f.expires_date, f.date_status_change, f.status, f.featured_date_available from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " f, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_id = f.products_id"  . $search . $order_by;
  301.  
  302. // Split Page
  303. // reset page when page is unknown
  304. if (($_GET['page'] == '1' or $_GET['page'] == '') and $_GET['fID'] != '') {
  305.   $old_page = $_GET['page'];
  306.   $check_page = $db->Execute($featured_query_raw);
  307.   if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN) {
  308.     $check_count=1;
  309.     while (!$check_page->EOF) {
  310.       if ($check_page->fields['featured_id'] == $_GET['fID']) {
  311.         break;
  312.       }
  313.       $check_count++;
  314.       $check_page->MoveNext();
  315.     }
  316.     $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN) !=0 ? .5 : 0)),0);
  317.     $page = $_GET['page'];
  318.     if ($old_page != $_GET['page']) {
  319. // do nothing
  320.     }
  321.   } else {
  322.     $_GET['page'] = 1;
  323.   }
  324. }
  325.  
  326.  
  327. // create split page control
  328.     $featured_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, $featured_query_raw, $featured_query_numrows);
  329.     $featured = $db->Execute($featured_query_raw);
  330.     while (!$featured->EOF) {
  331.       if ((!isset($_GET['fID']) || (isset($_GET['fID']) && ($_GET['fID'] == $featured->fields['featured_id']))) && !isset($fInfo)) {
  332.         $products = $db->Execute("select products_image
  333.                                  from " . TABLE_PRODUCTS . "
  334.                                  where products_id = '" . (int)$featured->fields['products_id'] . "'");
  335.  
  336.         $fInfo_array = array_merge($featured->fields, $products->fields);
  337.         $fInfo = new objectInfo($fInfo_array);
  338.       }
  339.  
  340.       if (isset($fInfo) && is_object($fInfo) && ($featured->fields['featured_id'] == $fInfo->featured_id)) {
  341.         echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=edit') . '\'">' . "\n";
  342.       } else {
  343.         echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=edit') . '\'">' . "\n";
  344.       }
  345.  
  346. ?>
  347.                 <td  class="dataTableContent" align="right"><?php echo $featured->fields['products_id']; ?>&nbsp;</td>
  348.                 <td  class="dataTableContent"><?php echo $featured->fields['products_name']; ?></td>
  349.                 <td  class="dataTableContent" align="left"><?php echo $featured->fields['products_model']; ?>&nbsp;</td>
  350.                 <td  class="dataTableContent" align="center"><?php echo (($featured->fields['featured_date_available'] != '0001-01-01' and $featured->fields['featured_date_available'] !='') ? zen_date_short($featured->fields['featured_date_available']) : TEXT_NONE); ?></td>
  351.                 <td  class="dataTableContent" align="center"><?php echo (($featured->fields['expires_date'] != '0001-01-01' and $featured->fields['expires_date'] !='') ? zen_date_short($featured->fields['expires_date']) : TEXT_NONE); ?></td>
  352.                 <td  class="dataTableContent" align="center">
  353. <?php
  354.       if ($featured->fields['status'] == '1') {
  355.         echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=setflag&flag=0&id=' . $featured->fields['featured_id'] . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>';
  356.       } else {
  357.         echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=setflag&flag=1&id=' . $featured->fields['featured_id'] . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
  358.       }
  359. ?>
  360.                 </td>
  361.                 <td class="dataTableContent" align="right">
  362.                   <?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?>
  363.                           <?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '</a>'; ?>
  364.                   <?php if (isset($fInfo) && is_object($fInfo) && ($featured->fields['featured_id'] == $fInfo->featured_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_FEATURED, zen_get_all_get_params(array('fID')) . 'fID=' . $featured->fields['featured_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
  365.                         </td>
  366.       </tr>
  367. <?php
  368.       $featured->MoveNext();
  369.     }
  370. ?>
  371.               <tr>
  372.                 <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
  373.                   <tr>
  374.                     <td class="smallText" valign="top"><?php echo $featured_split->display_count($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_FEATURED); ?></td>
  375.                     <td class="smallText" align="right"><?php echo $featured_split->display_links($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
  376.                   </tr>
  377. <?php
  378.   if (empty($action)) {
  379. ?>
  380.                   <tr>
  381.                     <td colspan="2" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&action=new') . '">' . zen_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
  382.                   </tr>
  383. <?php
  384.   }
  385. ?>
  386.                 </table></td>
  387.               </tr>
  388.             </table></td>
  389. <?php
  390.   $heading = array();
  391.   $contents = array();
  392.  
  393.   switch ($action) {
  394.     case 'delete':
  395.       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_FEATURED . '</b>');
  396.  
  397.       $contents = array('form' => zen_draw_form('featured', FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=deleteconfirm'));
  398.       $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
  399.       $contents[] = array('text' => '<br /><b>' . $fInfo->products_name . '</b>');
  400.       $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  401.       break;
  402.     case 'pre_add':
  403.       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_PRE_ADD_FEATURED . '</b>');
  404.       $contents = array('form' => zen_draw_form('featured', FILENAME_FEATURED, 'action=pre_add_confirmation' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')));
  405.       $contents[] = array('text' => TEXT_INFO_PRE_ADD_INTRO);
  406.       $contents[] = array('text' => '<br />' . TEXT_PRE_ADD_PRODUCTS_ID . '<br>' . zen_draw_input_field('pre_add_products_id', '', zen_set_field_length(TABLE_FEATURED, 'products_id')));
  407.       $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_confirm.gif', IMAGE_CONFIRM) . '&nbsp;<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . ($fInfo->featured_id > 0 ? '&fID=' . $fInfo->featured_id : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  408.       break;
  409.     default:
  410.       if (is_object($fInfo)) {
  411.         $heading[] = array('text' => '<b>' . $fInfo->products_name . '</b>');
  412.  
  413.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
  414.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'action=edit&products_filter=' . $fInfo->products_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a>');
  415.         $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($fInfo->featured_date_added));
  416.         $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($fInfo->featured_last_modified));
  417.         $contents[] = array('align' => 'center', 'text' => '<br />' . zen_info_image($fInfo->products_image, $fInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
  418.  
  419.         $contents[] = array('text' => '<br />' . TEXT_INFO_AVAILABLE_DATE . ' <b>' . (($fInfo->featured_date_available != '0001-01-01' and $fInfo->featured_date_available !='') ? zen_date_short($fInfo->featured_date_available) : TEXT_NONE) . '</b>');
  420.         $contents[] = array('text' => TEXT_INFO_EXPIRES_DATE . ' <b>' . (($fInfo->expires_date != '0001-01-01' and $fInfo->expires_date !='') ? zen_date_short($fInfo->expires_date) : TEXT_NONE) . '</b>');
  421.         $contents[] = array('text' => '<br />' . TEXT_INFO_STATUS_CHANGE . ' ' . zen_date_short($fInfo->date_status_change));
  422.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CATEGORIES, '&action=new_product' . '&cPath=' . zen_get_product_path($fInfo->products_id, 'override') . '&pID=' . $fInfo->products_id . '&product_type=' . zen_get_products_type($fInfo->products_id)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . '</a>');
  423.  
  424.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=pre_add' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_select.gif', IMAGE_SELECT) . '<br />' . TEXT_INFO_MANUAL . '</a><br /><br />');
  425.       } else {
  426.         $heading[] = array('text' => '<b>' . TEXT_NONE . '</b>');
  427.         $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=pre_add' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_select.gif', IMAGE_SELECT) . '<br />' . TEXT_INFO_MANUAL . '</a><br /><br />');
  428.       }
  429.       break;
  430.   }
  431.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  432.     echo '            <td width="25%" valign="top">' . "\n";
  433.  
  434.     $box = new box;
  435.     echo $box->infoBox($heading, $contents);
  436.  
  437.     echo '            </td>' . "\n";
  438.   }
  439. }
  440. ?>
  441.           </tr>
  442.         </table></td>
  443.       </tr>
  444.     </table></td>
  445. <!-- body_text_eof //-->
  446.   </tr>
  447. </table>
  448. <!-- body_eof //-->
  449.  
  450. <!-- footer //-->
  451. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  452. <!-- footer_eof //-->
  453. </body>
  454. </html>
  455. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  456.  


cron