当前位置: 首页>>代码示例>>PHP>>正文


PHP zen_set_product_status函数代码示例

本文整理汇总了PHP中zen_set_product_status函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_set_product_status函数的具体用法?PHP zen_set_product_status怎么用?PHP zen_set_product_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zen_set_product_status函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

 if ($_POST['quick_updates_new']['products_image']) {
     foreach ($_POST['quick_updates_new']['products_image'] as $products_id => $new_value) {
         if (trim($_POST['quick_updates_new']['products_image'][$products_id]) != trim($_POST['quick_updates_old']['products_image'][$products_id])) {
             $quick_updates_count['products_image'][$products_id] = $products_id;
             $db->Execute("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . zen_db_input($new_value) . "', products_last_modified=now() WHERE products_id=" . (int) $products_id);
         }
     }
 }
 if ($_POST['quick_updates_old']['products_status']) {
     foreach ($_POST['quick_updates_old']['products_status'] as $products_id => $status) {
         if (!isset($_POST['quick_updates_new']['products_status'][$products_id])) {
             $_POST['quick_updates_new']['products_status'][$products_id] = '0';
         }
         if ($_POST['quick_updates_new']['products_status'][$products_id] != $_POST['quick_updates_old']['products_status'][$products_id]) {
             $quick_updates_count['products_status'][$products_id] = $products_id;
             zen_set_product_status((int) $products_id, (int) $_POST['quick_updates_new']['products_status'][$products_id]);
         }
     }
 }
 if ($_POST['quick_updates_new']['products_tax_class_id']) {
     foreach ($_POST['quick_updates_new']['products_tax_class_id'] as $products_id => $new_value) {
         if ($_POST['quick_updates_new']['products_tax_class_id'][$products_id] != $_POST['quick_updates_old']['products_tax_class_id'][$products_id]) {
             $quick_updates_count['products_tax_class_id'][$products_id] = $products_id;
             $db->Execute("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id='" . (int) $new_value . "', products_last_modified=now() WHERE products_id=" . (int) $products_id);
         }
     }
 }
 if ($_POST['quick_updates_new']['categories_id']) {
     foreach ($_POST['quick_updates_new']['categories_id'] as $products_id => $new_value) {
         if ($_POST['quick_updates_new']['categories_id'][$products_id] != $_POST['quick_updates_old']['categories_id'][$products_id]) {
             if (zen_childs_in_category_count($new_value)) {
开发者ID:happyxlq,项目名称:zencart_svn,代码行数:31,代码来源:quick_updates.php

示例2: zen_redirect

         }
         // for
     }
     zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID']));
     break;
 case 'remove_type':
     $sql = "delete from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "\n              where category_id = '" . zen_db_prepare_input($_GET['cID']) . "'\n              and product_type_id = '" . zen_db_prepare_input($_GET['type_id']) . "'";
     $db->Execute($sql);
     zen_remove_restrict_sub_categories($_GET['cID'], $_GET['type_id']);
     $action = "edit";
     zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $_GET['cPath'] . '&cID=' . zen_db_prepare_input($_GET['cID'])));
     break;
 case 'setflag':
     if ($_GET['flag'] == '0' || $_GET['flag'] == '1') {
         if (isset($_GET['pID'])) {
             zen_set_product_status($_GET['pID'], $_GET['flag']);
         }
     }
     zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
     break;
 case 'insert_category':
 case 'update_category':
     if (isset($_POST['add_type']) or isset($_POST['add_type_all'])) {
         // check if it is already restricted
         $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "\n                where category_id = '" . zen_db_prepare_input($_POST['categories_id']) . "'\n                and product_type_id = '" . zen_db_prepare_input($_POST['restrict_type']) . "'";
         $type_to_cat = $db->Execute($sql);
         if ($type_to_cat->RecordCount() < 1) {
             //@@TODO find all sub-categories and restrict them as well.
             $insert_sql_data = array('category_id' => zen_db_prepare_input($_POST['categories_id']), 'product_type_id' => zen_db_prepare_input($_POST['restrict_type']));
             zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);
             /*
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:categories.php


注:本文中的zen_set_product_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。