if (isset($_REQUEST["ID"])) {
$id=$_REQUEST["ID"];
$blog="";
$num=0;
$where="";
if ($id==0) {
$id=1;
$where= " where ID=1 ";
}
elseif ($id==5) {
$blog="_blog order by Data desc ";
$dataform=",DATE_FORMAT(Data,\"%d-%m-%Y\") as datforma";
$strSQL="select count(*) from $sito" ."_sito_blog";
if ($numrighe=mysql_query($strSQL)) {
$righe=mysql_fetch_array($numrighe);
if (isset($_REQUEST["num"])) {
$num=intval($_REQUEST["num"]);
if (!($num>=0 && $num<$righe[0]))
$num=0;
}
}
}
else {
$where= " where ID=$id ";
}
$strSQL="select * $dataform from $sito" ."_sito$blog $where limit $num,1 ";
}
else
$strSQL="select * from $sito" ."_sito where ID=1";
if($pag=mysql_query($strSQL)) {
$datapag=mysql_fetch_array($pag);
$news=true;
}
switch ($id) {
case 5:
if ($news) {
echo "
NEWS
" .$datapag["Titolo"] ."
" .$datapag["datforma"] ."
" .$datapag["Descrizione"] ."
";
if ($num<$righe[0]-1) {
$prox=$num+1;
echo "
Precedente ";
}
if ($num>0) {
$prox=$num-1;
echo "
Successiva";
}
}
else {
echo "
NEWS
Non disponibili
";
}
break;
case 3:
$leg=intval($_REQUEST["leg"]);
if ($leg>0 or $leg<6)
include("../provincepiemonte/age$leg.html") ;
else
include("../provincepiemonte/age0.html") ;
break;
default:
echo "
" .$datapag["Titolo"] ."
" .$datapag["Descrizione"] ."
";
}
?>