">
"box2", 2=>"box3",3=>"box3", 4=>"box1"); $idBlock=array(1=>"boxBig", 2=>"boxMidle", 3=>"boxMidle", 4=>"boxMini"); $kolSlov=array(1=>35, 2=>15, 3=>15, 4=>15); $urlImg=array(1=>"grafika/slider/375x0/", 2=>"grafika/slider/280x0/", 3=>"grafika/slider/280x0/", 4=>"grafika/slider/231x0/"); if($res AND mysql_num_rows($res)>0){ $np=1; while($row=mysql_fetch_assoc($res)){ switch($row['id']){ case 1:{ $idRecord=randRecord("site_otel",$row['kol']); if(empty($idRecord)){ $idRecord=0; } else{ $idRecord=implode(",",$idRecord); } $result=mysql_query("SELECT so.id,so.link_otel,so.link_strana,so.short_descript,so.full_descript, s.name AS nameStrana, o.Name AS nameOtel, o.star FROM site_otel so LEFT JOIN strana s ON so.link_strana=s.id LEFT JOIN hotel o ON so.link_otel=o.id WHERE so.id IN ($idRecord) "); if($result AND mysql_num_rows($result)>0){ echo<<

{$row['title']}

DIV1; while($box = mysql_fetch_assoc($result)) { //разбиваем на массив $desr=codeClean($box['full_descript'],"str3"); $arr=explode(" ",$desr); //берем первые 6 элементов $arr=array_slice($arr,0,$kolSlov[$np]); //превращаем в строку $new_descr=implode(" ",$arr); $foto = "logo.jpg"; $resImg=mysql_query("SELECT file FROM site_galery WHERE tab='otel' AND section='{$box[id]}' ORDER BY id"); if($resImg AND mysql_num_rows($resImg)>0){ while($rowImg=mysql_fetch_assoc($resImg)){ if(is_file($urlImg[$np].$rowImg['file'])){ $foto=$rowImg['file']; break; } } } if($np==4){ $tit=""; } else{ $tit="

{$box['nameOtel']}

"; } $id_avia = get_avia_strana($box['link_strana']); if($id_avia) { $date_from = mktime(0,0,0,date("m"),date("d"),date("y")); $date_to = mktime(0,0,0,date("m"),date("d")+10,date("y")); $arr_dat = dat_fly($date_from,$date_to,$id_avia); if($arr_dat) { $type = 1; $eda = 3; $price = price_bron($box['link_otel'],array(25,25),array(),$id_avia,$id_avia,(int)$arr_dat['from'],(int)$arr_dat['to'],$type,$eda,0,1,0,"pol"); } else { $price= 0; } if($price>0) { $text_price = "от ".$price." руб."; } else { $text_price = "уточнять"; } } else { $text_price ="уточнять"; } $str_star = star_str($box['star']); echo<< {$tit}
{$str_star}

{$new_descr}...

{$text_price}

DIV2; } echo("
"); } break; } case 2:{ $idRecord=randRecord("site_strana",$row['kol']); if(empty($idRecord)){ $idRecord=0; } else{ $idRecord=implode(",",$idRecord); } $result=mysql_query("SELECT id,name,geografik,descript FROM site_strana WHERE id IN ($idRecord)"); if($result AND mysql_num_rows($result)>0){ echo<<

{$row['title']}

DIV1; while($box = mysql_fetch_assoc($result)) { //разбиваем на массив $desr=codeClean($box['descript'],"str3"); $arr=explode(" ",$desr); //берем первые 6 элементов $arr=array_slice($arr,0,$kolSlov[$np]); //превращаем в строку $new_descr=implode(" ",$arr); $foto = "logo.jpg"; $resImg=mysql_query("SELECT file FROM site_galery WHERE tab='strana' AND section='{$box[id]}' ORDER BY id"); if($resImg AND mysql_num_rows($resImg)>0){ while($rowImg=mysql_fetch_assoc($resImg)){ if(is_file($urlImg[$np].$rowImg['file'])){ $foto=$rowImg['file']; break; } } } if($np==4){ $tit=""; } else{ $tit="

{$box['name']}

"; } $data_strana = get_id_strana_id_avia($box['name']); if($data_strana) { $date_from = mktime(0,0,0,date("m"),date("d"),date("y")); $date_to = mktime(0,0,0,date("m"),date("d")+10,date("y")); $arr_dat = dat_fly($date_from,$date_to,$id_avia); if($arr_dat) { $type = 1; $eda = 3; $price = price_bron($data_strana['id_hotel'],array(25,25),array(),$data_strana['id_avia'],$data_strana['id_avia'],(int)$arr_dat['from'],(int)$arr_dat['to'],$type,$eda,0,1,0,"pol"); } else { $price= 0; } if($price<=0) { $res_t = mysql_query(" SELECT rommType,mealPlan FROM nomera WHERE hotel='{$data_strana['id_hotel']}' AND fromData>='{$date_from}' AND toData>='{$date_to}' AND dbl>0 ORDER BY dbl LIMIT 1 "); if($res_t AND mysql_num_rows($res_t)>0) { $row_t = mysql_fetch_assoc($res_t); $price = price_bron($data_strana['id_hotel'],array(25,25),array(),$data_strana['id_avia'],$data_strana['id_avia'],(int)$date_from,(int)$date_to,$row_t['rommType'],$row_t['mealPlan'],0,1,0,"pol"); } } if($price>0) { $text_price = "от ".$price." руб."; } else { $text_price = "уточнять"; } } else { $text_price = "уточнять"; } echo<< {$tit}

{$new_descr}...

{$text_price}

DIV2; } echo("
"); } break; } case 3:{ $idRecord=randRecord("site_tour",$row['kol']); if(empty($idRecord)){ $idRecord=0; } else{ $idRecord=implode(",",$idRecord); } $result=mysql_query("SELECT sn.id, sn.title, sn.descript,sn.link_strana,sn.link_otel, ss.name AS nameStrana, so.Name AS nameOtel FROM site_tour sn LEFT JOIN strana ss ON ss.id=sn.link_strana LEFT JOIN hotel so ON so.id=sn.link_otel WHERE sn.id IN ($idRecord)"); if($result AND mysql_num_rows($result)>0){ echo<<

{$row['title']}

DIV1; while($box = mysql_fetch_assoc($result)){ //разбиваем на массив $desr=codeClean($box['descript'],"str3"); $arr=explode(" ",$desr); //берем первые 6 элементов $arr=array_slice($arr,0,$kolSlov[$np]); //превращаем в строку $new_descr=implode(" ",$arr); $foto = "logo.jpg"; $resImg=mysql_query("SELECT file FROM site_galery WHERE tab='tour' AND section='{$box[id]}' ORDER BY id"); if($resImg AND mysql_num_rows($resImg)>0){ while($rowImg=mysql_fetch_assoc($resImg)){ if(is_file($urlImg[$np].$rowImg['file'])){ $foto=$rowImg['file']; break; } } } if($np==4){ $tit=""; } else{ $tit="

{$box['title']}

"; } echo<< {$tit}

{$new_descr}...

DIV2; } echo("
"); } break; } case 4:{ $idRecord=randRecord("site_sanatorium",$row['kol']); if(empty($idRecord)){ $idRecord=0; } else{ $idRecord=implode(",",$idRecord); } $result=mysql_query("SELECT so.id,so.title,so.link_strana,so.link_otel,so.short_descript,so.full_descript, s.name AS nameStrana FROM site_sanatorium so LEFT JOIN strana s ON so.link_strana=s.id WHERE so.id IN ($idRecord)"); if($result AND mysql_num_rows($result)>0){ echo<<

{$row['title']}

DIV1; while($box = mysql_fetch_assoc($result)){ //разбиваем на массив $desr=codeClean($box['full_descript'],"str3"); $arr=explode(" ",$desr); //берем первые 6 элементов $arr=array_slice($arr,0,$kolSlov[$np]); //превращаем в строку $new_descr=implode(" ",$arr); $foto = "logo.jpg"; $resImg=mysql_query("SELECT file FROM site_galery WHERE tab='sanatorium' AND section='{$box[id]}' ORDER BY id"); if($resImg AND mysql_num_rows($resImg)>0){ while($rowImg=mysql_fetch_assoc($resImg)){ if(is_file($urlImg[$np].$rowImg['file'])){ $foto=$rowImg['file']; break; } } } if($np==4){ $tit=""; } else{ $tit="

{$box['title']}

"; } $id_avia = get_avia_strana($box['link_strana']); if($id_avia) { $date_from = mktime(0,0,0,date("m"),date("d"),date("y")); $date_to = mktime(0,0,0,date("m"),date("d")+10,date("y")); $arr_dat = dat_fly($date_from,$date_to,$id_avia); if($arr_dat) { $type = 1; $eda = 3; $price = price_bron($box['link_otel'],array(25,25),array(),$id_avia,$id_avia,(int)$arr_dat['from'],(int)$arr_dat['to'],$type,$eda,0,1,0,"pol"); } else { $price= 0; } if($price>0) { $text_price = "от ".$price." руб."; } else { $text_price = "уточнять"; } } else { $text_price ="уточнять"; } echo<< {$tit}

{$new_descr}...

{$text_price}

DIV2; } echo("
"); } break; } } $np++; } } ?>

ВВЕРХ