(1753,'lib',45,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0430 [2 \\u0448\\u0430\\u0433\\u0430]\",\"lib_dir_id\":\"9\",\"description\":\"\\u041e\\u0441\\u0443\\u0449\\u0435\\u0441\\u0442\\u0432\\u043b\\u044f\\u0435\\u0442 \\u0440\\u0430\\u0431\\u043e\\u0442\\u0443 \\u0441 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u043e\\u0439 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\",\"lib\":\"<?php\\r\\n\\r\\nclass Shop_Purchase_Discount_Controller_Observer\\r\\n{\\r\\n    static public function onAfterGetDiscounts($object, $args)\\r\\n    {\\r\\n        \\r\\n\\t\\t\\t$iSiteuserGroupId = array(12,13,14,15,16,17,18);\\r\\n\\r\\n\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u043e\\u0432\\u0430\\u043d\\r\\n\\t\\tif ($oSiteuser)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aSiteuser_Groups = $oSiteuser->Siteuser_Groups->findAll();\\r\\n\\r\\n\\t\\t\\tforeach ($aSiteuser_Groups as $oSiteuser_Group)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tif (in_array($oSiteuser_Group->id, $iSiteuserGroupId))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ \\u041c\\u0430\\u0441\\u0441\\u0438\\u0432 \\u0440\\u0430\\u0441\\u0441\\u0447\\u0438\\u0442\\u0430\\u043d\\u043d\\u044b\\u0445 \\u0441\\u043a\\u0438\\u0434\\u043e\\u043a\\r\\n        $aDiscounts = $object->getReturn();\\r\\n         unset($aDiscounts[0]);\\r\\n        \\/\\/var_dump($aDiscounts[0]->name);\\r\\n\\t\\t\\t\\t\\t$object->setReturn(array($aDiscounts));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\r\\n    }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'Shop_Purchase_Discount_Controller.onAfterGetDiscounts\', array(\'Shop_Purchase_Discount_Controller_Observer\', \'onAfterGetDiscounts\'));\\r\\n\\r\\n$Shop_Cart_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$oShop = $Shop_Cart_Controller_Show->getEntity();\\r\\n\\r\\nShop_Payment_System_Handler::checkAfterContent($oShop);\\r\\n\\r\\nShop_Delivery_Handler::checkAfterContent($oShop);\\r\\n\\r\\n\\r\\n\\/\\/ ------------------------------------------------\\r\\n\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434 \\u0438\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u0438 \\u043e \\u0441\\u0442\\u0430\\u0442\\u0443\\u0441\\u0435 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u0430 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u0435\\u0433\\u043e \\u0441\\u043e\\u0432\\u0435\\u0440\\u0448\\u0435\\u043d\\u0438\\u044f \\u0438 \\u043f\\u0435\\u0440\\u0435\\u043d\\u0430\\u043f\\u0440\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u0441 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u043d\\u043e\\u0439 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b\\r\\n\\/\\/ ------------------------------------------------\\r\\nif (isset($_REQUEST[\'payment\'])\\r\\n\\t|| isset($_GET[\'action\']) && ($_GET[\'action\'] == \'PaymentSuccess\' || $_GET[\'action\'] == \'PaymentFail\')\\r\\n\\t|| isset($_REQUEST[\'pg_order_id\'])\\r\\n)\\r\\n{\\r\\n\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c ID \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430\\r\\n\\tif (isset($_REQUEST[\'order_id\']))\\r\\n\\t{\\r\\n\\t\\t$order_id = intval(Core_Array::getRequest(\'order_id\'));\\r\\n\\t}\\r\\n\\t\\/\\/\\u043e\\u0442 \\u042f\\u043d\\u0434\\u0435\\u043a\\u0441\\u0430\\r\\n\\telseif(isset($_GET[\'orderNumber\']))\\r\\n\\t{\\r\\n\\t\\t$order_id = intval(Core_Array::getGet(\'orderNumber\'));\\r\\n\\t}\\r\\n\\t\\/\\/\\u043e\\u0442 PayPal\\r\\n\\telseif(isset($_REQUEST[\'invoice\']))\\r\\n\\t{\\r\\n\\t\\t$oShop_Order = Core_Entity::factory(\'Shop_Order\')->getByGuid(Core_Array::getRequest(\'invoice\'));\\r\\n\\t\\t$order_id = $oShop_Order ? intval($oShop_Order->id) : NULL;\\r\\n\\t}\\r\\n\\t\\/\\/\\u043e\\u0442 IntellectMoney\\r\\n\\telseif(isset($_REQUEST[\'orderId\']))\\r\\n\\t{\\r\\n\\t\\t$order_id = intval(Core_Array::getGet(\'orderId\'));\\r\\n\\t}\\r\\n\\t\\/\\/\\u043e\\u0442 Platron\\r\\n\\telseif(isset($_REQUEST[\'pg_order_id\']))\\r\\n\\t{\\r\\n\\t\\t$order_id = intval(Core_Array::getRequest(\'pg_order_id\'));\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\t$order_id = intval(Core_Array::getRequest(\'InvId\'));\\r\\n\\t}\\r\\n\\r\\n\\t$oShop_Order = Core_Entity::factory(\'Shop_Order\')->find($order_id);\\r\\n\\r\\n\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t{\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\r\\n\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t\\tif ($oSiteuser)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\t$siteuser_id = FALSE;\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ \\u0415\\u0441\\u043b\\u0438 \\u0437\\u0430\\u043a\\u0430\\u0437 \\u043f\\u0440\\u0438\\u043d\\u0430\\u0434\\u043b\\u0435\\u0436\\u0438\\u0442 \\u0442\\u0435\\u043a\\u0443\\u0449\\u0435\\u043c\\u0443 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u043d\\u043e\\u043c\\u0443 \\u043f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044e\\r\\n\\tif ($oShop_Order->siteuser_id == $siteuser_id)\\r\\n\\t{\\r\\n\\t\\tif (Core_Array::getRequest(\'payment\') == \'success\' || Core_Array::getRequest(\'action\') == \'PaymentSuccess\' || Core_Array::getRequest(\'pg_order_id\') > 0)\\r\\n\\t\\t{\\r\\n\\t\\t\\t?><h1>\\u041f\\u043e\\u0434\\u0442\\u0432\\u0435\\u0440\\u0436\\u0434\\u0435\\u043d\\u0438\\u0435 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u0430<\\/h1>\\r\\n\\t\\t\\t<p>\\u0421\\u043f\\u0430\\u0441\\u0438\\u0431\\u043e, \\u0438\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431 \\u043e\\u043f\\u043b\\u0430\\u0442\\u0435 \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430 <strong>\\u2116 <?php echo $oShop_Order->invoice?><\\/strong>\\r\\n\\u043f\\u043e\\u043b\\u0443\\u0447\\u0435\\u043d\\u0430.<\\/p>\\r\\n\\t\\t\\t<?php\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t?><h1>\\u041f\\u043b\\u0430\\u0442\\u0435\\u0436 \\u043d\\u0435 \\u043f\\u043e\\u043b\\u0443\\u0447\\u0435\\u043d<\\/h1>\\r\\n\\t\\t\\t<p>\\u041a \\u0441\\u043e\\u0436\\u0430\\u043b\\u0435\\u043d\\u0438\\u044e \\u043f\\u0440\\u0438 \\u043e\\u043f\\u043b\\u0430\\u0442\\u0435 \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430 <strong>\\u2116 <?php echo $oShop_Order->invoice?><\\/strong> \\u043f\\u0440\\u043e\\u0438\\u0437\\u043e\\u0448\\u043b\\u0430 \\u043e\\u0448\\u0438\\u0431\\u043a\\u0430.<\\/p>\\r\\n\\t\\t\\t<?php\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u043b\\u0443\\u0447\\u0430\\u0435\\u0432, \\u043a\\u043e\\u0433\\u0434\\u0430 \\u043e\\u0442\\u043a\\u043b\\u044e\\u0447\\u0435\\u043d \\u043c\\u043e\\u0434\\u0443\\u043b\\u044c \\\"\\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u0438 \\u0441\\u0430\\u0439\\u0442\\u0430\\\"\\r\\n\\telseif ($siteuser_id === FALSE)\\r\\n\\t{\\r\\n\\t\\t?><h1>\\u041f\\u043e\\u0434\\u0442\\u0432\\u0435\\u0440\\u0436\\u0434\\u0435\\u043d\\u0438\\u0435 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u0430<\\/h1>\\r\\n\\t\\t<p>\\u0411\\u043b\\u0430\\u0433\\u043e\\u0434\\u0430\\u0440\\u0438\\u043c \\u0437\\u0430 \\u043f\\u043e\\u0441\\u0435\\u0449\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0430\\u0448\\u0435\\u0433\\u043e \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430!<\\/p>\\r\\n\\t\\t<?php\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\t?><h1>\\u041e\\u0448\\u0438\\u0431\\u043a\\u0430<\\/h1>\\r\\n\\t\\t<p>\\u041d\\u0435\\u0432\\u0435\\u0440\\u043d\\u044b\\u0439 \\u043d\\u043e\\u043c\\u0435\\u0440 \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430!<\\/p>\\r\\n\\t\\t<?php\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ \\u041f\\u0440\\u0435\\u0440\\u044b\\u0432\\u0430\\u0435\\u043c \\u0432\\u044b\\u043f\\u043e\\u043b\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u0438\\u043f\\u043e\\u0432\\u043e\\u0439 \\u0434\\u0438\\u043d\\u0430\\u043c\\u0438\\u0447\\u0435\\u0441\\u043a\\u043e\\u0439 \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u044b\\r\\n\\treturn TRUE;\\r\\n}\\r\\n\\r\\nCore_Session::start();\\r\\n\\r\\nif (Core_Array::getPost(\'oneStepCheckout\'))\\r\\n{\\r\\n\\t\\/\\/ \\u0421\\u0431\\u0440\\u0430\\u0441\\u044b\\u0432\\u0430\\u0435\\u043c \\u0438\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044e \\u043e \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u043c \\u0437\\u0430\\u043a\\u0430\\u0437\\u0435\\r\\n\\t$_SESSION[\'last_order_id\'] = 0;\\r\\n\\r\\n\\t\\/\\/ \\u041e\\u0444\\u043e\\u0440\\u043c\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0432 \\u043e\\u0434\\u0438\\u043d \\u0448\\u0430\\u0433\\r\\n\\t$Shop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\t$aShop_Cart = $Shop_Cart_Controller->getAll($oShop);\\r\\n\\tforeach ($aShop_Cart as $oShop_Cart)\\r\\n\\t{\\r\\n\\t\\t$Shop_Cart_Controller\\r\\n\\t\\t\\t->shop_item_id($oShop_Cart->shop_item_id)\\r\\n\\t\\t\\t->delete();\\r\\n\\t}\\r\\n\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'shop_item_id\'));\\r\\n\\r\\n\\tif ($shop_item_id)\\r\\n\\t{\\r\\n\\t\\tShop_Cart_Controller::instance()\\r\\n\\t\\t\\t->shop_item_id($shop_item_id)\\r\\n\\t\\t\\t->quantity(Core_Array::getRequest(\'count\', 1))\\r\\n\\t\\t\\t->add();\\r\\n\\t}\\r\\n\\r\\n\\t$_SESSION[\'hostcmsOrder\'] = array();\\r\\n\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_id\'] = intval(Core_Array::getPost(\'shop_country_id\', 0));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_id\'] = intval(Core_Array::getPost(\'shop_country_location_id\', 0));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_city_id\'] = intval(Core_Array::getPost(\'shop_country_location_city_id\', 0));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_city_area_id\'] = intval(Core_Array::getPost(\'shop_country_location_city_area_id\', 0));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'postcode\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'postcode\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'address\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'full_address\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'surname\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'surname\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'name\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'site_users_surname\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'patronymic\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'patronymic\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'phone\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'phone\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'email\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'description\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'description\')));\\r\\n\\r\\n\\t\\/\\/ Additional order properties\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'properties\'] = array();\\r\\n\\r\\n\\t$oShop_Order_Property_List = Core_Entity::factory(\'Shop_Order_Property_List\', $oShop->id);\\r\\n\\r\\n\\t$aProperties = $oShop_Order_Property_List->Properties->findAll();\\r\\n\\tforeach ($aProperties as $oProperty)\\r\\n\\t{\\r\\n\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t$aPropertiesValue = Core_Array::getPost(\'property_\' . $oProperty->id);\\r\\n\\r\\n\\t\\tif (!is_null($aPropertiesValue))\\r\\n\\t\\t{\\r\\n\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\tforeach ($aPropertiesValue as $sPropertyValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'properties\'][] = array($oProperty->id, $sPropertyValue);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\t$shop_delivery_condition_id = strval(Core_Array::getPost(\'shop_delivery_condition_id\', 0));\\r\\n\\r\\n\\tif (is_numeric($shop_delivery_condition_id))\\r\\n\\t{\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\'] = intval($shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t$oShop_Delivery_Condition = Core_Entity::factory(\'Shop_Delivery_Condition\', $_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\']);\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_id\'] = $oShop_Delivery_Condition->shop_delivery_id;\\r\\n\\t}\\r\\n\\r\\n\\t$_POST[\'step\'] = 4;\\r\\n}\\r\\n$o_Siteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\nif(!is_null(strval(Core_Array::getPost(\'email\'))) && strval(Core_Array::getPost(\'email\')) != \'\' && !isset($o_Siteuser)){\\r\\n$error_login = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n$onewSiteuser = Core_Entity::factory(\'Siteuser\');\\r\\n$oTmpSiteuser = $onewSiteuser->Site->Siteusers->getByLogin($error_login);\\r\\n\\r\\n\\r\\nif (!is_null($oTmpSiteuser)){\\r\\n                \\r\\n $_SESSION[\'double_login\'] = 1;                 \\r\\n $_POST[\'step\'] = 1; \\r\\n\\t $_POST[\'email\'] = \'\'; \\r\\necho \'<div class=\\\"error-box\\\">\\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0441 \\u0442\\u0430\\u043a\\u0438\\u043c email \\u0443\\u0436\\u0435 \\u0437\\u0430\\u0440\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d,<br \\/> <a href=\\\"\\/users\\/\\\">\\u0432\\u043e\\u0439\\u0434\\u0438\\u0442\\u0435 \\u0432 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u0443<\\/a> \\u0438\\u043b\\u0438 <a href=\\\"\\/users\\/restore_password\\/\\\">\\u0432\\u043e\\u0441\\u0441\\u0442\\u0430\\u043d\\u043e\\u0432\\u0438\\u0442\\u0435 \\u043f\\u0430\\u0440\\u043e\\u043b\\u044c<\\/a><\\/div>\';                \\r\\n            }\\r\\n} \\r\\n\\r\\nswitch (Core_Array::getPost(\'recount\') ? 0 : Core_Array::getPost(\'step\'))\\r\\n{  \\r\\n\\t\\r\\n\\t\\/\\/ \\u0410\\u0434\\u0440\\u0435\\u0441 \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438\\r\\n\\tcase 1:\\r\\n\\t\\t\\techo\'<form method=\\\"POST\\\" class=\\\"form-adress\\\">\';\\r\\n\\t\\t\\/\\/ \\u0421\\u0431\\u0440\\u0430\\u0441\\u044b\\u0432\\u0430\\u0435\\u043c \\u0438\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044e \\u043e \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u043c \\u0437\\u0430\\u043a\\u0430\\u0437\\u0435\\r\\n\\t\\t$_SESSION[\'last_order_id\'] = 0;\\r\\n\\r\\n\\t\\t\\r\\n\\t\\t$Shop_Delivery_Controller_Show = new Shop_Delivery_Controller_Show($oShop);\\r\\n\\r\\n\\t\\t$Shop_Delivery_Controller_Show\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t->setUp()\\r\\n\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'deliveryXsl\')\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->show();\\r\\n\\t\\t\\r\\n\\t\\t$Shop_Payment_System_Controller_Show = new Shop_Payment_System_Controller_Show($oShop);\\r\\n\\r\\n\\t\\t$shop_delivery_condition_id = strval(Core_Array::getPost(\'shop_delivery_condition_id\', 0));\\r\\n\\r\\n\\t\\tif (is_numeric($shop_delivery_condition_id))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\'] = intval($shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t\\t$oShop_Delivery_Condition = Core_Entity::factory(\'Shop_Delivery_Condition\', $_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\']);\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_id\'] = $oShop_Delivery_Condition->shop_delivery_id;\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\'] = 0;\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u0432 shop_delivery_condition_id \\u0442\\u043e\\u0433\\u0434\\u0430 \\\"10-123#\\\", ID \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u0430 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\u0430 \\u0432 \\u0441\\u0435\\u0441\\u0441\\u0438\\u0438, \\u0432 \\u043a\\u043e\\u0442\\u043e\\u0440\\u043e\\u043c\\r\\n\\t\\t\\t\\/\\/ \\u0445\\u0440\\u0430\\u043d\\u0438\\u0442\\u0441\\u044f \\u0441\\u0442\\u043e\\u0438\\u043c\\u043e\\u0441\\u0442\\u044c \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438, \\u043d\\u0430\\u043b\\u043e\\u0433, \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0441\\u043f\\u0435\\u0446\\u0438\\u0444\\u0438\\u0447\\u043d\\u043e\\u0433\\u043e \\u0443\\u0441\\u043b\\u043e\\u0432\\u0438\\u044f \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438\\r\\n\\t\\t\\tlist($shopDeliveryInSession) = explode(\'#\', $shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t\\tlist($shop_delivery_id, $position) = explode(\'-\', $shopDeliveryInSession);\\r\\n\\r\\n\\t\\t\\t$oShop_Delivery = $oShop->Shop_Deliveries->getById($shop_delivery_id);\\r\\n\\r\\n\\t\\t\\tif (!is_null($oShop_Delivery))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oShop_Delivery_Handler = Shop_Delivery_Handler::factory($oShop_Delivery);\\r\\n\\t\\t\\t\\t$oShop_Delivery_Handler->process($position);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$Shop_Payment_System_Controller_Show\\r\\n\\t\\t\\t->shop_delivery_id(Core_Array::get($_SESSION[\'hostcmsOrder\'], \'shop_delivery_id\'))\\r\\n\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'paymentSystemXsl\')\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->show();\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t$Shop_Address_Controller_Show = new Shop_Address_Controller_Show($oShop);\\r\\n\\t\\tif(isset($_SESSION[\'double_login\']) && $_SESSION[\'double_login\'] == 1){\\r\\n \\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_surname\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'surname\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_name\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'name\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_patronymic\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'patronymic\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_phone\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'phone\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_email\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'email\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_full_address\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'full_address\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_postcode\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'postcode\'))))\\r\\n                        );\\r\\n\\t\\t\\t$Shop_Address_Controller_Show->addEntity(\\r\\n                            Core::factory(\'Core_Xml_Entity\')\\r\\n                                ->name(\'mem_description\')->value(Core_Str::stripTags(strval(Core_Array::getPost(\'description\'))))\\r\\n                        );\\r\\n\\t\\t}\\r\\n\\t\\t$Shop_Address_Controller_Show->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'deliveryAddressXsl\')\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->show();\\r\\n\\t\\techo\'<\\/form>\';\\r\\n\\tbreak;\\r\\n\\t\\/\\/ \\u0421\\u043f\\u043e\\u0441\\u043e\\u0431 \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438\\r\\n\\tcase 2:\\r\\n\\t\\r\\n\\tbreak;\\r\\n\\t\\/\\/ \\u0424\\u043e\\u0440\\u043c\\u0430 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b\\r\\n\\tcase 3:\\r\\n\\t\\t\\r\\n\\tbreak;\\r\\n\\t\\/\\/ \\u041e\\u043a\\u043e\\u043d\\u0447\\u0430\\u043d\\u0438\\u0435 \\u043e\\u0444\\u043e\\u0440\\u043c\\u043b\\u0435\\u043d\\u0438\\u044f \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430\\r\\n\\tcase 4:\\r\\nif (Core_Str::stripTags(strval(Core_Array::getPost(\'fast_order_phone\'))) == \'OK\') {\\t\\t\\r\\n\\t$_SESSION[\'last_order_id\'] = 0;\\r\\n}\\r\\n\\t\\t\\r\\n$regSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\t\\t\\r\\n\\t\\tif (!isset($regSiteuser) && Core_Str::stripTags(strval(Core_Array::getPost(\'fast_order_phone\'))) != \'OK\'){\\r\\n\\t\\t\\t$newSiteuser_password = md5(uniqid(rand(),true));\\r\\n\\t\\t\\t$newSiteuser_phone = Core_Str::stripTags(strval(Core_Array::getPost(\'phone\')));\\r\\n\\t\\t$newSiteuser = Core_Entity::factory(\'Siteuser\');\\r\\n\\t\\t$newSiteuser->login = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n\\t\\tstrlen($newSiteuser_password) > 0 && $newSiteuser->password = Core_Hash::instance()->hash($newSiteuser_password);\\r\\n\\t\\t$newSiteuser->email = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n\\t\\t$newSiteuser->name = Core_Str::stripTags(strval(Core_Array::getPost(\'name\')));\\r\\n\\t $newSiteuser->surname = Core_Str::stripTags(strval(Core_Array::getPost(\'surname\')));\\r\\n\\t $newSiteuser->patronymic = Core_Str::stripTags(strval(Core_Array::getPost(\'patronymic\')));\\r\\n\\t\\t\\t$newSiteuser->phone = Core_Str::stripTags(strval(Core_Array::getPost(\'phone\')));\\r\\n\\t\\t\\t$newSiteuser->address = Core_Str::stripTags(strval(Core_Array::getPost(\'full_address\')));\\r\\n\\t\\t\\t$newSiteuser->postcode = Core_Str::stripTags(strval(Core_Array::getPost(\'postcode\')));\\r\\n\\t\\t$newSiteuser->save();\\r\\n\\t\\t\\t$newSiteuser->activate();\\r\\n\\t\\t$oSiteuser_Group = $newSiteuser->Site->Siteuser_Groups->getDefault();\\r\\n\\t\\t\\t$oSiteuser_Group->add($newSiteuser);\\r\\n\\t\\t\\t$newSiteuser->setCurrent();\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t$mail_to_user = \'\\u0417\\u0434\\u0440\\u0430\\u0432\\u0441\\u0442\\u0432\\u0443\\u0439\\u0442\\u0435, \\u0432\\u044b \\u0443\\u0441\\u043f\\u0435\\u0448\\u043d\\u043e \\u0437\\u0430\\u0440\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0438\\u0440\\u043e\\u0432\\u0430\\u043b\\u0438\\u0441\\u044c \\u043d\\u0430 \\u0441\\u0430\\u0439\\u0442\\u0435 nails.ua <br \\/>\\u0412\\u0430\\u0448\\u0438 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0435 \\u0434\\u043b\\u044f \\u0432\\u0445\\u043e\\u0434\\u0430 \\u0432 \\u043b\\u0438\\u0447\\u043d\\u044b\\u0439 \\u043a\\u0430\\u0431\\u0438\\u043d\\u0435\\u0442:<br \\/> \\u041b\\u043e\\u0433\\u0438\\u043d: \' . $newSiteuser->login . \'<br \\/>\\u041f\\u0430\\u0440\\u043e\\u043b\\u044c: \' . $newSiteuser_password ;\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t$oCore_Mail_Driver = Core_Mail::instance()\\r\\n         ->to($newSiteuser->email)  \\r\\n         ->from(\'shop@nails.ua\')\\r\\n         ->subject(\'\\u0412\\u044b \\u0443\\u0441\\u043f\\u0435\\u0448\\u043d\\u043e \\u0437\\u0430\\u0440\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u044b \\u043d\\u0430 \\u0441\\u0430\\u0439\\u0442\\u0435 nails.ua\')\\r\\n         ->message($mail_to_user)\\r\\n                        ->senderName(\'nails.ua\')\\r\\n         ->contentType(\'text\\/html\')\\r\\n         ->send(); \\t\\t\\r\\n\\t\\t\\t\\t$_SESSION[\'double_login\'] = 0;\\r\\n\\t\\t\\theader(\'Content-type: text\\/html; charset=utf-8\');   \\r\\n  \\r\\ntry {  \\r\\n\\r\\n    \\/\\/ \\u041f\\u043e\\u0434\\u043a\\u043b\\u044e\\u0447\\u0430\\u0435\\u043c\\u0441\\u044f \\u043a \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440\\u0443   \\r\\n    $client = new SoapClient(\'http:\\/\\/turbosms.in.ua\\/api\\/wsdl.html\');   \\r\\n\\r\\n    \\/\\/ \\u041c\\u043e\\u0436\\u043d\\u043e \\u043f\\u0440\\u043e\\u0441\\u043c\\u043e\\u0442\\u0440\\u0435\\u0442\\u044c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0445 \\u043c\\u0435\\u0442\\u043e\\u0434\\u043e\\u0432 \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440\\u0430   \\r\\n    \\/\\/print_r($client->__getFunctions());   \\r\\n\\r\\n    \\/\\/ \\u0414\\u0430\\u043d\\u043d\\u044b\\u0435 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438   \\r\\n    $auth = [   \\r\\n        \'login\' => \'nailsua\',   \\r\\n        \'password\' => \'AeFFhdWC4b2XxD\'   \\r\\n    ];   \\r\\n\\r\\n    \\/\\/ \\u0410\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0438\\u0440\\u0443\\u0435\\u043c\\u0441\\u044f \\u043d\\u0430 \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440\\u0435   \\r\\n    $result = $client->Auth($auth);   \\r\\n\\r\\n    \\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438   \\r\\n    \\/\\/echo $result->AuthResult . PHP_EOL;   \\r\\n\\r\\n    \\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0445 \\u043a\\u0440\\u0435\\u0434\\u0438\\u0442\\u043e\\u0432   \\r\\n    $result = $client->GetCreditBalance();   \\r\\n   \\/\\/ echo $result->GetCreditBalanceResult . PHP_EOL;   \\r\\n$text_sms = \'\\u0412\\u044b \\u0437\\u0430\\u0440\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u044b \\u043d\\u0430 \\u0441\\u0430\\u0439\\u0442\\u0435 nails.ua. \\u041b\\u043e\\u0433\\u0438\\u043d: \' . $newSiteuser->login . \' \\u041f\\u0430\\u0440\\u043e\\u043b\\u044c: \' . $newSiteuser_password;\\r\\n    \\/\\/ \\u0422\\u0435\\u043a\\u0441\\u0442 \\u0441\\u043e\\u043e\\u0431\\u0449\\u0435\\u043d\\u0438\\u044f \\u041e\\u0411\\u042f\\u0417\\u0410\\u0422\\u0415\\u041b\\u042c\\u041d\\u041e \\u043e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c \\u0432 \\u043a\\u043e\\u0434\\u0438\\u0440\\u043e\\u0432\\u043a\\u0435 UTF-8   \\r\\n    $text = iconv(\'utf-8\', \'utf-8\', $text_sms);   \\r\\n\\r\\n    \\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0441\\u043e\\u043e\\u0431\\u0449\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0430 \\u043e\\u0434\\u0438\\u043d \\u043d\\u043e\\u043c\\u0435\\u0440.   \\r\\n    \\/\\/ \\u041f\\u043e\\u0434\\u043f\\u0438\\u0441\\u044c \\u043e\\u0442\\u043f\\u0440\\u0430\\u0432\\u0438\\u0442\\u0435\\u043b\\u044f \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0441\\u043e\\u0434\\u0435\\u0440\\u0436\\u0430\\u0442\\u044c \\u0430\\u043d\\u0433\\u043b\\u0438\\u0439\\u0441\\u043a\\u0438\\u0435 \\u0431\\u0443\\u043a\\u0432\\u044b \\u0438 \\u0446\\u0438\\u0444\\u0440\\u044b. \\u041c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0434\\u043b\\u0438\\u043d\\u0430 - 11 \\u0441\\u0438\\u043c\\u0432\\u043e\\u043b\\u043e\\u0432.   \\r\\n    \\/\\/ \\u041d\\u043e\\u043c\\u0435\\u0440 \\u0443\\u043a\\u0430\\u0437\\u044b\\u0432\\u0430\\u0435\\u0442\\u0441\\u044f \\u0432 \\u043f\\u043e\\u043b\\u043d\\u043e\\u043c \\u0444\\u043e\\u0440\\u043c\\u0430\\u0442\\u0435, \\u0432\\u043a\\u043b\\u044e\\u0447\\u0430\\u044f \\u043f\\u043b\\u044e\\u0441 \\u0438 \\u043a\\u043e\\u0434 \\u0441\\u0442\\u0440\\u0430\\u043d\\u044b   \\r\\n    $sms = [   \\r\\n        \'sender\' => \'nails.ua\',   \\r\\n        \'destination\' => $newSiteuser_phone,   \\r\\n        \'text\' => $text   \\r\\n    ];  \\r\\n    $result = $client->SendSMS($sms);  \\r\\n\\r\\n   ob_start();\\r\\nvar_dump($result); \\/\\/\\u0421\\u044e\\u0434\\u0430 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0435 \\u043f\\u0435\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0430\\u044f, \\u043e\\u0431\\u044c\\u0435\\u043a\\u0442\\r\\n$t = ob_get_contents();\\r\\nob_clean();\\r\\n\\r\\n\\/\\/file_put_contents($_SERVER[\'DOCUMENT_ROOT\'] . \'\\/upload\\/.tmp.txt\', $t); \\/\\/\\u0410\\u0434\\u0440\\u0435\\u0441 \\u043a \\u0444\\u0430\\u0439\\u043b\\u0443\\r\\n\\r\\n    \\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0440\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u043e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0438.   \\r\\n    \\/\\/echo $result->SendSMSResult->ResultArray[0] . PHP_EOL;   \\r\\n\\r\\n\\r\\n} catch(Exception $e) {  \\r\\n    \\/\\/echo \'\\u041e\\u0448\\u0438\\u0431\\u043a\\u0430: \' . $e->getMessage() . PHP_EOL;  \\r\\n}  \\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t}\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_id\'] = intval(Core_Array::getPost(\'shop_country_id\', 0));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_id\'] = intval(Core_Array::getPost(\'shop_country_location_id\', 0));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_city_id\'] = intval(Core_Array::getPost(\'shop_country_location_city_id\', 0));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_country_location_city_area_id\'] = intval(Core_Array::getPost(\'shop_country_location_city_area_id\', 0));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'postcode\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'postcode\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'address\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'full_address\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'surname\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'surname\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'name\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'name\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'patronymic\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'patronymic\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'company\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'company\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'phone\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'phone\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'fax\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'fax\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'email\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'description\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'description\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'tin\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'tin\')));\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'kpp\'] = Core_Str::stripTags(strval(Core_Array::getPost(\'kpp\')));\\r\\n\\r\\n\\t\\t\\/\\/ Additional order properties\\r\\n\\t\\t$_SESSION[\'hostcmsOrder\'][\'properties\'] = array();\\r\\n\\r\\n\\t\\t$oShop_Order_Property_List = Core_Entity::factory(\'Shop_Order_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $oShop_Order_Property_List->Properties->findAll();\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getPost(\'property_\' . $oProperty->id);\\r\\n\\r\\n\\t\\t\\tif (!is_null($aPropertiesValue))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\tforeach ($aPropertiesValue as $sPropertyValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'properties\'][] = array($oProperty->id, $sPropertyValue);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n \\r\\n\\t\\t\\/\\/\\u0437\\u0430\\u043f\\u043e\\u043b\\u043d\\u0435\\u043d\\u0438\\u0435 id \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438\\r\\n\\t\\t\\r\\n\\t$shop_delivery_condition_id = strval(Core_Array::getPost(\'shop_delivery_condition_id\', 0));\\r\\n\\r\\n\\t\\tif (is_numeric($shop_delivery_condition_id))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\'] = intval($shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t\\t$oShop_Delivery_Condition = Core_Entity::factory(\'Shop_Delivery_Condition\', $_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\']);\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_id\'] = $oShop_Delivery_Condition->shop_delivery_id;\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'shop_delivery_condition_id\'] = 0;\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u0432 shop_delivery_condition_id \\u0442\\u043e\\u0433\\u0434\\u0430 \\\"10-123#\\\", ID \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u0430 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\u0430 \\u0432 \\u0441\\u0435\\u0441\\u0441\\u0438\\u0438, \\u0432 \\u043a\\u043e\\u0442\\u043e\\u0440\\u043e\\u043c\\r\\n\\t\\t\\t\\/\\/ \\u0445\\u0440\\u0430\\u043d\\u0438\\u0442\\u0441\\u044f \\u0441\\u0442\\u043e\\u0438\\u043c\\u043e\\u0441\\u0442\\u044c \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438, \\u043d\\u0430\\u043b\\u043e\\u0433, \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0441\\u043f\\u0435\\u0446\\u0438\\u0444\\u0438\\u0447\\u043d\\u043e\\u0433\\u043e \\u0443\\u0441\\u043b\\u043e\\u0432\\u0438\\u044f \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043a\\u0438\\r\\n\\t\\t\\tlist($shopDeliveryInSession) = explode(\'#\', $shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t\\tlist($shop_delivery_id, $position) = explode(\'-\', $shopDeliveryInSession);\\r\\n\\r\\n\\t\\t\\t$oShop_Delivery = $oShop->Shop_Deliveries->getById($shop_delivery_id);\\r\\n\\r\\n\\t\\t\\tif (!is_null($oShop_Delivery))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oShop_Delivery_Handler = Shop_Delivery_Handler::factory($oShop_Delivery);\\r\\n\\t\\t\\t\\t$oShop_Delivery_Handler->process($position);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c \\u043d\\u0430\\u043b\\u0438\\u0447\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 \\u0432 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0435\\r\\n\\t\\t$Shop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\t\\t$aShop_Cart = $Shop_Cart_Controller->getAll($oShop);\\r\\n\\r\\n\\t\\t\\/\\/ \\u0410 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0435 \\u0435\\u0441\\u0442\\u044c \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u043b\\u0438 \\u0437\\u0430\\u043f\\u043e\\u043b\\u043d\\u0435\\u043d \\u043d\\u043e\\u043c\\u0435\\u0440 \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u0433\\u043e \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430\\r\\n\\t\\tif (count($aShop_Cart) || Core_Array::get($_SESSION, \'last_order_id\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$shop_payment_system_id\\r\\n\\t\\t\\t\\t= $_SESSION[\'hostcmsOrder\'][\'shop_payment_system_id\']\\r\\n\\t\\t\\t\\t= intval(Core_Array::getPost(\'shop_payment_system_id\', 0));\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u041e\\u043f\\u043b\\u0430\\u0442\\u0430 \\u0431\\u043e\\u043d\\u0443\\u0441\\u0430\\u043c\\u0438 \\u0441 \\u043b\\u0438\\u0446\\u0435\\u0432\\u043e\\u0433\\u043e \\u0441\\u0447\\u0435\\u0442\\u0430\\r\\n\\t\\t\\t$_SESSION[\'hostcmsOrder\'][\'partial_payment_by_personal_account\'] = Core_Array::getPost(\'partial_payment_by_personal_account\', 0);\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u0415\\u0441\\u043b\\u0438 \\u0432\\u044b\\u0431\\u0440\\u0430\\u043d\\u0430 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u043d\\u0430\\u044f \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u0430\\r\\n\\t\\t\\tif ($_SESSION[\'hostcmsOrder\'][\'shop_payment_system_id\'])\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tShop_Payment_System_Handler::factory(\\r\\n\\t\\t\\t\\t\\tCore_Entity::factory(\'Shop_Payment_System\', $shop_payment_system_id)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t->orderParams($_SESSION[\'hostcmsOrder\'])\\r\\n\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t?><h1>\\u041e\\u0448\\u0438\\u0431\\u043a\\u0430! \\u041d\\u0435 \\u0443\\u043a\\u0430\\u0437\\u0430\\u043d\\u0430 \\u043d\\u0438 \\u043e\\u0434\\u043d\\u0430 \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u043d\\u0430\\u044f \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u0430.<\\/h1><?php\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\/\\/ \\u0418\\u043d\\u0430\\u0447\\u0435 \\u043d\\u0435 \\u043f\\u0440\\u0435\\u0440\\u044b\\u0432\\u0430\\u0435\\u043c \\u0438 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0438\\u0439 \\u0448\\u0430\\u0433 - \\u043e\\u0431\\u044b\\u0447\\u043d\\u0430\\u044f \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t}\\r\\n\\tdefault:\\r\\n\\t\\t$xslName = Core_Array::get(Core_Page::instance()->libParams, \'cartXsl\');\\r\\n\\t\\t\\r\\n\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t\\tif (!is_null($oSiteuser)){\\r\\n\\t\\t$bonus_balance = Core_Entity::factory(\'Siteuser\')->getCurrent()->getTransactionsAmount($oShop); \\r\\n\\t\\t}\\r\\n\\t\\t\\r\\nif (!is_null($oSiteuser)){\\r\\n$aSiteuser_Groups = Core_Entity::factory(\'Siteuser\')->getCurrent()->Siteuser_Groups->findAll();\\r\\nforeach ($aSiteuser_Groups as $oSiteuser_Group)\\r\\n{\\r\\n$Shop_Cart_Controller_Show->addEntity(\\r\\n      Core::factory(\'Core_Xml_Entity\')\\r\\n         ->name(\'group_user\')\\r\\n         ->value($oSiteuser_Group->id)\\r\\n         \\r\\n         \\r\\n   );\\r\\n$Shop_Cart_Controller_Show->addEntity(\\r\\n      Core::factory(\'Core_Xml_Entity\')\\r\\n         ->name(\'user_balance\')\\r\\n         ->value($bonus_balance)\\r\\n         \\r\\n         \\r\\n   );\\r\\n\\r\\n}\\r\\n\\t\\t\\t}\\r\\n\\t\\t$Shop_Cart_Controller_Show\\r\\n\\t\\t\\t->couponText(\\r\\n\\t\\t\\t\\tCore_Str::stripTags(Core_Array::get(Core_Array::getSession(\'hostcmsOrder\', array()), \'coupon_text\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t->show();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0411\\u043b\\u043e\\u043a \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438 \\u043f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044f\\r\\n\\/* if (Core::moduleIsActive(\'siteuser\'))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\tif (is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t\\/\\/ \\u0410\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f\\r\\n\\t\\t$Siteuser_Controller_Show = new Siteuser_Controller_Show(\\r\\n\\t\\t\\tCore_Entity::factory(\'Siteuser\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Siteuser_Controller_Show\\r\\n\\t\\t\\t->location(Core::$url[\'path\'])\\r\\n\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'userAuthorizationXsl\')\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->show();\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0430\\u0446\\u0438\\u044f\\r\\n\\t\\t$Siteuser_Controller_Show = new Siteuser_Controller_Show(\\r\\n\\t\\t\\tCore_Entity::factory(\'Siteuser\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Siteuser_Controller_Show->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'userRegistrationXsl\')\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->location(Core::$url[\'path\'])\\r\\n\\t\\t\\t->fastRegistration(TRUE)\\r\\n\\t\\t\\t->properties(TRUE)\\r\\n\\t\\t\\t\\/\\/->showMaillists(TRUE)\\r\\n\\t\\t\\t->show();\\r\\n\\t}\\r\\n} *\\/\",\"lib_config\":\"<?php\\r\\n\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nif ($_SERVER[\'REQUEST_URI\'] == \'\\/checkout\\/\' && $_SERVER[\'REQUEST_METHOD\'] == \'GET\') {\\r\\n\\t$Shop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\t$aShop_Cart = $Shop_Cart_Controller->getAll($oShop);\\r\\n\\tif (count($aShop_Cart) == 0) {\\r\\n\\t\\theader(\'Location: \\/cart\\/\',true, 301);\\r\\n\\t\\texit;\\r\\n\\t}\\r\\n\\tif (isset($_SESSION[\'double_login\']) && $_SESSION[\'double_login\'] == 1 && isset($_SESSION[\'post\'])) {\\r\\n\\t\\t$_POST = $_SESSION[\'post\'];\\r\\n\\t\\tunset($_SESSION[\'post\']);\\r\\n\\t\\tunset($_SESSION[\'double_login\']);\\r\\n\\t\\tunset($_SESSION[\'double_phone\']);\\r\\n\\t} elseif (isset($_SESSION[\'double_phone\']) && $_SESSION[\'double_phone\'] == 1 && isset($_SESSION[\'post\'])) {\\r\\n\\t\\t$_POST = $_SESSION[\'post\'];\\r\\n\\t\\tunset($_SESSION[\'post\']);\\r\\n\\t\\tunset($_SESSION[\'double_login\']);\\r\\n\\t\\tunset($_SESSION[\'double_phone\']);\\r\\n\\t} else {\\r\\n\\t\\t$_POST[\'step\'] = 1;\\r\\n\\t}\\r\\n}\\r\\n\\r\\nif ($_SERVER[\'REQUEST_URI\'] == \'\\/thank-you\\/\' && $_SERVER[\'REQUEST_METHOD\'] == \'GET\') {\\r\\n\\theader(\'Location: \\/cart\\/\',true, 301);\\r\\n\\texit;\\r\\n}\\r\\n\\r\\nif ($_SERVER[\'REQUEST_URI\'] == \'\\/thank-you\\/\' && $_SERVER[\'REQUEST_METHOD\'] == \'POST\' && Core_Str::stripTags(strval(Core_Array::getPost(\'fast_order_phone\'))) != \'OK\') {\\r\\n\\t$cur_user = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\tif(!is_null(strval(Core_Array::getPost(\'email\'))) && !isset($cur_user)){\\r\\n\\t\\t$newSiteuser_login = Core_Str::stripTags(strval(Core_Array::getPost(\'email\')));\\r\\n\\t\\t$onewSiteuser = Core_Entity::factory(\'Siteuser\');\\r\\n\\t\\t$oTmpSiteuser = $onewSiteuser->Site->Siteusers->getByLogin($newSiteuser_login);\\r\\n\\t\\tif (!is_null($oTmpSiteuser)){\\r\\n\\t\\t\\t$_SESSION[\'post\'] = $_POST;\\r\\n\\t\\t\\t$_SESSION[\'double_login\'] = 1;\\r\\n\\t\\t\\theader(\'Location: \\/checkout\\/\',true, 301);\\r\\n\\t\\t\\texit;\\r\\n\\t\\t}\\r\\n\\t\\t\\r\\n\\t\\t$newSiteuser_phone = Core_Str::stripTags(strval(Core_Array::getPost(\'phone\')));\\r\\n\\t\\t$oTmpSiteuser_phone =\\tCore_Entity::factory(\'Directory_Phone\')->getByValue($newSiteuser_phone);\\r\\n\\t\\tif(!is_null($oTmpSiteuser_phone)) {\\r\\n\\t\\t\\t$_SESSION[\'post\'] = $_POST;\\r\\n\\t\\t\\t$_SESSION[\'double_phone\'] = 1;\\r\\n\\t\\t\\theader(\'Location: \\/checkout\\/\',true, 301);\\r\\n\\t\\t\\texit;\\r\\n\\t\\t}\\t\\t\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0442\\u044c \\u043e\\u0441\\u0442\\u0430\\u0442\\u043e\\u043a \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435 \\u043f\\u0440\\u0438 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0438 \\u0432 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0443\\r\\n$bCheckStock = FALSE;\\r\\n\\r\\nShop_Payment_System_Handler::checkBeforeContent($oShop);\\r\\n\\r\\nShop_Delivery_Handler::checkBeforeContent($oShop);\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 \\u0432 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0443\\r\\nif (Core_Array::getRequest(\'add\'))\\r\\n{\\r\\n\\t\\/\\/ \\u0417\\u0430\\u043f\\u0440\\u0435\\u0449\\u0430\\u0435\\u043c \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\\u0430\\u0446\\u0438\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u044b \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u044b\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->header(\'X-Robots-Tag\', \'none\');\\r\\n\\r\\n\\t$add = Core_Array::getRequest(\'add\');\\r\\n\\t!is_array($add) && $add = array($add);\\r\\n\\r\\n\\t$count = Core_Array::getRequest(\'count\', 1);\\r\\n\\t!is_array($count) && $count = array($count);\\r\\n\\r\\n\\t$oShop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\r\\n\\tforeach ($add as $key => $shop_item_id)\\r\\n\\t{\\r\\n\\t\\t$oShop_Cart_Controller\\r\\n\\t\\t\\t->clear()\\r\\n\\t\\t\\t->checkStock($bCheckStock)\\r\\n\\t\\t\\t->shop_item_id(intval($shop_item_id))\\r\\n\\t\\t\\t->quantity(floatval(Core_Array::get($count, $key, 1)))\\r\\n\\t\\t\\t->add();\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ Ajax\\r\\nif (Core_Array::getRequest(\'_\', FALSE)\\r\\n\\t&& (Core_Array::getRequest(\'add\') || Core_Array::getRequest(\'loadCart\')))\\r\\n{\\r\\n\\tob_start();\\r\\n\\r\\n\\t\\/\\/ \\u041a\\u0440\\u0430\\u0442\\u043a\\u0430\\u044f \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u0430\\r\\n\\t$Shop_Cart_Controller_Show = new Shop_Cart_Controller_Show(\\r\\n\\t\\t$oShop\\r\\n\\t);\\r\\n\\t$Shop_Cart_Controller_Show\\r\\n\\t\\t->xsl(\\r\\n\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'littleCartXsl\')\\r\\n\\t\\t\\t)\\r\\n\\t\\t)\\r\\n\\t\\t->couponText(isset($_SESSION) ? Core_Array::get($_SESSION, \'coupon_text\') : NULL)\\r\\n\\t\\t->show();\\r\\n\\r\\n\\techo json_encode(ob_get_clean());\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0411\\u044b\\u0441\\u0442\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043a\\u0430\\u0437 \\u0432 1 \\u043a\\u043b\\u0438\\u043a\\r\\nif (!is_null(Core_Array::getRequest(\'oneStepCheckout\')))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'shop_item_id\'));\\r\\n\\r\\n\\t$Shop_Cart_Controller_Onestep = new Shop_Cart_Controller_Onestep($oShop);\\r\\n\\r\\n\\t\\/\\/ \\u0413\\u0435\\u043d\\u0435\\u0440\\u0430\\u0446\\u0438\\u044f \\u043e\\u043a\\u043d\\u0430 \\u0441 \\u0437\\u0430\\u043a\\u0430\\u0437\\u043e\\u043c \\u0432 1 \\u043a\\u043b\\u0438\\u043a\\r\\n\\tif (!is_null(Core_Array::getRequest(\'showDialog\'))\\r\\n\\t\\t&& Core_Array::getRequest(\'_\', FALSE)\\r\\n\\t\\t&& $shop_item_id\\r\\n\\t)\\r\\n\\t{\\r\\n\\t\\tob_start();\\r\\n\\r\\n\\t\\t$oneStepXslName = Core_Array::get(Core_Page::instance()->libParams, \'oneStepXsl\');\\r\\n\\r\\n\\t\\t$iQuantity = floatval(Core_Array::getRequest(\'count\', 1));\\r\\n\\r\\n\\t\\t$Shop_Cart_Controller_Onestep\\r\\n\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')->getByName($oneStepXslName)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->shop_item_id($shop_item_id)\\r\\n\\t\\t\\t->quantity($iQuantity)\\r\\n\\t\\t\\t->addEntity(\\r\\n\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')->name(\'count\')->value($iQuantity)\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->show();\\r\\n\\r\\n\\t\\tCore::showJson(\\r\\n\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\'html\' => ob_get_clean(),\\r\\n\\t\\t\\t\\t\'id\' => $shop_item_id\\r\\n\\t\\t\\t)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u0434\\u043e\\u0441\\u0442\\u0430\\u0432\\u043e\\u043a\\r\\n\\tif (!is_null(Core_Array::getRequest(\'showDelivery\')))\\r\\n\\t{\\r\\n\\t\\t$shop_country_id = Core_Array::getRequest(\'shop_country_id\', 0);\\r\\n\\t\\t$shop_country_location_id = Core_Array::getRequest(\'shop_country_location_id\', 0);\\r\\n\\t\\t$shop_country_location_city_id = Core_Array::getRequest(\'shop_country_location_city_id\', 0);\\r\\n\\t\\t$shop_country_location_city_area_id = Core_Array::getRequest(\'shop_country_location_city_area_id\', 0);\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\')->find($shop_item_id);\\r\\n\\t\\tif (!is_null($oShop_Item->id))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTotal = $Shop_Cart_Controller_Onestep->quantity(Core_Array::getRequest(\'count\', 1))->calculatePrice($oShop_Item);\\r\\n\\r\\n\\t\\t\\t$aDelivery = $Shop_Cart_Controller_Onestep->showDelivery($shop_country_id, $shop_country_location_id, $shop_country_location_city_id, $shop_country_location_city_area_id, $aTotal[\'weight\'], $aTotal[\'amount\']);\\r\\n\\r\\n\\t\\t\\tCore::showJson(\\r\\n\\t\\t\\t\\tarray(\'delivery\' => $aDelivery)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u043b\\u0430\\u0442\\u0435\\u0436\\u043d\\u044b\\u0445 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\r\\n\\tif (!is_null(Core_Array::getRequest(\'showPaymentSystem\')))\\r\\n\\t{\\r\\n\\t\\t$shop_delivery_condition_id = strval(Core_Array::getGet(\'shop_delivery_condition_id\', 0));\\r\\n\\r\\n\\t\\t$aPaymentSystems = array();\\r\\n\\t\\tif (is_numeric($shop_delivery_condition_id))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Delivery_Condition = Core_Entity::factory(\'Shop_Delivery_Condition\', $shop_delivery_condition_id);\\r\\n\\r\\n\\t\\t\\t$aPaymentSystems = $Shop_Cart_Controller_Onestep->showPaymentSystem($oShop_Delivery_Condition->shop_delivery_id);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tCore::showJson(array(\'payment_systems\' => $aPaymentSystems));\\r\\n\\t}\\r\\n}\\r\\n\\r\\nif (Core_Array::getGet(\'action\') == \'repeat\')\\r\\n{\\r\\n\\t$guid = Core_Array::getGet(\'guid\');\\r\\n\\tif (strlen($guid))\\r\\n\\t{\\r\\n\\t\\t$oShop_Order = $oShop->Shop_Orders->getByGuid($guid);\\r\\n\\r\\n\\t\\tif (!is_null($oShop_Order))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aShop_Order_Items = $oShop_Order->Shop_Order_Items->findAll();\\r\\n\\r\\n\\t\\t\\t$oShop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\r\\n\\t\\t\\tforeach ($aShop_Order_Items as $oShop_Order_Item)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oShop_Order_Item->shop_item_id && $oShop_Cart_Controller\\r\\n\\t\\t\\t\\t\\t->clear()\\r\\n\\t\\t\\t\\t\\t->checkStock($bCheckStock)\\r\\n\\t\\t\\t\\t\\t->shop_item_id($oShop_Order_Item->shop_item_id)\\r\\n\\t\\t\\t\\t\\t->quantity($oShop_Order_Item->quantity)\\r\\n\\t\\t\\t\\t\\t->marking($oShop_Order_Item->marking)\\r\\n\\t\\t\\t\\t\\t->add();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'ajaxLoad\')))\\r\\n{\\r\\n\\t$aObjects = array();\\r\\n\\r\\n\\tif (Core_Array::getGet(\'shop_country_id\'))\\r\\n\\t{\\r\\n\\t\\t$oShop_Country_Location = Core_Entity::factory(\'Shop_Country_Location\');\\r\\n\\t\\t$oShop_Country_Location\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_country_id\', \'=\', intval(Core_Array::getGet(\'shop_country_id\')));\\r\\n\\t\\t$aObjects = $oShop_Country_Location->getAllByActive(1);\\r\\n\\t}\\r\\n\\telseif (Core_Array::getGet(\'shop_country_location_id\'))\\r\\n\\t{\\r\\n\\t\\t$oShop_Country_Location_City = Core_Entity::factory(\'Shop_Country_Location_City\');\\r\\n\\t\\t$oShop_Country_Location_City\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_country_location_id\', \'=\', intval(Core_Array::getGet(\'shop_country_location_id\')));\\r\\n\\t\\t$aObjects = $oShop_Country_Location_City->getAllByActive(1);\\r\\n\\t}\\r\\n\\telseif (Core_Array::getGet(\'shop_country_location_city_id\'))\\r\\n\\t{\\r\\n\\t\\t$oShop_Country_Location_City_Area = Core_Entity::factory(\'Shop_Country_Location_City_Area\');\\r\\n\\t\\t$oShop_Country_Location_City_Area\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_country_location_city_id\', \'=\', intval(Core_Array::getGet(\'shop_country_location_city_id\')));\\r\\n\\t\\t$aObjects = $oShop_Country_Location_City_Area->getAllByActive(1);\\r\\n\\t}\\r\\n\\r\\n\\t$aArray = array(\'\\u2026\');\\r\\n\\tforeach ($aObjects as $Object)\\r\\n\\t{\\r\\n\\t\\t\\/\\/$aArray[\'_\' . $Object->id] = $Object->name;\\r\\n\\t\\t$aArray[\'_\' . $Object->id] = $Object->getName();\\r\\n\\t}\\r\\n\\r\\n\\tCore::showJson($aArray);\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u044f\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 \\u0438\\u0437 \\u043a\\u043e\\u0440\\u0437\\u0438\\u043d\\u044b\\r\\nif (Core_Array::getGet(\'delete\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getGet(\'delete\'));\\r\\n\\r\\n\\tif ($shop_item_id)\\r\\n\\t{\\r\\n\\t\\t$oShop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\t\\t$oShop_Cart_Controller\\r\\n\\t\\t\\t->shop_item_id($shop_item_id)\\r\\n\\t\\t\\t->delete();\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0417\\u0430\\u043f\\u043e\\u043c\\u0438\\u043d\\u0430\\u0435\\u043c \\u043a\\u0443\\u043f\\u043e\\u043d\\r\\n\\tCore_Session::start();\\r\\n$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t\\t\\r\\nif (!is_null($oSiteuser)){\\r\\n$aSiteuser_Groups = Core_Entity::factory(\'Siteuser\')->getCurrent()->Siteuser_Groups->findAll();\\r\\nforeach ($aSiteuser_Groups as $oSiteuser_Group)\\r\\n{\\r\\n$type_user = $oSiteuser_Group->id;\\r\\n         \\r\\n         \\r\\n\\r\\n\\r\\n}\\r\\n\\t\\r\\nif($type_user == 10){\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'coupon_text\'] = \'000-742-858-027\';\\r\\n}else{\\r\\n\\t$_SESSION[\'hostcmsOrder\'][\'coupon_text\'] = \'\';\\r\\n}\\r\\n\\t\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\nif (Core_Array::getPost(\'recount\') || Core_Array::getPost(\'step\') == 1)\\r\\n{\\r\\n\\t$oShop_Cart_Controller = Shop_Cart_Controller::instance();\\r\\n\\t$aCart = $oShop_Cart_Controller->getAll($oShop);\\r\\n\\r\\n\\t\\/\\/ \\u0421\\u043a\\u043b\\u0430\\u0434 \\u043f\\u043e \\u0443\\u043c\\u043e\\u043b\\u0447\\u0430\\u043d\\u0438\\u044e\\r\\n\\t$oShop_Warehouse = $oShop->Shop_Warehouses->getDefault();\\r\\n\\r\\n\\tforeach ($aCart as $oShop_Cart)\\r\\n\\t{\\r\\n\\t\\t$quantity = Core_Array::getPost(\'quantity_\' . $oShop_Cart->shop_item_id);\\r\\n\\r\\n\\t\\t\\/\\/ \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e \\u0431\\u044b\\u043b\\u043e \\u043f\\u0435\\u0440\\u0435\\u0434\\u0430\\u043d\\u043e\\r\\n\\t\\tif (!is_null($quantity))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Cart_Controller\\r\\n\\t\\t\\t\\t->clear()\\r\\n\\t\\t\\t\\t->checkStock($bCheckStock)\\r\\n\\t\\t\\t\\t->shop_item_id($oShop_Cart->shop_item_id)\\r\\n\\t\\t\\t\\t->quantity($quantity)\\r\\n\\t\\t\\t\\t->postpone(is_null(Core_Array::getPost(\'postpone_\' . $oShop_Cart->shop_item_id)) ? 0 : 1)\\r\\n\\t\\t\\t\\t->shop_warehouse_id(\\r\\n\\t\\t\\t\\t\\tCore_Array::getPost(\'warehouse_\' . $oShop_Cart->shop_item_id, !is_null($oShop_Warehouse) ? $oShop_Warehouse->id : 0)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t->update();\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\n\\r\\n$Shop_Cart_Controller_Show = new Shop_Cart_Controller_Show($oShop);\\r\\n\\r\\n\\r\\nif (Core_Array::getPost(\'recount\',\'\') == \'\' && Core_Array::getPost(\'step\') == 1 && $_SERVER[\'REQUEST_URI\'] != \'\\/checkout\\/\') {\\r\\n\\theader(\'Location: \\/checkout\\/\',true, 301);\\r\\n\\texit;\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Cart_Controller_Show;\",\"user_id\":\"19\"}','2021-04-07 17:11:20',20,0),(1754,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\n\\n$Shop_Controller_Show = Core_Page::instance()->object;\\n\\n$xslName = $Shop_Controller_Show->item\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\n\\n$Shop_Controller_Show->addEntity(\\n\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\n)->addEntity(\\n\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\n)->addEntity(\\n\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\n);\\n\\n$Shop_Controller_Show\\n\\t->tags(TRUE)\\n\\t->comments(TRUE)\\n\\t->associatedItems(TRUE)\\n\\t->modifications(TRUE);\\n\\nif ($Shop_Controller_Show->item == 0)\\n{\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\n\\n\\t\\/\\/ Producers\\n\\tif (Core_Array::getGet(\'producer_id\'))\\n\\t{\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\n\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\n\\t\\t);\\n\\n\\t\\t$Shop_Controller_Show->shopItems()\\n\\t\\t\\t->queryBuilder()\\n\\t\\t\\t->select(\'shop_items.*\')\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\n\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\n\\t}\\n\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\n\\t{\\n\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\n\\t\\t);\\n\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\n\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\n\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\n\\t\\t);\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\n\\n\\t\\t\\/\\/ Prices\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\n\\t\\t{\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\n\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\n\\t\\t\\t\\t);\\n\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\n\\t\\t\\t}\\n\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\n\\t\\t\\t\\t->queryBuilder()\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\n\\t\\t\\t\\t))\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\n\\n\\t\\t\\tif ($price_from)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\n\\t\\t\\t\\t);\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\n\\t\\t\\t}\\n\\t\\t\\tif ($price_to)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\n\\t\\t\\t\\t);\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\n\\t\\t\\t}\\n\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t->clearOrderBy()\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\n\\t\\t}\\n\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t->clearOrderBy()\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\n\\n\\t\\t\\/\\/ Additional properties\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\n\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\n\\n\\t\\t$aTmpProperties = array();\\n\\t\\t$havingCount = 0;\\n\\t\\tforeach ($aProperties as $oProperty)\\n\\t\\t{\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\n\\t\\t\\tif ($aPropertiesValue)\\n\\t\\t\\t{\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\n\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\n\\t\\t\\t\\t$havingCount++;\\n\\t\\t\\t}\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\n\\t\\t\\t{\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\n\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\n\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\n\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\n\\t\\t\\t\\t\\t\\t));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t$havingCount++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif (count($aTmpProperties))\\n\\t\\t{\\n\\t\\t\\t$aTableNames = array();\\n\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\n\\t\\t\\t\\t->setAnd()\\n\\t\\t\\t\\t->open();\\n\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\n\\t\\t\\t{\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\n\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\n\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\n\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\n\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\n\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\n\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t\\t->where(\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\n\\t\\t\\t\\t\\t\\t\\t);\\n\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\n\\t\\t\\t\\t\\t\\t\\t->close();\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t->setOr();\\n\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\n\\t\\t\\t\\t\\t\\t);\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t->open()\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\n\\t\\t\\t\\t\\t\\t->setOr()\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\n\\t\\t\\t\\t\\t\\t->close()\\n\\t\\t\\t\\t\\t\\t->setAnd();\\n\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t->open()\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\n\\t\\t\\t\\t\\t\\t->setOr()\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\n\\t\\t\\t\\t\\t\\t->close();\\n\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t->setOr();\\n\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\n\\t\\t\\t\\t\\t)->addEntity(\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\n\\t\\t\\t\\t\\t);\\n\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t->close()\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\n\\n\\t\\t\\t$havingCount > 1\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\n\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\n\\t\\t\\t\\t\\t\\tarray(\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\n\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\nelse\\n{\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\n\\t{\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\n\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\n\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\n\\t\\t);\\n\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t->name(\'document\');\\n\\n\\t\\t$siteuser_id = 0;\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\n\\t\\t{\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\n\\n\\t\\t\\tif ($oSiteuser)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\n\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\n\\t\\t$oComment->active = $oShop->comment_active;\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\n\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\n\\n\\t\\t$oXmlCommentTag\\n\\t\\t\\t->addEntity($oComment)\\n\\t\\t\\t->addEntity($oShop_Item);\\n\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\n\\t\\t{\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/ Antispam\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\n\\t\\t\\t\\t\\t\\t->execute();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$oComment->save();\\n\\n\\t\\t\\t\\t\\t$oComment\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\n\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\n\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\n\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\n\\t\\t\\t\\t\\t\\t->xsl(\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\n\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\t->process();\\n\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\n\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\n\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\n\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\t->send();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\n\\t\\t\\t\\t\\t);\\n\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\n\\t\\t\\t\\t);\\n\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\n\\t\\t\\t);\\n\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\n\\t\\t}\\n\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\n\\t\\t\\t)\\n\\t\\t\\t->process();\\n\\n\\t\\t$Shop_Controller_Show->addEntity(\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\n\\t\\t);\\n\\t}\\n}\\n\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\n\\/* if ($Shop_Controller_Show->group == 0)\\n{\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\n}*\\/\\n\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\n$oShop = $Shop_Controller_Show->getEntity();\\n\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\n\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\n\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\n$oShop_Producers = $oShop->Shop_Producers;\\n$oShop_Producers->queryBuilder()\\n\\t->select(\'shop_producers.*\')\\n\\t->distinct()\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\n\\n$aShop_Producers = $oShop_Producers->findAll();\\nforeach ($aShop_Producers as $oShop_Producer)\\n{\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\n\\t$oProducersXmlEntity->addEntity(\\n\\t\\t$oShop_Producer->clearEntities()\\n\\t);\\n}\\n\\n$Shop_Controller_Show\\n\\t->xsl(\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\n\\t)\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\n\\t->itemsProperties(TRUE)\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\n\\t->specialprices(TRUE)\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\n\\t\\/\\/->modificationsList(TRUE)\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\n\\t\\/\\/->groupsMode(\'none\')\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\n\\t->groupsProperties(TRUE)\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\n\\t\\/\\/->filterShortcuts(TRUE)\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\n\\t->show();\",\"lib_config\":\"<?php\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\n\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\n{\\n   protected function _groupCondition()\\n   {\\n      $oShop = $this->getEntity();\\n   \\n      if ($this->group)\\n      {\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\n         $aSubGroupsID[] = $this->group;\\n\\n         $this->shopItems()\\n            ->queryBuilder()\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\n      }\\n      else\\n      {\\n         $this->shopItems()\\n            ->queryBuilder()\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\n      }\\n\\n      return $this;\\n   }\\n\\n   protected $_aGroupTree = array();\\n\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\n   {\\n      $iShopId = intval($iShopId);\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\n      $iLevel = intval($iLevel);\\n\\n      if ($iLevel == 0)\\n      {\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\n            ->from(\'shop_groups\')\\n            ->where(\'shop_id\', \'=\', $iShopId)\\n            ->where(\'deleted\', \'=\', 0)\\n            ->execute()->asAssoc()->result();\\n\\n         foreach ($aTmp as $aGroup)\\n         {\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\n         }\\n      }\\n\\n      $aReturn = array();\\n\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\n      {\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\n         {\\n            $aReturn[] = $childrenGroup[\'id\'];\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\n         }\\n      }\\n\\n      $iLevel == 0 && $this->_aGroupTree = array();\\n\\n      return $aReturn;\\n   }\\n}\\n\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\n\\n\\n\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\nif ($on_page > 0 && $on_page < 150)\\n{\\n\\t$limit = $on_page;\\n\\n\\t$Shop_Controller_Show->addEntity(\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\n\\t);\\n}\\nelse\\n{\\n\\t$limit = $oShop->items_on_page;\\n}\\n\\n$Shop_Controller_Show\\n\\t->limit($limit)\\n\\t->parseUrl();\\n\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\n$guid = Core_Array::getGet(\'download_file\');\\nif (strlen($guid))\\n{\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\n\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\n\\t{\\n\\t\\t$iDay = 7;\\n\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\n\\t\\t{\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\n\\t\\t\\t{\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\n\\t\\t\\t\\texit();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\n\\texit();\\n}\\n\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\nif (Core_Array::getRequest(\'compare\'))\\n{\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\n\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\n\\t{\\n\\t\\tCore_Session::start();\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\n\\t\\t{\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->status(200)\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->body(json_encode(\'OK\'))\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->sendHeaders()\\n\\t\\t->showBody();\\n\\n\\texit();\\n}\\n\\n\\/\\/ Viewed items\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\n{\\n\\t$Shop_Controller_Show->addIntoViewed();\\n}\\n\\nif (!is_null(Core_Array::getGet(\'vote\')))\\n{\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\n\\n\\tif ($entity_id && !is_null($oSiteuser))\\n\\t{\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\n\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\n\\n\\t\\tif (!is_null($oObject))\\n\\t\\t{\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\n\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\n\\n\\t\\t\\t$deleteVote = 0;\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\n\\t\\t\\tif (is_null($oVote))\\n\\t\\t\\t{\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\n\\n\\t\\t\\t\\t$oObject->add($oVote);\\n\\t\\t\\t}\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\n\\t\\t\\t\\t$oVote->save();\\n\\t\\t\\t}\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\t$deleteVote = 1;\\n\\t\\t\\t\\t$oVote->delete();\\n\\t\\t\\t}\\n\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\n\\n\\t\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->body(\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\n\\t\\t\\t\\t)\\n\\t\\t\\t);\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->status(200)\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\n\\t\\t->header(\'Vary\', \'Accept\')\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\n\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\n\\t{\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\n\\t}\\n\\telse\\n\\t{\\n\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\n\\t}\\n\\n\\tif(Core_Array::getRequest(\'_\'))\\n\\t{\\n\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->sendHeaders()\\n\\t\\t\\t->showBody();\\n\\t\\texit();\\n\\t}\\n}\\n\\nCore_Page::instance()->object = $Shop_Controller_Show;\\n\\n\\n\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\n\\n$collection_flag = 0;\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\n$aPropertyValues = $oStructure->getPropertyValues();\\n foreach($aPropertyValues as $oPropertyValue)\\n {  if($oPropertyValue->Property->id == 61){\\n    $collection_flag = $oPropertyValue->value;\\n }\\n } \\n\\nif($collection_flag == 1){\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\n\\n\\n\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\nif ($on_page > 0 && $on_page < 150)\\n{\\n\\t$limit = $on_page;\\n\\n\\t$Shop_Controller_Show->addEntity(\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\n\\t);\\n}\\nelse\\n{\\n\\t$limit = $oShop->items_on_page;\\n}\\n\\n$Shop_Controller_Show\\n\\t->limit($limit)\\n\\t->parseUrl();\\n\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\n$guid = Core_Array::getGet(\'download_file\');\\nif (strlen($guid))\\n{\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\n\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\n\\t{\\n\\t\\t$iDay = 7;\\n\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\n\\t\\t{\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\n\\t\\t\\t{\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\n\\t\\t\\t\\texit();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\n\\texit();\\n}\\n\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\nif (Core_Array::getRequest(\'compare\'))\\n{\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\n\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\n\\t{\\n\\t\\tCore_Session::start();\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\n\\t\\t{\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->status(200)\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->body(json_encode(\'OK\'))\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->sendHeaders()\\n\\t\\t->showBody();\\n\\n\\texit();\\n}\\n\\n\\/\\/ Viewed items\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\n{\\n\\t$Shop_Controller_Show->addIntoViewed();\\n}\\n\\nif (!is_null(Core_Array::getGet(\'vote\')))\\n{\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\n\\n\\tif ($entity_id && !is_null($oSiteuser))\\n\\t{\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\n\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\n\\n\\t\\tif (!is_null($oObject))\\n\\t\\t{\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\n\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\n\\n\\t\\t\\t$deleteVote = 0;\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\n\\t\\t\\tif (is_null($oVote))\\n\\t\\t\\t{\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\n\\n\\t\\t\\t\\t$oObject->add($oVote);\\n\\t\\t\\t}\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\n\\t\\t\\t\\t$oVote->save();\\n\\t\\t\\t}\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\t$deleteVote = 1;\\n\\t\\t\\t\\t$oVote->delete();\\n\\t\\t\\t}\\n\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\n\\n\\t\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->body(\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\n\\t\\t\\t\\t)\\n\\t\\t\\t);\\n\\t\\t}\\n\\t}\\n\\n\\tCore_Page::instance()->response\\n\\t\\t->status(200)\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\n\\t\\t->header(\'Vary\', \'Accept\')\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\n\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\n\\t{\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\n\\t}\\n\\telse\\n\\t{\\n\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\n\\t}\\n\\n\\tif(Core_Array::getRequest(\'_\'))\\n\\t{\\n\\t\\tCore_Page::instance()->response\\n\\t\\t\\t->sendHeaders()\\n\\t\\t\\t->showBody();\\n\\t\\texit();\\n\\t}\\n}\\n\\nCore_Page::instance()->object = $Shop_Controller_Show;\\n\\n\\n\\t\\n}\",\"user_id\":\"19\"}','2021-04-07 17:45:36',20,0),(1755,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\r\\nclass Shop_Item_Observer\\r\\n{\\r\\n   static public function onBeforeGetXml($object, $args)\\r\\n   {\\r\\n      $aShop_Item_Prices = $object->Shop_Item_Prices->findAll();\\r\\n      $object->addEntities(\\r\\n         $aShop_Item_Prices\\r\\n      );\\r\\n   }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'shop_item.onBeforeGetXml\', array(\'Shop_Item_Observer\', \'onBeforeGetXml\'));\\r\\n$Shop_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$xslName = $Shop_Controller_Show->item\\r\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\r\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\r\\n\\r\\n$Shop_Controller_Show->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\r\\n);\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->tags(TRUE)\\r\\n\\t->comments(TRUE)\\r\\n\\t->associatedItems(TRUE)\\r\\n\\t->modifications(TRUE);\\r\\n\\r\\nif ($Shop_Controller_Show->item == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\r\\n\\r\\n\\t\\/\\/ Producers\\r\\n\\tif (Core_Array::getGet(\'producer_id\'))\\r\\n\\t{\\r\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->select(\'shop_items.*\')\\r\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\r\\n\\t}\\r\\n\\r\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\r\\n\\t{\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\r\\n\\t\\t);\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\r\\n\\r\\n\\t\\t\\/\\/ Prices\\r\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\r\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\r\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\r\\n\\r\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\r\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\r\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\r\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\r\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\r\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\r\\n\\t\\t\\t\\t))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\tif ($price_from)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tif ($price_to)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\r\\n\\r\\n\\t\\t\\/\\/ Additional properties\\r\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\r\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\r\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\r\\n\\r\\n\\t\\t$aTmpProperties = array();\\r\\n\\t\\t$havingCount = 0;\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\r\\n\\t\\t\\tif ($aPropertiesValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\r\\n\\r\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\r\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\r\\n\\r\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\r\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\r\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\r\\n\\r\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\r\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\r\\n\\t\\t\\t\\t\\t\\t));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tif (count($aTmpProperties))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTableNames = array();\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\r\\n\\t\\t\\t\\t->setAnd()\\r\\n\\t\\t\\t\\t->open();\\r\\n\\r\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\r\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\r\\n\\r\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\r\\n\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\r\\n\\r\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\r\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\r\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\r\\n\\t\\t\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t\\t->close();\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\r\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t\\t\\t->setAnd();\\r\\n\\r\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\r\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\r\\n\\t\\t\\t\\t\\t)->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\t$havingCount > 1\\r\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\r\\n\\r\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\r\\n\\t\\t\\t\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n\\t{\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\r\\n\\r\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\r\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'document\');\\r\\n\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\tif ($oSiteuser)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\r\\n\\r\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\r\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\r\\n\\t\\t$oComment->active = $oShop->comment_active;\\r\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\r\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\r\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\r\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\r\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\r\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\r\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\r\\n\\r\\n\\t\\t$oXmlCommentTag\\r\\n\\t\\t\\t->addEntity($oComment)\\r\\n\\t\\t\\t->addEntity($oShop_Item);\\r\\n\\r\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ Antispam\\r\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\r\\n\\t\\t\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oComment->save();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment\\r\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\r\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\r\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\r\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\r\\n\\r\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\r\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\r\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\r\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\r\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\r\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\r\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\r\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\r\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->send();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\r\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\r\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\/* if ($Shop_Controller_Show->group == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\r\\n}*\\/\\r\\n\\r\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\r\\n$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\r\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\r\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\r\\n\\r\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\r\\n$oShop_Producers = $oShop->Shop_Producers;\\r\\n$oShop_Producers->queryBuilder()\\r\\n\\t->select(\'shop_producers.*\')\\r\\n\\t->distinct()\\r\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\r\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\r\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\r\\n\\r\\n$aShop_Producers = $oShop_Producers->findAll();\\r\\nforeach ($aShop_Producers as $oShop_Producer)\\r\\n{\\r\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\r\\n\\t$oProducersXmlEntity->addEntity(\\r\\n\\t\\t$oShop_Producer->clearEntities()\\r\\n\\t);\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->xsl(\\r\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\n\\t->itemsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\r\\n\\t->specialprices(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\r\\n\\t\\/\\/->modificationsList(TRUE)\\r\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t\\/\\/->groupsMode(\'none\')\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t->groupsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\r\\n\\t\\/\\/->filterShortcuts(TRUE)\\r\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\r\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\r\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\r\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\r\\n\\t->show();\",\"lib_config\":\"<?php\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\r\\n{\\r\\n   protected function _groupCondition()\\r\\n   {\\r\\n      $oShop = $this->getEntity();\\r\\n   \\r\\n      if ($this->group)\\r\\n      {\\r\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\r\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\r\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\r\\n         $aSubGroupsID[] = $this->group;\\r\\n\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n      }\\r\\n      else\\r\\n      {\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\r\\n      }\\r\\n\\r\\n      return $this;\\r\\n   }\\r\\n\\r\\n   protected $_aGroupTree = array();\\r\\n\\r\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\r\\n   {\\r\\n      $iShopId = intval($iShopId);\\r\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\r\\n      $iLevel = intval($iLevel);\\r\\n\\r\\n      if ($iLevel == 0)\\r\\n      {\\r\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\r\\n            ->from(\'shop_groups\')\\r\\n            ->where(\'shop_id\', \'=\', $iShopId)\\r\\n            ->where(\'deleted\', \'=\', 0)\\r\\n            ->execute()->asAssoc()->result();\\r\\n\\r\\n         foreach ($aTmp as $aGroup)\\r\\n         {\\r\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $aReturn = array();\\r\\n\\r\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\r\\n      {\\r\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\r\\n         {\\r\\n            $aReturn[] = $childrenGroup[\'id\'];\\r\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $iLevel == 0 && $this->_aGroupTree = array();\\r\\n\\r\\n      return $aReturn;\\r\\n   }\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\r\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n$collection_flag = 0;\\r\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\r\\n$aPropertyValues = $oStructure->getPropertyValues();\\r\\n foreach($aPropertyValues as $oPropertyValue)\\r\\n {  if($oPropertyValue->Property->id == 61){\\r\\n    $collection_flag = $oPropertyValue->value;\\r\\n }\\r\\n } \\r\\n\\r\\nif($collection_flag == 1){\\r\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\t\\r\\n}\",\"user_id\":\"19\"}','2021-04-07 17:47:01',20,0),(1756,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\r\\nclass Shop_Item_Observer\\r\\n{\\r\\n   static public function onBeforeGetXml($object, $args)\\r\\n   {\\r\\n      $aShop_Item_Price = $object->price;\\r\\n      $object->addEntities(\\r\\n         $aShop_Item_Price\\r\\n      );\\r\\n   }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'shop_item.onBeforeGetXml\', array(\'Shop_Item_Observer\', \'onBeforeGetXml\'));\\r\\n$Shop_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$xslName = $Shop_Controller_Show->item\\r\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\r\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\r\\n\\r\\n$Shop_Controller_Show->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\r\\n);\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->tags(TRUE)\\r\\n\\t->comments(TRUE)\\r\\n\\t->associatedItems(TRUE)\\r\\n\\t->modifications(TRUE);\\r\\n\\r\\nif ($Shop_Controller_Show->item == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\r\\n\\r\\n\\t\\/\\/ Producers\\r\\n\\tif (Core_Array::getGet(\'producer_id\'))\\r\\n\\t{\\r\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->select(\'shop_items.*\')\\r\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\r\\n\\t}\\r\\n\\r\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\r\\n\\t{\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\r\\n\\t\\t);\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\r\\n\\r\\n\\t\\t\\/\\/ Prices\\r\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\r\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\r\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\r\\n\\r\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\r\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\r\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\r\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\r\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\r\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\r\\n\\t\\t\\t\\t))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\tif ($price_from)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tif ($price_to)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\r\\n\\r\\n\\t\\t\\/\\/ Additional properties\\r\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\r\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\r\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\r\\n\\r\\n\\t\\t$aTmpProperties = array();\\r\\n\\t\\t$havingCount = 0;\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\r\\n\\t\\t\\tif ($aPropertiesValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\r\\n\\r\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\r\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\r\\n\\r\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\r\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\r\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\r\\n\\r\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\r\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\r\\n\\t\\t\\t\\t\\t\\t));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tif (count($aTmpProperties))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTableNames = array();\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\r\\n\\t\\t\\t\\t->setAnd()\\r\\n\\t\\t\\t\\t->open();\\r\\n\\r\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\r\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\r\\n\\r\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\r\\n\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\r\\n\\r\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\r\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\r\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\r\\n\\t\\t\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t\\t->close();\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\r\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t\\t\\t->setAnd();\\r\\n\\r\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\r\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\r\\n\\t\\t\\t\\t\\t)->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\t$havingCount > 1\\r\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\r\\n\\r\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\r\\n\\t\\t\\t\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n\\t{\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\r\\n\\r\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\r\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'document\');\\r\\n\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\tif ($oSiteuser)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\r\\n\\r\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\r\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\r\\n\\t\\t$oComment->active = $oShop->comment_active;\\r\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\r\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\r\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\r\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\r\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\r\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\r\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\r\\n\\r\\n\\t\\t$oXmlCommentTag\\r\\n\\t\\t\\t->addEntity($oComment)\\r\\n\\t\\t\\t->addEntity($oShop_Item);\\r\\n\\r\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ Antispam\\r\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\r\\n\\t\\t\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oComment->save();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment\\r\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\r\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\r\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\r\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\r\\n\\r\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\r\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\r\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\r\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\r\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\r\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\r\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\r\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\r\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->send();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\r\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\r\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\/* if ($Shop_Controller_Show->group == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\r\\n}*\\/\\r\\n\\r\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\r\\n$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\r\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\r\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\r\\n\\r\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\r\\n$oShop_Producers = $oShop->Shop_Producers;\\r\\n$oShop_Producers->queryBuilder()\\r\\n\\t->select(\'shop_producers.*\')\\r\\n\\t->distinct()\\r\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\r\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\r\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\r\\n\\r\\n$aShop_Producers = $oShop_Producers->findAll();\\r\\nforeach ($aShop_Producers as $oShop_Producer)\\r\\n{\\r\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\r\\n\\t$oProducersXmlEntity->addEntity(\\r\\n\\t\\t$oShop_Producer->clearEntities()\\r\\n\\t);\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->xsl(\\r\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\n\\t->itemsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\r\\n\\t->specialprices(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\r\\n\\t\\/\\/->modificationsList(TRUE)\\r\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t\\/\\/->groupsMode(\'none\')\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t->groupsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\r\\n\\t\\/\\/->filterShortcuts(TRUE)\\r\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\r\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\r\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\r\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\r\\n\\t->show();\",\"lib_config\":\"<?php\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\r\\n{\\r\\n   protected function _groupCondition()\\r\\n   {\\r\\n      $oShop = $this->getEntity();\\r\\n   \\r\\n      if ($this->group)\\r\\n      {\\r\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\r\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\r\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\r\\n         $aSubGroupsID[] = $this->group;\\r\\n\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n      }\\r\\n      else\\r\\n      {\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\r\\n      }\\r\\n\\r\\n      return $this;\\r\\n   }\\r\\n\\r\\n   protected $_aGroupTree = array();\\r\\n\\r\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\r\\n   {\\r\\n      $iShopId = intval($iShopId);\\r\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\r\\n      $iLevel = intval($iLevel);\\r\\n\\r\\n      if ($iLevel == 0)\\r\\n      {\\r\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\r\\n            ->from(\'shop_groups\')\\r\\n            ->where(\'shop_id\', \'=\', $iShopId)\\r\\n            ->where(\'deleted\', \'=\', 0)\\r\\n            ->execute()->asAssoc()->result();\\r\\n\\r\\n         foreach ($aTmp as $aGroup)\\r\\n         {\\r\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $aReturn = array();\\r\\n\\r\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\r\\n      {\\r\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\r\\n         {\\r\\n            $aReturn[] = $childrenGroup[\'id\'];\\r\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $iLevel == 0 && $this->_aGroupTree = array();\\r\\n\\r\\n      return $aReturn;\\r\\n   }\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\r\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n$collection_flag = 0;\\r\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\r\\n$aPropertyValues = $oStructure->getPropertyValues();\\r\\n foreach($aPropertyValues as $oPropertyValue)\\r\\n {  if($oPropertyValue->Property->id == 61){\\r\\n    $collection_flag = $oPropertyValue->value;\\r\\n }\\r\\n } \\r\\n\\r\\nif($collection_flag == 1){\\r\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\t\\r\\n}\",\"user_id\":\"19\"}','2021-04-07 17:49:30',20,0),(1757,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\r\\nclass Shop_Item_Observer\\r\\n{\\r\\n   static public function onBeforeGetXml($object, $args)\\r\\n   {\\r\\n      $aShop_Item_Price = $object->price;\\r\\n      $object->addEntity(\\r\\n    Core::factory(\'Core_Xml_Entity\')\\r\\n        ->name(\'izn_price\')\\r\\n        ->value($aShop_Item_Price)\\r\\n)\\r\\n->addCacheSignature(\'izn_price=\' . $aShop_Item_Price);\\r\\n   }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'shop_item.onBeforeGetXml\', array(\'Shop_Item_Observer\', \'onBeforeGetXml\'));\\r\\n$Shop_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$xslName = $Shop_Controller_Show->item\\r\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\r\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\r\\n\\r\\n$Shop_Controller_Show->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\r\\n);\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->tags(TRUE)\\r\\n\\t->comments(TRUE)\\r\\n\\t->associatedItems(TRUE)\\r\\n\\t->modifications(TRUE);\\r\\n\\r\\nif ($Shop_Controller_Show->item == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\r\\n\\r\\n\\t\\/\\/ Producers\\r\\n\\tif (Core_Array::getGet(\'producer_id\'))\\r\\n\\t{\\r\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->select(\'shop_items.*\')\\r\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\r\\n\\t}\\r\\n\\r\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\r\\n\\t{\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\r\\n\\t\\t);\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\r\\n\\r\\n\\t\\t\\/\\/ Prices\\r\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\r\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\r\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\r\\n\\r\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\r\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\r\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\r\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\r\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\r\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\r\\n\\t\\t\\t\\t))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\tif ($price_from)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tif ($price_to)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\r\\n\\r\\n\\t\\t\\/\\/ Additional properties\\r\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\r\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\r\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\r\\n\\r\\n\\t\\t$aTmpProperties = array();\\r\\n\\t\\t$havingCount = 0;\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\r\\n\\t\\t\\tif ($aPropertiesValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\r\\n\\r\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\r\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\r\\n\\r\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\r\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\r\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\r\\n\\r\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\r\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\r\\n\\t\\t\\t\\t\\t\\t));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tif (count($aTmpProperties))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTableNames = array();\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\r\\n\\t\\t\\t\\t->setAnd()\\r\\n\\t\\t\\t\\t->open();\\r\\n\\r\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\r\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\r\\n\\r\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\r\\n\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\r\\n\\r\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\r\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\r\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\r\\n\\t\\t\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t\\t->close();\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\r\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t\\t\\t->setAnd();\\r\\n\\r\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\r\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\r\\n\\t\\t\\t\\t\\t)->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\t$havingCount > 1\\r\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\r\\n\\r\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\r\\n\\t\\t\\t\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n\\t{\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\r\\n\\r\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\r\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'document\');\\r\\n\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\tif ($oSiteuser)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\r\\n\\r\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\r\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\r\\n\\t\\t$oComment->active = $oShop->comment_active;\\r\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\r\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\r\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\r\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\r\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\r\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\r\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\r\\n\\r\\n\\t\\t$oXmlCommentTag\\r\\n\\t\\t\\t->addEntity($oComment)\\r\\n\\t\\t\\t->addEntity($oShop_Item);\\r\\n\\r\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ Antispam\\r\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\r\\n\\t\\t\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oComment->save();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment\\r\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\r\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\r\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\r\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\r\\n\\r\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\r\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\r\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\r\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\r\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\r\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\r\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\r\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\r\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->send();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\r\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\r\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\/* if ($Shop_Controller_Show->group == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\r\\n}*\\/\\r\\n\\r\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\r\\n$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\r\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\r\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\r\\n\\r\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\r\\n$oShop_Producers = $oShop->Shop_Producers;\\r\\n$oShop_Producers->queryBuilder()\\r\\n\\t->select(\'shop_producers.*\')\\r\\n\\t->distinct()\\r\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\r\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\r\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\r\\n\\r\\n$aShop_Producers = $oShop_Producers->findAll();\\r\\nforeach ($aShop_Producers as $oShop_Producer)\\r\\n{\\r\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\r\\n\\t$oProducersXmlEntity->addEntity(\\r\\n\\t\\t$oShop_Producer->clearEntities()\\r\\n\\t);\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->xsl(\\r\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\n\\t->itemsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\r\\n\\t->specialprices(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\r\\n\\t\\/\\/->modificationsList(TRUE)\\r\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t\\/\\/->groupsMode(\'none\')\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t->groupsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\r\\n\\t\\/\\/->filterShortcuts(TRUE)\\r\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\r\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\r\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\r\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\r\\n\\t->show();\",\"lib_config\":\"<?php\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\r\\n{\\r\\n   protected function _groupCondition()\\r\\n   {\\r\\n      $oShop = $this->getEntity();\\r\\n   \\r\\n      if ($this->group)\\r\\n      {\\r\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\r\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\r\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\r\\n         $aSubGroupsID[] = $this->group;\\r\\n\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n      }\\r\\n      else\\r\\n      {\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\r\\n      }\\r\\n\\r\\n      return $this;\\r\\n   }\\r\\n\\r\\n   protected $_aGroupTree = array();\\r\\n\\r\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\r\\n   {\\r\\n      $iShopId = intval($iShopId);\\r\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\r\\n      $iLevel = intval($iLevel);\\r\\n\\r\\n      if ($iLevel == 0)\\r\\n      {\\r\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\r\\n            ->from(\'shop_groups\')\\r\\n            ->where(\'shop_id\', \'=\', $iShopId)\\r\\n            ->where(\'deleted\', \'=\', 0)\\r\\n            ->execute()->asAssoc()->result();\\r\\n\\r\\n         foreach ($aTmp as $aGroup)\\r\\n         {\\r\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $aReturn = array();\\r\\n\\r\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\r\\n      {\\r\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\r\\n         {\\r\\n            $aReturn[] = $childrenGroup[\'id\'];\\r\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $iLevel == 0 && $this->_aGroupTree = array();\\r\\n\\r\\n      return $aReturn;\\r\\n   }\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\r\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n$collection_flag = 0;\\r\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\r\\n$aPropertyValues = $oStructure->getPropertyValues();\\r\\n foreach($aPropertyValues as $oPropertyValue)\\r\\n {  if($oPropertyValue->Property->id == 61){\\r\\n    $collection_flag = $oPropertyValue->value;\\r\\n }\\r\\n } \\r\\n\\r\\nif($collection_flag == 1){\\r\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\t\\r\\n}\",\"user_id\":\"19\"}','2021-04-07 17:49:45',20,0),(1758,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\r\\nclass Shop_Item_Observer\\r\\n{\\r\\n   static public function onBeforeGetXml($object, $args)\\r\\n   {\\r\\n      $aShop_Item_Price = $object->price;\\r\\n      $object->addEntity(\\r\\n    Core::factory(\'Core_Xml_Entity\')\\r\\n        ->name(\'izn_price\')\\r\\n        ->value($aShop_Item_Price)\\r\\n)\\r\\n;\\r\\n   }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'shop_item.onBeforeGetXml\', array(\'Shop_Item_Observer\', \'onBeforeGetXml\'));\\r\\n$Shop_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$xslName = $Shop_Controller_Show->item\\r\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\r\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\r\\n\\r\\n$Shop_Controller_Show->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\r\\n);\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->tags(TRUE)\\r\\n\\t->comments(TRUE)\\r\\n\\t->associatedItems(TRUE)\\r\\n\\t->modifications(TRUE);\\r\\n\\r\\nif ($Shop_Controller_Show->item == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\r\\n\\r\\n\\t\\/\\/ Producers\\r\\n\\tif (Core_Array::getGet(\'producer_id\'))\\r\\n\\t{\\r\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->select(\'shop_items.*\')\\r\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\r\\n\\t}\\r\\n\\r\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\r\\n\\t{\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\r\\n\\t\\t);\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\r\\n\\r\\n\\t\\t\\/\\/ Prices\\r\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\r\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\r\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\r\\n\\r\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\r\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\r\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\r\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\r\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\r\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\r\\n\\t\\t\\t\\t))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\tif ($price_from)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tif ($price_to)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\r\\n\\r\\n\\t\\t\\/\\/ Additional properties\\r\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\r\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\r\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\r\\n\\r\\n\\t\\t$aTmpProperties = array();\\r\\n\\t\\t$havingCount = 0;\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\r\\n\\t\\t\\tif ($aPropertiesValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\r\\n\\r\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\r\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\r\\n\\r\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\r\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\r\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\r\\n\\r\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\r\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\r\\n\\t\\t\\t\\t\\t\\t));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tif (count($aTmpProperties))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTableNames = array();\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\r\\n\\t\\t\\t\\t->setAnd()\\r\\n\\t\\t\\t\\t->open();\\r\\n\\r\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\r\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\r\\n\\r\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\r\\n\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\r\\n\\r\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\r\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\r\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\r\\n\\t\\t\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t\\t->close();\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\r\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t\\t\\t->setAnd();\\r\\n\\r\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\r\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\r\\n\\t\\t\\t\\t\\t)->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\t$havingCount > 1\\r\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\r\\n\\r\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\r\\n\\t\\t\\t\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n\\t{\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\r\\n\\r\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\r\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'document\');\\r\\n\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\tif ($oSiteuser)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\r\\n\\r\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\r\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\r\\n\\t\\t$oComment->active = $oShop->comment_active;\\r\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\r\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\r\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\r\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\r\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\r\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\r\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\r\\n\\r\\n\\t\\t$oXmlCommentTag\\r\\n\\t\\t\\t->addEntity($oComment)\\r\\n\\t\\t\\t->addEntity($oShop_Item);\\r\\n\\r\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ Antispam\\r\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\r\\n\\t\\t\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oComment->save();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment\\r\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\r\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\r\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\r\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\r\\n\\r\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\r\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\r\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\r\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\r\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\r\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\r\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\r\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\r\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->send();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\r\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\r\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\/* if ($Shop_Controller_Show->group == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\r\\n}*\\/\\r\\n\\r\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\r\\n$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\r\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\r\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\r\\n\\r\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\r\\n$oShop_Producers = $oShop->Shop_Producers;\\r\\n$oShop_Producers->queryBuilder()\\r\\n\\t->select(\'shop_producers.*\')\\r\\n\\t->distinct()\\r\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\r\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\r\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\r\\n\\r\\n$aShop_Producers = $oShop_Producers->findAll();\\r\\nforeach ($aShop_Producers as $oShop_Producer)\\r\\n{\\r\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\r\\n\\t$oProducersXmlEntity->addEntity(\\r\\n\\t\\t$oShop_Producer->clearEntities()\\r\\n\\t);\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->xsl(\\r\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\n\\t->itemsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\r\\n\\t->specialprices(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\r\\n\\t\\/\\/->modificationsList(TRUE)\\r\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t\\/\\/->groupsMode(\'none\')\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t->groupsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\r\\n\\t\\/\\/->filterShortcuts(TRUE)\\r\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\r\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\r\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\r\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\r\\n\\t->show();\",\"lib_config\":\"<?php\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\r\\n{\\r\\n   protected function _groupCondition()\\r\\n   {\\r\\n      $oShop = $this->getEntity();\\r\\n   \\r\\n      if ($this->group)\\r\\n      {\\r\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\r\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\r\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\r\\n         $aSubGroupsID[] = $this->group;\\r\\n\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n      }\\r\\n      else\\r\\n      {\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\r\\n      }\\r\\n\\r\\n      return $this;\\r\\n   }\\r\\n\\r\\n   protected $_aGroupTree = array();\\r\\n\\r\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\r\\n   {\\r\\n      $iShopId = intval($iShopId);\\r\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\r\\n      $iLevel = intval($iLevel);\\r\\n\\r\\n      if ($iLevel == 0)\\r\\n      {\\r\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\r\\n            ->from(\'shop_groups\')\\r\\n            ->where(\'shop_id\', \'=\', $iShopId)\\r\\n            ->where(\'deleted\', \'=\', 0)\\r\\n            ->execute()->asAssoc()->result();\\r\\n\\r\\n         foreach ($aTmp as $aGroup)\\r\\n         {\\r\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $aReturn = array();\\r\\n\\r\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\r\\n      {\\r\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\r\\n         {\\r\\n            $aReturn[] = $childrenGroup[\'id\'];\\r\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $iLevel == 0 && $this->_aGroupTree = array();\\r\\n\\r\\n      return $aReturn;\\r\\n   }\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\r\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n$collection_flag = 0;\\r\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\r\\n$aPropertyValues = $oStructure->getPropertyValues();\\r\\n foreach($aPropertyValues as $oPropertyValue)\\r\\n {  if($oPropertyValue->Property->id == 61){\\r\\n    $collection_flag = $oPropertyValue->value;\\r\\n }\\r\\n } \\r\\n\\r\\nif($collection_flag == 1){\\r\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\t\\r\\n}\",\"user_id\":\"19\"}','2021-04-07 17:52:32',20,0),(1759,'lib',44,'{\"name\":\"\\u0418\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041d\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0443\\u0435\\u0442 \\u0438\\u043d\\u0442\\u0435\\u0440\\u043d\\u0435\\u0442-\\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\",\"lib\":\"<?php\\r\\nclass Shop_Item_Observer\\r\\n{\\r\\n   static public function onBeforeGetXml($object, $args)\\r\\n   {\\r\\n\\t\\t$iSiteuserGroupId = array(12,13,14,15,16,17,18);\\r\\n\\r\\n\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u043e\\u0432\\u0430\\u043d\\r\\n\\t\\tif ($oSiteuser)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aSiteuser_Groups = $oSiteuser->Siteuser_Groups->findAll();\\r\\n\\r\\n\\t\\t\\tforeach ($aSiteuser_Groups as $oSiteuser_Group)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tif (in_array($oSiteuser_Group->id, $iSiteuserGroupId))\\r\\n\\t\\t\\t\\t{\\r\\n      $aShop_Item_Price = $object->price;\\r\\n      $object->addEntity(\\r\\n    Core::factory(\'Core_Xml_Entity\')\\r\\n        ->name(\'izn_price\')\\r\\n        ->value($aShop_Item_Price)\\r\\n)\\r\\n;\\r\\n\\t\\t\\t\\t\\t }\\r\\n\\t\\t\\t\\t }\\r\\n\\t\\t\\t }\\r\\n   }\\r\\n}\\r\\n\\r\\nCore_Event::attach(\'shop_item.onBeforeGetXml\', array(\'Shop_Item_Observer\', \'onBeforeGetXml\'));\\r\\n$Shop_Controller_Show = Core_Page::instance()->object;\\r\\n\\r\\n$xslName = $Shop_Controller_Show->item\\r\\n\\t? Core_Array::get(Core_Page::instance()->libParams, \'shopItemXsl\')\\r\\n\\t: Core_Array::get(Core_Page::instance()->libParams, \'shopXsl\');\\r\\n\\r\\n$Shop_Controller_Show->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'\\u0422\\u0435\\u043a\\u0443\\u0449\\u0430\\u044f\\u0413\\u0440\\u0443\\u043f\\u043f\\u0430\')->value($Shop_Controller_Show->group)\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n)->addEntity(\\r\\n\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t->name(\'show_add_comments\')->value(Core_Array::get(Core_Page::instance()->libParams, \'showAddComment\', 2))\\r\\n);\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->tags(TRUE)\\r\\n\\t->comments(TRUE)\\r\\n\\t->associatedItems(TRUE)\\r\\n\\t->modifications(TRUE);\\r\\n\\r\\nif ($Shop_Controller_Show->item == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->itemsForbiddenTags(array(\'text\'));\\r\\n\\r\\n\\t\\/\\/ Producers\\r\\n\\tif (Core_Array::getGet(\'producer_id\'))\\r\\n\\t{\\r\\n\\t\\t$iProducerId = intval(Core_Array::getGet(\'producer_id\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'producer_id\')->value($iProducerId)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t->select(\'shop_items.*\')\\r\\n\\t\\t\\t->where(\'shop_items.shop_producer_id\', \'=\', $iProducerId);\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'producer_id=\' . $iProducerId);\\r\\n\\t}\\r\\n\\r\\n\\tif (Core_Array::getGet(\'filter\') || Core_Array::getGet(\'sorting\'))\\r\\n\\t{\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'filter\')->value(1)\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$sorting = intval(Core_Array::getGet(\'sorting\'));\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'sorting\')->value($sorting)\\r\\n\\t\\t);\\r\\n\\t\\t$Shop_Controller_Show->addCacheSignature(\'sorting=\' . $sorting);\\r\\n\\r\\n\\t\\t\\/\\/ Prices\\r\\n\\t\\t$price_from = intval(Core_Array::getGet(\'price_from\'));\\r\\n\\t\\t$price_to = intval(Core_Array::getGet(\'price_to\'));\\r\\n\\t\\tif ($price_from || $price_to || $sorting == 1 || $sorting == 2)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0432\\u0430\\u043b\\u044e\\u0442 \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430\\r\\n\\t\\t\\t$aShop_Currencies = Core_Entity::factory(\'Shop_Currency\')->findAll();\\r\\n\\r\\n\\t\\t\\t$query_tax = \'IF(`shop_taxes`.`tax_is_included` IS NULL OR `shop_taxes`.`tax_is_included` = 1, 0, `shop_items`.`price` * `shop_taxes`.`rate` \\/ 100)\';\\r\\n\\t\\t\\t$query_currency_switch = \\\"`shop_items`.`price` + {$query_tax}\\\";\\r\\n\\t\\t\\tforeach ($aShop_Currencies as $oShop_Currency)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043a\\u043e\\u044d\\u0444\\u0444\\u0438\\u0446\\u0438\\u0435\\u043d\\u0442 \\u043f\\u0435\\u0440\\u0435\\u0441\\u0447\\u0435\\u0442\\u0430 \\u0434\\u043b\\u044f \\u043a\\u0430\\u0436\\u0434\\u043e\\u0439 \\u0432\\u0430\\u043b\\u044e\\u0442\\u044b\\r\\n\\t\\t\\t\\t$currency_coefficient = Shop_Controller::instance()->getCurrencyCoefficientInShopCurrency(\\r\\n\\t\\t\\t\\t\\t$oShop_Currency, $oShop->Shop_Currency\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$query_currency_switch = \\\"IF (`shop_items`.`shop_currency_id` = \'{$oShop_Currency->id}\', IF (COUNT(`shop_discounts`.`id`), ((`shop_items`.`price` + {$query_tax}) * (1 - SUM(DISTINCT IF(`shop_discounts`.`type` = 0, `shop_discounts`.`value`, 0)) \\/ 100)) * {$currency_coefficient} - SUM(DISTINCT IF(`shop_discounts`.`type`, `shop_discounts`.`value`, 0)), (`shop_items`.`price`) * {$currency_coefficient}), {$query_currency_switch})\\\";\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$current_date = date(\'Y-m-d H:i:s\');\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()\\r\\n\\t\\t\\t\\t->queryBuilder()\\r\\n\\t\\t\\t\\t->select(array(Core_QueryBuilder::expression($query_currency_switch), \'absolute_price\'))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_discounts\', \'shop_items.id\', \'=\', \'shop_item_discounts.shop_item_id\')\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_discounts\', \'shop_item_discounts.shop_discount_id\', \'=\', \'shop_discounts.id\', array(\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.active\', \'=\', 1)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND \' => array(\'shop_discounts.deleted\', \'=\', 0)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_discounts.start_datetime\', \'<=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'AND (\' => array(\'shop_discounts.end_datetime\', \'>=\', $current_date)),\\r\\n\\t\\t\\t\\t\\tarray(\'OR\' => array(\'shop_discounts.end_datetime\', \'=\', \'0000-00-00 00:00:00\')),\\r\\n\\t\\t\\t\\t\\tarray(\')\' => NULL)\\r\\n\\t\\t\\t\\t))\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_taxes\', \'shop_taxes.id\', \'=\', \'shop_items.shop_tax_id\')\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\tif ($price_from)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'>=\', $price_from);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_from\')->value($price_from)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_from=\' . $price_from);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tif ($price_to)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()->having(\'absolute_price\', \'<=\', $price_to);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'price_to\')->value($price_to)\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\'price_to=\' . $price_to);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t\\t->orderBy(\'absolute_price\', $sorting == 1 ? \'ASC\' : \'DESC\');\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$sorting == 3 && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t->clearOrderBy()\\r\\n\\t\\t\\t->orderBy(\'shop_items.name\', \'ASC\');\\r\\n\\r\\n\\t\\t\\/\\/ Additional properties\\r\\n\\t\\t$oShop_Item_Property_List = Core_Entity::factory(\'Shop_Item_Property_List\', $oShop->id);\\r\\n\\r\\n\\t\\t$aProperties = $Shop_Controller_Show->group !== FALSE && is_null($Shop_Controller_Show->tag)\\r\\n\\t\\t\\t? $oShop_Item_Property_List->getPropertiesForGroup($Shop_Controller_Show->group)\\r\\n\\t\\t\\t: $oShop_Item_Property_List->Properties->findAll();\\r\\n\\r\\n\\t\\t$aTmpProperties = array();\\r\\n\\t\\t$havingCount = 0;\\r\\n\\t\\tforeach ($aProperties as $oProperty)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ \\u0421\\u0432-\\u0432\\u043e \\u043c\\u043e\\u0436\\u0435\\u0442 \\u0438\\u043c\\u0435\\u0442\\u044c \\u043d\\u0435\\u0441\\u043a\\u043e\\u043b\\u044c\\u043a\\u043e \\u0437\\u043d\\u0430\\u0447\\u0435\\u043d\\u0438\\u0439\\r\\n\\t\\t\\t$aPropertiesValue = Core_Array::getGet(\'property_\' . $oProperty->id);\\r\\n\\t\\t\\tif ($aPropertiesValue)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t!is_array($aPropertiesValue) && $aPropertiesValue = array($aPropertiesValue);\\r\\n\\t\\t\\t\\t$aPropertiesValue = array_map(\'strval\', $aPropertiesValue);\\r\\n\\r\\n\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, $aPropertiesValue);\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telseif (!is_null(Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$tmpFrom = Core_Array::getGet(\'property_\' . $oProperty->id . \'_from\');\\r\\n\\t\\t\\t\\t$tmpTo = Core_Array::getGet(\'property_\' . $oProperty->id . \'_to\');\\r\\n\\r\\n\\t\\t\\t\\t!is_array($tmpFrom) && $tmpFrom = array($tmpFrom);\\r\\n\\t\\t\\t\\t!is_array($tmpTo) && $tmpTo = array($tmpTo);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ From ... to ...\\r\\n\\t\\t\\t\\tforeach ($tmpFrom as $iKey => $sValue)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$to = Core_Array::get($tmpTo, $iKey);\\r\\n\\r\\n\\t\\t\\t\\t\\t$aTmpProperties[] = array($oProperty, array(\\r\\n\\t\\t\\t\\t\\t\\t\\t\'from\' => $sValue != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($sValue) : intval($sValue))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\'to\' => $to != \'\'\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t? ($oProperty->type == 11 ? floatval($to) : intval($to))\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t: \'\'\\r\\n\\t\\t\\t\\t\\t\\t));\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t$havingCount++;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tif (count($aTmpProperties))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$aTableNames = array();\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->leftJoin(\'shop_item_properties\', \'shop_items.shop_id\', \'=\', \'shop_item_properties.shop_id\')\\r\\n\\t\\t\\t\\t->setAnd()\\r\\n\\t\\t\\t\\t->open();\\r\\n\\r\\n\\t\\t\\tforeach ($aTmpProperties as $aTmpProperty)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tlist($oProperty, $aPropertyValues) = $aTmpProperty;\\r\\n\\t\\t\\t\\t$tableName = $oProperty->createNewValue(0)->getTableName();\\r\\n\\r\\n\\t\\t\\t\\t!in_array($tableName, $aTableNames) && $aTableNames[] = $tableName;\\r\\n\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->where(\'shop_item_properties.property_id\', \'=\', $oProperty->id);\\r\\n\\r\\n\\t\\t\\t\\tif (!isset($aPropertyValues[\'from\']))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u0414\\u043b\\u044f \\u0441\\u0442\\u0440\\u043e\\u043a \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 LIKE %...%\\r\\n\\t\\t\\t\\t\\tif ($oProperty->type == 1)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'LIKE\', \\\"%{$propertyValue}%\\\");\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\/\\/ Checkbox\\r\\n\\t\\t\\t\\t\\t\\t$oProperty->type == 7 && $aPropertyValues[0] != \'\' && $aPropertyValues = array(1);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset = $oProperty->type != 7 && $oProperty->type != 3;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()->open();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$tableName . \'.value\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? \'=\' : \'IN\',\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tcount($aPropertyValues) == 1 ? $aPropertyValues[0] : $aPropertyValues\\r\\n\\t\\t\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$bCheckUnset && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t\\t->close();\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\tforeach ($aPropertyValues as $propertyValue)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id)->value($propertyValue)\\r\\n\\t\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t\\t\\t\\t$Shop_Controller_Show->addCacheSignature(\\\"property{$oProperty->id}={$propertyValue}\\\");\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$from = trim(Core_Array::get($aPropertyValues, \'from\'));\\r\\n\\t\\t\\t\\t\\t$from && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'>=\', $from)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t\\t\\t->setAnd();\\r\\n\\r\\n\\t\\t\\t\\t\\t$to = trim(Core_Array::get($aPropertyValues, \'to\'));\\r\\n\\t\\t\\t\\t\\t$to && $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->open()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'<=\', $to)\\r\\n\\t\\t\\t\\t\\t\\t->setOr()\\r\\n\\t\\t\\t\\t\\t\\t->where($tableName . \'.value\', \'IS\', NULL)\\r\\n\\t\\t\\t\\t\\t\\t->close();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->setOr();\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_from\')->value($from)\\r\\n\\t\\t\\t\\t\\t)->addEntity(\\r\\n\\t\\t\\t\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t\\t->name(\'property_\' . $oProperty->id . \'_to\')->value($to)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_from={$from}\\\")\\r\\n\\t\\t\\t\\t\\t\\t->addCacheSignature(\\\"property{$oProperty->id}_to={$to}\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t->close()\\r\\n\\t\\t\\t\\t->groupBy(\'shop_items.id\');\\r\\n\\r\\n\\t\\t\\t$havingCount > 1\\r\\n\\t\\t\\t\\t&& $Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t\\t->having(Core_Querybuilder::expression(\'COUNT(DISTINCT `shop_item_properties`.`property_id`)\'), \'=\', $havingCount);\\r\\n\\r\\n\\t\\t\\tforeach ($aTableNames as $tableName)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->shopItems()->queryBuilder()\\r\\n\\t\\t\\t\\t\\t->leftJoin($tableName, \'shop_items.id\', \'=\', $tableName . \'.entity_id\',\\r\\n\\t\\t\\t\\t\\t\\tarray(\\r\\n\\t\\t\\t\\t\\t\\t\\tarray(\'AND\' => array(\'shop_item_properties.property_id\', \'=\', Core_QueryBuilder::expression($tableName . \'.property_id\')))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\tif (Core_Array::getPost(\'add_comment\') && Core_Array::get(Core_Page::instance()->libParams, \'showComments\', 1))\\r\\n\\t{\\r\\n\\t\\t$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->cache(FALSE);\\r\\n\\r\\n\\t\\t$oLastComment = Core_Entity::factory(\'Comment\')->getLastCommentByIp(\\r\\n\\t\\t\\tCore_Array::get($_SERVER, \'REMOTE_ADDR\')\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\t$oXmlCommentTag = Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'document\');\\r\\n\\r\\n\\t\\t$siteuser_id = 0;\\r\\n\\t\\tif (Core::moduleIsActive(\'siteuser\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\r\\n\\t\\t\\tif ($oSiteuser)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$oComment = Core_Entity::factory(\'Comment\');\\r\\n\\r\\n\\t\\t$allowable_tags = \'<b><strong><i><em><br><p><u><strike><ul><ol><li>\';\\r\\n\\t\\t$oComment->parent_id = intval(Core_Array::getPost(\'parent_id\', 0));\\r\\n\\t\\t$oComment->active = $oShop->comment_active;\\r\\n\\t\\t$oComment->author = Core_Str::stripTags(Core_Array::getPost(\'author\'));\\r\\n\\t\\t$oComment->email = Core_Str::stripTags(Core_Array::getPost(\'email\'));\\r\\n\\t\\t$oComment->phone = Core_Str::stripTags(Core_Array::getPost(\'phone\'));\\r\\n\\t\\t$oComment->grade = intval(Core_Array::getPost(\'grade\', 0));\\r\\n\\t\\t$oComment->subject = Core_Str::stripTags(Core_Array::getPost(\'subject\'));\\r\\n\\t\\t$oComment->text = nl2br(Core_Str::stripTags(Core_Array::getPost(\'text\'), $allowable_tags));\\r\\n\\t\\t$oComment->siteuser_id = $siteuser_id;\\r\\n\\r\\n\\t\\t$oShop_Item = Core_Entity::factory(\'Shop_Item\', $Shop_Controller_Show->item);\\r\\n\\r\\n\\t\\t$oXmlCommentTag\\r\\n\\t\\t\\t->addEntity($oComment)\\r\\n\\t\\t\\t->addEntity($oShop_Item);\\r\\n\\r\\n\\t\\tif (is_null($oLastComment) || time() > Core_Date::sql2timestamp($oLastComment->datetime) + ADD_COMMENT_DELAY)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($oShop->use_captcha == 0 || $siteuser_id > 0 || Core_Captcha::valid(Core_Array::getPost(\'captcha_id\'), Core_Array::getPost(\'captcha\')))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\/\\/ Antispam\\r\\n\\t\\t\\t\\tif (Core::moduleIsActive(\'antispam\'))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$Antispam_Controller = new Antispam_Controller();\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = $Antispam_Controller\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->author)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->phone)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->subject)\\r\\n\\t\\t\\t\\t\\t\\t->addText($oComment->text)\\r\\n\\t\\t\\t\\t\\t\\t->execute();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$bAntispamAnswer = TRUE;\\r\\n\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\tif ($bAntispamAnswer)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oComment->save();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment\\r\\n\\t\\t\\t\\t\\t\\t->dateFormat($oShop->format_date)\\r\\n\\t\\t\\t\\t\\t\\t->dateTimeFormat($oShop->format_datetime);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oShop_Item->add($oComment)->clearCache();\\r\\n\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity($oShop);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\/\\/ \\u041e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 \\u043f\\u0438\\u0441\\u044c\\u043c\\u0430 \\u0430\\u0434\\u043c\\u0438\\u043d\\u0438\\u0441\\u0442\\u0440\\u0430\\u0442\\u043e\\u0440\\u0443\\r\\n\\t\\t\\t\\t\\t$sText = Xsl_Processor::instance()\\r\\n\\t\\t\\t\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t\\t\\t\\t->xsl(\\r\\n\\t\\t\\t\\t\\t\\t\\tCore_Entity::factory(\'Xsl\')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t->getByName(Core_Array::get(Core_Page::instance()->libParams, \'addCommentAdminMailXsl\'))\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t\\t\\t\\t$aFrom = array_map(\'trim\', explode(\',\', EMAIL_TO));\\r\\n\\r\\n\\t\\t\\t\\t\\tCore_Mail::instance()\\r\\n\\t\\t\\t\\t\\t\\t->to(EMAIL_TO)\\r\\n\\t\\t\\t\\t\\t\\t->from($aFrom[0])\\r\\n\\t\\t\\t\\t\\t\\t->header(\'Reply-To\', Core_Valid::email($oComment->email)\\r\\n\\t\\t\\t\\t\\t\\t\\t? $oComment->email\\r\\n\\t\\t\\t\\t\\t\\t\\t: $aFrom[0]\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->subject(Core::_(\'Shop.comment_mail_subject\'))\\r\\n\\t\\t\\t\\t\\t\\t->message(trim($sText))\\r\\n\\t\\t\\t\\t\\t\\t->contentType(Core_Array::get(Core_Page::instance()->libParams, \'commentMailNoticeType\', 0) == 0\\r\\n\\t\\t\\t\\t\\t\\t\\t? \'text\\/plain\'\\r\\n\\t\\t\\t\\t\\t\\t\\t: \'text\\/html\'\\r\\n\\t\\t\\t\\t\\t\\t)\\r\\n\\t\\t\\t\\t\\t\\t->send();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\telse\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t\\t->name(\'error_antispam\')->value(1)\\r\\n\\t\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t\\t->name(\'error_captcha\')->value(1)\\r\\n\\t\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oXmlCommentTag->addEntity(Core::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'error_time\')->value(1)\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\t\\t$oComment->text = Core_Str::br2nl($oComment->text);\\r\\n\\t\\t\\t$Shop_Controller_Show->addEntity($oComment);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0420\\u0435\\u0437\\u0443\\u043b\\u044c\\u0442\\u0430\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u044f \\u043a\\u043e\\u043c\\u043c\\u0435\\u043d\\u0442\\u0430\\u0440\\u0438\\u044f\\r\\n\\t\\t$xsl_result = Xsl_Processor::instance()\\r\\n\\t\\t\\t->xml($oXmlCommentTag->getXml())\\r\\n\\t\\t\\t->xsl(Core_Entity::factory(\'Xsl\')->getByName(\\r\\n\\t\\t\\t\\tCore_Array::get(Core_Page::instance()->libParams, \'addCommentNoticeXsl\'))\\r\\n\\t\\t\\t)\\r\\n\\t\\t\\t->process();\\r\\n\\r\\n\\t\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t\\t->name(\'message\')->value($xsl_result)\\r\\n\\t\\t);\\r\\n\\t}\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0412 \\u043a\\u043e\\u0440\\u043d\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0438\\u0437 \\u0432\\u0441\\u0435\\u0445 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\/* if ($Shop_Controller_Show->group == 0)\\r\\n{\\r\\n\\t$Shop_Controller_Show->group(FALSE)->forbidSelectModifications();\\r\\n}*\\/\\r\\n\\r\\n\\/* \\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438 *\\/\\r\\n$oShop = $Shop_Controller_Show->getEntity();\\r\\n\\r\\n\\/\\/ XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c, \\u043a \\u043a\\u043e\\u0442\\u043e\\u0440\\u0439 \\u0431\\u0443\\u0434\\u0443\\u0442 \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0442\\u044c\\u0441\\u044f \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438\\r\\n$oProducersXmlEntity = Core::factory(\'Core_Xml_Entity\')->name(\'producers\');\\r\\n\\r\\n\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u044c \\u043a\\u043e\\u043d\\u0442\\u0440\\u043e\\u043b\\u043b\\u0435\\u0440\\u0443 \\u043f\\u043e\\u043a\\u0430\\u0437\\u0430\\r\\n$Shop_Controller_Show->addEntity($oProducersXmlEntity);\\r\\n\\r\\n\\/\\/ \\u0421\\u043f\\u0438\\u0441\\u043e\\u043a \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439\\r\\n$oShop_Producers = $oShop->Shop_Producers;\\r\\n$oShop_Producers->queryBuilder()\\r\\n\\t->select(\'shop_producers.*\')\\r\\n\\t->distinct()\\r\\n\\t->join(\'shop_items\', \'shop_items.shop_producer_id\', \'=\', \'shop_producers.id\')\\r\\n\\t->where(\'shop_items.shop_group_id\', \'=\', $Shop_Controller_Show->group)\\r\\n\\t->where(\'shop_items.deleted\', \'=\', 0);\\r\\n\\r\\n$aShop_Producers = $oShop_Producers->findAll();\\r\\nforeach ($aShop_Producers as $oShop_Producer)\\r\\n{\\r\\n\\t\\/\\/ \\u0414\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044f \\u043f\\u043e\\u0442\\u043e\\u043c\\u043a\\u043e\\u043c XML-\\u0441\\u0443\\u0449\\u043d\\u043e\\u0441\\u0442\\u0438\\r\\n\\t$oProducersXmlEntity->addEntity(\\r\\n\\t\\t$oShop_Producer->clearEntities()\\r\\n\\t);\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->xsl(\\r\\n\\t\\tCore_Entity::factory(\'Xsl\')->getByName($xslName)\\r\\n\\t)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\n\\t->itemsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0441\\u043f\\u0435\\u0446\\u0438\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0446\\u0435\\u043d\\u044b\\r\\n\\t->specialprices(TRUE)\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u043c\\u043e\\u0434\\u0438\\u0444\\u0438\\u043a\\u0430\\u0446\\u0438\\u0438 \\u043d\\u0430 \\u0443\\u0440\\u043e\\u0432\\u043d\\u0435 \\u0441 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u043c\\r\\n\\t\\/\\/->modificationsList(TRUE)\\r\\n\\t\\/\\/ \\u0420\\u0435\\u0436\\u0438\\u043c \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t\\/\\/->groupsMode(\'none\')\\r\\n\\t\\/\\/ \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u044c \\u0434\\u043e\\u043f. \\u0441\\u0432-\\u0432\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n\\t->groupsProperties(TRUE)\\r\\n\\t\\/\\/ \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043f\\u043e \\u044f\\u0440\\u043b\\u044b\\u043a\\u0430\\u043c\\r\\n\\t\\/\\/->filterShortcuts(TRUE)\\r\\n\\t\\/\\/ \\u0423\\u0447\\u0435\\u0442 \\u043e\\u0441\\u0442\\u0430\\u0442\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u043d\\u0430 \\u0441\\u043a\\u043b\\u0430\\u0434\\u0435\\r\\n\\t\\/\\/->warehouseMode(\'in-stock\')\\r\\n\\t\\/\\/ \\u0422\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b \\u0441\\u043f\\u0438\\u0441\\u043a\\u043e\\u0432 \\u0432 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0435\\r\\n\\t\\/\\/->itemsPropertiesListJustAvailable(TRUE)\\r\\n\\t->show();\",\"lib_config\":\"<?php\\r\\n$oShop = Core_Entity::factory(\'Shop\', Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\nclass My_Shop_Controller_Show extends Shop_Controller_Show\\r\\n{\\r\\n   protected function _groupCondition()\\r\\n   {\\r\\n      $oShop = $this->getEntity();\\r\\n   \\r\\n      if ($this->group)\\r\\n      {\\r\\n         \\/\\/ \\u0435\\u0441\\u043b\\u0438 ID \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043d\\u0435 0, \\u0442.\\u0435. \\u043d\\u0435 \\u043a\\u043e\\u0440\\u043d\\u0435\\u0432\\u0430\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f\\u0430\\r\\n         \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b\\r\\n         $aSubGroupsID = $this->fillShopGroup($oShop->id, $this->group); \\/\\/ \\u0434\\u043e\\u0431\\u0430\\u0432\\u043b\\u044f\\u0435\\u043c \\u0442\\u0435\\u043a\\u0443\\u0449\\u0443\\u044e \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0432 \\u043c\\u0430\\u0441\\u0441\\u0438\\u0432\\r\\n         $aSubGroupsID[] = $this->group;\\r\\n\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'IN\', $aSubGroupsID); \\/\\/ \\u043f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c \\u0432\\u0441\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u0438\\u0437 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\r\\n      }\\r\\n      else\\r\\n      {\\r\\n         $this->shopItems()\\r\\n            ->queryBuilder()\\r\\n            ->where(\'shop_items.shop_group_id\', \'=\', 0);\\r\\n      }\\r\\n\\r\\n      return $this;\\r\\n   }\\r\\n\\r\\n   protected $_aGroupTree = array();\\r\\n\\r\\n   public function fillShopGroup($iShopId, $iShopGroupParentId = 0, $iLevel = 0)\\r\\n   {\\r\\n      $iShopId = intval($iShopId);\\r\\n      $iShopGroupParentId = intval($iShopGroupParentId);\\r\\n      $iLevel = intval($iLevel);\\r\\n\\r\\n      if ($iLevel == 0)\\r\\n      {\\r\\n         $aTmp = Core_QueryBuilder::select(\'id\', \'parent_id\')\\r\\n            ->from(\'shop_groups\')\\r\\n            ->where(\'shop_id\', \'=\', $iShopId)\\r\\n            ->where(\'deleted\', \'=\', 0)\\r\\n            ->execute()->asAssoc()->result();\\r\\n\\r\\n         foreach ($aTmp as $aGroup)\\r\\n         {\\r\\n            $this->_aGroupTree[$aGroup[\'parent_id\']][] = $aGroup;\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $aReturn = array();\\r\\n\\r\\n      if (isset($this->_aGroupTree[$iShopGroupParentId]))\\r\\n      {\\r\\n         foreach ($this->_aGroupTree[$iShopGroupParentId] as $childrenGroup)\\r\\n         {\\r\\n            $aReturn[] = $childrenGroup[\'id\'];\\r\\n            $aReturn = array_merge($aReturn, $this->fillShopGroup($iShopId, $childrenGroup[\'id\'], $iLevel + 1));\\r\\n         }\\r\\n      }\\r\\n\\r\\n      $iLevel == 0 && $this->_aGroupTree = array();\\r\\n\\r\\n      return $aReturn;\\r\\n   }\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\r\\n\\/\\/$Shop_Controller_Show = new Shop_Controller_Show($oShop);\\r\\n\\/\\/ $Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n$collection_flag = 0;\\r\\n$oStructure = Core_Entity::factory(\'Shop_Group\',  Core_Page::instance()->object->group);\\r\\n$aPropertyValues = $oStructure->getPropertyValues();\\r\\n foreach($aPropertyValues as $oPropertyValue)\\r\\n {  if($oPropertyValue->Property->id == 61){\\r\\n    $collection_flag = $oPropertyValue->value;\\r\\n }\\r\\n } \\r\\n\\r\\nif($collection_flag == 1){\\r\\n$Shop_Controller_Show = new My_Shop_Controller_Show($oShop);\\r\\n\\r\\n\\r\\n\\r\\n\\/* \\u041a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e *\\/\\r\\n$on_page = intval(Core_Array::getGet(\'on_page\'));\\r\\nif ($on_page > 0 && $on_page < 150)\\r\\n{\\r\\n\\t$limit = $on_page;\\r\\n\\r\\n\\t$Shop_Controller_Show->addEntity(\\r\\n\\t\\tCore::factory(\'Core_Xml_Entity\')\\r\\n\\t\\t\\t->name(\'on_page\')->value($on_page)\\r\\n\\t);\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\t$limit = $oShop->items_on_page;\\r\\n}\\r\\n\\r\\n$Shop_Controller_Show\\r\\n\\t->limit($limit)\\r\\n\\t->parseUrl();\\r\\n\\r\\n\\/\\/ \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0441\\u043a\\u0430\\u0447\\u0438\\u0432\\u0430\\u043d\\u0438\\u044f \\u0444\\u0430\\u0439\\u043b\\u0430 \\u044d\\u043b\\u0435\\u043a\\u0442\\u0440\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430\\r\\n$guid = Core_Array::getGet(\'download_file\');\\r\\nif (strlen($guid))\\r\\n{\\r\\n\\t$oShop_Order_Item_Digital = Core_Entity::factory(\'Shop_Order_Item_Digital\')->getByGuid($guid);\\r\\n\\r\\n\\tif (!is_null($oShop_Order_Item_Digital) && $oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\t$iDay = 7;\\r\\n\\r\\n\\t\\t\\/\\/ \\u041f\\u0440\\u043e\\u0432\\u0435\\u0440\\u044f\\u0435\\u043c, \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u043b\\u0438 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0430 (\\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u0434\\u043e\\u0441\\u0442\\u0443\\u043f\\u043d\\u0430 \\u0432 \\u0442\\u0435\\u0447\\u0435\\u043d\\u0438\\u0435 \\u043d\\u0435\\u0434\\u0435\\u043b\\u0438 \\u043f\\u043e\\u0441\\u043b\\u0435 \\u043e\\u043f\\u043b\\u0430\\u0442\\u044b)\\r\\n\\t\\tif (Core_Date::sql2timestamp($oShop_Order_Item_Digital->Shop_Order_Item->Shop_Order->payment_datetime) > time() - 24 * 60 * 60 * $iDay)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Item_Digital = $oShop_Order_Item_Digital->Shop_Item_Digital;\\r\\n\\t\\t\\tif ($oShop_Item_Digital->filename != \'\')\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tCore_File::download($oShop_Item_Digital->getFullFilePath(), $oShop_Item_Digital->filename);\\r\\n\\t\\t\\t\\texit();\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\tCore_Message::show(Core::_(\'Shop_Order_Item_Digital.time_is_up\', $iDay));\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response->status(404)->sendHeaders()->showBody();\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ \\u0421\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\r\\nif (Core_Array::getRequest(\'compare\'))\\r\\n{\\r\\n\\t$shop_item_id = intval(Core_Array::getRequest(\'compare\'));\\r\\n\\r\\n\\tif (Core_Entity::factory(\'Shop_Item\', $shop_item_id)->shop_id == $oShop->id)\\r\\n\\t{\\r\\n\\t\\tCore_Session::start();\\r\\n\\t\\tif (isset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]))\\r\\n\\t\\t{\\r\\n\\t\\t\\tunset($_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id]);\\r\\n\\t\\t}\\r\\n\\t\\telse\\r\\n\\t\\t{\\r\\n\\t\\t\\t$_SESSION[\'hostcmsCompare\'][$oShop->id][$shop_item_id] = 1;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \\\"Accept\\\")\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->body(json_encode(\'OK\'))\\r\\n\\t\\t->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->sendHeaders()\\r\\n\\t\\t->showBody();\\r\\n\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n\\/\\/ Viewed items\\r\\nif ($Shop_Controller_Show->item && $Shop_Controller_Show->viewed)\\r\\n{\\r\\n\\t$Shop_Controller_Show->addIntoViewed();\\r\\n}\\r\\n\\r\\nif (!is_null(Core_Array::getGet(\'vote\')))\\r\\n{\\r\\n\\t$oSiteuser = Core_Entity::factory(\'Siteuser\')->getCurrent();\\r\\n\\t$entity_id = intval(Core_Array::getGet(\'id\'));\\r\\n\\r\\n\\tif ($entity_id && !is_null($oSiteuser))\\r\\n\\t{\\r\\n\\t\\t$entity_type = strval(Core_Array::getGet(\'entity_type\'));\\r\\n\\t\\t$vote = intval(Core_Array::getGet(\'vote\'));\\r\\n\\r\\n\\t\\t$oObject = Vote_Controller::instance()->getVotedObject($entity_type, $entity_id);\\r\\n\\r\\n\\t\\tif (!is_null($oObject))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oVote = $oObject->Votes->getBySiteuser_Id($oSiteuser->id);\\r\\n\\r\\n\\t\\t\\t$vote_value = $vote ? 1 : -1;\\r\\n\\r\\n\\t\\t\\t$deleteVote = 0;\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435\\r\\n\\t\\t\\tif (is_null($oVote))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote = Core_Entity::factory(\'Vote\');\\r\\n\\t\\t\\t\\t$oVote->siteuser_id = $oSiteuser->id;\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\r\\n\\t\\t\\t\\t$oObject->add($oVote);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043d\\u043e \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u043f\\u0440\\u043e\\u0442\\u0438\\u0432\\u043e\\u043f\\u043e\\u043b\\u043e\\u0436\\u043d\\u0443\\u044e \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443\\r\\n\\t\\t\\telseif ($oVote->value != $vote_value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$oVote->value = $vote_value;\\r\\n\\t\\t\\t\\t$oVote->save();\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u0442\\u0435\\u043b\\u044c \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b \\u0440\\u0430\\u043d\\u0435\\u0435 \\u0438 \\u043f\\u043e\\u0441\\u0442\\u0430\\u0432\\u0438\\u043b \\u0442\\u0430\\u043a\\u0443\\u044e \\u0436\\u0435 \\u043e\\u0446\\u0435\\u043d\\u043a\\u0443 \\u043a\\u0430\\u043a \\u0438 \\u0440\\u0430\\u043d\\u0435\\u0435, \\u043e\\u0431\\u043d\\u0443\\u043b\\u044f\\u0435\\u043c \\u0435\\u0433\\u043e \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435, \\u043a\\u0430\\u043a \\u0431\\u0443\\u0434\\u0442\\u043e \\u043e\\u043d \\u0432\\u043e\\u043e\\u0431\\u0449\\u0435 \\u043d\\u0435 \\u0433\\u043e\\u043b\\u043e\\u0441\\u043e\\u0432\\u0430\\u043b\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$deleteVote = 1;\\r\\n\\t\\t\\t\\t$oVote->delete();\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$aVotingStatistic = Vote_Controller::instance()->getRate($entity_type, $entity_id);\\r\\n\\r\\n\\t\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->body(\\r\\n\\t\\t\\t\\tjson_encode(array(\'value\' => $oVote->value, \'item\' => $oObject->id, \'entity_type\' => $entity_type,\\r\\n\\t\\t\\t\\t\\t\'likes\' => $aVotingStatistic[\'likes\'], \'dislikes\' => $aVotingStatistic[\'dislikes\'],\\r\\n\\t\\t\\t\\t\\t\'rate\' => $aVotingStatistic[\'rate\'], \'delete_vote\' => $deleteVote)\\r\\n\\t\\t\\t\\t)\\r\\n\\t\\t\\t);\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Page::instance()->response\\r\\n\\t\\t->status(200)\\r\\n\\t\\t->header(\'Pragma\', \\\"no-cache\\\")\\r\\n\\t\\t->header(\'Cache-Control\', \\\"private, no-cache\\\")\\r\\n\\t\\t->header(\'Vary\', \'Accept\')\\r\\n\\t\\t->header(\'Last-Modified\', gmdate(\'D, d M Y H:i:s\', time()) . \' GMT\')\\r\\n\\t\\t->header(\'X-Powered-By\', \'HostCMS\')\\r\\n\\t\\t->header(\'Content-Disposition\', \'inline; filename=\\\"files.json\\\"\');\\r\\n\\r\\n\\tif (strpos(Core_Array::get($_SERVER, \'HTTP_ACCEPT\', \'\'), \'application\\/json\') !== FALSE)\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response->header(\'Content-type\', \'application\\/json; charset=utf-8\');\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->header(\'X-Content-Type-Options\', \'nosniff\')\\r\\n\\t\\t\\t->header(\'Content-type\', \'text\\/plain; charset=utf-8\');\\r\\n\\t}\\r\\n\\r\\n\\tif(Core_Array::getRequest(\'_\'))\\r\\n\\t{\\r\\n\\t\\tCore_Page::instance()->response\\r\\n\\t\\t\\t->sendHeaders()\\r\\n\\t\\t\\t->showBody();\\r\\n\\t\\texit();\\r\\n\\t}\\r\\n}\\r\\n\\r\\nCore_Page::instance()->object = $Shop_Controller_Show;\\r\\n\\r\\n\\r\\n\\t\\r\\n}\",\"user_id\":\"19\"}','2021-04-07 17:53:01',20,0),(1760,'xsl',248,'{\"name\":\"\\u041c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u041a\\u0430\\u0442\\u0430\\u043b\\u043e\\u0433\\u0422\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432\\u041d\",\"xsl_dir_id\":\"24\",\"description\":\"\",\"xsl\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\r\\n<!DOCTYPE xsl:stylesheet>\\r\\n<xsl:stylesheet version=\\\"1.0\\\"\\r\\n\\txmlns:xsl=\\\"http:\\/\\/www.w3.org\\/1999\\/XSL\\/Transform\\\"\\r\\n\\txmlns:hostcms=\\\"http:\\/\\/www.hostcms.ru\\/\\\"\\r\\n\\texclude-result-prefixes=\\\"hostcms\\\">\\r\\n\\t<xsl:output xmlns=\\\"http:\\/\\/www.w3.org\\/TR\\/xhtml1\\/strict\\\" doctype-public=\\\"-\\/\\/W3C\\/\\/DTD XHTML 1.0 Strict\\/\\/EN\\\" encoding=\\\"utf-8\\\" indent=\\\"yes\\\" method=\\\"html\\\" omit-xml-declaration=\\\"no\\\" version=\\\"1.0\\\" media-type=\\\"text\\/xml\\\"\\/>\\r\\n\\t\\r\\n\\t<xsl:decimal-format name=\\\"my\\\" decimal-separator=\\\",\\\" grouping-separator=\\\" \\\"\\/>\\r\\n\\t\\r\\n\\t<xsl:template match=\\\"\\/\\\">\\r\\n\\t\\t<xsl:apply-templates select=\\\"\\/shop\\\"\\/>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<xsl:variable name=\\\"n\\\" select=\\\"number(3)\\\"\\/>\\r\\n\\t\\r\\n\\t<xsl:template match=\\\"\\/shop\\\">\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c ID \\u0440\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044c\\u0441\\u043a\\u043e\\u0439 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u0438 \\u0437\\u0430\\u043f\\u0438\\u0441\\u044b\\u0432\\u0430\\u0435\\u043c \\u0432 \\u043f\\u0435\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0443\\u044e $group -->\\r\\n\\t\\t<xsl:variable name=\\\"group\\\" select=\\\"group\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:choose>\\r\\n\\t\\t\\t<xsl:when test=\\\"$group = 0\\\">\\r\\n\\t\\t\\t\\t<h1 hostcms:id=\\\"{@id}\\\" hostcms:field=\\\"name\\\" hostcms:entity=\\\"shop\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of select=\\\"name\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/h1>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442\\u0441\\u044f \\u043f\\u0440\\u0438 \\u043e\\u0442\\u0441\\u0443\\u0442\\u0441\\u0442\\u0432\\u0438\\u0438 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0430\\u0446\\u0438\\u0438 \\u043f\\u043e \\u0442\\u044d\\u0433\\u0430\\u043c -->\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"count(tag) = 0 and page = 0 and description != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t<div hostcms:id=\\\"{@id}\\\" hostcms:field=\\\"description\\\" hostcms:entity=\\\"shop\\\" hostcms:type=\\\"wysiwyg\\\" class=\\\"group_description\\\"><xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"description\\\"\\/><\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t<xsl:otherwise>\\r\\n\\t\\t\\t\\t<!-- \\u041f\\u0443\\u0442\\u044c \\u043a \\u0433\\u0440\\u0443\\u043f\\u043f\\u0435 -->\\r\\n\\t\\t\\t\\t<div id=\\\"path\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\".\\/\\/shop_group[@id=$group]\\\" mode=\\\"breadCrumbs\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<h1 hostcms:id=\\\"{$group}\\\" hostcms:field=\\\"name\\\" hostcms:entity=\\\"shop_group\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of select=\\\".\\/\\/shop_group[@id=$group]\\/name\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/h1>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0442\\u043e\\u043b\\u044c\\u043a\\u043e \\u043d\\u0430 \\u043f\\u0435\\u0440\\u0432\\u043e\\u0439 \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0435 -->\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"page = 0 and .\\/\\/shop_group[@id=$group]\\/description != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t<div hostcms:id=\\\"{$group}\\\" hostcms:field=\\\"description\\\" hostcms:entity=\\\"shop_group\\\" hostcms:type=\\\"wysiwyg\\\" class=\\\"group_description\\\" ><xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\".\\/\\/shop_group[@id=$group]\\/description\\\"\\/><\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t<\\/xsl:otherwise>\\r\\n\\t\\t<\\/xsl:choose>\\r\\n\\t\\t<xsl:if test=\\\".\\/\\/shop_group[@id=$group]\\/property_value[property_id = 61]\\/value = 1\\\">\\r\\n\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0435\\u043d\\u0438\\u0435 \\u043a\\u043e\\u043b\\u043b\\u0435\\u043a\\u0446\\u0438\\u0439-->\\r\\n\\t\\t\\t<xsl:if test=\\\"count(tag) = 0 and count(shop_producer) = 0 and count(\\/\\/shop_group[parent_id=$group]) &gt; 0\\\">\\r\\n\\t\\t\\t\\t<div class=\\\"collection-block\\\">\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\".\\/\\/shop_group[parent_id=$group]\\\" mode=\\\"collect\\\" \\/>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\\"collection-caddy\\\">\\r\\n\\t\\t\\t\\t\\t<div style=\\\"clear:both;\\\"><\\/div>\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t<!-- \\u041e\\u0431\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 \\u0432\\u044b\\u0431\\u0440\\u0430\\u043d\\u043d\\u044b\\u0445 \\u0442\\u044d\\u0433\\u043e\\u0432 -->\\r\\n\\t\\t<xsl:if test=\\\"count(tag)\\\">\\r\\n\\t\\t<p class=\\\"h2\\\">\\u041c\\u0435\\u0442\\u043a\\u0430 \\u2014 <strong><xsl:value-of select=\\\"tag\\/name\\\"\\/><\\/strong>.<\\/p>\\r\\n\\t\\t\\t<xsl:if test=\\\"tag\\/description != \'\'\\\">\\r\\n\\t\\t\\t\\t<p><xsl:value-of select=\\\"tag\\/description\\\" disable-output-escaping=\\\"yes\\\" \\/><\\/p>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:variable name=\\\"count\\\">1<\\/xsl:variable>\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0435\\u043d\\u0438\\u0435 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f \\u0434\\u0430\\u043d\\u043d\\u043e\\u0439 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b, \\u0442\\u043e\\u043b\\u044c\\u043a\\u043e \\u0435\\u0441\\u043b\\u0438 \\u043f\\u043e\\u0434\\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u0435\\u0441\\u0442\\u044c \\u0438 \\u043d\\u0435 \\u0438\\u0434\\u0435\\u0442 \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0430 \\u043f\\u043e \\u043c\\u0435\\u0442\\u043a\\u0430\\u043c -->\\r\\n\\t\\t<xsl:if test=\\\"count(tag) = 0 and count(shop_producer) = 0 and count(\\/\\/shop_group[parent_id=$group]) &gt; 0\\\">\\r\\n\\t\\t\\t<div id=\\\"cat_group_holder\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"not(\\/\\/shop_group[@id=$group]\\/property_value[property_id = 61]\\/value) or .\\/\\/shop_group[@id=$group]\\/property_value[property_id = 61]\\/value != 1\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\".\\/\\/shop_group[parent_id=$group][position() mod $n = 1]\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:if test=\\\"count(shop_item) &gt; 0 or \\/shop\\/filter = 1\\\">\\r\\n\\t\\t\\t<!-- \\u0434\\u043e\\u043f\\u043e\\u043b\\u043d\\u0435\\u043d\\u0438\\u0435 \\u043f\\u0443\\u0442\\u0438 \\u0434\\u043b\\u044f action, \\u0435\\u0441\\u043b\\u0438 \\u0432\\u044b\\u0431\\u0440\\u0430\\u043d\\u0430 \\u043c\\u0435\\u0442\\u043a\\u0430 -->\\r\\n\\t\\t<xsl:variable name=\\\"form_tag_url\\\"><xsl:if test=\\\"count(tag) = 1\\\">tag\\/<xsl:value-of select=\\\"tag\\/urlencode\\\"\\/>\\/<\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<xsl:variable name=\\\"path\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t\\t<xsl:when test=\\\"\\/shop\\/\\/shop_group[@id=$group]\\/node()\\\"><xsl:value-of select=\\\"\\/shop\\/\\/shop_group[@id=$group]\\/url\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t<xsl:otherwise><xsl:value-of select=\\\"\\/shop\\/url\\\"\\/><\\/xsl:otherwise>\\r\\n\\t\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<form method=\\\"get\\\" action=\\\"{$path}{$form_tag_url}\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"1=0\\\">\\r\\n\\t\\t\\t\\t\\t<div class=\\\"shop_filter\\\">\\r\\n\\t\\t\\t\\t\\t\\t<div class=\\\"sorting\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<select name=\\\"sorting\\\" onchange=\\\"$(this).parents(\'form:first\').submit()\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<option>\\u0421\\u043e\\u0440\\u0442\\u0438\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c<\\/option>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<option value=\\\"1\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/sorting = 1\\\"><xsl:attribute name=\\\"selected\\\">selected<\\/xsl:attribute><\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\u041f\\u043e \\u0446\\u0435\\u043d\\u0435 (\\u0441\\u043d\\u0430\\u0447\\u0430\\u043b\\u0430 \\u0434\\u0435\\u0448\\u0435\\u0432\\u044b\\u0435)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/option>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<option value=\\\"2\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/sorting = 2\\\"><xsl:attribute name=\\\"selected\\\">selected<\\/xsl:attribute><\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\u041f\\u043e \\u0446\\u0435\\u043d\\u0435 (\\u0441\\u043d\\u0430\\u0447\\u0430\\u043b\\u0430 \\u0434\\u043e\\u0440\\u043e\\u0433\\u0438\\u0435)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/option>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<option value=\\\"3\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/sorting = 3\\\"><xsl:attribute name=\\\"selected\\\">selected<\\/xsl:attribute><\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\u041f\\u043e \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u044e\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/option>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/select>\\r\\n\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t<div class=\\\"priceFilter\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:text>\\u0426\\u0435\\u043d\\u0430 \\u043e\\u0442: <\\/xsl:text>\\r\\n\\t\\t\\t\\t\\t\\t\\t<input name=\\\"price_from\\\" size=\\\"5\\\" type=\\\"text\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/price_from != 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:attribute name=\\\"value\\\"><xsl:value-of select=\\\"\\/shop\\/price_from\\\"\\/><\\/xsl:attribute>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/input>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:text>\\u0434\\u043e: <\\/xsl:text>\\r\\n\\t\\t\\t\\t\\t\\t\\t<input name=\\\"price_to\\\" size=\\\"5\\\" type=\\\"text\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/price_to != 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:attribute name=\\\"value\\\"><xsl:value-of select=\\\"\\/shop\\/price_to\\\"\\/><\\/xsl:attribute>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/input>\\r\\n\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t<!-- \\u0424\\u0438\\u043b\\u044c\\u0442\\u0440 \\u043f\\u043e \\u0434\\u043e\\u043f\\u043e\\u043b\\u043d\\u0438\\u0442\\u0435\\u043b\\u044c\\u043d\\u044b\\u043c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430\\u043c \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430: -->\\r\\n\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"count(shop_item_properties\\/\\/property[filter != 0 and (type = 0 or type = 1 or type = 3 or type = 7 or type = 11)])\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<span class=\\\"table_row\\\"><\\/span>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"shop_item_properties\\/\\/property[filter != 0 and (type = 0 or type = 1 or type = 3 or type = 7 or type = 11)]\\\" mode=\\\"propertyList\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t<input name=\\\"filter\\\" class=\\\"button\\\" value=\\\"\\u041f\\u0440\\u0438\\u043c\\u0435\\u043d\\u0438\\u0442\\u044c\\\" type=\\\"submit\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t<!-- \\u0422\\u0430\\u0431\\u043b\\u0438\\u0446\\u0430 \\u0441 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u0430\\u043c\\u0438 \\u0434\\u043b\\u044f \\u0441\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u044f -->\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"count(\\/shop\\/compare_items\\/compare_item) &gt; 0\\\">\\r\\n\\t\\t\\t\\t\\t<table cellpadding=\\\"5px\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\r\\n\\t\\t\\t\\t\\t\\t<tr>\\r\\n\\t\\t\\t\\t\\t\\t\\t<td>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<input type=\\\"checkbox\\\" onclick=\\\"SelectAllItemsByPrefix(this.checked, \'del_compare_id_\')\\\" \\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/td>\\r\\n\\t\\t\\t\\t\\t\\t\\t<td>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<b>\\u0421\\u0440\\u0430\\u0432\\u043d\\u0438\\u0432\\u0430\\u0435\\u043c\\u044b\\u0435 \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u044b<\\/b>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/td>\\r\\n\\t\\t\\t\\t\\t\\t<\\/tr>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"compare_items\\/compare_item\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/table>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<!-- <div class=\\\"nofloat\\\" style=\\\"height: 47px; padding: 5px 0;\\\">\\r\\n\\t\\t\\t\\t\\t\\t<div class=\\\"gray_button left\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<div>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<input name=\\\"apply_compare\\\" value=\\\"\\u0421\\u0440\\u0430\\u0432\\u043d\\u0438\\u0442\\u044c\\\" type=\\\"button\\\" onclick=\\\"javascript:location=\'{\\/shop\\/url}compare_items\\/\';\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t<div class=\\\"gray_button right\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<div>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<input name=\\\"delete_compare\\\" value=\\\"\\u0423\\u0434\\u0430\\u043b\\u0438\\u0442\\u044c\\\" type=\\\"submit\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t<\\/div> -->\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<div class=\\\"shop_block\\\">\\r\\n\\t\\t\\t\\t\\t<div class=\\\"shop_table\\\">\\r\\n\\t\\t\\t\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430 -->\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"shop_item[shortcut_id = 0]\\\" \\/>\\r\\n\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<p class=\\\"button\\\" id=\\\"compareButton\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:if test=\\\"count(\\/shop\\/comparing\\/shop_item) = 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:attribute name=\\\"style\\\">display: none<\\/xsl:attribute>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t<a href=\\\"{\\/shop\\/url}compare_items\\/\\\">\\u0421\\u0440\\u0430\\u0432\\u043d\\u0438\\u0442\\u044c \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b<\\/a>\\r\\n\\t\\t\\t\\t<\\/p>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"total &gt; 0 and limit &gt; 0\\\">\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"count_pages\\\" select=\\\"ceiling(total div limit)\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"visible_pages\\\" select=\\\"5\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"real_visible_pages\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"$count_pages &lt; $visible_pages\\\"><xsl:value-of select=\\\"$count_pages\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:otherwise><xsl:value-of select=\\\"$visible_pages\\\"\\/><\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<!-- \\u0421\\u0447\\u0438\\u0442\\u0430\\u0435\\u043c \\u043a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c\\u044b\\u0445 \\u0441\\u0441\\u044b\\u043b\\u043e\\u043a \\u043f\\u0435\\u0440\\u0435\\u0434 \\u0442\\u0435\\u043a\\u0443\\u0449\\u0438\\u043c \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u043e\\u043c -->\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"pre_count_page\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"page - (floor($real_visible_pages div 2)) &lt; 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"page\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"($count_pages - page - 1) &lt; floor($real_visible_pages div 2)\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$real_visible_pages - ($count_pages - page - 1) - 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"round($real_visible_pages div 2) = $real_visible_pages div 2\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"floor($real_visible_pages div 2) - 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"floor($real_visible_pages div 2)\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<\\/xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<!-- \\u0421\\u0447\\u0438\\u0442\\u0430\\u0435\\u043c \\u043a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c\\u044b\\u0445 \\u0441\\u0441\\u044b\\u043b\\u043e\\u043a \\u043f\\u043e\\u0441\\u043b\\u0435 \\u0442\\u0435\\u043a\\u0443\\u0449\\u0435\\u0433\\u043e \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u0430 -->\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"post_count_page\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"0 &gt; page - (floor($real_visible_pages div 2) - 1)\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$real_visible_pages - page - 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"($count_pages - page - 1) &lt; floor($real_visible_pages div 2)\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$real_visible_pages - $pre_count_page - 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$real_visible_pages - $pre_count_page - 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<xsl:variable name=\\\"i\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"page + 1 = $count_pages\\\"><xsl:value-of select=\\\"page - $real_visible_pages + 1\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"page - $pre_count_page &gt; 0\\\"><xsl:value-of select=\\\"page - $pre_count_page\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:otherwise>0<\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<p>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:call-template name=\\\"for\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"limit\\\" select=\\\"limit\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"page\\\" select=\\\"page\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"items_count\\\" select=\\\"total\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"i\\\" select=\\\"$i\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"post_count_page\\\" select=\\\"$post_count_page\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"pre_count_page\\\" select=\\\"$pre_count_page\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:with-param name=\\\"visible_pages\\\" select=\\\"$real_visible_pages\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:call-template>\\r\\n\\t\\t\\t\\t\\t<\\/p>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!--<p style=\\\"float:right; margin: 0 40px 0 0\\\">\\u041f\\u043e\\u043a\\u0430\\u0437\\u0430\\u0442\\u044c \\u043f\\u043e:\\r\\n\\t\\t\\t\\t<a href=\\\"{$path}?on_page=20\\\">20<\\/a><xsl:text> <\\/xsl:text>\\r\\n\\t\\t\\t\\t<a href=\\\"{$path}?on_page=50\\\">50<\\/a><xsl:text> <\\/xsl:text>\\r\\n\\t\\t\\t\\t\\t<a href=\\\"{$path}?on_page=100\\\">100<\\/a>\\r\\n\\t\\t\\t\\t<\\/p> -->\\r\\n\\t\\t\\t\\t<div style=\\\"clear: both\\\"><\\/div>\\r\\n\\t\\t\\t<\\/form>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u0415\\u0441\\u0442\\u044c \\u0438\\u0437\\u0431\\u0440\\u0430\\u043d\\u043d\\u044b\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b -->\\r\\n\\t\\t<xsl:if test=\\\"favorite\\/shop_item\\\">\\r\\n\\t\\t\\t<p class=\\\"h1 red\\\">\\u041c\\u043e\\u0438 \\u0438\\u0437\\u0431\\u0440\\u0430\\u043d\\u043d\\u044b\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b<\\/p>\\r\\n\\t\\t\\t<div class=\\\"shop_block\\\">\\r\\n\\t\\t\\t\\t<div class=\\\"shop_table\\\">\\r\\n\\t\\t\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0442\\u043e\\u0432\\u0430\\u0440\\u044b \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430 -->\\r\\n\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"favorite\\/shop_item[position() &lt; 4]\\\" \\/>\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u0415\\u0441\\u0442\\u044c \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438-->\\r\\n\\t\\t<xsl:if test=\\\"count(producers\\/shop_producer) > 0\\\">\\r\\n\\t\\t\\t<div style=\\\"margin-top: 40px\\\">\\r\\n\\t\\t\\t\\t<h1>\\u041f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0438<\\/h1>\\r\\n\\t\\t\\t\\t<xsl:apply-templates select=\\\"producers\\/shop_producer\\\"\\/>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 -->\\r\\n\\t<xsl:template match=\\\"shop_item\\\">\\r\\n\\t\\t<div class=\\\"item_in_list_holder shop-item\\\"  data-collection=\\\"{shop_group_id}\\\" data-collitem=\\\"{@id}\\\">\\r\\n\\t\\t\\t<div class=\\\"cat_item_title\\\">\\r\\n\\t\\t\\t\\t<a href=\\\"{url}\\\" class=\\\"cat_title\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"name\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/a>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<div class=\\\"item_small_img_holder\\\">\\r\\n\\t\\t\\t\\t<a href=\\\"{url}\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:choose>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:when test=\\\"image_small != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<img src=\\\"{dir}{image_small}\\\" alt=\\\"{name}\\\" title=\\\"{name}\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t\\t\\t<img src=\\\"\\/images\\/no-image.png\\\" alt=\\\"{name}\\\" title=\\\"{name}\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:otherwise>\\r\\n\\t\\t\\t\\t\\t<\\/xsl:choose>\\r\\n\\t\\t\\t\\t<\\/a>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<div class=\\\"item_desc_holder\\\">\\r\\n\\t\\t\\t\\t<!-- \\u0410\\u0440\\u0442\\u0438\\u043a\\u0443\\u043b -->\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"marking != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t<p>\\u0410\\u0440\\u0442\\u0438\\u043a\\u0443\\u043b:\\r\\n\\t\\t\\t\\t\\t\\t<b>\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"marking\\\"\\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/b>\\r\\n\\t\\t\\t\\t\\t<\\/p>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 -->\\r\\n\\t\\t\\t\\t<p>\\r\\n\\t\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"description\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/p>\\r\\n\\t\\t\\t\\t<a href=\\\"{url}\\\">\\u041f\\u043e\\u0434\\u0440\\u043e\\u0431\\u043d\\u0435\\u0435...<\\/a>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!-- \\u0422\\u044d\\u0433\\u0438 \\u0434\\u043b\\u044f \\u0438\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u043e\\u043d\\u043d\\u043e\\u0433\\u043e \\u044d\\u043b\\u0435\\u043c\\u0435\\u043d\\u0442\\u0430 -->\\r\\n\\t\\t\\t\\t<div class=\\\"item_tags\\\">\\r\\n\\t\\t\\t\\t\\t<p>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"count(tag) &gt; 0\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<img src=\\\"\\/hostcmsfiles\\/images\\/tags.gif\\\" \\/><span><xsl:apply-templates select=\\\"tag\\\"\\/><\\/span>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t<\\/p>\\r\\n\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t<div class=\\\"cat_item_price_holder\\\"><div class=\\\"cat_item_price\\\"><xsl:value-of select=\\\"format-number(price, \'### ##0,00\', \'my\')\\\"\\/><xsl:text> <\\/xsl:text><xsl:value-of select=\\\"currency\\\"\\/><xsl:text> <\\/xsl:text><br \\/><\\/div>\\r\\n\\t\\t\\t\\t\\t<div class=\\\"cat_add_into_cart_form\\\">\\r\\n\\t\\t\\t\\t\\t\\t<div class=\\\"form-quant\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\u0423\\u043a\\u0430\\u0436\\u0438\\u0442\\u0435 \\u043a\\u043e\\u043b\\u0438\\u0447\\u0435\\u0441\\u0442\\u0432\\u043e:<input type=\\\"text\\\" name=\\\"quantity\\\" value=\\\"1\\\" size=\\\"2\\\" id=\\\"quantity_{@id}\\\" class=\\\"form-control\\\" \\/>\\r\\n\\t\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t\\t\\t<a href=\\\"\\/cart\\/?add={@id}\\\" onclick=\\\"return $.bootstrapAddIntoCart(\'\\/cart\\/\', {@id}, $(\'#quantity_{@id}\').val())\\\" class=\\\"button2 white medium\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t<img alt=\\\"\\u041a\\u0443\\u043f\\u0438\\u0442\\u044c\\\" title=\\\"\\u041a\\u0443\\u043f\\u0438\\u0442\\u044c\\\" src=\\\"\\/images\\/shopnew\\/cart_buy_button.png\\\" \\/><\\/a><\\/div><\\/div>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<div class=\\\"clr\\\"><\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<xsl:template match=\\\"tag\\\">\\r\\n\\t\\t<a href=\\\"{\\/shop\\/url}tag\\/{urlencode}\\/\\\" class=\\\"tag\\\" id=\\\"{name}\\\">\\r\\n\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"name\\\"\\/>\\r\\n\\t\\t<\\/a>\\r\\n\\t<xsl:if test=\\\"position() != last()\\\"><xsl:text>, <\\/xsl:text><\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 -->\\r\\n\\t<xsl:template match=\\\"shop_group\\\">\\r\\n\\t\\t\\r\\n\\t\\t<xsl:for-each select=\\\". | following-sibling::shop_group[position() &lt; $n]\\\">\\r\\n\\t\\t\\t<div class=\\\"item_group_holder\\\">\\r\\n\\t\\t\\t\\t<!-- <xsl:if test=\\\"image_small!=\'\'\\\">\\r\\n\\t\\t\\t\\t\\t<a href=\\\"{url}\\\" target=\\\"_blank\\\"><img src=\\\"{dir}{image_small}\\\" align=\\\"middle\\\"\\/><\\/a>\\r\\n\\t\\t\\t\\t<xsl:text> <\\/xsl:text><\\/xsl:if> -->\\r\\n\\t\\t\\t\\t<a href=\\\"{url}\\\" hostcms:id=\\\"{@id}\\\" hostcms:field=\\\"name\\\" hostcms:entity=\\\"shop_group\\\" class=\\\"item_group_link\\\"><xsl:value-of select=\\\"name\\\"\\/><\\/a>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/xsl:for-each>\\r\\n\\t\\t\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0433\\u0440\\u0443\\u043f\\u043f \\u043a\\u043e\\u043b\\u043b\\u0435\\u043a\\u0446\\u0438\\u0438 -->\\r\\n\\t<xsl:template match=\\\"shop_group\\\" mode=\\\"collect\\\">\\r\\n\\t\\t<xsl:variable name=\\\"group_id\\\" select=\\\"@id\\\" \\/>\\r\\n\\t\\t\\r\\n\\t\\t<div class=\\\"collection-item\\\" data-collection=\\\"{@id}\\\">\\r\\n\\t\\t\\t<div class=\\\"collection-item-block\\\">\\r\\n\\t\\t\\t\\t<img src=\\\"{dir}{image_large}\\\" class=\\\"collection-image\\\" \\/>\\r\\n\\t\\t\\t\\t<span class=\\\"collection-name\\\"><xsl:value-of select=\\\"name\\\"\\/><\\/span>\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"description !=\'\'\\\">\\r\\n\\t\\t\\t\\t\\t<div class=\\\"desc\\\"><xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"description\\\"\\/><\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t<div class=\\\"collection-items\\\">\\r\\n\\t\\t\\t\\t<xsl:apply-templates select=\\\"\\/\\/shop_item[shop_group_id = $group_id]\\\" mode=\\\"collect_item\\\"\\/>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 \\u043a\\u043e\\u043b\\u043b\\u0435\\u043a\\u0446\\u0438\\u0438 -->\\r\\n\\t<xsl:template match=\\\"shop_item\\\" mode=\\\"collect_item\\\">\\r\\n\\t\\t<div class=\\\"collection-items-item\\\" data-collection=\\\"{shop_group_id}\\\" data-collitem=\\\"{@id}\\\">\\r\\n\\t\\t\\t<img src=\\\"{dir}{property_value[property_id = 62]\\/file}\\\" \\/>\\r\\n\\t\\t\\t<span class=\\\"collection-items-item-name\\\"><xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"property_value[property_id = 62]\\/file_description\\\"\\/><\\/span>\\r\\n\\t\\t\\t\\r\\n\\t\\t<\\/div>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0432\\u044b\\u0432\\u043e\\u0434\\u0438\\u0442 \\u0440\\u0435\\u043a\\u0443\\u0440\\u0441\\u0438\\u0432\\u043d\\u043e \\u0441\\u0441\\u044b\\u043b\\u043a\\u0438 \\u043d\\u0430 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u043c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d\\u0430 -->\\r\\n\\t<xsl:template match=\\\"shop_group\\\" mode=\\\"breadCrumbs\\\">\\r\\n\\t\\t<xsl:param name=\\\"parent_id\\\" select=\\\"parent_id\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u041f\\u043e\\u043b\\u0443\\u0447\\u0430\\u0435\\u043c ID \\u0440\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u044c\\u0441\\u043a\\u043e\\u0439 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b \\u0438 \\u0437\\u0430\\u043f\\u0438\\u0441\\u044b\\u0432\\u0430\\u0435\\u043c \\u0432 \\u043f\\u0435\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0443\\u044e $group -->\\r\\n\\t\\t<xsl:param name=\\\"group\\\" select=\\\"\\/shop\\/shop_group\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:apply-templates select=\\\"\\/\\/shop_group[@id=$parent_id]\\\" mode=\\\"breadCrumbs\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:if test=\\\"parent_id=0\\\">\\r\\n\\t\\t\\t<a href=\\\"{\\/shop\\/url}\\\" hostcms:id=\\\"{\\/shop\\/@id}\\\" hostcms:field=\\\"name\\\" hostcms:entity=\\\"shop\\\">\\r\\n\\t\\t\\t\\t<xsl:value-of select=\\\"\\/shop\\/name\\\"\\/>\\r\\n\\t\\t\\t<\\/a>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t<span><xsl:text> \\u2192 <\\/xsl:text><\\/span>\\r\\n\\t\\t\\r\\n\\t\\t<a href=\\\"{url}\\\" hostcms:id=\\\"{@id}\\\" hostcms:field=\\\"name\\\" hostcms:entity=\\\"shop_group\\\">\\r\\n\\t\\t\\t<xsl:value-of select=\\\"name\\\"\\/>\\r\\n\\t\\t<\\/a>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0441\\u043f\\u0438\\u0441\\u043a\\u0430 \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 \\u0434\\u043b\\u044f \\u0441\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u044f -->\\r\\n\\t<xsl:template match=\\\"compare_items\\/compare_item\\\">\\r\\n\\t\\t<xsl:variable name=\\\"var_compare_id\\\" select=\\\".\\\"\\/>\\r\\n\\t\\t<tr>\\r\\n\\t\\t\\t<td>\\r\\n\\t\\t\\t\\t<input type=\\\"checkbox\\\" name=\\\"del_compare_id_{compare_item_id}\\\" id=\\\"id_del_compare_id_{compare_item_id}\\\"\\/>\\r\\n\\t\\t\\t<\\/td>\\r\\n\\t\\t\\t<td>\\r\\n\\t\\t\\t\\t<a href=\\\"{\\/shop\\/url}{compare_item_url}{compare_url}\\/\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of select=\\\"compare_name\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/a>\\r\\n\\t\\t\\t<\\/td>\\r\\n\\t\\t<\\/tr>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0430 \\u043f\\u043e \\u0434\\u043e\\u043f\\u043e\\u043b\\u043d\\u0438\\u0442\\u0435\\u043b\\u044c\\u043d\\u044b\\u043c \\u0441\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u0430\\u043c -->\\r\\n\\t<xsl:template match=\\\"property\\\" mode=\\\"propertyList\\\">\\r\\n\\t\\t<xsl:variable name=\\\"nodename\\\">property_<xsl:value-of select=\\\"@id\\\"\\/><\\/xsl:variable>\\r\\n\\t\\t<xsl:variable name=\\\"nodename_from\\\">property_<xsl:value-of select=\\\"@id\\\"\\/>_from<\\/xsl:variable>\\r\\n\\t\\t<xsl:variable name=\\\"nodename_to\\\">property_<xsl:value-of select=\\\"@id\\\"\\/>_to<\\/xsl:variable>\\r\\n\\t\\t\\r\\n\\t\\t<div class=\\\"filterField\\\">\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<xsl:if test=\\\"filter != 5\\\">\\r\\n\\t\\t\\t<legend><xsl:value-of select=\\\"name\\\"\\/><xsl:text> <\\/xsl:text><\\/legend>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<xsl:choose>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u043f\\u043e\\u043b\\u0435 \\u0432\\u0432\\u043e\\u0434\\u0430 -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 1\\\">\\r\\n\\t\\t\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t\\t\\t<input type=\\\"text\\\" name=\\\"property_{@id}\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:attribute name=\\\"value\\\"><xsl:value-of select=\\\"\\/shop\\/*[name()=$nodename]\\\"\\/><\\/xsl:attribute>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t<\\/input>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 2\\\">\\r\\n\\t\\t\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t\\t\\t<select name=\\\"property_{@id}\\\">\\r\\n\\t\\t\\t\\t\\t\\t<option value=\\\"0\\\">...<\\/option>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"list\\/list_item\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/select>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u043f\\u0435\\u0440\\u0435\\u043a\\u043b\\u044e\\u0447\\u0430\\u0442\\u0435\\u043b\\u0438 -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 3\\\">\\r\\n\\t\\t\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t\\t\\t<div class=\\\"propertyInput\\\">\\r\\n\\t\\t\\t\\t\\t\\t<input type=\\\"radio\\\" name=\\\"property_{@id}\\\" value=\\\"0\\\" id=\\\"id_prop_radio_{@id}_0\\\"><\\/input>\\r\\n\\t\\t\\t\\t\\t\\t<label for=\\\"id_prop_radio_{@id}_0\\\">\\u041b\\u044e\\u0431\\u043e\\u0439 \\u0432\\u0430\\u0440\\u0438\\u0430\\u043d\\u0442<\\/label>\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"list\\/list_item\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0444\\u043b\\u0430\\u0436\\u043a\\u0438 -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 4\\\">\\r\\n\\t\\t\\t\\t\\t<div class=\\\"propertyInput\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"list\\/list_item\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0444\\u043b\\u0430\\u0436\\u043e\\u043a -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 5\\\">\\r\\n\\t\\t\\t\\t\\t<input type=\\\"checkbox\\\" name=\\\"property_{@id}\\\" id=\\\"property_{@id}\\\" style=\\\"padding-top:4px\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] != \'\'\\\">\\r\\n\\t\\t\\t\\t\\t\\t\\t<xsl:attribute name=\\\"checked\\\"><xsl:value-of select=\\\"\\/shop\\/*[name()=$nodename]\\\"\\/><\\/xsl:attribute>\\r\\n\\t\\t\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\t<\\/input>\\r\\n\\t\\t\\t\\t\\t<label for=\\\"property_{@id}\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"name\\\"\\/><xsl:text> <\\/xsl:text>\\r\\n\\t\\t\\t\\t\\t<\\/label>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0435\\u043d\\u0438\\u0435 \\u043f\\u043e\\u043b\\u0435\\u0439 \\\"\\u043e\\u0442 \\u0438 \\u0434\\u043e\\\" -->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 6\\\">\\r\\n\\t\\t\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t\\t\\t\\u043e\\u0442: <input type=\\\"text\\\" name=\\\"property_{@id}_from\\\" size=\\\"2\\\" value=\\\"{\\/shop\\/*[name()=$nodename_from]}\\\"\\/> \\u0434\\u043e: <input type=\\\"text\\\" name=\\\"property_{@id}_to\\\" size=\\\"2\\\" value=\\\"{\\/shop\\/*[name()=$nodename_to]}\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a \\u0441 \\u043c\\u043d\\u043e\\u0436\\u0435\\u0441\\u0442\\u0432\\u0435\\u043d\\u043d\\u044b\\u043c \\u0432\\u044b\\u0431\\u043e\\u0440\\u043e\\u043c-->\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"filter = 7\\\">\\r\\n\\t\\t\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t\\t\\t<select name=\\\"property_{@id}[]\\\" multiple=\\\"multiple\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:apply-templates select=\\\"list\\/list_item\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/select>\\r\\n\\t\\t\\t\\t<\\/xsl:when>\\r\\n\\t\\t\\t<\\/xsl:choose>\\r\\n\\t\\t<\\/div>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<xsl:template match=\\\"list\\/list_item\\\">\\r\\n\\t\\t<xsl:if test=\\\"..\\/..\\/filter = 2\\\">\\r\\n\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a -->\\r\\n\\t\\t\\t<xsl:variable name=\\\"nodename\\\">property_<xsl:value-of select=\\\"..\\/..\\/@id\\\"\\/><\\/xsl:variable>\\r\\n\\t\\t\\t<option value=\\\"{@id}\\\">\\r\\n\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] = @id\\\"><xsl:attribute name=\\\"selected\\\">selected<\\/xsl:attribute><\\/xsl:if>\\r\\n\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"value\\\"\\/>\\r\\n\\t\\t\\t<\\/option>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t<xsl:if test=\\\"..\\/..\\/filter = 3\\\">\\r\\n\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u043f\\u0435\\u0440\\u0435\\u043a\\u043b\\u044e\\u0447\\u0430\\u0442\\u0435\\u043b\\u0438 -->\\r\\n\\t\\t\\t<xsl:variable name=\\\"nodename\\\">property_<xsl:value-of select=\\\"..\\/..\\/@id\\\"\\/><\\/xsl:variable>\\r\\n\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t<input type=\\\"radio\\\" name=\\\"property_{..\\/..\\/@id}\\\" value=\\\"{@id}\\\" id=\\\"id_property_{..\\/..\\/@id}_{@id}\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] = @id\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:attribute name=\\\"checked\\\">checked<\\/xsl:attribute>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t<\\/input>\\r\\n\\t\\t\\t<label for=\\\"id_property_{..\\/..\\/@id}_{@id}\\\">\\r\\n\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"value\\\"\\/>\\r\\n\\t\\t\\t<\\/label>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t<xsl:if test=\\\"..\\/..\\/filter = 4\\\">\\r\\n\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0444\\u043b\\u0430\\u0436\\u043a\\u0438 -->\\r\\n\\t\\t\\t<xsl:variable name=\\\"nodename\\\">property_<xsl:value-of select=\\\"..\\/..\\/@id\\\"\\/><\\/xsl:variable>\\r\\n\\t\\t\\t<br\\/>\\r\\n\\t\\t\\t<input type=\\\"checkbox\\\" value=\\\"{@id}\\\" name=\\\"property_{..\\/..\\/@id}[]\\\" id=\\\"property_{..\\/..\\/@id}_{@id}\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] = @id\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:attribute name=\\\"checked\\\">checked<\\/xsl:attribute>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t<label for=\\\"property_{..\\/..\\/@id}_{@id}\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"value\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/label>\\r\\n\\t\\t\\t<\\/input>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t<xsl:if test=\\\"..\\/..\\/filter = 7\\\">\\r\\n\\t\\t\\t<!-- \\u041e\\u0442\\u043e\\u0431\\u0440\\u0430\\u0436\\u0430\\u0435\\u043c \\u0441\\u043f\\u0438\\u0441\\u043e\\u043a -->\\r\\n\\t\\t\\t<xsl:variable name=\\\"nodename\\\">property_<xsl:value-of select=\\\"..\\/..\\/@id\\\"\\/><\\/xsl:variable>\\r\\n\\t\\t\\t<option value=\\\"{@id}\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"\\/shop\\/*[name()=$nodename] = @id\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:attribute name=\\\"selected\\\">\\r\\n\\t\\t\\t\\t\\t<\\/xsl:attribute>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t<xsl:value-of disable-output-escaping=\\\"yes\\\" select=\\\"value\\\"\\/>\\r\\n\\t\\t\\t<\\/option>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u041c\\u0435\\u0442\\u043a\\u0438 \\u0434\\u043b\\u044f \\u0442\\u043e\\u0432\\u0430\\u0440\\u043e\\u0432 -->\\r\\n\\t<!-- <xsl:template match=\\\"tag\\\">\\r\\n\\t\\t<a href=\\\"{\\/shop\\/url}tag\\/{urlencode}\\/\\\" class=\\\"tag\\\">\\r\\n\\t\\t\\t<xsl:value-of select=\\\"tag_name\\\"\\/>\\r\\n\\t\\t<\\/a>\\r\\n\\t<xsl:if test=\\\"position() != last()\\\"><xsl:text>, <\\/xsl:text><\\/xsl:if>\\r\\n\\t<\\/xsl:template> -->\\r\\n\\t\\r\\n\\t<!-- \\u0426\\u0438\\u043a\\u043b \\u0434\\u043b\\u044f \\u0432\\u044b\\u0432\\u043e\\u0434\\u0430 \\u0441\\u0442\\u0440\\u043e\\u043a \\u0441\\u0441\\u044b\\u043b\\u043e\\u043a -->\\r\\n\\t<xsl:template name=\\\"for\\\">\\r\\n\\t\\t\\r\\n\\t\\t<xsl:param name=\\\"limit\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"page\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"pre_count_page\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"post_count_page\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"i\\\" select=\\\"0\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"items_count\\\"\\/>\\r\\n\\t\\t<xsl:param name=\\\"visible_pages\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:variable name=\\\"n\\\" select=\\\"ceiling($items_count div $limit)\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:variable name=\\\"start_page\\\"><xsl:choose>\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"$page + 1 = $n\\\"><xsl:value-of select=\\\"$page - $visible_pages + 1\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t<xsl:when test=\\\"$page - $pre_count_page &gt; 0\\\"><xsl:value-of select=\\\"$page - $pre_count_page\\\"\\/><\\/xsl:when>\\r\\n\\t\\t\\t\\t<xsl:otherwise>0<\\/xsl:otherwise>\\r\\n\\t\\t<\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:if test=\\\"$i = $start_page and $page != 0\\\">\\r\\n\\t\\t\\t<span class=\\\"ctrl\\\">\\r\\n\\t\\t\\t\\t\\u2190 Ctrl\\r\\n\\t\\t\\t<\\/span>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:if test=\\\"$i = ($page + $post_count_page + 1) and $n != ($page+1)\\\">\\r\\n\\t\\t\\t<span class=\\\"ctrl\\\">\\r\\n\\t\\t\\t\\tCtrl \\u2192\\r\\n\\t\\t\\t<\\/span>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u041f\\u0435\\u0440\\u0435\\u0434\\u0430\\u0435\\u043c \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440 -->\\r\\n<xsl:variable name=\\\"filter\\\"><xsl:if test=\\\"\\/shop\\/filter\\/node()\\\">?filter=1&amp;sorting=<xsl:value-of select=\\\"\\/shop\\/sorting\\\"\\/>&amp;price_from=<xsl:value-of select=\\\"\\/shop\\/price_from\\\"\\/>&amp;price_to=<xsl:value-of select=\\\"\\/shop\\/price_to\\\"\\/><xsl:for-each select=\\\"\\/shop\\/*\\\"><xsl:if test=\\\"starts-with(name(), \'property_\')\\\">&amp;<xsl:value-of select=\\\"name()\\\"\\/>[]=<xsl:value-of select=\\\".\\\"\\/><\\/xsl:if><\\/xsl:for-each><\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\r\\n<xsl:variable name=\\\"on_page\\\"><xsl:if test=\\\"\\/shop\\/on_page\\/node() and \\/shop\\/on_page > 0\\\"><xsl:choose><xsl:when test=\\\"\\/shop\\/filter\\/node()\\\">&amp;<\\/xsl:when><xsl:otherwise>?<\\/xsl:otherwise><\\/xsl:choose>on_page=<xsl:value-of select=\\\"\\/shop\\/on_page\\\"\\/><\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\r\\n\\t\\t<xsl:if test=\\\"$items_count &gt; $limit and ($page + $post_count_page + 1) &gt; $i\\\">\\r\\n\\t\\t\\t<!-- \\u0417\\u0430\\u043d\\u043e\\u0441\\u0438\\u043c \\u0432 \\u043f\\u0435\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0443\\u044e $group \\u0438\\u0434\\u0435\\u043d\\u0442\\u0438\\u0444\\u0438\\u043a\\u0430\\u0442\\u043e\\u0440 \\u0442\\u0435\\u043a\\u0443\\u0449\\u0435\\u0439 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b -->\\r\\n\\t\\t\\t<xsl:variable name=\\\"group\\\" select=\\\"\\/shop\\/group\\\"\\/>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u041f\\u0443\\u0442\\u044c \\u0434\\u043b\\u044f \\u0442\\u044d\\u0433\\u0430 -->\\r\\n\\t\\t<xsl:variable name=\\\"tag_path\\\"><xsl:if test=\\\"count(\\/shop\\/tag) != 0\\\">tag\\/<xsl:value-of select=\\\"\\/shop\\/tag\\/urlencode\\\"\\/>\\/<\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u041f\\u0443\\u0442\\u044c \\u0434\\u043b\\u044f \\u0441\\u0440\\u0430\\u0432\\u043d\\u0435\\u043d\\u0438\\u044f \\u0442\\u043e\\u0432\\u0430\\u0440\\u0430 -->\\r\\n\\t\\t<xsl:variable name=\\\"shop_producer_path\\\"><xsl:if test=\\\"count(\\/shop\\/shop_producer)\\\">producer-<xsl:value-of select=\\\"\\/shop\\/shop_producer\\/@id\\\"\\/>\\/<\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u041e\\u043f\\u0440\\u0435\\u0434\\u0435\\u043b\\u044f\\u0435\\u043c \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0434\\u043b\\u044f \\u0444\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f \\u0430\\u0434\\u0440\\u0435\\u0441\\u0430 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0438 -->\\r\\n<xsl:variable name=\\\"group_link\\\"><xsl:choose><xsl:when test=\\\"$group != 0\\\"><xsl:value-of select=\\\"\\/shop\\/\\/shop_group[@id=$group]\\/url\\\"\\/><\\/xsl:when><xsl:otherwise><xsl:value-of select=\\\"\\/shop\\/url\\\"\\/><\\/xsl:otherwise><\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u041e\\u043f\\u0440\\u0435\\u0434\\u0435\\u043b\\u044f\\u0435\\u043c \\u0430\\u0434\\u0440\\u0435\\u0441 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0438 -->\\r\\n\\t\\t<xsl:variable name=\\\"number_link\\\"><xsl:if test=\\\"$i != 0\\\">page-<xsl:value-of select=\\\"$i + 1\\\"\\/>\\/<\\/xsl:if><\\/xsl:variable>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0443 \\u043d\\u0430 \\u043f\\u0435\\u0440\\u0432\\u0443\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443 -->\\r\\n\\t\\t\\t<xsl:if test=\\\"$page - $pre_count_page &gt; 0 and $i = $start_page\\\">\\r\\n\\t\\t\\t\\t<a href=\\\"{$group_link}{$tag_path}{$shop_producer_path}{$filter}{$on_page}\\\" class=\\\"page_link\\\" style=\\\"text-decoration: none;\\\">\\u2190<\\/a>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u0421\\u0442\\u0430\\u0432\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0443 \\u043d\\u0430 \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443-->\\r\\n\\t\\t\\t<xsl:if test=\\\"$i != $page\\\">\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"($page - $pre_count_page) &lt;= $i and $i &lt; $n\\\">\\r\\n\\t\\t\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0438 \\u043d\\u0430 \\u0432\\u0438\\u0434\\u0438\\u043c\\u044b\\u0435 \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u044b -->\\r\\n\\t\\t\\t\\t\\t<a href=\\\"{$group_link}{$number_link}{$tag_path}{$shop_producer_path}{$filter}{$on_page}\\\" class=\\\"page_link\\\">\\r\\n\\t\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$i + 1\\\"\\/>\\r\\n\\t\\t\\t\\t\\t<\\/a>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0443 \\u043d\\u0430 \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u044e\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443 -->\\r\\n\\t\\t\\t\\t<xsl:if test=\\\"$i+1 &gt;= ($page + $post_count_page + 1) and $n &gt; ($page + 1 + $post_count_page)\\\">\\r\\n\\t\\t\\t\\t\\t<!-- \\u0412\\u044b\\u0432\\u043e\\u0434\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0443 \\u043d\\u0430 \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u044e\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443 -->\\r\\n\\t\\t\\t\\t\\t<a href=\\\"{$group_link}page-{$n}\\/{$tag_path}{$shop_producer_path}{$filter}{$on_page}\\\" class=\\\"page_link\\\" style=\\\"text-decoration: none;\\\">\\u2192<\\/a>\\r\\n\\t\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u043d\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0443\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443 \\u0434\\u043b\\u044f Ctrl + \\u0432\\u043b\\u0435\\u0432\\u043e -->\\r\\n<xsl:if test=\\\"$page != 0 and $i = $page\\\"><xsl:variable name=\\\"prev_number_link\\\"><xsl:if test=\\\"$page &gt; 1\\\">page-<xsl:value-of select=\\\"$i\\\"\\/>\\/<\\/xsl:if><\\/xsl:variable><a href=\\\"{$group_link}{$prev_number_link}{$tag_path}{$shop_producer_path}{$filter}{$on_page}\\\" id=\\\"id_prev\\\"><\\/a><\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u0421\\u0441\\u044b\\u043b\\u043a\\u0430 \\u043d\\u0430 \\u0441\\u043b\\u0435\\u0434\\u0443\\u044e\\u0449\\u0443\\u044e \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443 \\u0434\\u043b\\u044f Ctrl + \\u0432\\u043f\\u0440\\u0430\\u0432\\u043e -->\\r\\n\\t\\t\\t<xsl:if test=\\\"($n - 1) > $page and $i = $page\\\">\\r\\n\\t\\t\\t\\t<a href=\\\"{$group_link}page-{$page+2}\\/{$tag_path}{$shop_producer_path}{$filter}{$on_page}\\\" id=\\\"id_next\\\"><\\/a>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u041d\\u0435 \\u0441\\u0442\\u0430\\u0432\\u0438\\u043c \\u0441\\u0441\\u044b\\u043b\\u043a\\u0443 \\u043d\\u0430 \\u0441\\u0442\\u0440\\u0430\\u043d\\u0438\\u0446\\u0443-->\\r\\n\\t\\t\\t<xsl:if test=\\\"$i = $page\\\">\\r\\n\\t\\t\\t\\t<span class=\\\"current\\\">\\r\\n\\t\\t\\t\\t\\t<xsl:value-of select=\\\"$i+1\\\"\\/>\\r\\n\\t\\t\\t\\t<\\/span>\\r\\n\\t\\t\\t<\\/xsl:if>\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t<!-- \\u0420\\u0435\\u043a\\u0443\\u0440\\u0441\\u0438\\u0432\\u043d\\u044b\\u0439 \\u0432\\u044b\\u0437\\u043e\\u0432 \\u0448\\u0430\\u0431\\u043b\\u043e\\u043d\\u0430. \\u041d\\u0415\\u041e\\u0411\\u0425\\u041e\\u0414\\u0418\\u041c\\u041e \\u041f\\u0415\\u0420\\u0415\\u0414\\u0410\\u0412\\u0410\\u0422\\u042c \\u0412\\u0421\\u0415 \\u041d\\u0415\\u041e\\u0411\\u0425\\u041e\\u0414\\u0418\\u041c\\u042b\\u0415 \\u041f\\u0410\\u0420\\u0410\\u041c\\u0415\\u0422\\u0420\\u042b! -->\\r\\n\\t\\t\\t<xsl:call-template name=\\\"for\\\">\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"i\\\" select=\\\"$i + 1\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"limit\\\" select=\\\"$limit\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"page\\\" select=\\\"$page\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"items_count\\\" select=\\\"$items_count\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"pre_count_page\\\" select=\\\"$pre_count_page\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"post_count_page\\\" select=\\\"$post_count_page\\\"\\/>\\r\\n\\t\\t\\t\\t<xsl:with-param name=\\\"visible_pages\\\" select=\\\"$visible_pages\\\"\\/>\\r\\n\\t\\t\\t<\\/xsl:call-template>\\r\\n\\t\\t<\\/xsl:if>\\r\\n\\t<\\/xsl:template>\\r\\n\\t\\r\\n\\t<!-- \\u0428\\u0430\\u0431\\u043b\\u043e\\u043d \\u0434\\u043b\\u044f \\u0444\\u0438\\u043b\\u044c\\u0442\\u0440\\u0430 \\u043f\\u0440\\u043e\\u0438\\u0437\\u0432\\u043e\\u0434\\u0438\\u0442\\u0435\\u043b\\u0435\\u0439 -->\\r\\n\\t<xsl:template match=\\\"producers\\/shop_producer\\\">\\r\\n\\t\\t<!-- \\u0417\\u0430\\u043d\\u043e\\u0441\\u0438\\u043c \\u0432 \\u043f\\u0435\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0443\\u044e $group \\u0438\\u0434\\u0435\\u043d\\u0442\\u0438\\u0444\\u0438\\u043a\\u0430\\u0442\\u043e\\u0440 \\u0442\\u0435\\u043a\\u0443\\u0449\\u0435\\u0439 \\u0433\\u0440\\u0443\\u043f\\u043f\\u044b -->\\r\\n\\t\\t<xsl:variable name=\\\"group\\\" select=\\\"\\/shop\\/group\\\"\\/>\\r\\n\\t\\t\\r\\n\\t\\t<!-- \\u041e\\u043f\\u0440\\u0435\\u0434\\u0435\\u043b\\u044f\\u0435\\u043c \\u0433\\u0440\\u0443\\u043f\\u043f\\u0443 \\u0434\\u043b\\u044f \\u0444\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f \\u0430\\u0434\\u0440\\u0435\\u0441\\u0430 \\u0441\\u0441\\u044b\\u043b\\u043a\\u0438 -->\\r\\n<xsl:variable name=\\\"group_link\\\"><xsl:choose><xsl:when test=\\\"$group != 0\\\"><xsl:value-of select=\\\"\\/shop\\/\\/shop_group[@id=$group]\\/url\\\"\\/><\\/xsl:when><xsl:otherwise><xsl:value-of select=\\\"\\/shop\\/url\\\"\\/><\\/xsl:otherwise><\\/xsl:choose><\\/xsl:variable>\\r\\n\\t\\t\\r\\n\\t\\t<a href=\\\"{$group_link}?producer_id={@id}\\\"><xsl:value-of select=\\\"name\\\"\\/><\\/a>\\r\\n\\t<\\/xsl:template>\\r\\n<\\/xsl:stylesheet>\",\"user_id\":\"19\"}','2021-04-07 17:54:06',20,0),(1708,'shop_order',340,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"20\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"240\",\"source_id\":\"0\",\"name\":\"Test\",\"surname\":\"Latkin\",\"patronymic\":\"\",\"email\":\"latkin.oleh@gmail.com\",\"acceptance_report\":\"340\",\"acceptance_report_datetime\":\"2021-02-19 14:39:58\",\"vat_invoice\":\"340\",\"vat_invoice_datetime\":\"2021-02-19 14:39:58\",\"company\":\"\",\"tin\":\"\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"0\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"26\",\"datetime\":\"2021-02-19 14:39:58\",\"paid\":\"0\",\"posted\":\"0\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0437\\u0430\\u043a\\u0430\\u0437\\u0430\",\"system_information\":\"\\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u043e \\u0437\\u0430\\u043a\\u0430\\u0437\\u0435\",\"canceled\":\"0\",\"user_id\":\"0\",\"invoice\":\"340\",\"status_datetime\":\"2021-02-19 14:39:58\",\"guid\":\"1C9F521B-F366-CB08-7C2A-487796E44C30\",\"delivery_information\":\"\\u041e\\u043f\\u0438\\u0441\\u0430\\u043d\\u0438\\u0435 \\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431 \\u043e\\u0442\\u043f\\u0440\\u0430\\u0432\\u0438\\u0442\\u0435\\u043b\\u0435\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1012\":{\"shop_item_id\":\"42024\",\"shop_order_id\":\"340\",\"name\":\"\\u041a\\u0443\\u0441\\u0430\\u0447\\u043a\\u0438 \\u043f\\u0440\\u043e\\u0444\\u0435\\u0441\\u0441\\u0438\\u043e\\u043d\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u0434\\u043b\\u044f \\u0432\\u0440\\u043e\\u0441\\u0448\\u0435\\u0433\\u043e \\u043d\\u043e\\u0433\\u0442\\u044f Staleks Pro EXPERT NE-61, 16 \\u043c\\u043c\",\"quantity\":\"2.00\",\"price\":\"524.00\",\"marking\":\"0933\",\"rate\":\"0\",\"user_id\":\"0\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"1\"}}}','2021-03-24 15:29:08',25,0),(1737,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"0\",\"posted\":\"0\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:47:49',25,0),(1738,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"0\",\"posted\":\"0\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:48:43',25,0),(1739,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"0\",\"posted\":\"0\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"1\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"0\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:48:56',25,0),(1740,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"0\",\"posted\":\"1\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:49:31',25,0),(1741,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"0\",\"posted\":\"0\",\"payment_datetime\":\"0000-00-00 00:00:00\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"1\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"0\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:49:44',25,0),(1742,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"1\",\"posted\":\"0\",\"payment_datetime\":\"2021-03-26 12:49:44\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:50:43',25,0),(1743,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"1\",\"posted\":\"1\",\"payment_datetime\":\"2021-03-26 12:50:43\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"0\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 12:50:47',25,0),(1744,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"6\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"1\",\"posted\":\"1\",\"payment_datetime\":\"2021-03-26 12:50:47\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 12:46:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 13:01:23',25,0),(1745,'shop_order',343,'{\"shop_id\":\"3\",\"company_id\":\"0\",\"shop_country_location_id\":\"0\",\"shop_country_id\":\"0\",\"shop_country_location_city_id\":\"0\",\"shop_country_location_city_area_id\":\"0\",\"shop_delivery_id\":\"0\",\"shop_delivery_condition_id\":\"0\",\"siteuser_id\":\"140\",\"source_id\":\"0\",\"name\":\"\\u041e\\u043b\\u0435\\u0433\",\"surname\":\"\\u041b\\u0430\\u0442\\u043a\\u0438\\u043d\",\"patronymic\":\"\\u0413\\u0435\\u043d\\u043d\\u0430\\u0434\\u044c\\u0435\\u0432\\u0438\\u0447\",\"email\":\"tempc4@ukr.net\",\"acceptance_report\":\"\",\"acceptance_report_datetime\":\"2021-03-26 12:37:56\",\"vat_invoice\":\"\",\"vat_invoice_datetime\":\"2021-03-26 12:37:56\",\"company\":\"\",\"tin\":\"2473300199\",\"kpp\":\"\",\"fax\":\"\",\"shop_order_status_id\":\"1\",\"shop_currency_id\":\"5\",\"shop_payment_system_id\":\"0\",\"datetime\":\"2021-03-26 12:37:56\",\"paid\":\"1\",\"posted\":\"1\",\"payment_datetime\":\"2021-03-26 12:50:47\",\"address\":\"\",\"house\":\"\",\"flat\":\"\",\"postcode\":\"\",\"phone\":\"+38 (067) 593-96-43\",\"description\":\"\",\"system_information\":\"\",\"canceled\":\"0\",\"user_id\":\"25\",\"invoice\":\"340\",\"status_datetime\":\"2021-03-26 13:01:00\",\"guid\":\"458A0B3A-16F5-47E9-18AF-077D5529ACB0\",\"delivery_information\":\"\",\"ip\":\"127.0.0.1\",\"coupon\":\"\",\"unloaded\":\"1\",\"shop_order_items\":{\"1023\":{\"shop_item_id\":\"40588\",\"shop_order_id\":\"343\",\"name\":\"BLAZE A Monomer - \\u0410\\u043a\\u0440\\u0438\\u043b\\u043e\\u0432\\u044b\\u0439 \\u043c\\u043e\\u043d\\u043e\\u043c\\u0435\\u0440 \\/ \\u043c\\u0430\\u043a\\u0441\\u0438\\u043c\\u0430\\u043b\\u044c\\u043d\\u0430\\u044f \\u0430\\u0434\\u0433\\u0435\\u0437\\u0438\\u044f, 236 \\u043c\\u043b\",\"quantity\":\"1.00\",\"price\":\"479.00\",\"marking\":\"0402\",\"rate\":\"0\",\"user_id\":\"25\",\"hash\":null,\"shop_item_digital_id\":\"0\",\"type\":\"0\",\"shop_warehouse_id\":\"0\"}}}','2021-03-26 13:03:52',25,0),(1746,'lib',36,'{\"name\":\"\\u041e\\u0431\\u043c\\u0435\\u043d \\u0441 1\\u0421:\\u0423\\u043f\\u0440\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0440\\u0433\\u043e\\u0432\\u043b\\u0435\\u0439\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0441 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043e\\u0439 1\\u0421.\",\"lib\":\"\",\"lib_config\":\"<?php\\r\\n@ini_set(\'display_errors\', 1);\\r\\nerror_reporting(E_ALL);\\r\\n@set_time_limit(90000);\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0430\\u044f \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u044f\\r\\n$currentMonth = date(\'n\');\\r\\n$sTemporaryDirectory = TMP_DIR . \'1c_exchange_files\\/\';\\r\\n$sMonthTemporaryDirectory = $sTemporaryDirectory . \'month-\' . $currentMonth . \'\\/\';\\r\\n$sCmsFolderTemporaryDirectory = CMS_FOLDER . $sMonthTemporaryDirectory;\\r\\n\\r\\n\\/\\/ \\u041c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d \\u0434\\u043b\\u044f \\u0432\\u044b\\u0433\\u0440\\u0443\\u0437\\u043a\\u0438\\r\\n$oShop = Core_Entity::factory(\'Shop\')->find(Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\n\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0432\\u044b\\u0433\\u0440\\u0443\\u0436\\u0430\\u0435\\u043c\\u044b\\u0445 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0445 (1000000 = 1 \\u043c\\u0411)\\r\\n$iFileLimit = 1000000;\\r\\n\\r\\n\\/\\/ \\u041b\\u043e\\u0433\\u0438\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043e\\u0431\\u043c\\u0435\\u043d\\r\\n$bDebug = TRUE;\\r\\n\\r\\n\\/\\/ bugfix\\r\\nusleep(10);\\r\\n\\r\\n$BOM = \\\"\\\\xEF\\\\xBB\\\\xBF\\\";\\r\\n\\r\\n\\/\\/ \\u0420\\u0435\\u0448\\u0435\\u043d\\u0438\\u0435 \\u043f\\u0440\\u043e\\u0431\\u043b\\u0435\\u043c\\u044b \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438 \\u043f\\u0440\\u0438 PHP \\u0432 \\u0440\\u0435\\u0436\\u0438\\u043c\\u0435 CGI\\r\\nif (isset($_REQUEST[\'authorization\'])\\r\\n|| (isset($_SERVER[\'argv\'][0])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_USER\'])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_PW\'])))\\r\\n{\\r\\n\\t$authorization_base64 = isset($_REQUEST[\'authorization\'])\\r\\n\\t\\t? $_REQUEST[\'authorization\']\\r\\n\\t\\t: mb_substr($_SERVER[\'argv\'][0], 14);\\r\\n\\r\\n\\t$authorization = base64_decode(mb_substr($authorization_base64, 6));\\r\\n\\t$authorization_explode = explode(\':\', $authorization);\\r\\n\\r\\n\\tif (count($authorization_explode) == 2)\\r\\n\\t{\\r\\n\\t\\tlist($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']) = $authorization_explode;\\r\\n\\t}\\r\\n\\r\\n\\tunset($authorization);\\r\\n}\\r\\n\\r\\nif (!isset($_SERVER[\'PHP_AUTH_USER\']))\\r\\n{\\r\\n\\theader(\'WWW-Authenticate: Basic realm=\\\"HostCMS\\\"\');\\r\\n\\theader(\'HTTP\\/1.0 401 Unauthorized\');\\r\\n\\texit;\\r\\n}\\r\\nelseif (isset($_SERVER[\'PHP_AUTH_USER\']) && isset($_SERVER[\'PHP_AUTH_PW\']))\\r\\n{\\r\\n\\t$answr = Core_Auth::login($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']);\\r\\n\\r\\n\\tCore_Auth::setCurrentSite();\\r\\n\\r\\n\\tif (!Core_Auth::logged())\\r\\n\\t{\\r\\n\\t\\tCore_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$ERROR)\\r\\n\\t\\t\\t\\/\\/->notify(FALSE)\\r\\n\\t\\t\\t->write(Core::_(\'Core.error_log_authorization_error\'));\\r\\n\\t}\\r\\n\\r\\n\\t$oUser = Core_Entity::factory(\'User\')->getByLogin(\\r\\n\\t\\t$_SERVER[\'PHP_AUTH_USER\']\\r\\n\\t);\\r\\n\\r\\n\\tif ($answr !== TRUE || !is_null($oUser) && $oUser->read_only)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u043e\\u0448\\u0438\\u0431\\u043a\\u0430 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043d\\u0435 \\u043f\\u0440\\u043e\\u0439\\u0434\\u0435\\u043d\\u0430\\r\\n\\t\\texit(\'Authentication failed!\');\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n$sType = Core_Array::getGet(\'type\');\\r\\n$sMode = Core_Array::getGet(\'mode\');\\r\\n\\r\\nif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'checkauth\')\\r\\n{\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif ($sType == \'catalog\')\\r\\n\\t{\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0437\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0435 \\u043c\\u0435\\u0441\\u044f\\u0446\\u044b\\r\\n\\t\\tfor ($i = 1; $i <= 12; $i++)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($currentMonth != $i)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$sTmpDir = CMS_FOLDER . $sTemporaryDirectory . \'month-\' . $i;\\r\\n\\r\\n\\t\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043c\\u0435\\u0441\\u044f\\u0446\\u0430 \' . $i);\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u044f\\u0435\\u043c \\u0444\\u0430\\u0439\\u043b\\u044b \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043c\\u0435\\u0441\\u044f\\u0446\\u0430\\r\\n\\t\\t\\t\\tif (is_dir($sTmpDir)\\r\\n\\t\\t\\t\\t\\t&& Core_File::deleteDir($sTmpDir) === FALSE)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\techo \\\"{$BOM}failure\\\\nCan\'t delete temporary folder {$sTmpDir}\\\";\\r\\n\\t\\t\\t\\t\\tdie();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML \\u0444\\u0430\\u0439\\u043b\\u043e\\u0432\\r\\n\\t\\tif (is_dir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML-\\u0444\\u0430\\u0439\\u043b\\u043e\\u0432 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430\');\\r\\n\\r\\n\\t\\t\\ttry\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tclearstatcache();\\r\\n\\r\\n\\t\\t\\t\\tif ($dh = @opendir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\twhile (($file = readdir($dh)) !== FALSE)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tif ($file != \'.\' && $file != \'..\')\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$pathName = $sCmsFolderTemporaryDirectory .  $file;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\tif (Core_File::getExtension($pathName) == \'xml\' && is_file($pathName))\\r\\n\\t\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0444\\u0430\\u0439\\u043b\\u0430 \' . $pathName);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tCore_File::delete($pathName);\\r\\n\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\tclosedir($dh);\\r\\n\\t\\t\\t\\t\\tclearstatcache();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tcatch(Exception $exc)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Session::start();\\r\\n\\techo sprintf(\\\"{$BOM}success\\\\n%s\\\\n%s\\\", session_name(), session_id());\\r\\n}\\r\\nelseif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'init\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, mode=init\');\\r\\n\\r\\n\\techo sprintf(\\\"{$BOM}zip=no\\\\nfile_limit=%s\\\", $iFileLimit);\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . $sFileName;\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif (is_file($sFullFileName)\\r\\n\\t\\t\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u043c\\u0435\\u043d\\u044c\\u0448\\u0435 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0438\\u043b\\u0438 \\u043f\\u0440\\u043e\\u0448\\u043b\\u043e 5 \\u043c\\u0438\\u043d\\u0443\\u0442 \\u0441 \\u0434\\u0430\\u0442\\u044b \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u0433\\u043e \\u0438\\u0437\\u043c\\u0435\\u043d\\u0435\\u043d\\u0438\\u044f\\r\\n\\t\\t&& (filesize($sFullFileName) < $iFileLimit || (filemtime($sFullFileName) + 60*5) < time())\\r\\n\\t)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, DELETE previous file, type=catalog, mode=file, destination=\' . $sFullFileName\\r\\n\\t\\t\\t\\t. \', filesize: \' . filesize($sFullFileName) . \', fileLimit: \' . $iFileLimit\\r\\n\\t\\t\\t\\t. \', time: \' . filemtime($sFullFileName) . \', current: \' . time()\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\tCore_File::delete($sFullFileName);\\r\\n\\t}\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sCmsFolderTemporaryDirectory . $sFileName);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopGroupId = 0;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sPicturesPath = $sMonthTemporaryDirectory;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importAction = 1;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sShopDefaultPriceName = defined(\'SHOP_DEFAULT_CML_CURRENCY_NAME\')\\r\\n\\t\\t\\t? SHOP_DEFAULT_CML_CURRENCY_NAME\\r\\n\\t\\t\\t: \'\\u0420\\u043e\\u0437\\u043d\\u0438\\u0447\\u043d\\u0430\\u044f\';\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->updateFields = array(\'marking\', \'name\', \'shop_group_id\', \'text\', \'description\', \'images\', \'taxes\', \'shop_producer_id\');\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->skipProperties = array(\'\\u0421\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u043e1\');\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$aReturn = $oShop_Item_Import_Cml_Controller->import();\\r\\n\\r\\n\\t\\tif ($aReturn[\'status\'] == \'success\')\\r\\n\\t\\t{\\r\\n\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t->write(\'1\\u0421, type=catalog, mode=import, file=\' . $sFileName . \', import success, DELETE FILE\');\\r\\n\\r\\n\\t\\t\\tCore_File::delete($sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName));\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\techo \\\"{$BOM}\\\" . $aReturn[\'status\'];\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'query\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query\');\\r\\n\\r\\n\\t$oXml = new Core_SimpleXMLElement(sprintf(\\r\\n\\t\\t\\\"<?xml version=\\\\\\\"1.0\\\\\\\" encoding=\\\\\\\"utf-8\\\\\\\"?>\\\\n<\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u0412\\u0435\\u0440\\u0441\\u0438\\u044f\\u0421\\u0445\\u0435\\u043c\\u044b=\\\\\\\"2.08\\\\\\\" \\u0414\\u0430\\u0442\\u0430\\u0424\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f=\\\\\\\"%s\\\\\\\"><\\/\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f>\\\",\\r\\n\\t\\tdate(\\\"Y-m-d\\\")));\\r\\n\\r\\n\\t\\/\\/ Gwt Max Order Id\\r\\n\\t$oCore_QueryBuilder_Select = Core_QueryBuilder::select(array(\'MAX(id)\', \'max_id\'));\\r\\n\\t$oCore_QueryBuilder_Select\\r\\n\\t\\t->from(\'shop_orders\')\\r\\n\\t\\t->where(\'shop_orders.shop_id\', \'=\', $oShop->id)\\r\\n\\t\\t->where(\'shop_orders.unloaded\', \'=\', 0)\\r\\n\\t\\t->where(\'shop_orders.deleted\', \'=\', 0);\\r\\n\\r\\n\\t$aRow = $oCore_QueryBuilder_Select->execute()->asAssoc()->current();\\r\\n\\r\\n\\t$maxId = $aRow[\'max_id\'];\\r\\n\\r\\n\\t$iFrom = 0;\\r\\n\\t$onStep = 500;\\r\\n\\r\\n\\tdo {\\r\\n\\t\\t$oShop_Orders = $oShop->Shop_Orders;\\r\\n\\t\\t$oShop_Orders->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_orders.id\', \'BETWEEN\', array($iFrom + 1, $iFrom + $onStep));\\r\\n\\r\\n\\t\\t$aShop_Orders = $oShop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\t\\tforeach($aShop_Orders as $oShop_Order)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Order->addCml($oXml);\\r\\n\\t\\t\\t$oShop_Order->unloaded = 1;\\r\\n\\t\\t\\t$oShop_Order->save();\\r\\n\\t\\t}\\r\\n\\t\\t$iFrom += $onStep;\\r\\n\\t}\\r\\n\\twhile ($iFrom < $maxId);\\r\\n\\r\\n\\theader(\'Content-type: text\\/xml; charset=UTF-8\');\\r\\n\\techo $BOM, $oXml->asXML();\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'success\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=success\');\\r\\n\\r\\n\\t\\/*$aShopOrders = $oShop->Shop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\tforeach($aShopOrders as $oShopOrder)\\r\\n\\t{\\r\\n\\t\\t$oShopOrder->unloaded = 1;\\r\\n\\t\\t$oShopOrder->save();\\r\\n\\t}*\\/\\r\\n\\r\\n\\techo \\\"{$BOM}success\\\\n\\\";\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullFileName);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importOrders();\\r\\n\\r\\n\\t\\tis_file($sFullFileName) && Core_File::delete($sFullFileName);\\r\\n\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\n\\r\\ndie();\",\"user_id\":\"19\"}','2021-03-30 13:26:17',32,0),(1747,'lib',36,'{\"name\":\"\\u041e\\u0431\\u043c\\u0435\\u043d \\u0441 1\\u0421:\\u0423\\u043f\\u0440\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0440\\u0433\\u043e\\u0432\\u043b\\u0435\\u0439\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0441 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043e\\u0439 1\\u0421.\",\"lib\":\"\",\"lib_config\":\"<?php\\r\\n@ini_set(\'display_errors\', 1);\\r\\nerror_reporting(E_ALL);\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0430\\u044f \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u044f\\r\\n$currentMonth = date(\'n\');\\r\\n$sTemporaryDirectory = TMP_DIR . \'1c_exchange_files\\/\';\\r\\n$sMonthTemporaryDirectory = $sTemporaryDirectory . \'month-\' . $currentMonth . \'\\/\';\\r\\n$sCmsFolderTemporaryDirectory = CMS_FOLDER . $sMonthTemporaryDirectory;\\r\\n\\r\\n\\/\\/ \\u041c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d \\u0434\\u043b\\u044f \\u0432\\u044b\\u0433\\u0440\\u0443\\u0437\\u043a\\u0438\\r\\n$oShop = Core_Entity::factory(\'Shop\')->find(Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\n\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0432\\u044b\\u0433\\u0440\\u0443\\u0436\\u0430\\u0435\\u043c\\u044b\\u0445 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0445 (10000000 = 10 \\u043c\\u0411)\\r\\n$iFileLimit = 10000000;\\r\\n\\r\\n\\/\\/ \\u041b\\u043e\\u0433\\u0438\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043e\\u0431\\u043c\\u0435\\u043d\\r\\n$bDebug = TRUE;\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u044f \\u043d\\u0430 \\u0448\\u0430\\u0433, \\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\r\\n$iTimeout = 25;\\r\\n\\r\\n\\/\\/ bugfix\\r\\nusleep(10);\\r\\n\\r\\n$BOM = \\\"\\\\xEF\\\\xBB\\\\xBF\\\";\\r\\n\\r\\n\\/\\/ \\u0420\\u0435\\u0448\\u0435\\u043d\\u0438\\u0435 \\u043f\\u0440\\u043e\\u0431\\u043b\\u0435\\u043c\\u044b \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438 \\u043f\\u0440\\u0438 PHP \\u0432 \\u0440\\u0435\\u0436\\u0438\\u043c\\u0435 CGI\\r\\nif (isset($_REQUEST[\'authorization\'])\\r\\n|| (isset($_SERVER[\'argv\'][0])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_USER\'])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_PW\'])))\\r\\n{\\r\\n\\t$authorization_base64 = isset($_REQUEST[\'authorization\'])\\r\\n\\t\\t? $_REQUEST[\'authorization\']\\r\\n\\t\\t: mb_substr($_SERVER[\'argv\'][0], 14);\\r\\n\\r\\n\\t$authorization = base64_decode(mb_substr($authorization_base64, 6));\\r\\n\\t$authorization_explode = explode(\':\', $authorization);\\r\\n\\r\\n\\tif (count($authorization_explode) == 2)\\r\\n\\t{\\r\\n\\t\\tlist($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']) = $authorization_explode;\\r\\n\\t}\\r\\n\\r\\n\\tunset($authorization);\\r\\n}\\r\\n\\r\\nif (!isset($_SERVER[\'PHP_AUTH_USER\']))\\r\\n{\\r\\n\\theader(\'WWW-Authenticate: Basic realm=\\\"HostCMS\\\"\');\\r\\n\\theader(\'HTTP\\/1.0 401 Unauthorized\');\\r\\n\\texit;\\r\\n}\\r\\nelseif (isset($_SERVER[\'PHP_AUTH_USER\']) && isset($_SERVER[\'PHP_AUTH_PW\']))\\r\\n{\\r\\n\\t$answr = Core_Auth::login($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']);\\r\\n\\r\\n\\tCore_Auth::setCurrentSite();\\r\\n\\r\\n\\tif (!Core_Auth::logged())\\r\\n\\t{\\r\\n\\t\\tCore_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$ERROR)\\r\\n\\t\\t\\t\\/\\/->notify(FALSE)\\r\\n\\t\\t\\t->write(Core::_(\'Core.error_log_authorization_error\'));\\r\\n\\t}\\r\\n\\r\\n\\t$oUser = Core_Entity::factory(\'User\')->getByLogin(\\r\\n\\t\\t$_SERVER[\'PHP_AUTH_USER\']\\r\\n\\t);\\r\\n\\r\\n\\tif ($answr !== TRUE || !is_null($oUser) && $oUser->read_only)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u043e\\u0448\\u0438\\u0431\\u043a\\u0430 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043d\\u0435 \\u043f\\u0440\\u043e\\u0439\\u0434\\u0435\\u043d\\u0430\\r\\n\\t\\texit(\'Authentication failed!\');\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n$sType = Core_Array::getGet(\'type\');\\r\\n$sMode = Core_Array::getGet(\'mode\');\\r\\n\\r\\nif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'checkauth\')\\r\\n{\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif ($sType == \'catalog\')\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0445 \\u043c\\u0435\\u0441\\u044f\\u0446\\u0435\\u0432\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0437\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0435 \\u043c\\u0435\\u0441\\u044f\\u0446\\u044b\\r\\n\\t\\tfor ($i = 1; $i <= 12; $i++)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($currentMonth != $i)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$sTmpDir = CMS_FOLDER . $sTemporaryDirectory . \'month-\' . $i;\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u044f\\u0435\\u043c \\u0444\\u0430\\u0439\\u043b\\u044b \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043c\\u0435\\u0441\\u044f\\u0446\\u0430\\r\\n\\t\\t\\t\\tif (is_dir($sTmpDir)\\r\\n\\t\\t\\t\\t\\t&& Core_File::deleteDir($sTmpDir) === FALSE)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\techo \\\"{$BOM}failure\\\\nCan\'t delete temporary folder {$sTmpDir}\\\";\\r\\n\\t\\t\\t\\t\\tdie();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML \\u0444\\u0430\\u0439\\u043b\\u043e\\u0432\\r\\n\\t\\tif (is_dir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t{\\r\\n\\t\\t\\ttry\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tclearstatcache();\\r\\n\\r\\n\\t\\t\\t\\tif ($dh = @opendir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\twhile (($file = readdir($dh)) !== FALSE)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tif ($file != \'.\' && $file != \'..\')\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$pathName = $sCmsFolderTemporaryDirectory .  $file;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\tif (Core_File::getExtension($pathName) == \'xml\' && is_file($pathName))\\r\\n\\t\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML-\\u0444\\u0430\\u0439\\u043b\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \' . $pathName);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tCore_File::delete($pathName);\\r\\n\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\tclosedir($dh);\\r\\n\\t\\t\\t\\t\\tclearstatcache();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tcatch(Exception $exc)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Session::start();\\r\\n\\techo sprintf(\\\"{$BOM}success\\\\n%s\\\\n%s\\\", session_name(), session_id());\\r\\n}\\r\\nelseif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'init\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, mode=init\');\\r\\n\\r\\n\\techo sprintf(\\\"{$BOM}zip=no\\\\nfile_limit=%s\\\", $iFileLimit);\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . $sFileName;\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif (is_file($sFullFileName)\\r\\n\\t\\t\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u043c\\u0435\\u043d\\u044c\\u0448\\u0435 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0438\\u043b\\u0438 \\u043f\\u0440\\u043e\\u0448\\u043b\\u043e 5 \\u043c\\u0438\\u043d\\u0443\\u0442 \\u0441 \\u0434\\u0430\\u0442\\u044b \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u0433\\u043e \\u0438\\u0437\\u043c\\u0435\\u043d\\u0435\\u043d\\u0438\\u044f\\r\\n\\t\\t&& (filesize($sFullFileName) < $iFileLimit * 0.95 || (filemtime($sFullFileName) + 60 * 5) < time())\\r\\n\\t)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, DELETE previous file, type=catalog, mode=file, destination=\' . $sFullFileName\\r\\n\\t\\t\\t\\t. \', filesize: \' . filesize($sFullFileName) . \', fileLimit: \' . $iFileLimit\\r\\n\\t\\t\\t\\t. \', time: \' . filemtime($sFullFileName) . \', current: \' . time()\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\tCore_File::delete($sFullFileName);\\r\\n\\t}\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$sFullPath = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullPath);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopGroupId = 0;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sPicturesPath = $sMonthTemporaryDirectory;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importAction = 1;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sShopDefaultPriceName = defined(\'SHOP_DEFAULT_CML_CURRENCY_NAME\')\\r\\n\\t\\t\\t? SHOP_DEFAULT_CML_CURRENCY_NAME\\r\\n\\t\\t\\t: \'\\u0420\\u043e\\u0437\\u043d\\u0438\\u0447\\u043d\\u0430\\u044f\';\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->updateFields = array(\'marking\', \'name\', \'shop_group_id\', \'text\', \'description\', \'images\', \'taxes\', \'shop_producer_id\');\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->skipProperties = array(\'\\u0421\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u043e1\');\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->timeout = $iTimeout;\\r\\n\\t\\t\\/\\/ \\u0421\\u043e\\u0431\\u044b\\u0442\\u0438\\u0439\\u043d\\u0430\\u044f \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\\u0430\\u0446\\u0438\\u044f\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->searchIndexation = TRUE;\\r\\n\\t\\t$aReturn = $oShop_Item_Import_Cml_Controller->import();\\r\\n\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, status: \' . $aReturn[\'status\'] . \', timeout: \' . $oShop_Item_Import_Cml_Controller->timeout . \', type=catalog, mode=import, file=\' . $sFileName . \', size=\' . Core_File::filesize($sFullPath));\\r\\n\\r\\n\\t\\tif ($aReturn[\'status\'] == \'success\')\\r\\n\\t\\t{\\r\\n\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t->write(\'1\\u0421, Delete file: \' . $sFileName);\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u0435\\u0440\\u0435\\u0434 \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435\\u043c \\u0434\\u0435\\u043b\\u0430\\u0435\\u043c \\u043a\\u043e\\u043f\\u0438\\u044e \\u0444\\u0430\\u0439\\u043b\\u0430 \\u0434\\u043b\\u044f \\u043e\\u0442\\u043b\\u0430\\u0434\\u043a\\u0438\\r\\n\\t\\t\\t\\/\\/Core_File::copy($sFullPath, $sFullPath . time());\\r\\n\\r\\n\\t\\t\\tCore_File::delete($sFullPath);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\techo $BOM . $aReturn[\'status\'];\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'query\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query\');\\r\\n\\r\\n\\t$oXml = new Core_SimpleXMLElement(sprintf(\\r\\n\\t\\t\\\"<?xml version=\\\\\\\"1.0\\\\\\\" encoding=\\\\\\\"utf-8\\\\\\\"?>\\\\n<\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u0412\\u0435\\u0440\\u0441\\u0438\\u044f\\u0421\\u0445\\u0435\\u043c\\u044b=\\\\\\\"2.08\\\\\\\" \\u0414\\u0430\\u0442\\u0430\\u0424\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f=\\\\\\\"%s\\\\\\\"><\\/\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f>\\\",\\r\\n\\t\\tdate(\\\"Y-m-d\\\")));\\r\\n\\r\\n\\tif ($oShop->shop_company_id && method_exists($oShop->Company, \'addCml\'))\\r\\n\\t{\\r\\n\\t\\t$oShop->Company->addCml($oXml);\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ Get Max Order Id\\r\\n\\t$oCore_QueryBuilder_Select = Core_QueryBuilder::select(array(\'MAX(id)\', \'max_id\'));\\r\\n\\t$oCore_QueryBuilder_Select\\r\\n\\t\\t->from(\'shop_orders\')\\r\\n\\t\\t->where(\'shop_orders.shop_id\', \'=\', $oShop->id)\\r\\n\\t\\t->where(\'shop_orders.unloaded\', \'=\', 0)\\r\\n\\t\\t->where(\'shop_orders.deleted\', \'=\', 0);\\r\\n\\r\\n\\t$aRow = $oCore_QueryBuilder_Select->execute()->asAssoc()->current();\\r\\n\\r\\n\\t$maxId = $aRow[\'max_id\'];\\r\\n\\r\\n\\t$iFrom = 0;\\r\\n\\t$onStep = 500;\\r\\n\\t$iCounter = 0;\\r\\n\\r\\n\\tdo {\\r\\n\\t\\t$oShop_Orders = $oShop->Shop_Orders;\\r\\n\\t\\t$oShop_Orders->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_orders.id\', \'BETWEEN\', array($iFrom + 1, $iFrom + $onStep));\\r\\n\\r\\n\\t\\t$aShop_Orders = $oShop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\t\\tforeach($aShop_Orders as $oShop_Order)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Order->addCml($oXml);\\r\\n\\t\\t\\t$oShop_Order->unloaded = 1;\\r\\n\\t\\t\\t$oShop_Order->save();\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$iCounter += count($aShop_Orders);\\r\\n\\r\\n\\t\\t$iFrom += $onStep;\\r\\n\\t}\\r\\n\\twhile ($iFrom < $maxId);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query. Completed, found \' . $iCounter . \' orders\');\\r\\n\\r\\n\\theader(\'Content-type: text\\/xml; charset=UTF-8\');\\r\\n\\techo $BOM;\\r\\n\\techo $oXml->asXML();\\r\\n\\r\\n\\t\\/*$dom = dom_import_simplexml($oXml)->ownerDocument;\\r\\n\\t$dom->formatOutput = TRUE;\\r\\n\\techo $dom->saveXML(NULL, LIBXML_NOEMPTYTAG);*\\/\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'success\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=success\');\\r\\n\\r\\n\\t\\/*$aShopOrders = $oShop->Shop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\tforeach($aShopOrders as $oShopOrder)\\r\\n\\t{\\r\\n\\t\\t$oShopOrder->unloaded = 1;\\r\\n\\t\\t$oShopOrder->save();\\r\\n\\t}*\\/\\r\\n\\r\\n\\techo \\\"{$BOM}success\\\\n\\\";\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullFileName);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importOrders();\\r\\n\\r\\n\\t\\tis_file($sFullFileName) && Core_File::delete($sFullFileName);\\r\\n\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\n\\r\\ndie();\",\"user_id\":\"19\"}','2021-03-30 13:29:57',32,0),(1748,'lib',36,'{\"name\":\"\\u041e\\u0431\\u043c\\u0435\\u043d \\u0441 1\\u0421:\\u0423\\u043f\\u0440\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0440\\u0433\\u043e\\u0432\\u043b\\u0435\\u0439\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0441 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043e\\u0439 1\\u0421.\",\"lib\":\"\",\"lib_config\":\"<?php\\r\\n@ini_set(\'display_errors\', 1);\\r\\nerror_reporting(E_ALL);\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0430\\u044f \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u044f\\r\\n$currentMonth = date(\'n\');\\r\\n$sTemporaryDirectory = TMP_DIR . \'1c_exchange_files\\/\';\\r\\n$sMonthTemporaryDirectory = $sTemporaryDirectory . \'month-\' . $currentMonth . \'\\/\';\\r\\n$sCmsFolderTemporaryDirectory = CMS_FOLDER . $sMonthTemporaryDirectory;\\r\\n\\r\\n\\/\\/ \\u041c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d \\u0434\\u043b\\u044f \\u0432\\u044b\\u0433\\u0440\\u0443\\u0437\\u043a\\u0438\\r\\n$oShop = Core_Entity::factory(\'Shop\')->find(Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\n\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0432\\u044b\\u0433\\u0440\\u0443\\u0436\\u0430\\u0435\\u043c\\u044b\\u0445 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0445 (10000000 = 10 \\u043c\\u0411)\\r\\n$iFileLimit = 10000000;\\r\\n\\r\\n\\/\\/ \\u041b\\u043e\\u0433\\u0438\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043e\\u0431\\u043c\\u0435\\u043d\\r\\n$bDebug = TRUE;\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u044f \\u043d\\u0430 \\u0448\\u0430\\u0433, \\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\r\\n$iTimeout = 25;\\r\\n\\r\\n\\/\\/ bugfix\\r\\nusleep(10);\\r\\n\\r\\n$BOM = \\\"\\\\xEF\\\\xBB\\\\xBF\\\";\\r\\n\\r\\n\\/\\/ \\u0420\\u0435\\u0448\\u0435\\u043d\\u0438\\u0435 \\u043f\\u0440\\u043e\\u0431\\u043b\\u0435\\u043c\\u044b \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438 \\u043f\\u0440\\u0438 PHP \\u0432 \\u0440\\u0435\\u0436\\u0438\\u043c\\u0435 CGI\\r\\nif (isset($_REQUEST[\'authorization\'])\\r\\n|| (isset($_SERVER[\'argv\'][0])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_USER\'])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_PW\'])))\\r\\n{\\r\\n\\t$authorization_base64 = isset($_REQUEST[\'authorization\'])\\r\\n\\t\\t? $_REQUEST[\'authorization\']\\r\\n\\t\\t: mb_substr($_SERVER[\'argv\'][0], 14);\\r\\n\\r\\n\\t$authorization = base64_decode(mb_substr($authorization_base64, 6));\\r\\n\\t$authorization_explode = explode(\':\', $authorization);\\r\\n\\r\\n\\tif (count($authorization_explode) == 2)\\r\\n\\t{\\r\\n\\t\\tlist($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']) = $authorization_explode;\\r\\n\\t}\\r\\n\\r\\n\\tunset($authorization);\\r\\n}\\r\\n\\r\\nif (!isset($_SERVER[\'PHP_AUTH_USER\']))\\r\\n{\\r\\n\\theader(\'WWW-Authenticate: Basic realm=\\\"HostCMS\\\"\');\\r\\n\\theader(\'HTTP\\/1.0 401 Unauthorized\');\\r\\n\\texit;\\r\\n}\\r\\nelseif (isset($_SERVER[\'PHP_AUTH_USER\']) && isset($_SERVER[\'PHP_AUTH_PW\']))\\r\\n{\\r\\n\\t$answr = Core_Auth::login($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']);\\r\\n\\r\\n\\tCore_Auth::setCurrentSite();\\r\\n\\r\\n\\tif (!Core_Auth::logged())\\r\\n\\t{\\r\\n\\t\\tCore_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$ERROR)\\r\\n\\t\\t\\t\\/\\/->notify(FALSE)\\r\\n\\t\\t\\t->write(Core::_(\'Core.error_log_authorization_error\'));\\r\\n\\t}\\r\\n\\r\\n\\t$oUser = Core_Entity::factory(\'User\')->getByLogin(\\r\\n\\t\\t$_SERVER[\'PHP_AUTH_USER\']\\r\\n\\t);\\r\\n\\r\\n\\tif ($answr !== TRUE || !is_null($oUser) && $oUser->read_only)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u043e\\u0448\\u0438\\u0431\\u043a\\u0430 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043d\\u0435 \\u043f\\u0440\\u043e\\u0439\\u0434\\u0435\\u043d\\u0430\\r\\n\\t\\texit(\'Authentication failed!\');\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n$sType = Core_Array::getGet(\'type\');\\r\\n$sMode = Core_Array::getGet(\'mode\');\\r\\n\\r\\nif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'checkauth\')\\r\\n{\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif ($sType == \'catalog\')\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0445 \\u043c\\u0435\\u0441\\u044f\\u0446\\u0435\\u0432\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0437\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0435 \\u043c\\u0435\\u0441\\u044f\\u0446\\u044b\\r\\n\\t\\tfor ($i = 1; $i <= 12; $i++)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($currentMonth != $i)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$sTmpDir = CMS_FOLDER . $sTemporaryDirectory . \'month-\' . $i;\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u044f\\u0435\\u043c \\u0444\\u0430\\u0439\\u043b\\u044b \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043c\\u0435\\u0441\\u044f\\u0446\\u0430\\r\\n\\t\\t\\t\\tif (is_dir($sTmpDir)\\r\\n\\t\\t\\t\\t\\t&& Core_File::deleteDir($sTmpDir) === FALSE)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\techo \\\"{$BOM}failure\\\\nCan\'t delete temporary folder {$sTmpDir}\\\";\\r\\n\\t\\t\\t\\t\\tdie();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML \\u0444\\u0430\\u0439\\u043b\\u043e\\u0432\\r\\n\\t\\tif (is_dir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t{\\r\\n\\t\\t\\ttry\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tclearstatcache();\\r\\n\\r\\n\\t\\t\\t\\tif ($dh = @opendir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\twhile (($file = readdir($dh)) !== FALSE)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tif ($file != \'.\' && $file != \'..\')\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$pathName = $sCmsFolderTemporaryDirectory .  $file;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\tif (Core_File::getExtension($pathName) == \'xml\' && is_file($pathName))\\r\\n\\t\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML-\\u0444\\u0430\\u0439\\u043b\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \' . $pathName);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tCore_File::delete($pathName);\\r\\n\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\tclosedir($dh);\\r\\n\\t\\t\\t\\t\\tclearstatcache();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tcatch(Exception $exc)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Session::start();\\r\\n\\techo sprintf(\\\"{$BOM}success\\\\n%s\\\\n%s\\\", session_name(), session_id());\\r\\n}\\r\\nelseif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'init\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, mode=init\');\\r\\n\\r\\n\\techo sprintf(\\\"{$BOM}zip=no\\\\nfile_limit=%s\\\", $iFileLimit);\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . $sFileName;\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif (is_file($sFullFileName)\\r\\n\\t\\t\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u043c\\u0435\\u043d\\u044c\\u0448\\u0435 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0438\\u043b\\u0438 \\u043f\\u0440\\u043e\\u0448\\u043b\\u043e 5 \\u043c\\u0438\\u043d\\u0443\\u0442 \\u0441 \\u0434\\u0430\\u0442\\u044b \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u0433\\u043e \\u0438\\u0437\\u043c\\u0435\\u043d\\u0435\\u043d\\u0438\\u044f\\r\\n\\t\\t&& (filesize($sFullFileName) < $iFileLimit * 0.95 || (filemtime($sFullFileName) + 60 * 5) < time())\\r\\n\\t)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, DELETE previous file, type=catalog, mode=file, destination=\' . $sFullFileName\\r\\n\\t\\t\\t\\t. \', filesize: \' . filesize($sFullFileName) . \', fileLimit: \' . $iFileLimit\\r\\n\\t\\t\\t\\t. \', time: \' . filemtime($sFullFileName) . \', current: \' . time()\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\tCore_File::delete($sFullFileName);\\r\\n\\t}\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$sFullPath = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullPath);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopGroupId = 0;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sPicturesPath = $sMonthTemporaryDirectory;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importAction = 1;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sShopDefaultPriceName = defined(\'SHOP_DEFAULT_CML_CURRENCY_NAME\')\\r\\n\\t\\t\\t? SHOP_DEFAULT_CML_CURRENCY_NAME\\r\\n\\t\\t\\t: \'\\u0420\\u043e\\u0437\\u043d\\u0438\\u0447\\u043d\\u0430\\u044f\';\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->updateFields = array(\'marking\', \'name\', \'shop_group_id\', \'text\', \'description\', \'images\', \'taxes\', \'shop_producer_id\');\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->skipProperties = array(\'\\u0421\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u043e1\');\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->timeout = $iTimeout;\\r\\n\\t\\t\\/\\/ \\u0421\\u043e\\u0431\\u044b\\u0442\\u0438\\u0439\\u043d\\u0430\\u044f \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\\u0430\\u0446\\u0438\\u044f\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->searchIndexation = TRUE;\\r\\n\\t\\t$aReturn = $oShop_Item_Import_Cml_Controller->import();\\r\\n\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, status: \' . $aReturn[\'status\'] . \', timeout: \' . $oShop_Item_Import_Cml_Controller->timeout . \', type=catalog, mode=import, file=\' . $sFileName . \', size=\' . Core_File::filesize($sFullPath));\\r\\n\\r\\n\\t\\tif ($aReturn[\'status\'] == \'success\')\\r\\n\\t\\t{\\r\\n\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t->write(\'1\\u0421, Delete file: \' . $sFileName);\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u0435\\u0440\\u0435\\u0434 \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435\\u043c \\u0434\\u0435\\u043b\\u0430\\u0435\\u043c \\u043a\\u043e\\u043f\\u0438\\u044e \\u0444\\u0430\\u0439\\u043b\\u0430 \\u0434\\u043b\\u044f \\u043e\\u0442\\u043b\\u0430\\u0434\\u043a\\u0438\\r\\n\\t\\t\\tCore_File::copy($sFullPath, $sFullPath . time());\\r\\n\\r\\n\\t\\t\\tCore_File::delete($sFullPath);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\techo $BOM . $aReturn[\'status\'];\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'query\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query\');\\r\\n\\r\\n\\t$oXml = new Core_SimpleXMLElement(sprintf(\\r\\n\\t\\t\\\"<?xml version=\\\\\\\"1.0\\\\\\\" encoding=\\\\\\\"utf-8\\\\\\\"?>\\\\n<\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u0412\\u0435\\u0440\\u0441\\u0438\\u044f\\u0421\\u0445\\u0435\\u043c\\u044b=\\\\\\\"2.08\\\\\\\" \\u0414\\u0430\\u0442\\u0430\\u0424\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f=\\\\\\\"%s\\\\\\\"><\\/\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f>\\\",\\r\\n\\t\\tdate(\\\"Y-m-d\\\")));\\r\\n\\r\\n\\tif ($oShop->shop_company_id && method_exists($oShop->Company, \'addCml\'))\\r\\n\\t{\\r\\n\\t\\t$oShop->Company->addCml($oXml);\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ Get Max Order Id\\r\\n\\t$oCore_QueryBuilder_Select = Core_QueryBuilder::select(array(\'MAX(id)\', \'max_id\'));\\r\\n\\t$oCore_QueryBuilder_Select\\r\\n\\t\\t->from(\'shop_orders\')\\r\\n\\t\\t->where(\'shop_orders.shop_id\', \'=\', $oShop->id)\\r\\n\\t\\t->where(\'shop_orders.unloaded\', \'=\', 0)\\r\\n\\t\\t->where(\'shop_orders.deleted\', \'=\', 0);\\r\\n\\r\\n\\t$aRow = $oCore_QueryBuilder_Select->execute()->asAssoc()->current();\\r\\n\\r\\n\\t$maxId = $aRow[\'max_id\'];\\r\\n\\r\\n\\t$iFrom = 0;\\r\\n\\t$onStep = 500;\\r\\n\\t$iCounter = 0;\\r\\n\\r\\n\\tdo {\\r\\n\\t\\t$oShop_Orders = $oShop->Shop_Orders;\\r\\n\\t\\t$oShop_Orders->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_orders.id\', \'BETWEEN\', array($iFrom + 1, $iFrom + $onStep));\\r\\n\\r\\n\\t\\t$aShop_Orders = $oShop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\t\\tforeach($aShop_Orders as $oShop_Order)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Order->addCml($oXml);\\r\\n\\t\\t\\t$oShop_Order->unloaded = 1;\\r\\n\\t\\t\\t$oShop_Order->save();\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$iCounter += count($aShop_Orders);\\r\\n\\r\\n\\t\\t$iFrom += $onStep;\\r\\n\\t}\\r\\n\\twhile ($iFrom < $maxId);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query. Completed, found \' . $iCounter . \' orders\');\\r\\n\\r\\n\\theader(\'Content-type: text\\/xml; charset=UTF-8\');\\r\\n\\techo $BOM;\\r\\n\\techo $oXml->asXML();\\r\\n\\r\\n\\t\\/*$dom = dom_import_simplexml($oXml)->ownerDocument;\\r\\n\\t$dom->formatOutput = TRUE;\\r\\n\\techo $dom->saveXML(NULL, LIBXML_NOEMPTYTAG);*\\/\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'success\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=success\');\\r\\n\\r\\n\\t\\/*$aShopOrders = $oShop->Shop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\tforeach($aShopOrders as $oShopOrder)\\r\\n\\t{\\r\\n\\t\\t$oShopOrder->unloaded = 1;\\r\\n\\t\\t$oShopOrder->save();\\r\\n\\t}*\\/\\r\\n\\r\\n\\techo \\\"{$BOM}success\\\\n\\\";\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullFileName);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importOrders();\\r\\n\\r\\n\\t\\tis_file($sFullFileName) && Core_File::delete($sFullFileName);\\r\\n\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\n\\r\\ndie();\",\"user_id\":\"19\"}','2021-03-30 13:30:08',32,0),(1749,'lib',36,'{\"name\":\"\\u041e\\u0431\\u043c\\u0435\\u043d \\u0441 1\\u0421:\\u0423\\u043f\\u0440\\u0430\\u0432\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0442\\u043e\\u0440\\u0433\\u043e\\u0432\\u043b\\u0435\\u0439\",\"lib_dir_id\":\"9\",\"description\":\"\\u0420\\u0435\\u0430\\u043b\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0441 \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u043e\\u0439 1\\u0421.\",\"lib\":\"\",\"lib_config\":\"<?php\\r\\n@ini_set(\'display_errors\', 1);\\r\\nerror_reporting(E_ALL);\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u0435\\u043d\\u043d\\u0430\\u044f \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u044f\\r\\n$currentMonth = date(\'n\');\\r\\n$sTemporaryDirectory = TMP_DIR . \'1c_exchange_files\\/\';\\r\\n$sMonthTemporaryDirectory = $sTemporaryDirectory . \'month-\' . $currentMonth . \'\\/\';\\r\\n$sCmsFolderTemporaryDirectory = CMS_FOLDER . $sMonthTemporaryDirectory;\\r\\n\\r\\n\\/\\/ \\u041c\\u0430\\u0433\\u0430\\u0437\\u0438\\u043d \\u0434\\u043b\\u044f \\u0432\\u044b\\u0433\\u0440\\u0443\\u0437\\u043a\\u0438\\r\\n$oShop = Core_Entity::factory(\'Shop\')->find(Core_Array::get(Core_Page::instance()->libParams, \'shopId\'));\\r\\n\\r\\n\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0432\\u044b\\u0433\\u0440\\u0443\\u0436\\u0430\\u0435\\u043c\\u044b\\u0445 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0445 (10000000 = 10 \\u043c\\u0411)\\r\\n$iFileLimit = 10000000;\\r\\n\\r\\n\\/\\/ \\u041b\\u043e\\u0433\\u0438\\u0440\\u043e\\u0432\\u0430\\u0442\\u044c \\u043e\\u0431\\u043c\\u0435\\u043d\\r\\n$bDebug = TRUE;\\r\\n\\r\\n\\/\\/ \\u0412\\u0440\\u0435\\u043c\\u044f \\u043d\\u0430 \\u0448\\u0430\\u0433, \\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\r\\n$iTimeout = 25;\\r\\n\\r\\n\\/\\/ bugfix\\r\\nusleep(10);\\r\\n\\r\\n$BOM = \\\"\\\\xEF\\\\xBB\\\\xBF\\\";\\r\\n\\r\\n\\/\\/ \\u0420\\u0435\\u0448\\u0435\\u043d\\u0438\\u0435 \\u043f\\u0440\\u043e\\u0431\\u043b\\u0435\\u043c\\u044b \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438 \\u043f\\u0440\\u0438 PHP \\u0432 \\u0440\\u0435\\u0436\\u0438\\u043c\\u0435 CGI\\r\\nif (isset($_REQUEST[\'authorization\'])\\r\\n|| (isset($_SERVER[\'argv\'][0])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_USER\'])\\r\\n\\t\\t&& empty($_SERVER[\'PHP_AUTH_PW\'])))\\r\\n{\\r\\n\\t$authorization_base64 = isset($_REQUEST[\'authorization\'])\\r\\n\\t\\t? $_REQUEST[\'authorization\']\\r\\n\\t\\t: mb_substr($_SERVER[\'argv\'][0], 14);\\r\\n\\r\\n\\t$authorization = base64_decode(mb_substr($authorization_base64, 6));\\r\\n\\t$authorization_explode = explode(\':\', $authorization);\\r\\n\\r\\n\\tif (count($authorization_explode) == 2)\\r\\n\\t{\\r\\n\\t\\tlist($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']) = $authorization_explode;\\r\\n\\t}\\r\\n\\r\\n\\tunset($authorization);\\r\\n}\\r\\n\\r\\nif (!isset($_SERVER[\'PHP_AUTH_USER\']))\\r\\n{\\r\\n\\theader(\'WWW-Authenticate: Basic realm=\\\"HostCMS\\\"\');\\r\\n\\theader(\'HTTP\\/1.0 401 Unauthorized\');\\r\\n\\texit;\\r\\n}\\r\\nelseif (isset($_SERVER[\'PHP_AUTH_USER\']) && isset($_SERVER[\'PHP_AUTH_PW\']))\\r\\n{\\r\\n\\t$answr = Core_Auth::login($_SERVER[\'PHP_AUTH_USER\'], $_SERVER[\'PHP_AUTH_PW\']);\\r\\n\\r\\n\\tCore_Auth::setCurrentSite();\\r\\n\\r\\n\\tif (!Core_Auth::logged())\\r\\n\\t{\\r\\n\\t\\tCore_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$ERROR)\\r\\n\\t\\t\\t\\/\\/->notify(FALSE)\\r\\n\\t\\t\\t->write(Core::_(\'Core.error_log_authorization_error\'));\\r\\n\\t}\\r\\n\\r\\n\\t$oUser = Core_Entity::factory(\'User\')->getByLogin(\\r\\n\\t\\t$_SERVER[\'PHP_AUTH_USER\']\\r\\n\\t);\\r\\n\\r\\n\\tif ($answr !== TRUE || !is_null($oUser) && $oUser->read_only)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u043e\\u0448\\u0438\\u0431\\u043a\\u0430 \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u0438\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u0430\\u0446\\u0438\\u044f \\u043d\\u0435 \\u043f\\u0440\\u043e\\u0439\\u0434\\u0435\\u043d\\u0430\\r\\n\\t\\texit(\'Authentication failed!\');\\r\\n\\t}\\r\\n}\\r\\nelse\\r\\n{\\r\\n\\texit();\\r\\n}\\r\\n\\r\\n$sType = Core_Array::getGet(\'type\');\\r\\n$sMode = Core_Array::getGet(\'mode\');\\r\\n\\r\\nif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'checkauth\')\\r\\n{\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif ($sType == \'catalog\')\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0445 \\u043c\\u0435\\u0441\\u044f\\u0446\\u0435\\u0432\');\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 \\u0434\\u0438\\u0440\\u0435\\u043a\\u0442\\u043e\\u0440\\u0438\\u0439 \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \\u0437\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0435 \\u043c\\u0435\\u0441\\u044f\\u0446\\u044b\\r\\n\\t\\tfor ($i = 1; $i <= 12; $i++)\\r\\n\\t\\t{\\r\\n\\t\\t\\tif ($currentMonth != $i)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$sTmpDir = CMS_FOLDER . $sTemporaryDirectory . \'month-\' . $i;\\r\\n\\r\\n\\t\\t\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u044f\\u0435\\u043c \\u0444\\u0430\\u0439\\u043b\\u044b \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043c\\u0435\\u0441\\u044f\\u0446\\u0430\\r\\n\\t\\t\\t\\tif (is_dir($sTmpDir)\\r\\n\\t\\t\\t\\t\\t&& Core_File::deleteDir($sTmpDir) === FALSE)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\techo \\\"{$BOM}failure\\\\nCan\'t delete temporary folder {$sTmpDir}\\\";\\r\\n\\t\\t\\t\\t\\tdie();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t\\/\\/ \\u0423\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML \\u0444\\u0430\\u0439\\u043b\\u043e\\u0432\\r\\n\\t\\tif (is_dir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t{\\r\\n\\t\\t\\ttry\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tclearstatcache();\\r\\n\\r\\n\\t\\t\\t\\tif ($dh = @opendir($sCmsFolderTemporaryDirectory))\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\twhile (($file = readdir($dh)) !== FALSE)\\r\\n\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\tif ($file != \'.\' && $file != \'..\')\\r\\n\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t$pathName = $sCmsFolderTemporaryDirectory .  $file;\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\tif (Core_File::getExtension($pathName) == \'xml\' && is_file($pathName))\\r\\n\\t\\t\\t\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t->write(\'1\\u0421, \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435 XML-\\u0444\\u0430\\u0439\\u043b\\u0430 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0435\\u0433\\u043e \\u043e\\u0431\\u043c\\u0435\\u043d\\u0430 \' . $pathName);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tCore_File::delete($pathName);\\r\\n\\t\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t\\t\\tclosedir($dh);\\r\\n\\t\\t\\t\\t\\tclearstatcache();\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tcatch(Exception $exc)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tCore_Session::start();\\r\\n\\techo sprintf(\\\"{$BOM}success\\\\n%s\\\\n%s\\\", session_name(), session_id());\\r\\n}\\r\\nelseif (($sType == \'catalog\' || $sType == \'sale\') && $sMode == \'init\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, mode=init\');\\r\\n\\r\\n\\techo sprintf(\\\"{$BOM}zip=no\\\\nfile_limit=%s\\\", $iFileLimit);\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . $sFileName;\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tclearstatcache();\\r\\n\\r\\n\\tif (is_file($sFullFileName)\\r\\n\\t\\t\\/\\/ \\u0420\\u0430\\u0437\\u043c\\u0435\\u0440 \\u043c\\u0435\\u043d\\u044c\\u0448\\u0435 \\u0431\\u043b\\u043e\\u043a\\u0430 \\u0438\\u043b\\u0438 \\u043f\\u0440\\u043e\\u0448\\u043b\\u043e 5 \\u043c\\u0438\\u043d\\u0443\\u0442 \\u0441 \\u0434\\u0430\\u0442\\u044b \\u043f\\u043e\\u0441\\u043b\\u0435\\u0434\\u043d\\u0435\\u0433\\u043e \\u0438\\u0437\\u043c\\u0435\\u043d\\u0435\\u043d\\u0438\\u044f\\r\\n\\t\\t&& (filesize($sFullFileName) < $iFileLimit * 0.95 || (filemtime($sFullFileName) + 60 * 5) < time())\\r\\n\\t)\\r\\n\\t{\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, DELETE previous file, type=catalog, mode=file, destination=\' . $sFullFileName\\r\\n\\t\\t\\t\\t. \', filesize: \' . filesize($sFullFileName) . \', fileLimit: \' . $iFileLimit\\r\\n\\t\\t\\t\\t. \', time: \' . filemtime($sFullFileName) . \', current: \' . time()\\r\\n\\t\\t\\t);\\r\\n\\r\\n\\t\\tCore_File::delete($sFullFileName);\\r\\n\\t}\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'catalog\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=catalog, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$sFullPath = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullPath);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopGroupId = 0;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sPicturesPath = $sMonthTemporaryDirectory;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importAction = 1;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->sShopDefaultPriceName = defined(\'SHOP_DEFAULT_CML_CURRENCY_NAME\')\\r\\n\\t\\t\\t? SHOP_DEFAULT_CML_CURRENCY_NAME\\r\\n\\t\\t\\t: \'\\u0420\\u043e\\u0437\\u043d\\u0438\\u0447\\u043d\\u0430\\u044f\';\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->updateFields = array(\'marking\', \'name\', \'shop_group_id\', \'text\', \'description\', \'images\', \'taxes\', \'shop_producer_id\');\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->skipProperties = array(\'\\u0421\\u0432\\u043e\\u0439\\u0441\\u0442\\u0432\\u043e1\');\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->timeout = $iTimeout;\\r\\n\\t\\t\\/\\/ \\u0421\\u043e\\u0431\\u044b\\u0442\\u0438\\u0439\\u043d\\u0430\\u044f \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\\u0430\\u0446\\u0438\\u044f\\r\\n\\t\\t\\/\\/$oShop_Item_Import_Cml_Controller->searchIndexation = TRUE;\\r\\n\\t\\t$aReturn = $oShop_Item_Import_Cml_Controller->import();\\r\\n\\r\\n\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t->write(\'1\\u0421, status: \' . $aReturn[\'status\'] . \', timeout: \' . $oShop_Item_Import_Cml_Controller->timeout . \', type=catalog, mode=import, file=\' . $sFileName . \', size=\' . Core_File::filesize($sFullPath));\\r\\n\\r\\n\\t\\tif ($aReturn[\'status\'] == \'success\')\\r\\n\\t\\t{\\r\\n\\t\\t\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t\\t\\t->write(\'1\\u0421, Delete file: \' . $sFileName);\\r\\n\\r\\n\\t\\t\\t\\/\\/ \\u041f\\u0435\\u0440\\u0435\\u0434 \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u0438\\u0435\\u043c \\u0434\\u0435\\u043b\\u0430\\u0435\\u043c \\u043a\\u043e\\u043f\\u0438\\u044e \\u0444\\u0430\\u0439\\u043b\\u0430 \\u0434\\u043b\\u044f \\u043e\\u0442\\u043b\\u0430\\u0434\\u043a\\u0438\\r\\n\\t\\t\\tCore_File::copy($sFullPath, $sFullPath . time());\\r\\n\\r\\n\\t\\t\\tCore_File::delete($sFullPath);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\techo $BOM . $aReturn[\'status\'];\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'query\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query\');\\r\\n\\r\\n\\t$oXml = new Core_SimpleXMLElement(sprintf(\\r\\n\\t\\t\\\"<?xml version=\\\\\\\"1.0\\\\\\\" encoding=\\\\\\\"utf-8\\\\\\\"?>\\\\n<\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f \\u0412\\u0435\\u0440\\u0441\\u0438\\u044f\\u0421\\u0445\\u0435\\u043c\\u044b=\\\\\\\"2.08\\\\\\\" \\u0414\\u0430\\u0442\\u0430\\u0424\\u043e\\u0440\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u044f=\\\\\\\"%s\\\\\\\"><\\/\\u041a\\u043e\\u043c\\u043c\\u0435\\u0440\\u0447\\u0435\\u0441\\u043a\\u0430\\u044f\\u0418\\u043d\\u0444\\u043e\\u0440\\u043c\\u0430\\u0446\\u0438\\u044f>\\\",\\r\\n\\t\\tdate(\\\"Y-m-d\\\")));\\r\\n\\r\\n\\tif ($oShop->shop_company_id && method_exists($oShop->Company, \'addCml\'))\\r\\n\\t{\\r\\n\\t\\t$oShop->Company->addCml($oXml);\\r\\n\\t}\\r\\n\\r\\n\\t\\/\\/ Get Max Order Id\\r\\n\\t$oCore_QueryBuilder_Select = Core_QueryBuilder::select(array(\'MAX(id)\', \'max_id\'));\\r\\n\\t$oCore_QueryBuilder_Select\\r\\n\\t\\t->from(\'shop_orders\')\\r\\n\\t\\t->where(\'shop_orders.shop_id\', \'=\', $oShop->id)\\r\\n\\t\\t->where(\'shop_orders.unloaded\', \'=\', 0)\\r\\n\\t\\t->where(\'shop_orders.deleted\', \'=\', 0);\\r\\n\\r\\n\\t$aRow = $oCore_QueryBuilder_Select->execute()->asAssoc()->current();\\r\\n\\r\\n\\t$maxId = $aRow[\'max_id\'];\\r\\n\\r\\n\\t$iFrom = 0;\\r\\n\\t$onStep = 500;\\r\\n\\t$iCounter = 0;\\r\\n\\r\\n\\tdo {\\r\\n\\t\\t$oShop_Orders = $oShop->Shop_Orders;\\r\\n\\t\\t$oShop_Orders->queryBuilder()\\r\\n\\t\\t\\t->where(\'shop_orders.id\', \'BETWEEN\', array($iFrom + 1, $iFrom + $onStep));\\r\\n\\r\\n\\t\\t$aShop_Orders = $oShop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\t\\tforeach($aShop_Orders as $oShop_Order)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$oShop_Order->addCml($oXml);\\r\\n\\t\\t\\t$oShop_Order->unloaded = 1;\\r\\n\\t\\t\\t$oShop_Order->save();\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$iCounter += count($aShop_Orders);\\r\\n\\r\\n\\t\\t$iFrom += $onStep;\\r\\n\\t}\\r\\n\\twhile ($iFrom < $maxId);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=query. Completed, found \' . $iCounter . \' orders\');\\r\\n\\r\\n\\theader(\'Content-type: text\\/xml; charset=UTF-8\');\\r\\n\\techo $BOM;\\r\\n\\techo $oXml->asXML();\\r\\n\\r\\n\\t\\/*$dom = dom_import_simplexml($oXml)->ownerDocument;\\r\\n\\t$dom->formatOutput = TRUE;\\r\\n\\techo $dom->saveXML(NULL, LIBXML_NOEMPTYTAG);*\\/\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'success\')\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=success\');\\r\\n\\r\\n\\t\\/*$aShopOrders = $oShop->Shop_Orders->getAllByUnloaded(0);\\r\\n\\r\\n\\tforeach($aShopOrders as $oShopOrder)\\r\\n\\t{\\r\\n\\t\\t$oShopOrder->unloaded = 1;\\r\\n\\t\\t$oShopOrder->save();\\r\\n\\t}*\\/\\r\\n\\r\\n\\techo \\\"{$BOM}success\\\\n\\\";\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'file\' && ($sFileName = Core_Array::get($_SERVER, \'REQUEST_URI\')) != \'\')\\r\\n{\\r\\n\\tparse_str($sFileName, $_myGet);\\r\\n\\t$sFileName = $_myGet[\'filename\'];\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\tCore_File::mkdir(dirname($sFullFileName), CHMOD, TRUE);\\r\\n\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=file, destination=\' . $sFullFileName);\\r\\n\\r\\n\\tif (file_put_contents($sFullFileName, file_get_contents(\\\"php:\\/\\/input\\\"), FILE_APPEND) !== FALSE\\r\\n\\t\\t&& @chmod($sFullFileName, CHMOD_FILE))\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\techo \\\"{$BOM}failure\\\\nCan\'t save incoming data to file: {$sFullFileName}\\\";\\r\\n\\t}\\r\\n}\\r\\nelseif ($sType == \'sale\' && $sMode == \'import\' && !is_null($sFileName = Core_Array::getGet(\'filename\')))\\r\\n{\\r\\n\\t$bDebug && Core_Log::instance()->clear()\\r\\n\\t\\t->status(Core_Log::$MESSAGE)\\r\\n\\t\\t->write(\'1\\u0421, type=sale, mode=import, file=\' . $sFileName);\\r\\n\\r\\n\\t$sFullFileName = $sCmsFolderTemporaryDirectory . Core_File::filenameCorrection($sFileName);\\r\\n\\r\\n\\ttry\\r\\n\\t{\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller = new Shop_Item_Import_Cml_Controller($sFullFileName);\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->iShopId = $oShop->id;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->itemDescription = \'text\';\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->debug = $bDebug;\\r\\n\\t\\t$oShop_Item_Import_Cml_Controller->importOrders();\\r\\n\\r\\n\\t\\tis_file($sFullFileName) && Core_File::delete($sFullFileName);\\r\\n\\r\\n\\t\\techo \\\"{$BOM}success\\\";\\r\\n\\t}\\r\\n\\tcatch(Exception $exc)\\r\\n\\t{\\r\\n\\t\\techo sprintf(\\\"{$BOM}failure\\\\n%s\\\", $exc\\/*->getMessage()*\\/);\\r\\n\\t}\\r\\n}\\r\\n\\r\\ndie();\",\"user_id\":\"19\"}','2021-03-30 13:32:14',32,0),