 |
$obl='';
if (isset($_REQUEST['obl'])) $obl=$_REQUEST['obl'];
$fedokrug='';
if (isset($_REQUEST['fedokrug'])) $fedokrug=$_REQUEST['fedokrug'];
$country='';
if (isset($_REQUEST['country'])) $country=$_REQUEST['country'];
$currentyear = date("Y");
if (isset($_REQUEST['year'])) $currentyear=$_REQUEST['year'];
?>
|
require_once "navigator.php"; ?>
|
$result = mysql_query("select ".$table_news.".*, ProbegYear.NameP from ".$table_news.
", ProbegYear where ".$table_news.".Probeg_Year_id=ProbegYear.id and (DATE_FORMAT(news_date, '%Y') = '$currentyear') AND ".$table_news.".dj_is_for_social=0 union select *,NULL from "
.$table_news." where Probeg_Year_id is NULL and (DATE_FORMAT(news_date, '%Y') = '$currentyear') AND ".$table_news.".dj_is_for_social=0 order by DATE_FORMAT(news_date, '%m') desc, DATE_FORMAT(news_date, '%d') desc, 'news_time' desc",$connect);
if ($obl <>'')
$result = mysql_query("select ".$table_news.".*, ProbegYear.NameP from ".$table_news.", ProbegYear
where ".$table_news.".Probeg_Year_id=ProbegYear.id and (DATE_FORMAT(news_date, '%Y') = '$currentyear') and (".$table_news.".obl = '$obl') AND ".$table_news.".dj_is_for_social=0
union select *,NULL from ".$table_news."
where Probeg_Year_id is NULL and ".$table_news.".obl = '$obl' and (DATE_FORMAT(news_date, '%Y') = '$currentyear') AND ".$table_news.".dj_is_for_social=0 order by DATE_FORMAT(news_date, '%m') desc, DATE_FORMAT(news_date, '%d') desc, 'news_time' desc",$connect);
if ($fedokrug <>'')
$result = mysql_query("select ".$table_news.".*, ProbegYear.NameP from ".$table_news.", ProbegYear
where ".$table_news.".Probeg_Year_id=ProbegYear.id and (DATE_FORMAT(news_date, '%Y') = '$currentyear') and (".$table_news.".fedokrug = '$fedokrug') AND ".$table_news.".dj_is_for_social=0
union select *,NULL from ".$table_news."
where Probeg_Year_id is NULL and ".$table_news.".fedokrug = '$fedokrug' and (DATE_FORMAT(news_date, '%Y') = '$currentyear') AND ".$table_news.".dj_is_for_social=0 order by DATE_FORMAT(news_date, '%m') desc, DATE_FORMAT(news_date, '%d') desc, 'news_time' desc",$connect);
if ($country <>'')
{if ($country ='abroad')
$result = mysql_query("select ".$table_news.".*, ProbegYear.NameP from ".$table_news.", ProbegYear
where ".$table_news.".Probeg_Year_id=ProbegYear.id and (DATE_FORMAT(news_date, '%Y') = '$currentyear') and (".$table_news.".country <> 'Россия') AND ".$table_news.".dj_is_for_social=0
union select *,NULL from ".$table_news."
where Probeg_Year_id is NULL and ".$table_news.".country <> 'Россия' and (DATE_FORMAT(news_date, '%Y') = '$currentyear') AND ".$table_news.".dj_is_for_social=0 order by DATE_FORMAT(news_date, '%m') desc, DATE_FORMAT(news_date, '%d') desc, 'news_time' desc",$connect);
}
$num_rows = mysql_num_rows($result);
if($num_rows =="0"){print "Нет новостей за этот год!";}?>
"."Архив новостей ".$currentyear. " год"."";?>
echo "\n\n";
print "
| "."Месяц-День новости"." |
"."Название новости"." |
"."Пробег"." |
"."Область"." |
"."Фед.округ"." |
"."Страна"." |
"."Авторы"." |
"."Кол-во просмотров |
".''." | ";
for($i=0;$i < $num_rows;$i++)
{
$row=mysql_fetch_array($result) or die (mysql_error());
$news_date=substr($row['news_date'],5);
$news_title=$row['news_title'];
$news_time=$row['news_time'];
$news_id=$row['news_id'];
$probeg=$row['NameP'];
$obl=$row['obl'];
if ($obl == "000") {$obl = ' ';};
$fedokrug=$row['fedokrug'];
If ($fedokrug == '000')
{$fedokrug = ' ';};
$country=$row['country'];
If ($country == '000')
{$country = ' ';};
$authors=$row['authors'];
$adr="Cмотреть";
$wiew=$row['news_wiew'];
print "
| ".$news_date." |
".$news_title." |
".$probeg." |
".$obl." |
".$fedokrug." |
".$country." |
".$authors." |
".$wiew." |
".$adr." |
";
}
?>
|