[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文件
文件大小: 29.15 KiB
MD5: fc41aed699448fb933b2ad53f305acb0

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