[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/includes/modules/ -> move_product_confirm.php (source)

   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  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics