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 \r\n"; $headers .= "From: ".$_SERVER['HTTP_HOST']." <".$admin['a_mail1'].">\r\n"; $headers .= "Bcc: ".$admin['a_mail1']."\r\n"; //$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(); */ @session_start(); //echo $_GET['url']; exit(); //$_SESSION=array();print_r($_SESSION); if (strlen($_COOKIE['my_ses'])>6) { $dats = @unserialize( base64_decode ( $_COOKIE['my_ses'])); if (is_array($dats)) if ($_SESSION[live]!=1) { $_SESSION =$dats; $_SESSION[live]=1; } //print_r($dats); } //echo $_SESSION['IDF']; //if (intval($page)<=0) //print_r($_SESSION); if ( (!(strstr( $_SERVER['HTTP_REFERER'] , ''.$_GET['url'] ) ) ) && (!(strstr( $_SERVER['HTTP_REFERER'] , 'make.php' ) ) ) ) // //if (strlen($_SESSION['IDF'])>2) { //header('Location: /make.php?act=aclear&url='. $_GET['url'] . ''); exit(); //if (intval($page)<=0) die('QQQ'); //$_SESSION['IDF']=''; } //if ($_GET['url'] != $_SESSION['last_url'] ) unset($_SESSION['IDF']); //echo $_SERVER['HTTP_REFERER']; ////print_R($_SESSION); //echo $_SERVER['HTTP_REFERER'].' '; echo $_GET['url'];//exit();;; //$_SESSION['last_url'] = ''. $_GET['url']; // $_SERVER['REQUEST_URI'];// ''.$_GET['url']; //////////////// 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'; //$smarty->registerPlugin("modifier",'base64_encode', 'base64_encode'); $tags = new Tags($smarty); $smarty->assign('translate', $GLOBALS['trans']); // ==================================================================== $res= getMultiRowQuery(' select count(id) as cnt ,p_id from mr3_parts where show_cat=1 and type_ = 4 group by p_id','p_id'); $res2 = getMultiRowQuery(' select id,p_id from mr3_parts where type_ = 0 and show_cat=1 order by id desc','id'); foreach ( $res2 as $vs ) $res[$vs[p_id]]['cnt'] += intval($res[$vs[id]]['cnt']); // $smarty->assign('cat_count', $res); //print_R($res); // ==================================================================== /* 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["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=$_SERVER['HTTP_REFERER']; $as2= 'https://bogatyri.com.ua/'.$url.'' ; $as3= 'https://bogatyri.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(); } header("location: ".$_SERVER['HTTP_REFERER']); } 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']); } //echo $indic; //////// icon //@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.lga."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.lga.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; $CART->add($product, $qty); $_SESSION["addtv"]=1; //echo $qty; header("location: ".$_SERVER['HTTP_REFERER'].'#'.$product ); // header('Location: '.HOME.lga.'cart.html'); exit; break; case 'order': $c['phone'] = $cc['phone1'] . $cc['phone2'] . $cc['phone3'] ; // echo 'Location: '.HOME.lga.'thanks.html'; // die(); $CART->order($c); header('Location: '.HOME.lga.'thanks.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); } //echo 'SSS821221zz'; $GLOBALS['cur_obj'][id] = $m_item[id]; $GLOBALS['cur_obj'][p_id] = $m_item[p_id]; $GLOBALS['cur_obj'][type_] = $m_item[type_]; $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']; $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 'SOS2szz'; if (($m_item['type_'] == 4) || ($m_item['type_'] == 5) ) // { if ($m_item['show_cat']==0) { header("location: ".HOME.lga."404.html"); die(); } // print_r($m_item); die(); //echo $m_item['art2']; if (strlen(trim($m_item['art2']))>1) $sames = getMultiRowQuery(" select id,p_id, url_id, art,image, art2, name, title, q, price, brand, sizes, cvet from mr3_parts where art2= '".mysql_real_escape_string($m_item['art2'])."' limit 0, 50 ",'id'); //echo " select id,p_id, url_id, art, art2, name, title, q, price, brand, sizes, cvet from mr3_parts where type_=4 and art2= '".mysql_real_escape_string($m_item['art2'])."'"; unset($sames[$m_item['id']]); $smarty->assign('same_tovars', $sames); //print_r($sames ); $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($n); $menu->view_menu_tree(MENU_LEVEL); // //$menu->menu_tree; $smarty->assign('menu', $menu->build_menu()); //print_R( $menu->build_menu()); //die(); //$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'])); //echo ($m_item['id']); //print_R($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'])); $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); /////////////////////////////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') { $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://bogatyri.com.ua/'.$url.'' ; $as3= 'https://bogatyri.com.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 $page; //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); $size= &$_SESSION["tsizes"]; //unset($size); //print_R($size); echo 'ss'; 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]; //print_R($size); // (p_id=1 or p_id='.$paren_id . ") and if ($tname= selectSQL('mr3_tagname', ' ' . " where (p_id=1 or p_id=".$paren_id . ") and name ='' order by p_id ") ) { $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; } } unset($razmeri); //echo $m_item['sizes']; $razmeri_s= explode(',', $m_item['sizes']); if (count($razmeri_s)==1) if (strlen(trim($m_item['sizes']))<=1) unset($razmeri_s[0]); //print_R($razmeri_s); if (count($razmeri_s)>0)foreach ($razmeri_s as $kk => $vv ) { $razmeri[$kk][t_id]= $m_item['id'] ; $razmeri[$kk][value]= $vv ; } //print_R($razmeri); if (count($razmeri)>0) $sizechoesd=1; $smarty->assign('razmeri', $razmeri); if (strlen($razmeri)<1) $sizechoesd=1; $sizechoesd=0; ///////////////////// lack sizechoesd ////////////////////////////// $smarty->assign('sizechoesd', $sizechoesd); //////////// sizes $tts = explode(',', $m_item['sizes']); foreach ( $tts as $ks => $vs ) $tts[$ks] = hed('(', $vs); $m_sizes = implode(',', $tts); /// loking /// $tm= $m_item; //$tm= array('url_id' => $m_item['url_id'],'name' => $m_item['name'],'price' => $m_item['price'], 'image' => $m_item['image'] //, 'brand' => $m_item['brand'], 'sizes' => $m_sizes, 'id' => $m_item['id']); $tm= array('url_id' => $m_item['url_id'],'id' => $m_item['id']); unset($tm[description]); //unset($_SESSION["looking"]); //print_r($_SESSION["looking"]); if (isset($_SESSION["looking"])) { $lok=&$_SESSION["looking"]; array_unshift($lok, $tm);} else { $lok[]= $tm; $_SESSION["looking"]= $lok; } //$lok[]= $m_item; //if ($lok[0]['url_id']==$lok[1]['url_id']) { $k=0; } else $k=1; for ($l=count($lok)-1;$l>0;$l--) if ($lok[0]['url_id']==$lok[$l]['url_id']) unset($lok[$l]); $dual =1; // update `mr3_parts` set video = (select video from mr3_parts where id = 42225 ) and type=4 //print_r ($lok); //unset($_SESSION["looking"]);echo '11'; /// 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"]=''; } if (isset($_SESSION["looking"])) { $lok=&$_SESSION["looking"]; $k=0; //$lok= array_unique ($lok); $lok = array_slice($lok, 0+$k, Looking_count+5+$k+1); foreach ($lok as $kk =>$vv ) $rss[] = intval($vv[id]); $rs= getMultiRowQuery(" select url_id,name,price,image,brand,sizes,id from mr3_parts where id in (".implode(',', $rss).")", 'id' ); foreach ( $rs as $kk =>$vv ) $rs[$kk]['sizes'] = corsize($vv['sizes']); foreach ($lok as $kk =>$vv ) { if (!(isset( $rs [$vv[id]]))) { unset($lok[$kk]); continue;} $lok2[$kk] = $rs [$vv[id]]; } $smarty->assign('lookcount', count($lok) ); $smarty->assign('looking', array_slice($lok2, $k+$dual, $k+Looking_count)); } //print_r($lok2); //$_SESSION["hidhelps"]=1; //$_SESSION["hidhelps"]=0; $smarty->assign('hidhelps', $_SESSION["hidhelps"]); $smarty->assign('havetovar', $_SESSION["havetovar"]); //echo $_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); $smarty->assign('page', intval($page)); $_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'])); $smarty->assign( 'discount', (100-$euro)/100 ); //$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 } //echo 's'; //echo serialize($_SESSION); //echo setcookie ('my_ses', 'sdfaqzzwwwqaww333', time()+60*60*24*60); //setcookie ('my_ses',''); $ses_rem = $_SESSION; unset($ses_rem['login_admin']); unset($ses_rem['password_admin']); setcookie ('my_ses', base64_encode(serialize($ses_rem)), time()+60*60*24*60); //setcookie ('my_ses',''); //print_r($ses_rem); //header('Content-Type: text/html; charset=windows-1251'); // ==================================================================== $macros = new Macros($smarty); $macros->apply($html,0,$page, PER_PAGE,$m_item['url_id']); //echo "!! ". $m_item['p_id']; //echo "!! ". $parent_id; //echo ""; // ?>