- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
$_i=1;
$_stb = mysql_query("SELECT * FROM ".$admin_prefix."_catalog_title WHERE pub=1 ORDER BY sort, BINARY name");
while($_rtb=mysql_fetch_assoc($_stb)){
echo print_r($_rtb,2);
$sql="SELECT * FROM ".$admin_prefix."_catalog_regions WHERE pub=1 AND region_id=0 AND (id IN (".implode(",",$_SESSION['terms']['toureastgroup_catalog_regions'])."))";
$_s_reg=mysql_query($sql);
while($_r_reg=mysql_fetch_assoc($_s_reg)){
// определяем подрегионы региона
$result_array=array();$all_current_regions_array=array();$all_current_regions_array_where=array();
GetChildElements("region_id",$_r_reg['id'],$admin_prefix."_catalog_regions",$_SESSION['terms']['toureastgroup_catalog_regions']);
$all_current_regions_array=$result_array;
// добавляем сам регион
$all_current_regions_array[]=$_r_reg['id'];
// составляем условие региона
foreach($all_current_regions_array as $v){
$all_current_regions_array_where[]="(region_id LIKE '%##".$v."##%')";
}
$sql="SELECT * FROM ".$admin_prefix."_catalog_programms WHERE pub=1 AND title_id=$_rtb[id] AND (id IN (".$_SESSION['string_where_programms'].")) AND (".implode(" OR ",$all_current_regions_array_where).")";
$_s_pr=mysql_query($sql);
$_title_progs_id=array();
while($_r_pr=mysql_fetch_assoc($_s_pr)){
$_title_progs_id[]=$_r_pr['id'];
}
$_title_progs_where="(".implode(",",$_title_progs_id).")";
$sql="SELECT * FROM ".$admin_prefix."_catalog_programs_tours WHERE price>0 AND start>=".(time()-36000)." AND pub=1 AND (programm_id IN ".$_title_progs_where.") ORDER BY start LIMIT 5";
$_stours=mysql_query($sql);
if(mysql_num_rows($_stours)>0){
while($_rtours=mysql_fetch_assoc($_stours)){
echo '<pre>'.print_r($_rtours,2).'</pre>';
$_array_r=array();
}
}
}
$_i++;
Простите не удержался, больше не могу раскапывать это...
сайт ввв.toureastgroup.ру автор откликнись - плюну в лицо