當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。