<?php 
/**
 * Система управления сайтом HostCMS v. 5.xx
 * Copyright © 2005-2010 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
 *
 * Обработчик добавления/редактирования скидки на товар.
 * 
 * Файл: /admin/shop/action/add_item_discount.php
 * 
 * @author Hostmake LLC
 * @version 5.x
 */
$param = array();

$shop = & singleton('shop');

if (isset($_POST['edit_item_discount']))
{
	$param['shop_item_discount_id'] = to_int($_POST['edit_item_discount']);
}

$param['item_catalog_id'] = to_int($_REQUEST['shop_items_catalog_item_id']);

$param['shop_discount_id'] = to_int($_POST['shop_discount_id']);

if ($shop->InsertItemDiscount($param))
{
	show_message($GLOBALS['MSG_shops']['success_add_item_discount']);
}
else
{
	show_error_message($GLOBALS['MSG_shops']['error_add_item_discount']);
}
?>