"):"";
$logo = ((pg_Result($name_result,0,3)) && (pg_Result($name_result,0,3)!=" "))?"":"";
}
}
#$city_cmd = "select id,name from city where dish.city=city.id and dish.vid=video.id and dish.status=1 group by id order by name;";
$city_cmd = "select distinct id,name from city where dish.city=city.id and dish.vid=video.cid and dish.status=1 order by name;";
$city_result = pg_exec ($db, $city_cmd);
#$sat_cmd = "select id,name,deg,dolg from sat where dish.sid=sat.id and dish.vid=video.id and dish.status=1 group by id order by deg, name;";
$sat_cmd = "select distinct id,name,deg,dolg from sat where dish.sid=sat.id and dish.vid=video.cid and dish.status=1 order by deg, name;";
$sat_result = pg_exec ($db, $sat_cmd);
$cmd = "";
$err = "";
if($sat!= ""){$cmd = " dish.sid=$sat ";}
if($city!= ""){$cmd = (($cmd!="")?"$cmd and dish.city=$city ":" dish.city=$city ");}
if($cid!= ""){$cmd = (($cmd!="")?"$cmd and channel.id=$cid ":" channel.id=$cid ");}
$order = (($order<5 && $order>-1 && ($order))?($order):(5));
$orforpage=$order;
$satsort = (($order==1)?"":"");
$satsort = $satsort.(($order==0)?"":"");
$citysort = (($order==3)?"":"");
$citysort = $citysort.(($order==2)?"":"");
$datesort = (($order==5)?"":"");
$datesort = $datesort.(($order==4)?"":"");
$order = "$ord[$order]";
$order = "order by $order";
$result;
if($cmd!=""){
$cmd = "select distinct city.name,diam,mail,dish.name,channel.name,sat.name,sat.deg,sat.dolg,int4(abstime(dish.date)), dish.oid,dish.date from dish, city, sat, channel, video where $cmd and dish.sid=sat.id and dish.city=city.id and channel.id=dish.vid and status!=0 and dish.sid=video.sid and vid=video.cid $order;";
# 1 2 3 4 5 6 7 8 9 10
# $cmd = "select city.name,diam,mail,name,channel.name,sat.name,sat.deg,sat.dolg,date,oid from dish where sid=12 and sid=sat.id and dish.city=city.id and channel.id=dish.vid and status!=0 and sid=video.sid and vid=video.cid group by oid;";
$result = pg_Exec($db,$cmd);
}else{
$err = "Вы не выбрали ".(($sat=="")?" спутник":"").(($city=="")?" город":"");
}
$month = array("Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь");
//$title = "Telesputnik Reception Conditions for ";
?>
Telesputnik Reception Conditions
require($DOCUMENT_ROOT .'/templates/freq.html');
?>
'bannerid:'.$phpAds_raw['bannerid']);
echo $phpAds_raw['html'];
}
?>
$count_cmd = "select count(vid) from dish where video.cid=vid and video.sid=sid;";
$count_result = pg_exec($db,$count_cmd);
$count_tuples = (pg_NumRows($count_result)==1)?pg_Result($count_result,0,0):0;
?>