Активный отдых. Экстрим. Расписание туров. Карта:
Выберите параметры поиска:
=0){$a_ukrainian[]=intval($v);}}
if(!count($a_ukrainian)){$a_ukrainian[]=0;}
if(count($a_ukrainian)==2){$country_cond='';}
elseif(in_array(0,$a_ukrainian)){$country_cond='t.country!=4 AND';}
elseif(in_array(1,$a_ukrainian)){$country_cond='t.country=4 AND';}
$arr=explode(',',@$_GET['tour_types']);
$a_tour_types=array();
foreach($arr as $v){if(intval($v)>0){$a_tour_types[]=intval($v);}}
$arr=explode(',',@$_GET['tour_regions']);
$a_tour_regions=array();
foreach($arr as $v){if(intval($v)>0){$a_tour_regions[]=intval($v);}}
$arr=explode(',',@$_GET['tour_months']);
$a_tour_months=array();
foreach($arr as $v){if(intval($v)>0){$a_tour_months[]=intval($v);}}
echo'
';
$tour_region_cond=(count($a_tour_regions))?' AND r.region IN('.implode(',',$a_tour_regions).')':'';
$tour_type_cond=(count($a_tour_types))?' AND tt.tour_type IN('.implode(',',$a_tour_types).')':'';
$tour_months_cond=(count($a_tour_months))?' AND MONTH(s.start_date) IN('.implode(',',$a_tour_months).')':'';
function DateFromSQL($s){return substr($s,8,2).'.'.substr($s,5,2).'.'.substr($s,0,4);}
$sql='SELECT s.start_date, s.end_date, t.title, tt.name type, t.url, c.name country, r.name region, t.season, t.days, t.price, ELT(t.currency,"грн.","$","€") currency, t.comment
FROM tour t, region r, tour_schedule s, routes rt, tour_type tt, countries c
WHERE '.$country_cond.' r.region = t.region
AND c.country = t.country
AND t.act = 1'.$tour_region_cond.'
AND s.tour = t.tour
AND s.start_date >= NOW()'.$tour_months_cond.'
AND rt.tour = t.tour
AND rt.tour_type = tt.tour_type'.$tour_type_cond.'
order by s.start_date, t.srt';
$res=mysql_query($sql);
e(' ');
e('');
$sPrevPeriod='';
$sPrevTour='';
$sPrevDate='';
$sTypes='';
while($arr=mysql_fetch_assoc($res)){
if($sPrevTour!=$arr['title'] || $sPrevDate!=$arr['start_date']){
if($sPrevTour){
e(''.substr(DateFromSQL($a['start_date']),0,2).'-'.substr(DateFromSQL($a['end_date']),0,2).' | '.$a['title'].' | '.$a['days'].' | '.$a['price'].' '.$a['currency'].' | '.$a['country'].' | '.substr($sTypes,0,-1).' | ');
$sTypes='';
}
$sPrevTour=$arr['title'];
$sPrevDate=$arr['start_date'];
}
$sTypes.=$arr['type'].' ';
$a=$arr;
if($sPrevPeriod!=substr($arr['start_date'],0,7)){
$sPrevPeriod=substr($arr['start_date'],0,7);
e(' '.$months[intval(substr($sPrevPeriod,5,2))-1].' '.substr($sPrevPeriod,0,4).' | ');
e('Даты | Тур | Дней | Цена | Страна | Вид | ');
}
}
if($sPrevTour){
e(''.substr(DateFromSQL($a['start_date']),0,2).'-'.substr(DateFromSQL($a['end_date']),0,2).' | '.$a['title'].' | '.$a['days'].' | '.$a['price'].' '.$a['currency'].' | '.$a['country'].' | '.substr($sTypes,0,-1).' | ');
$sTypes='';
}
e(' ');
?> |
|
|