$value) { if (is_array($value)) $_REQUEST[$key] = addslashes_inArray($value); elseif (!get_magic_quotes_gpc()) { if ($key=="about") { $_REQUEST[$key] = $value; $$key = $value; } else { $_REQUEST[$key] = addslashes($value); $$key = addslashes($value); } } } foreach($_REQUEST as $key => $value) $$key = $value; if ($kabinet=="logout") { unset($_SESSION['logged']); unset($_SESSION['loggedmodule']); unset($_SESSION['loggedinformation']); if ($_SESSION['loggedvip']=="yes") { unset($_SESSION['loggedvip']); } unset($_SESSION['recycled']); header("Location: ".$mainurl); } $sql = new sql; $link = $sql->connect($dbhost, $dbusername, $dbpassword, $dbname); $sql->DEBUG = true; if (!empty($id)) { $defaultmodules = array(); $query = "select url from ".$prefix."_urls where parent=0"; $row = $sql->fetch_array($query); if ($row) { foreach($row as $key => $value) $defaultmodules[$value['url']] = $value['url']; } if (in_array($id, $defaultmodules)) { $_REQUEST['module'] = $module = $id; $id = $parent; $parent = 0; } else { $query = "select * from ".$prefix."_urls where url='".$id."'"; $row = $sql->fetch_one($query); // if ($row['module']=='saloons' && $row['parent']>0) // { // $_REQUEST['module'] = $module = 'kabinet'; // $_REQUEST['operation'] = 'show'; // } // else $_REQUEST['module'] = $module = $row['module']; $_REQUEST['parent'] = $row['parent']; // echo('
');
//			print_r($_REQUEST);
		}
	}	
	require('Smarty/Smarty.class.php');

	$smarty = new Smarty();

	if (!empty($selectlanguage))
	{
	    $lang = $selectlanguage;
	    $currentURL=str_replace('?newlang=' . $lang, '', $_SERVER['REQUEST_URI']);

	    if (($currentURL <> '/') and ($currentURL <> '/index.php'))
	        $newURL=str_replace('/' . $_SESSION['site']['mainlang'] . '/', '/' . $lang . '/', $currentURL);

	    elseif ($currentURL == '/')
	        $newURL=$currentURL . $lang . '/';

	    else
	        $newURL=$currentURL . $lang . '/index.php';

	    if (!headers_sent())
	        {
	        $_SESSION['site']['mainlang']=$lang;
	        header ('Location:' . $newURL);
	        exit;
	        }
	}

	if (!empty($lang))
	{
	    $oldlang = $_SESSION['site']['mainlang'];
	    $_SESSION['site']['mainlang'] = $lang;
	}

	if (empty($_SESSION['site']['mainlang']))
	    $_SESSION['site']['mainlang'] = $admin_lang;

	// ERROR 
	if (!in_array($_SESSION['site']['mainlang'], array_keys($langs)))
	    if (!empty($oldlang))
	        $_SESSION['site']['mainlang']=$oldlang;
	    else
	        $_SESSION['site']['mainlang'] = $admin_lang;
	// end ERROR	
		
	$prefix2 .= $prefix."_".$_SESSION['site']['mainlang'];
	include('include/public.php');

	$defGeneral = GetConstantsByModule("GENERAL");

	if (empty($module))
		$module = "main";

	if ($module!="search")
		unset($_SESSION['search_param']);
	
	if (file_exists("modules/general.php"))
		require_once ("modules/general.php");
	
	if (file_exists("modules/".$module."/index.php"))
	{
		if (empty($id))
			$_SESSION['PATH'] = array();
	    require_once ("modules/".$module."/index.php");
	}
	
	SetPath($data['title'],$_SERVER['REQUEST_URI']);
	if (!empty($SaloonData))
	{
		if (!empty($SaloonData['text_title']))
		{
			$smarty->assign("title", $SaloonData['text_title']);
		}
		else
		{
			$smarty->assign("title", $SaloonData['typesaloon'].$SaloonData['typeschool'].$SaloonData['typeshop']." ".$SaloonData['text_name']." ".$defGeneral['def_title']);
		}
		if (!empty($SaloonData['textarea_keywords']))
		{
			$smarty->assign("keywords", $SaloonData['textarea_keywords']);
		}
		else
		{
			$smarty->assign("keywords", $defGeneral['def_keywords']);
		}
		if (!empty($SaloonData['textarea_description']))
		{
			$smarty->assign('description', $SaloonData['textarea_description']);
		}
		else
		{
			$smarty->assign('description', $defGeneral['def_description']);
		}		
	}
	else
	{
		if(empty($data['title']))
			$smarty->assign("title", $defGeneral['def_title']);
		else $smarty->assign("title", $data['title']." | ".$defGeneral['def_title']);
		if(empty($data['keywords']))
			$smarty->assign('keywords', $defGeneral['def_keywords']);
		else $smarty->assign('keywords', $data['keywords']);
		if(empty($data['description']))
			$smarty->assign('description', $defGeneral['def_description']);
		else $smarty->assign('description', $data['description']);
	}

	$def = GetConstantsByModule('TEXT_CONSTANTS');
	$smarty->assign("def", $def);

	$data['PATH']  = $_SESSION['PATH'];
	$smarty->assign("LoggedUser", $_SESSION['logged']);	
	$smarty->assign("LoggedVip", $_SESSION['loggedvip']);	
	$smarty->assign("LoggedUserModule", $_SESSION['loggedmodule']);	
	$smarty->assign("LoggedUserInformation", $_SESSION['loggedinformation']);		
	$smarty->assign('defines',$defines);
	$smarty->assign('bottom_menu',$bottom_menu);
	$smarty->assign("subtitle", $data['title']);
	$smarty->assign("adminmail", $globals['email']);
	$smarty->assign("numcontact", $globals['numcontact']);
	$smarty->assign("ttl", $globals['ttl']*1000);
	$smarty->assign("mainurl", $mainurl);
	$smarty->assign("module", $module);
	if (!empty($data['addsalon']))
	{
		foreach($data['addsalon'] as $key => $value)
		{
			if (!is_array($value))		
			{
				$data['addsalon'][$key]=stripslashes($value);
				$data['addsalon'][$key]= str_replace('"', '"', $data['addsalon'][$key]);
			}
		}
	}
	
	$smarty->assign("data", $data);
	$smarty->assign("id", $id);
	$smarty->assign("sublevel", $sublevel);
	$smarty->assign("lang", $_SESSION['site']['mainlang']);	
	$smarty->assign("curdate", date('l, F d, Y'));	
	$smarty->assign("defGeneral", $defGeneral);	
	if (isset($def))
		$smarty->assign("def", $def);

	if (($recycledkolvo %100) >10 && ($recycledkolvo %100)<20)
		$stringtovar="товаров";
	elseif (($recycledkolvo % 10)==1)
		$stringtovar="товар";
	elseif (($recycledkolvo % 10)>1 && ($recycledkolvo % 10)<5)
		$stringtovar="товара";
	else $stringtovar="товаров";	
	$smarty->assign("stringtovar", $stringtovar);
	
	//echo($module." ".$id);
	if (($module=="") || ($module=="main") || ($module=="top" && $id==297))
	{
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[0] = $sql->fetch_one($query);
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[1] = $sql->fetch_one($query);		
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[2] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[3] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[4] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[5] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[6] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[7] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[8] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[9] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[10] = $sql->fetch_one($query);	
		$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13929 or select_rz_2=13943) order by id desc";
		$bannerdata[11] = $sql->fetch_one($query);	
	}
	else
	{
		if (($module=="kabinet" || $module=="salonservices" || $module=="picserv" || $module=="brands"))
		{
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[0] = $sql->fetch_one($query);
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[1] = $sql->fetch_one($query);		
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[2] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[3] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[4] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[5] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[6] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[7] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[8] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[9] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[10] = $sql->fetch_one($query);	
			$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13930 or select_rz_2=13943) order by id desc";
			$bannerdata[11] = $sql->fetch_one($query);				
		}
		else
		{
			if (($module=="top" && $id==298) || ($module=="serv"))
			{
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[0] = $sql->fetch_one($query);
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[1] = $sql->fetch_one($query);		
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[2] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[3] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[4] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[5] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[6] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[7] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[8] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[9] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[10] = $sql->fetch_one($query);	
				$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13931 or select_rz_2=13943) order by id desc";
				$bannerdata[11] = $sql->fetch_one($query);				
			}
			else
			{
				if (($module=="schools") || ($module=="schoolservice") || ($module=="textschools") || ($module=="contentschools"))
				{
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[0] = $sql->fetch_one($query);
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[1] = $sql->fetch_one($query);		
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[2] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[3] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[4] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[5] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[6] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[7] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[8] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[9] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[10] = $sql->fetch_one($query);	
					$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13932 or select_rz_2=13943) order by id desc";
					$bannerdata[11] = $sql->fetch_one($query);						
				}	
				else
				{
					if (($module=="shops") || ($module=="shopservice") || ($module=="shopserv") || ($module=="textshops") || ($module=="contentshops"))
					{
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[0] = $sql->fetch_one($query);
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[1] = $sql->fetch_one($query);		
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[2] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[3] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[4] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[5] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[6] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[7] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[8] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[9] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[10] = $sql->fetch_one($query);	
						$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13933 or select_rz_2=13943) order by id desc";
						$bannerdata[11] = $sql->fetch_one($query);							
					}
					else
					{
						if ($module=="menu" && $id==397)
						{
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[0] = $sql->fetch_one($query);
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[1] = $sql->fetch_one($query);		
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[2] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[3] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[4] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[5] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[6] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[7] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[8] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[9] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[10] = $sql->fetch_one($query);	
							$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13934 or select_rz_2=13943) order by id desc";
							$bannerdata[11] = $sql->fetch_one($query);								
						}
						else
						{
							if ($module=="menu" && $id==398)
							{
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[0] = $sql->fetch_one($query);
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[1] = $sql->fetch_one($query);		
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[2] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[3] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[4] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[5] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[6] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[7] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[8] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[9] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[10] = $sql->fetch_one($query);	
								$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13936 or select_rz_2=13943) order by id desc";
								$bannerdata[11] = $sql->fetch_one($query);									
							}
							else
							{
								if ($module=="gallerymain")
								{
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[0] = $sql->fetch_one($query);
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[1] = $sql->fetch_one($query);		
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[2] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[3] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[4] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[5] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[6] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[7] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[8] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[9] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[10] = $sql->fetch_one($query);	
									$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13937 or select_rz_2=13943) order by id desc";
									$bannerdata[11] = $sql->fetch_one($query);										
								}	
								else
								{
									if (($module=="menu" && $id==400) || ($module=="vote"))
									{
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13939 or select_rz_2=13943)  order by id desc";
										$bannerdata[0] = $sql->fetch_one($query);
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[1] = $sql->fetch_one($query);		
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[2] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[3] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[4] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[5] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[6] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[7] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[8] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[9] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[10] = $sql->fetch_one($query);	
										$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13939 or select_rz_2=13943) order by id desc";
										$bannerdata[11] = $sql->fetch_one($query);											
									}	
									else
									{
										if (($module=="health") || ($module=="healthservice") || ($module=="texthealth") || ($module=="contenthealth"))
										{
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[0] = $sql->fetch_one($query);
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[1] = $sql->fetch_one($query);		
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[2] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[3] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[4] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[5] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[6] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[7] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[8] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[9] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[10] = $sql->fetch_one($query);	
											$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13941 or select_rz_2=13943) order by id desc";
											$bannerdata[11] = $sql->fetch_one($query);												
										}
										else
										{
											if (($module=="health") || ($module=="healthservice") || ($module=="texthealth") || ($module=="contenthealth"))
											{
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and (select_rz_2=13944) order by id desc";
												$bannerdata[11] = $sql->fetch_one($query);											
											}
											else
											{
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3743 and (select_rz_2=13943) order by id desc";
												$bannerdata[0] = $sql->fetch_one($query);
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3744 and (select_rz_2=13943) order by id desc";
												$bannerdata[1] = $sql->fetch_one($query);		
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3745 and (select_rz_2=13943) order by id desc";
												$bannerdata[2] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3746 and (select_rz_2=13943) order by id desc";
												$bannerdata[3] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3747 and (select_rz_2=13943) order by id desc";
												$bannerdata[4] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3748 and (select_rz_2=13943) order by id desc";
												$bannerdata[5] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3749 and (select_rz_2=13943) order by id desc";
												$bannerdata[6] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3750 and (select_rz_2=13943) order by id desc";
												$bannerdata[7] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3751 and (select_rz_2=13943) order by id desc";
												$bannerdata[8] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3752 and (select_rz_2=13943) order by id desc";
												$bannerdata[9] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3753 and (select_rz_2=13943) order by id desc";
												$bannerdata[10] = $sql->fetch_one($query);	
												$query="select * from ".$prefix2."_banners where check_active=1 and parent='0' and select_pl_1=3754 and (select_rz_2=13943) order by id desc";
												$bannerdata[11] = $sql->fetch_one($query);
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	foreach($bannerdata as $key => $value)
		$bannerdata[$key]['textarea_video'] = $value['fck_body'];
	$smarty->assign("banners", $bannerdata);
	$smarty->assign("bannerdata", $bannerdata);
	
	if (($module=="sendmessage") || ($module=="sendzapis") || ($module=="sendschoolzapis") || ($module=="sendhealthzapis") || ($module=="sendshopzapis") || ($module=="sendphoto") || ($module=="msg"))
	{
		if (!empty($filename))
			$smarty->display($filename);	
	}
	elseif ($module=="virtualkabinet")
	{
		$headerfile = "header_m.tpl";		
		$smarty->display($headerfile);
		if (!empty($filename))
			$smarty->display($filename);	
		$footerfile = "footer_m.tpl";		
		$smarty->display($footerfile);
	}
	else
	{
		$headerfile = "header.tpl";		
		$smarty->display($headerfile);
		if (!empty($filename))
			$smarty->display($filename);
	
		if (empty($footerfile))
			$footerfile = "footer.tpl";		
		$smarty->display($footerfile);
	}	
	exit;
?>