assign( 'cart', $cart['cart'] ); $smarty -> assign( 'cart_summ', $cart['summ'] ); /* ---------------------------------------------------------------------- 25.22.2023 Получаем корневые товары интернет-магазина ---------------------------------------------------------------------- */ if ($_SERVER['SERVER_NAME']=='tk-ligat.ru')$smarty -> assign( 'menu_internet_magazin', \DB::getAll( "SELECT * FROM `tovar_category` WHERE `category`=0 AND `status`=1" ) ); if ($_SERVER['SERVER_NAME']=='v.yurecnt.ru')$smarty -> assign( 'menu_internet_magazin', \DB::getAll( "SELECT * FROM `tovar_category` WHERE `category`=1 AND `status`=1" ) ); /* ---------------------------------------------------------------------- 26.02.2023 Получаем количество товара в корзин ---------------------------------------------------------------------- */ $smarty -> assign( 'kolvo_tovar_in_cart', \DB::getAll("SELECT COUNT(*) FROM `cart` WHERE `user_id`=? AND `order` IS NULL", ($_SESSION['user_id'])?$_SESSION['user_id']:session_id() )[0]['COUNT(*)'] ); /* ---------------------------------------------------------------------- 09.12.2022 Выбираем шаблон модуля ---------------------------------------------------------------------- */ if ( file_exists ( 'skin/' . $_SERVER['SERVER_NAME'] . '/inc/mod/' . MOD . '/index.html' ) ) $smarty -> display( 'skin/' . $_SERVER['SERVER_NAME'] . '/inc/mod/' . MOD . '/index.html', @$_GET['id'] ); else $smarty -> display( 'api/modules/' . MOD . '/index.html', @$_GET['id'] ); $user_id = ( $_SESSION['user_id'] ? $_SESSION['user_id'] : session_id() ); $time_site = round( microtime(true) - $start_site, 5 ); \DB::add( "INSERT INTO `site_speed` ( `t`, `mod`, `mod_id`, `speed`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )", array( time(), MOD, $_GET['id'], $time_site, $user_id ) ); ?>