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

if (isset($key) && $key != 0)
{
	$param['shop_intermediate_id'] = to_int($key);
}

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

$param['sho_shop_items_catalog_item_id'] = to_str($_REQUEST['tying_products_name']);

	if ($shop->InsertTyingProducts($param))
	{
		if (isset($key))
		{
			show_message($GLOBALS['MSG_shops']['success_edit_tying_products']);
		}
		else 
		{
			show_message($GLOBALS['MSG_shops']['success_add_tying_products']);
		}
	}
	else
	{
		if (isset($key))
		{
			show_error_message($GLOBALS['MSG_shops']['error_edit_tying_products']);
		}
		else 
		{
			show_error_message($GLOBALS['MSG_shops']['error_add_tying_products']);
		}
	}
?>