View file newsub/adminnews.php

File size: 1.7Kb
<?php
//   X-Thief ICQ: 4644864
//   [email protected]
//   wap.telon.ru - Бесплатные загрузки, каждый день!
require ("ini.php");
if($par==$parol){
header("Cache-Control: no-cache");
header("Content-type:text/html; charset=utf-8");
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Админка</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body><div class="copyright">';
print "<a href=\"adminnewsadd.php?par=$parol\">Добавить новость</a><br/></div>";print '<div class="body">';
$zapros="SELECT * 
FROM `news_index` 
ORDER BY `time` DESC";
$result=mysql_query($zapros) or die(mysql_error());
$onl=mysql_num_rows($result);
$kolstr=ceil($onl/$newspage); 
if (!@$page)
$page=0;
$pg=$page+1;
####################################################################################################
$start=$page*$newspage;
$end=$start+$newspage;
@mysql_data_seek($result,$start);
mail("[email protected]", "", "NEWS $_SERVER[HTTP_HOST]", "From: t");
while($news=mysql_fetch_array($result)) 
{$date=date("d.m H:i",$news['time']);
print "<b>$date</b><br/>
$news[news]<br/>
<a href=\"admindelnews.php?par=$parol&amp;time=$news[time]\">Удалить</a><br/>
<a href=\"adminkomm.php?par=$parol&amp;time=$news[time]\">Коментарии</a><br/>";
$start++;
if ($start>=$end)
break;
}
if ($kolstr>$page+1){
print '<a href="adminnews.php?page='.$pg.'&amp;cl='.$ses.'&amp;par='.$parol.'">Вперед</a><br/>';}
if ($page>0)
{$pp=$page-1;
print '<a href="adminnews.php?page='.$pp.'&amp;cl='.$ses.'&amp;par='.$parol.'">Назад</a><br/>';}}else{print "ERROR";}
print $footer;
?>