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

Zen Cart 源代码 move_product_confirm.php




下载文件

文件名: move_product_confirm.php
文件类型: PHP文件
文件大小: 2.14 KiB
MD5: 3f6544c1a344dd683fc6f08fef09aa3e

move_product_confirm.php - 关闭高亮
  1. <?php
  2. //
  3. /**
  4.  * @package admin
  5.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  6.  * @copyright Portions Copyright 2003 osCommerce
  7.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  8.  * @version $Id: move_product_confirm.php 3009 2006-02-11 15:41:10Z wilt $
  9.  */
  10. if (!defined('IS_ADMIN_FLAG')) {
  11.   die('Illegal Access');
  12. }
  13.  
  14.         $products_id = zen_db_prepare_input($_POST['products_id']);
  15.         $new_parent_id = zen_db_prepare_input($_POST['move_to_category_id']);
  16.  
  17.         $duplicate_check = $db->Execute("select count(*) as total
  18.                                        from " . TABLE_PRODUCTS_TO_CATEGORIES . "
  19.                                        where products_id = '" . (int)$products_id . "'
  20.                                        and categories_id = '" . (int)$new_parent_id . "'");
  21.  
  22.         if ($duplicate_check->fields['total'] < 1) {
  23.           $db->Execute("update " . TABLE_PRODUCTS_TO_CATEGORIES . "
  24.                        set categories_id = '" . (int)$new_parent_id . "'
  25.                        where products_id = '" . (int)$products_id . "'
  26.                        and categories_id = '" . (int)$current_category_id . "'");
  27.  
  28.           // reset master_categories_id if moved from original master category
  29.           $check_master = $db->Execute("select products_id, master_categories_id from " . TABLE_PRODUCTS . " where products_id='" .  (int)$products_id . "'");
  30.           if ($check_master->fields['master_categories_id'] == (int)$current_category_id) {
  31.             $db->Execute("update " . TABLE_PRODUCTS . "
  32.                          set master_categories_id='" . (int)$new_parent_id . "'
  33.                          where products_id = '" . (int)$products_id . "'");
  34.           }
  35.  
  36.           // reset products_price_sorter for searches etc.
  37.           zen_update_products_price_sorter((int)$products_id);
  38.         } else {
  39.           $messageStack->add_session(ERROR_CANNOT_MOVE_PRODUCT_TO_CATEGORY_SELF, 'error');
  40.         }
  41.  
  42.         zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
  43. ?>