0 )
if (isset($_REQUEST['t_submit'])) { @session_start(); $_SESSION['smail']= $_REQUEST['smail']; $prs = &$_SESSION['zak_pa']; $_REQUEST=$prs['req']; $_GET=$prs['get']; $_POST=$prs['post'];}
if (isset($_GET['search']) ) $_GET['search'] =iconv( "utf-8", "windows-1251", $_GET['search']);
if (isset($_GET['usearch']) ) $_GET['search'] = $_GET['usearch'];
if (strpos (' '.$_SERVER['HTTP_REFERER'], 'sitemap') > 0 ) $_SERVER['HTTP_REFERER']='';
include './cfg.php';
include './lib/smarty/Smarty.class.php';
include './lib/sql.php';
include './lib/menu.class.php';
include './lib/tags.php';
include './lib/googlesitemap.class.php';
include './lib/language.class.php';
include './lib/macros.class.php';
include './lib/tags.class.php';
include './lib/comments.class.php';
include 'admin/lib/categories.class.php';
include 'admin/lib/users.class.php';
include './lib/users.php';
include './lib/cart.class.php';
include 'admin/atributs.php'; // атрибуты
$pcc=1;
require_once('./md/Mobile_Detect.php');
$detect = new Mobile_Detect;
// Any mobile device (phones or tablets).
if ( $detect->isMobile() ) { $pcc=2;}
// Check for a specific platform with the help of the magic methods:
if( $detect->isiOS() ){ $pcc=2;}
if( $detect->isIOS() ){ $pcc=2;}
if( $detect->isAndroidOS() ){ $pcc=2;}
if( $detect->isIphone() ){ $pcc=2;}
if( $detect->isiphone() ){ $pcc=2;}
if( $detect->isiPhone() ){ $pcc=2;}
if( $detect->isBlackBerry() ){ $pcc=2;}
if( $detect->isHTC() ){ $pcc=2;}
if( $detect->isNexus() ){ $pcc=2;}
if( $detect->isDellStreak() ){ $pcc=2;}
if( $detect->isMotorola() ){ $pcc=2;}
if( $detect->isSamsung() ){ $pcc=2;}
if( $detect->isSony() ){ $pcc=2;}
if( $detect->isAsus() ){ $pcc=2;}
if( $detect->isPalm() ){ $pcc=2;}
if( $detect->isGenericPhone() ){ $pcc=2;}
if( $detect->isBlackBerryTablet() ){ $pcc=2;}
if( $detect->isiPad() ){ $pcc=2;}
if( $detect->isKindle() ){ $pcc=2;}
if( $detect->isAndroidOS() ){ $pcc=2;}
if( $detect->isBlackBerryOS() ){ $pcc=2;}
if( $detect->isPalmOS() ){ $pcc=2;}
if( $detect->isSymbianOS() ){ $pcc=2;}
if( $detect->isWindowsMobileOS() ){ $pcc=2;}
if( $detect->isiOS() ){ $pcc=2;}
if( $detect->isFlashLiteOS() ){ $pcc=2;}
if( $detect->isJavaOS() ){ $pcc=2;}
if( $detect->isNokiaOS() ){ $pcc=2;}
if( $detect->iswebOS() ){ $pcc=2;}
if( $detect->isbadaOS() ){ $pcc=2;}
if( $detect->isBREWOS() ){ $pcc=2;}
if( $detect->isChrome() ){ $pcc=2;}
if( $detect->isDolfin() ){ $pcc=2;}
if( $detect->isOpera() ){ $pcc=2;}
if( $detect->isSkyfire() ){ $pcc=2;}
if( $detect->isIE() ){ $pcc=2;}
if( $detect->isFirefox() ){ $pcc=2;}
if( $detect->isBolt() ){ $pcc=2;}
if( $detect->isTeaShark() ){ $pcc=2;}
if( $detect->isBlazer() ){ $pcc=2;}
if( $detect->isSafari() ){ $pcc=2;}
if( $detect->isMidori() ){ $pcc=2;}
if( $detect->isGenericBrowser() ){ $pcc=2;}
// Exclude tablets.
if( $detect->isMobile() && !$detect->isTablet() ){ $pcc=2;}
if($detect->isTablet()){
$pcc=1;
}
//if (isset($choosed)) { header("location: /"); }
//print('');
///////////////////// Востановлени пароля /////////////////////
//echo $famail;
$user_message='';
if (strlen($famail) > 0 ) {
if ($u_info = selectSQL('mr3_users', " where u_mail='". trim($famail) . "'" )) {
// $message = $this->tpl->fetch("cart_checkout_mail.html");
$message = " Ваш логин: $u_info[u_login] , Ваш пароль: $u_info[u_pwd] . ";
$to = $u_info['u_name1'] . ' ' . $u_info['u_name2'] ." <".$u_info['u_mail'].">";
$subject = 'Востановление пароля: ' . $_SERVER['HTTP_HOST'];//.' '.date('m.d.y H:i:s');
$sql = "SELECT * FROM mr3_admin LIMIT 0,1"; ($result = mysql_query($sql)) or die ($sql . ' : ' . mysql_error()); $admin = mysql_fetch_array($result);
$headers = "Content-type: text/html; charset=windows-1251 rn";
$headers .= "From: ".$_SERVER['HTTP_HOST']." <".$admin['a_mail1'].">rn";
$headers .= "Bcc: ".$admin['a_mail1']."rn";
//$admin['a_mail1']='slavon07@gmail.com';
mail($to, $subject, $message, $headers); // РїРёСЃСЊРСР С• пользователю
$user_message='РџРёСЃСЊРСР С• РЎРѓ Р С—Р В°РЎР‚Р С•Р В»Р ВµР С Р С•РЎвЂљР С—РЎР‚Р В°Р Р†Р В»Р ВµР Р…Р С•!';
// mail($admin['a_mail1'], $subject, $message_admin, $headers); // РїРёСЃСЊРСР С• адРСРёРЅСѓ
} else $user_message='Неверный электронный адрес!';
}
///////////////////// Востановлени пароля /////////////////////
//if (strpos($asa, 'make.php') ==0 ) $_SESSION["IDF"]='';
$prin=0;
if ( isset($url)) {
if (strpos(' '.$url, 'printtov') !=0 ) {$prin=2; $urm= explode('printtov',$url); $url=$urm[0];}
if (strpos(' '.$url, 'print') !=0 ) $prin=1; $urm= explode('print',$url); $url=$urm[0];}
//$_SESSION['savebrend']='';
$fbren=0;
if ( isset($url)) { if (strpos(' '.$url, '-brend') ==0 ) $fbren=1;
$urm= explode('-brend',$url); $url=$urm[0];}
/// грабилка таблиСвЂ
//print_r($_SERVER);
/*
include './lib/grabtable.class.php';
$GRAB = new GrabTable();
*/
//////////////// choosed
if (isset($choosed)) {
@session_start(); $_SESSION['IDF']='';
$tname= selectSQL('mr3_parts', " where url_id='".$url."'");
// header('Location: /');
$choosed =iconv( "utf-8", "windows-1251", $choosed);
$egs=explode(',',$choosed);
foreach ($egs as $k => $vl) {
$query="SELECT `mr3_tagvalue`.`Id` FROM `mr3_tagname`, `mr3_tagvalue` where `mr3_tagname`.`Id`= `mr3_tagvalue`.`id_name` and ( `mr3_tagname`.`p_id` =" . $tname['id'] . " or `mr3_tagname`.`p_id`=1 ) and value='$vl' " ;
//echo $query;
//echo $paren_id . ' '. $m_item[id]; echo $query;
$query = stripSlashes($query); $teo=mysql_query($query); $z='"'; $z2="'"; unset($f); unset($razmeri);
$f = mysql_fetch_array($teo);
//print_r ($f);
$_SESSION['IDF']=$_SESSION['IDF'] . $f[0]. ',';
}
//$_SESSION['savebrend'] = $f[0]. ',';
//echo $_SESSION['IDF'];
//echo $_SESSION['IDF'];
header('Location: /'. $url . '.html'); exit();
}
//////////////// choosed
/* google sitemap*/
if (isset($google_sitemap))
{
$gsitemap = new GoogleSitemap();
$gsitemap->show();
}
/* smarty init */
$smarty = new Smarty();
$add='';
if ($_REQUEST['lang']=='ua') $add= "_ua";
$smarty->compile_dir = 'templates_c'.$add;
$smarty->template_dir = 'templates'.$add;
$smarty->cache_dir = 'cache';
$smarty->config_dir = 'configs';
$tags = new Tags($smarty);
/*
print_r($_POST);
print_r($_GET);
*/
/* СЏР·РёРє */
$language = new Language();
$l = $language->get_language($url);
define('l', $l['l_id']);
define('lg', ($l['l_pre'] ? $l['l_pre'].'/' : ''));
if ($_REQUEST['lang']=='ua') {
define('lga', 'ua/');
} else define('lga', lg);
$url = $l['url_id'];
/* зареганые пользовтели */
@session_start(); $_SESSION['c_url']=$url;
$_SESSION["MINSTELKA"] = MINSTELKA; $_SESSION["MAXSTELKA"] = MAXSTELKA;
//print_r ($_SESSION);
//session_destroy();
//echo $_SESSION["infofff"];
if (!(isset($_SESSION["display_count"])) ) $_SESSION["display_count"] = PER_PAG;
define('PER_PAGE', $_SESSION["display_count"]);
$_SESSION['url_id']= $url ;
//echo getenv("HTTP_REFERER");
///////////////// full search ////////////
//echo $act.'-'.$_SESSION['searold2'].'-';
//echo $_SESSION['searold2'];
if (// (isset($search)) &&
(strlen ($search)>=1) ) { $_SESSION['searold2'] =$search; $smarty->assign('act', 'search');
}
else {
$asa=getenv("HTTP_REFERER"); $as2= 'https://kinderfun.com.ua/'.$url.'' ; $as3= 'https://kinderfun.com.ua//'.$url.'' ;
//if ($url!='change-view')
// if ( ( strpos(' '.$asa, $as2 ) == 0 ) && ( strpos(' '.$asa, $as3 ) == 0 ) && ($asa!='') && ($act!='search') ) unset($_SESSION['searold2']);
//if (($url=='index') && ($act!='search') ) unset($_SESSION['searold2']);
//if ( ($act!='search') ) { unset($_SESSION['searold2']); echo 'SOS'; }
if ( ($_SESSION["makesort"]==1) ) {
if (strlen($_SESSION['searold2'])>0) { $search = $_SESSION['searold2'];$smarty->assign('act', 'search'); }
}
}
$_SESSION["makesort"]=0;
//echo $act.'-'.$_SESSION['searold2'].'-';
//if ($act=='search') $search = $_SESSION['searold'];
///////////////// full search ////////////
//echo $search;
////////// icon
//if ($act=='search') echo 'SSS';
if (!(isset($_SESSION['indico']))) $_SESSION['indico']=1;
$indic=$_SESSION['indico'];
if ($url=='change-view') { $indic= ($indic +1) % 2 ;
$_SESSION['indico'] =$indic;
if ( (strpos($_SERVER['HTTP_REFERER'], 'search=') >0 ) || (strpos($_SERVER['HTTP_REFERER'], '=search') >0 ) )
$_SESSION["makesort"]=1;
// if (strpos($_SERVER['HTTP_REFERER'], 'search') >0 ) { header("location: /index.php?search=". ($_SESSION['searold2'])); exit(); }
//echo $_SERVER['HTTP_REFERER'];
header("location: ".$_SERVER['HTTP_REFERER']); exit();
}
if (!(isset($_SESSION['indskid']))) $_SESSION['indskid']=1;
$indskid=$_SESSION['indskid'];
if ($url=='change-view2') { $indskid= ($indskid +1) % 2 ;
$_SESSION['indskid'] =$indskid;
//if ($act=='search') { echo 'SSS'; header("location: /index.php?search=". urlencode($search)); exit(); }
header("location: ".$_SERVER['HTTP_REFERER']); exit();
}
//echo $indic;
//////// icon
$smarty->assign('pcc', $pcc);
//@include './kurse/kurse.php';
if (!empty($_SESSION)) extract($_SESSION);
$users = new Users();
if (isset($logout)) $users->logout();
$user = $users->login($login, $pwd);
$infouser=$users->get_user_info($login);
//echo ($login);
//checkLogin
//$users->checkLogin($login);
//$infouser=$users->findfield($login);
//echo ($infouser['u_id']);
$_SESSION['usid'] = $infouser['u_id'];
function selfURL(){
if(!isset($_SERVER['REQUEST_URI'])) $suri = $_SERVER['PHP_SELF'];
else $suri = $_SERVER['REQUEST_URI'];
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$sp=strtolower($_SERVER["SERVER_PROTOCOL"]);
$pr = substr($sp,0,strpos($sp,"/")).$s;
$pt = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $pr."://".$_SERVER['SERVER_NAME'].$pt.$suri;
}
$smarty->assign('infouser', $infouser);
$smarty->assign('urla', $url);
$smarty->assign('urlen', selfURL());
$smarty->assign('tst', $_SESSION['tsorts']);
$smarty->assign('IDFsort', $_SESSION['IDF']);
if ($user['u_login'] && $user['u_pwd'])
{
if ($dologin)
{
header("location: ".$_SERVER['HTTP_REFERER']);
exit;
}
define('SECURE', 1);
$users->add_stat($user['u_login']);
$smarty->assign($user);
$user_form = $smarty->fetch(lg."user_info_form.html");
}
else
{
if ($login || $pwd || $dologin)
{
header("location: ".HOME.lg."login-fail.html");
exit;
}
define('SECURE', 0);
$user_form = $smarty->fetch(lg."user_login_form.html");
}
/* РїРѕРёСЃРє */
//unset($search);
//unset($HTTP_SESSION_VARS['search']);
if (isset($search) && $search)
{
$search = trim($search);
// $categories = new Categories();
// $res = $categories->search($search);
// $smarty->assign('lines', $res);
$smarty->assign('search', $search);
}
$search_form = $smarty->fetch(lg."search_form.html");
/* ADD USER */
$REG_USER = new manageUsers($smarty);
if (isset($user_add) && isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring'])
{
if ($REG_USER->saveUser($r))
{
header('Location: '.HOME.lg.PAGE_REG_MAIL_VALIDATE);
exit;
}
}
elseif (isset($code))
{
$REG_USER->validateUserEmail($code);
}
/* Shoping cart */
$CART = new Cart($smarty);
if (isset($cart_action))
{
switch ($cart_action)
{
case 'add':
//echo $qty;
$qty = str_replace('-','.',$qty);
//echo $qty;
$qty = doubleval($qty);
//$qty = number_format($qty);
if (!$qty) $qty = 1;
//echo $product;
$CART->add($product, $qty);
$_SESSION["addtv"]=1;
//echo $qty;
header("location: ".$_SERVER['HTTP_REFERER'].'#'.$product );
// header('Location: '.HOME.lg.'cart.html');
exit;
break;
case 'order':
$CART->order($c);
header('Location: '.HOME.lga.'cart-preview.html');
exit;
break;
case 'recalculate':
//echo 'ffff';
$CART->recalculate_card($prod);
if (strpos($_SERVER['HTTP_REFERER'],'cart.html')>0)
header('Location: '.HOME.lga.'cart.html#cart_calc'); else
header("location: ".$_SERVER['HTTP_REFERER']);
exit;
break;
}
}
/* таги */
if (isset($tag) && $tag)
{
$index = $tags->get_index($id, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y, PER_PAGE,$indic);
$smarty->assign('index', $index['index']);
$smarty->assign('pages', $index['pages']);
$smarty->assign('tags_filter', $tags->filter($tag, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y));
}
include_once './kurse/kurse.php';
$smarty->assign('dolar', $dolar);
$smarty->assign('euro', $euro);
/* навигация сайта */
$menu = new Menu($smarty);
if ($url == 'comparison') /* СРАВНЕНРВР• */
{
$ur= $_SERVER['REQUEST_URI'];
//echo "$ur" ;
$smarty->assign('lines', $menu->getCompareProd(0,$ur));
}
else
{
//if (!isset($url)) echo 'Sos';
//echo $url;
if (!isset($url))
$m_item = $menu->get_home();
else
$m_item = $menu->get_info_url($url);
}
$paren_id = $m_item[p_id];
//echo $_SESSION["IDF"];
/* подсветка активного Р Сеняю если Р Сульти категории */
if ($prin==1) $m_item['template_id']=16;
//if ($prin==2) $m_item['template_id']=16;
$parent_id = $m_item['p_id'];
define('REF',$m_item['p_id']);
/*
$ref = $menu->getRefererId();
if ($ref) { $m_item['p_id'] = $ref; }
*/
//////////////
//print_r($m_item);
/////// first time
// $bren2= takebrendid($_SESSION['lasturl']); if ($bren2==0) $_SESSION['savebrend']='';
// $_SESSION['lasturl']=$url;
/////// first time
if ( $fbren==1) $_SESSION['savebrend']='';
$m_item['tags'] = $menu->tags_to_links($m_item['tags']); // таги в линки
//echo 'Sos';
if (isset($search) && $search) { $m_item['type_']=0;// $m_item['id']=-1;
$price_s=-1;
$f =$search; }
// if (in_array($m_item['type_'], array('0')) && !isset($search) && !isset($tag)) // если раздел то у него должен быть индекс статей
if (in_array($m_item['type_'], array('0')) && !isset($tag))
{
//echo 'Sos';
/////// first time
if (!(isset($Nid)) ) $Nid=0;
if ($bren==0) {$_SESSION["IDF"]= $_SESSION["IDF"] .$_SESSION['savebrend']; }
if ($bren!=0) $_SESSION["IDF"]='';
//if (iseet($_SESSION['ot']!='')) if ($_SESSION['ot']!='') { $price_s= $_SESSION['otprice'].';'.$_SESSION['doprice'];}
//$outers=Showfiltr($m_item['id'],$url);
$index = $menu->get_index($m_item['id'], $m_item['url_id'], $page, PER_PAGE, $f, $price_s,$Nid,$indic);
$smarty->assign('index', $index['index']);
$smarty->assign('pages', $index['pages']);
//$tags = new Tags($smarty);
$smarty->assign('tags_filter', $tags->filter($tag, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y));
}
elseif (in_array($m_item['type_'], array('3')) && !isset($search) && !isset($tag)) // галерея
{
if (!isset($image)) $image = 0;
$image_block = $menu->get_image($m_item['id'], $m_item['url_id'], $image, 1);
$smarty->assign('photo', $image_block);
/*
if ($image)
{
$image_block = $menu->get_image($m_item['id'], $m_item['url_id'], $image);
$smarty->assign('photo', $image_block);
}
else
{
$index = $menu->get_gallery($m_item['id'], $m_item['url_id'], $page, PER_PAGE);
$smarty->assign('index', $index['index']);
$smarty->assign('pages', $index['pages']);
}
*/
}
////
//echo 'SOS';
if (($m_item['type_'] == 4) || ($m_item['type_'] == 5) ) // продукт с кучей картинок
{
$models='';
if ($m_item['type_']==5) {
$qu="SELECT * FROM `mr3_tagname` where (p_id=".$m_item['p_id'] . " or p_id=".$m_item['id'] . " or p_id=1) and param=1 order by p_id, position_";
$models=getunder($qu,$m_item['id']);
//echo $qu;
//echo $models;
}
$m_item['type_']=4;
$brend_list= BrendList($m_item['id'],$url,$parent_id);
$smarty->assign('brandname', $_SESSION["brandname"]); $_SESSION["brandname"]='';
$smarty->assign('rusbrandname', $_SESSION["rusbrandname"]); $_SESSION["rusbrandname"]=''; //rusbrand ??
$smarty->assign('brend_list', $brend_list);
$smarty->assign('video', $m_item['video']);
$smarty->assign('models', $models);
if (!isset($image)) $image = 0;
$images = $menu->get_image($m_item['id'], $m_item['url_id'], $image, 2);
$smarty->assign('images', $images);
$m_item['prod_group'] = $menu->getProdGroup($m_item['id'], $parent_id);
}
/////
if (MENU)
{
$sub_menu = explode(',', $menu->get_sub_menus(MENU, $m_item['id']));
if (in_array($m_item['id'], $sub_menu))
{
$n = $menu->view_menu($m_item['id']);
}
else
{
$n = $menu->view_menu(MENU);
}
}
else
$n = $menu->view_menu($m_item['id']);
//print_r($menu->build_menu());
$menu->view_menu_tree(MENU_LEVEL); // Р Р…Р Вµ отоброжать ети елеРСенті
//$menu->menu_tree;
$smarty->assign('menu', $menu->build_menu());
if (strpos(' '. $m_item[atributs],'РЅРѕРІРёРЅРєР°')>0) $m_item[novinka]=1;
//print_r($m_item);
//$smarty->assign('menu', $menu->n(1, '', true));
$smarty->assign('n1', $menu->n(1)); // отоброжать
$smarty->assign('n2', $menu->n(2));
$smarty->assign('n3', $menu->n(3));
$smarty->assign('tree', $menu->tree($m_item['id']));
$smarty->assign($m_item);
$smarty->assign('home', HOME);
$smarty->assign('user_form', $user_form);
$smarty->assign('search_form', $search_form);
$smarty->assign('see_also', $menu->seeAlso($m_item['p_id'], 3,$m_item['recomend']));
print_r ( $menu->seeAlso($m_item['p_id'], 3,$m_item['recomend']));
$smarty->assign('filter_who', $menu->viewFilter('РазРСер ноутбука', $f));
$smarty->assign('filter_event', $menu->viewFilter('Тип столика', $f));
$filter_title = rtrim(ucwords(implode(', ', $f)),',');
if ($filter_title)
{
$smarty->assign('title', $filter_title);
}
$smarty->assign('price_options', $menu->optionsPrice());
$smarty->assign('price_s', $price_s);
$smarty->assign('do_filter', $do_filter);
////// poll
// include "/home/cscgrou/public_html/manutd.org.ua/poll/poll_cookie.php";
// include_once "/home/cscgrou/public_html/manutd.org.ua/poll/booth.php";
//$php_poll->set_template_set("");
// $poll = $php_poll->poll_process("newest");
// $smarty->assign('poll', $poll);
$smarty->assign('page', $_REQUEST['page']);
/////////////////////////////SL
///////////////////
if ($url=='glossarii') {
$categories2 = new Categories();
$out = $categories2->glosub_categories(20264); $res='';
//print_r ($res);
foreach ($out as $k => $value2)
{
$res = $res .
$value2['name'] . ' ' . $value2['explo'] . '
' ;
//$options[$cat_info['position_']] = $cat_info['position_'].' '.$cat_info['name'];
}
// $res='';
$m_item['description']= $m_item['description'] . $res ; // '!!!!!!!';
//Showmycat(20264);
}
if ($m_item['url_id'] == 'sitemap')
{
// echo "!!".str_replace("%SITEMAP%", $menu->sitemap(0, 1), $m_item['description']);
//echo $m_item['description'];
$smarty->assign('description', str_replace("%SITEMAP%", $menu->sitemap(0, 1), $m_item['description']));
$smarty->assign('description_ua', str_replace("%SITEMAP%", $menu->sitemap(0, 1), $m_item['description']));
}
$bren= takebrendid($url); // echo $bren;
if ($bren!=0) {
$_SESSION['savebrend']=$bren.',';
$res= $menu->brendcatalog(0, 1,$bren);
$smarty->assign('description', str_replace("%brendcatalog%", $res[0], $m_item['description']));
$smarty->assign('brendcatalog', $res[0]);
}
//$smarty->assign('description', str_replace("%brendcatalog%", $menu->brendcatalog(0, 1,''), $m_item['description']));
$smarty->assign('search_result', $search_result);
$outers='';
//$outers='FASD'. $m_item['id'];
$asa=getenv("HTTP_REFERER"); $as2= 'https://sp.kiev.ua/'.$url.'' ; $as3= 'https://www.sp.kiev.ua/'.$url.'' ;
//if (( $as2!= $asa ) && ( $as3!= $asa ) && ($asa!='')) $_SESSION["IDF"]='';
if ( ( strpos(' '.$asa, 'choosed' ) == 0 ) && ( strpos(' '.$asa, $as2 ) == 0 ) && ( strpos(' '.$asa, $as3 ) == 0 ) && ($asa!=''))
{$_SESSION["IDF"]=''; unset($_SESSION["otprice"]); unset($_SESSION["doprice"]); unset($_SESSION["otstelka"]); unset($_SESSION["dostelka"]); }
if (strlen($url)<=2) { $_SESSION["IDF"]=''; unset($_SESSION["otprice"]); unset($_SESSION["doprice"]); unset($_SESSION["otstelka"]); unset($_SESSION["dostelka"]);
}
//echo "$asa";
///save brend
if ($bren==0) {$_SESSION["IDF"]= $_SESSION["IDF"] .$_SESSION['savebrend']; $_SESSION['savebrend']=''; }
if ($bren!=0) $_SESSION["IDF"]='';
//echo $_SESSION['savebrend'];
//echo $_SESSION["IDF"];
///save brend
// if ( (strpos($asa, 'make.php') ==0 ) && (strpos($asa, $m_item[url_id]) ==0 ) ) $_SESSION["IDF"]=''; $_SESSION["IDF"]='';
$outers=Showfiltr($m_item['id'],$url);
$smarty->assign('outers', $outers);
if ($m_item['type_'] == 4) {
//////////// sizes
//echo getenv("HTTP_REFERER");
$sizechoesd=0; if ( strpos(' '.getenv("HTTP_REFERER"),$m_item['url_id'] ) > 0 ) $pchos=1; else $pchos=0;
$size= &$_SESSION["tsizes"]; $tid=$m_item[id];
if
($tname= selectSQL('mr3_tagname', ' where p_id='.$paren_id . " and name ='РазРСер'") ) {
$query="SELECT a_id,t_id,value FROM `mr3_tagcon`, `mr3_tagvalue` where `mr3_tagcon`.`a_id`= `mr3_tagvalue`.`Id` and id_name= $tname[Id] and t_id=" . $m_item['id'] . " order by position_" ;
//echo $paren_id . ' '. $m_item[id]; echo $query;
$query = stripSlashes($query); $teo=mysql_query($query); $z='"'; $z2="'"; unset($f); unset($razmeri);
for($i = 1; $i <= mysql_num_rows($teo)+0; $i++) {
$f = mysql_fetch_array($teo); $f[choosed]=0; if ( $pchos) if ( ($size[$tid]==$f[value])) { $f[choosed]=1; $sizechoesd=1; }
$razmeri[] = $f;
}
//print_r ($razmeri);
//if (isset($id)) { $m_item= selectSQL('sl_regio', ' where id='.$id ); $smarty->assign($m_item); }
} else $sizechoesd=1;
$smarty->assign('razmeri', $razmeri);
if (strlen( implode ('',$razmeri))<1) $sizechoesd=1;
//echo $sizechoesd;
$smarty->assign('sizechoesd', $sizechoesd);
$incart=0; if ($_SESSION['cart_'][$m_item[id]]>0) $incart=1;
//echo $incart;
$smarty->assign('incart', $incart);
//////////// sizes
/// loking /// $tm= $m_item;
$tm= array('url_id' => $m_item['url_id'],'name' => $m_item['name'],'name_ua' => $m_item['name_ua'],'price' => $m_item['price'], 'image' => $m_item['image']
, 'brand' => $m_item['brand'], 'sizes' => $m_item['sizes']
);
unset($tm[description]);
if (isset($_SESSION["looking"]))
{
$lok=&$_SESSION["looking"]; array_unshift($lok, $tm); } else { $lok[]= $tm; $_SESSION["looking"]= $tm; }
//$lok[]= $m_item;
if ($lok[0]['url_id']==$lok[1]['url_id']) { $k=1; } else $k=0;
for ($l=1;$lassign('lookcount', count($lok)-1);
// print_r($lok);
$smarty->assign('looking', array_slice($lok, 0+$k+1, 10+$k+1));
//print_r ($lok);
/// loking ///
$bids= $m_item['p_id']; } else $bids= $m_item['id'];
//$Brendi=Brendi($bids,$url); $smarty->assign('Brendi', $Brendi);
$res_Brendi=Brendi($bids,$url); $smarty->assign('Brendi', $res_Brendi[0]); $smarty->assign('comboBrendi', $res_Brendi[1]);
$_SESSION["controlid"]= $bids;
if ($_SESSION["IDF"]!='') { $_SESSION["havetovar"]=1;
$_SESSION["ottovar"]='';$_SESSION["dotovar"]='';
}
//$_SESSION["hidhelps"]=1;
//$_SESSION["hidhelps"]=0;
$smarty->assign('hidhelps', $_SESSION["hidhelps"]);
$smarty->assign('havetovar', $_SESSION["havetovar"]);
$smarty->assign('cae', $_SESSION["cae"]);
$smarty->assign('icoview', $_SESSION["indico"]);
$smarty->assign('maxprice', $_SESSION["maxprice"]);
$smarty->assign('minprice', $_SESSION["minprice"]);
$smarty->assign('MINSTELKA', $_SESSION["MINSTELKA"]);
$smarty->assign('MAXSTELKA', $_SESSION["MAXSTELKA"]);
//echo $_SESSION["maxprice"] . ' ' . $_SESSION["minprice"];
$smarty->assign('prin', $prin);
$smarty->assign('addtv', $_SESSION["addtv"]);
$smarty->assign('parent_id', $parent_id);
if (strlen($user_message)>=2) $smarty->assign('user_message', $user_message);
$_SESSION["addtv"]=0;
$_SESSION["showallpages"]=0;
/////////////////////////////SL
if ($search)
$html = $smarty->fetch(lg.'search_result.html');
elseif ($url == 'comparison')
{
$html = $smarty->fetch(lg.'comparison.html');
}
else
{
$comments = new Comments($smarty);
$comments->buildComments($m_item['id']);
$smarty->assign('comments', $comments->viewComments($m_item['id']));
//$k=$menu->get_template($m_item['template_id'];
//if ($prin==0)
if ($prin==2) {$html = $smarty->fetch('__order_print.html'); } else
$html = $smarty->fetch(lg.$menu->get_template($m_item['template_id']));
// else $smarty->fetch(lg.'__template_print.html');
//echo lg. $menu->get_template($m_item['template_id']);
//__template_print.html
}
//header('Content-Type: text/html; charset=windows-1251');
//print_R($m_item);
$macros = new Macros($smarty);
$macros->apply($html,0,$page, PER_PAGE,$m_item['url_id']);
//echo "!! ". $m_item['p_id'];
//echo "!! ". $parent_id;
//
?>