[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 源代码 coupon_restrict.php

Zen Cart 源代码 coupon_restrict.php




下载文件

文件名: coupon_restrict.php
文件类型: PHP文件
文件大小: 23.18 KiB
MD5: 30761eb3ec280df8be2f183096305103

coupon_restrict.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.  * @version $Id: coupon_restrict.php 17889 2010-10-08 21:24:16Z wilt $
  8.  */
  9.   //define('MAX_DISPLAY_RESTRICT_ENTRIES', 10);
  10.   require('includes/application_top.php');
  11.   $restrict_array = array();
  12.   $restrict_array[] = array('id'=>'Deny', text=>'Deny');
  13.   $restrict_array[] = array('id'=>'Allow', text=>'Allow');
  14.  
  15.   $the_path = $_POST['cPath'];
  16.   if ($_GET['action']=='switch_status') {
  17.     $status = $db->Execute("select coupon_restrict
  18.                            from " . TABLE_COUPON_RESTRICT . "
  19.                            where restrict_id = '" . $_GET['info'] . "'");
  20.  
  21.     $new_status = 'N';
  22.     if ($status->fields['coupon_restrict'] == 'N') $new_status = 'Y';
  23.     $db->Execute("update " . TABLE_COUPON_RESTRICT . "
  24.                  set coupon_restrict = '" . $new_status . "'
  25.                  where restrict_id = '" . $_GET['info'] . "'");
  26.   }
  27.   if ($_GET['action']=='add_category' && isset($_POST['cPath'])) {
  28.     if ($_POST['cPath'] == 0) $_POST['cPath'] = -1;
  29.     $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . "
  30.                              where coupon_id = '" . $_GET['cid'] . "'
  31.                              and category_id = '" . $_POST['cPath'] . "'");
  32.  
  33.     if ($test_query->RecordCount() < 1) {
  34.       $status = 'N';
  35.       if ($_POST['restrict_status']=='Deny') $status = 'Y';
  36.       $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
  37.                  (coupon_id, category_id, coupon_restrict)
  38.                  values ('" . $_GET['cid'] . "', '" . $_POST['cPath'] . "', '" . $status . "')");
  39.     } else {
  40.       // message that nothing is done
  41.       $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
  42.     }
  43.   }
  44.  
  45.  
  46. // from products dropdown selection
  47.   if ($_GET['action']=='add_product' && $_POST['products_drop']) {
  48.     $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id = '" . $_POST['products_drop'] . "'");
  49.     if ($test_query->RecordCount() < 1) {
  50.       $status = 'N';
  51.       if ($_POST['restrict_status']=='Deny') $status = 'Y';
  52.  
  53. // ==================================
  54. // bof: ALL ADD/DELETE of Products in one Category
  55.         if ($_POST['products_drop'] < 0) {
  56.         // adding new records
  57.           if ($_POST['products_drop'] == -1) {
  58.           // to insert new products from a given categories_id for a coupon_code that are not already in the table
  59.           // products in the table from the catategories_id are skipped
  60.             $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
  61.             $new_products = $db->Execute($new_products_query);
  62.           }
  63.  
  64.           if ($_POST['products_drop'] == -2) {
  65.           // to delete existing products from a given categories_id for a coupon_code that are already in the table
  66.           // products in the table from the catategories_id are skipped
  67.             $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
  68.             $new_products = $db->Execute($new_products_query);
  69.           }
  70.  
  71.           // nothing to be done
  72.           if ($new_products->RecordCount() == 0) {
  73.             $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
  74.           }
  75.           while(!$new_products->EOF) {
  76.             // product passed and needs to be added/deleted
  77.             // add all products from select category for each product not already defined in coupons_restrict
  78.             if ($_POST['products_drop'] == -1) {
  79.               $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
  80.                          (coupon_id, product_id, coupon_restrict)
  81.                          values ('" . $_GET['cid'] . "', '" . $new_products->fields['products_id'] . "', '" . $status . "')");
  82.             } else {
  83.             // removed as defined in coupons_restrict for either DENY or ALLOW
  84.               $db->Execute("delete from " . TABLE_COUPON_RESTRICT . "
  85.                            WHERE coupon_id = '" . $_GET['cid'] . "'
  86.                            and product_id = '" . $new_products->fields['products_id'] . "'
  87.                            and coupon_restrict = '" . $status . "'");
  88.             }
  89.  
  90.             $new_products->MoveNext();
  91.           }
  92. // eof: ALL ADD/DELETE of Products in one Category
  93. // ==================================
  94.  
  95.       } else {
  96. // normal insert of product one by one allow/deny to coupon
  97.       $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
  98.                  (coupon_id, product_id, coupon_restrict)
  99.                  values ('" . $_GET['cid'] . "', '" . $_POST['products_drop'] . "', '" . $status . "')");
  100.       } // not all deny allow
  101.     } else {
  102.       $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_PRODUCT . ' ' . $_POST['products_drop'], 'caution');
  103.     }
  104.   }
  105.   if ($_GET['action']=='remove' && $_GET['info']) {
  106.     $db->Execute("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = '" . $_GET['info'] . "'");
  107.   }
  108. ?>
  109. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  110. <html <?php echo HTML_PARAMS; ?>>
  111. <head>
  112. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  113. <title><?php echo TITLE; ?></title>
  114. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  115. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  116. <script language="javascript" src="includes/menu.js"></script>
  117. <script type="text/javascript">
  118.   <!--
  119.   function init()
  120.   {
  121.     cssjsmenu('navbar');
  122.     if (document.getElementById)
  123.     {
  124.       var kill = document.getElementById('hoverJS');
  125.       kill.disabled = true;
  126.     }
  127.   }
  128.   // -->
  129. </script>
  130. </head>
  131. <body onload="init()">
  132. <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
  133. <!-- header //-->
  134. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  135. <!-- header_eof //-->
  136. <!-- body //-->
  137. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  138.   <tr>
  139. <!-- body_text //-->
  140.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  141.       <tr>
  142.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  143.           <tr>
  144.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  145.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  146.           </tr>
  147.         </table></td>
  148.       </tr>
  149.       <tr>
  150.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  151.           <tr>
  152.             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  153.               <tr>
  154.                 <td class="pageHeading"><?php echo HEADING_TITLE_CATEGORY; ?></td>
  155.               </tr>
  156.             </table></td>
  157.           </tr>
  158.           <tr>
  159.             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  160.               <tr>
  161.                 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  162.                   <tr class="dataTableHeadingRow">
  163.                     <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
  164.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
  165.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_ID; ?></td>
  166.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_NAME; ?></td>
  167.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
  168.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
  169.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
  170.                   </tr>
  171. <?php
  172.     $cr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and category_id != '0'";
  173.     $cr_split = new splitPageResults($_GET['cpage'], MAX_DISPLAY_RESTRICT_ENTRIES, $cr_query_raw, $cr_query_numrows);
  174.     $cr_list = $db->Execute($cr_query_raw);
  175.     while (!$cr_list->EOF) {
  176.       $rows++;
  177.       if (strlen($rows) < 2) {
  178.         $rows = '0' . $rows;
  179.       }
  180.       if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$cInfo)) {
  181.         $cInfo = new objectInfo($cr_list->fields);
  182.       }
  183.         echo '          <tr class="dataTableRow">' . "\n";
  184.      if ($cr_list->fields['category_id'] != -1) {
  185.      $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . "
  186.                             where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
  187.      $category_name = zen_get_category_name($cr_list->fields['category_id'], $_SESSION['languages_id']);
  188.      } else {
  189.         $category_name = TEXT_ALL_CATEGORIES;
  190.      }
  191. ?>
  192.                 <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
  193.                 <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
  194.                 <td class="dataTableContent" align="center"><?php echo $cr_list->fields['category_id']; ?></td>
  195.                 <td class="dataTableContent" align="center"><?php echo $category_name; ?></td>
  196. <?php
  197.         if ($cr_list->fields['coupon_restrict']=='N') {
  198.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
  199.         } else {
  200.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
  201.         }
  202.         if ($cr_list->fields['coupon_restrict']=='Y') {
  203.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
  204.         } else {
  205.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
  206.         }
  207.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
  208. ?>
  209.               </tr>
  210. <?php
  211.     $cr_list->MoveNext();
  212.     }
  213. ?>
  214.               <tr>
  215.                 <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  216.                   <tr>
  217.                     <td class="smallText" valign="top"><?php echo $cr_split->display_count($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['cpage'], TEXT_DISPLAY_NUMBER_OF_CATEGORIES); ?></td>
  218.                     <td class="smallText" align="right"><?php echo $cr_split->display_links($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['cpage'],zen_get_all_get_params(array('cpage','action', 'x', 'y')),'cpage'); ?></td>
  219.                   </tr>
  220.                 </table></td>
  221.               </tr>
  222.               <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  223.                 <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  224.                   <tr>
  225.                     <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
  226.                     <td class="smallText" align="left"></td>
  227.                     <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id); ?></td>
  228.                     <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array, $current_category_id); ?></td>
  229.                     <td class="smallText" align="left"><input type="submit" name="add" value="Add"></td>
  230.                     <td class="smallText" align="left">&nbsp;</td>
  231.                     <td class="smallText" align="left">&nbsp;</td>
  232.                   </tr>
  233.                 </table></td>
  234.               </tr></form>
  235.                 </table></td>
  236.               </tr>
  237.             </table></td>
  238.           </tr>
  239.           <tr>
  240.             <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  241.           </tr>
  242.           <tr>
  243.             <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  244.           </tr>
  245.           <tr>
  246.             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  247.               <tr>
  248.                 <td class="pageHeading"><?php echo HEADING_TITLE_PRODUCT; ?></td>
  249.               </tr>
  250.             </table></td>
  251.           </tr>
  252.           <tr>
  253.             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  254.               <tr>
  255.                 <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  256.                   <tr class="dataTableHeadingRow">
  257.                     <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
  258.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
  259.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_ID; ?></td>
  260.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_NAME; ?></td>
  261.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
  262.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
  263.                     <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
  264.                   </tr>
  265. <?php
  266.     $pr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id != '0'";
  267.     $pr_split = new splitPageResults($_GET['ppage'], MAX_DISPLAY_RESTRICT_ENTRIES, $pr_query_raw, $pr_query_numrows);
  268.     $pr_list = $db->Execute($pr_query_raw);
  269.     while (!$pr_list->EOF) {
  270.       $rows++;
  271.       if (strlen($rows) < 2) {
  272.         $rows = '0' . $rows;
  273.       }
  274.       if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$pInfo)) {
  275.         $pInfo = new objectInfo($pr_list);
  276.       }
  277.         echo '          <tr class="dataTableRow">' . "\n";
  278.  
  279.      $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
  280.      $product_name = zen_get_products_name($pr_list->fields['product_id'], $_SESSION['languages_id']);
  281. ?>
  282.                 <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
  283.                 <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
  284.                 <td class="dataTableContent" align="center"><?php echo $pr_list->fields['product_id']; ?></td>
  285.                 <td class="dataTableContent" align="left"><?php echo '<strong>' . $product_name . '</strong><br />' . TEXT_CATEGORY . zen_get_categories_name_from_product($pr_list->fields['product_id']) . '<br />' . TEXT_MANUFACTURER . zen_get_products_manufacturers_name($pr_list->fields['product_id']); ?></td>
  286. <?php
  287.         if ($pr_list->fields['coupon_restrict']=='N') {
  288.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
  289.         } else {
  290.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
  291.         }
  292.         if ($pr_list->fields['coupon_restrict']=='Y') {
  293.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_DENY) . '</a></td>';
  294.         } else {
  295.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ALLOW) . '</a></td>';
  296.         }
  297.           echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
  298. ?>
  299.               </tr>
  300. <?php
  301.     $pr_list->MoveNext();
  302.     }
  303. ?>
  304.               <tr>
  305.                 <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  306.                   <tr>
  307.                     <td class="smallText" valign="top"><?php echo $pr_split->display_count($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['ppage'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
  308.                     <td class="smallText" align="right"><?php echo $pr_split->display_links($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['ppage'],zen_get_all_get_params(array('ppage','action', 'x', 'y')),'ppage'); ?></td>
  309.                   </tr>
  310.                 </table></td>
  311.               </tr>
  312.               <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  313.                 <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  314.                   <tr>
  315. <?php
  316.       if (isset($_POST['cPath_prod'])) $current_category_id = $_POST['cPath_prod'];
  317.       $products = $db->Execute("select p.products_id, pd.products_name from " .
  318.       TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
  319.      where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'
  320.      and p.products_id = p2c.products_id and p2c.categories_id = '" . $_POST['cPath_prod'] . "'
  321.      order by pd.products_name");
  322.       $products_array = array();
  323.  
  324.       if (!$products->EOF) {
  325.         $products_array[] = array('id' => '-1',
  326.                                    'text' => TEXT_ALL_PRODUCTS_ADD);
  327.         $products_array[] = array('id' => '-2',
  328.                                    'text' => TEXT_ALL_PRODUCTS_REMOVE);
  329.       }
  330.  
  331.       while (!$products->EOF) {
  332.         $products_array[] = array('id'=>$products->fields['products_id'],
  333.                                    'text'=>$products->fields['products_name']);
  334.         $products->MoveNext();
  335.       }
  336. ?>
  337.                     <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
  338.                     <td class="smallText" align="left"></td><form name="restrict_product" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
  339.                     <?php echo zen_hide_session_id(); ?>
  340.                     <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath_prod', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form>
  341. <?php if (sizeof($products_array) > 0) { ?>
  342.                     <form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_product&info=' . $cInfo->restrict_id . '&build_cat=' . $current_category_id, 'NONSSL'); ?>"><?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  343.                     <td class="smallText" valign="top"><?php echo HEADER_PRODUCT_NAME; ?></td>
  344.                     <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('products_drop', $products_array, $current_category_id); ?></td>
  345.                     <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array); ?></td>
  346.                     <td class="smallText" align="left"><input type="submit" name="add" value="Update"></td>
  347.                     <td class="smallText" align="left">&nbsp;</td>
  348.                     <td class="smallText" align="left">&nbsp;</td>
  349. <?php } else { ?>
  350.                     <td class="smallText" align="left" colspan="6">&nbsp;</td>
  351. <?php } ?>
  352.                   </tr>
  353.                   <tr>
  354.                     <td class="smallText" align="left" colspan = "9"><?php echo TEXT_INFO_ADD_DENY_ALL; ?></td>
  355.                   </tr>
  356.                 </table></td>
  357.               </tr></form>
  358.                 </table></td>
  359.               </tr>
  360.             </table></td>
  361.           </tr>
  362.           <tr>
  363.             <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  364.           </tr>
  365.           <tr>
  366.             <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . (!empty($cInfo->coupon_id) ? $cInfo->coupon_id : $_GET['cid']) . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  367.           </tr>
  368.         </table></td>
  369.       </tr>
  370.       <tr>
  371.         <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  372.       </tr>
  373.     </table></td>
  374. <!-- body_text_eof //-->
  375.   </tr>
  376. </table>
  377. <!-- body_eof //-->
  378.  
  379. <!-- footer //-->
  380. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  381. <!-- footer_eof //-->
  382. <br>
  383. </body>
  384. </html>
  385. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  386.  


cron