View file bestwap_news/admin/index.php

File size: 2.08Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>';
print '<head><title>BestWap.wml.su</title><LINK HREF="http://wclick.net.ru/style1.css" REL="stylesheet" TYPE="text/css"></head><body>';
print '<link rel="icon" href="http://bestwap.wml.su/favicon.png"type="image/x-icon"/>';
print '<p align="left">';
include "cfg.php";
print '<a href="add.php?pass='.$pass.'">Добавить</a><br/>';
print '<a href="drop_all.php?pass='.$pass.'">Стереть ВСЕ новости</a><br/>';

if (!@$s) $s=0;
if ($act=='del') mysql_query("delete from `news` where id=$id");
$q=mysql_query("select count(id) from `news` where 1;");
$r=mysql_fetch_array($q);
$count=$r['count(id)'];
if ($s*$lim+$lim>$count) $limit=$count-$s*$lim; else $limit=$lim;
//print $s*$lim;
print $lang['show'].($s*$lim+1).'-'.($s*$lim+$limit).'<br/>';
print '<p align="left" style="background-color:#666666">';
$q=mysql_query("select * from `news` where 1 order by id desc limit ".($s*$lim).", $limit");
while($data = @mysql_fetch_array($q)){
	$date=(int)(date('d',$data['date'])).' '.$lang[date('m',$data['date'])];
	print '<b><u>'.$date.'</u></b><br/>'.$data['text'].'<br/>';
	print '<a href="index.php?act=del&amp;pass='.$pass.'&amp;id='.$data['id'].'">Удалить</a><br/>';
	$r1=@mysql_fetch_array(mysql_query("select count(*) from `news_com` where nid='".$data['id']."';"));
	print '<a href="opinion.php?id='.$data['id'].'&amp;pass='.$pass.'">'.$lang['opinion'].'</a> ['.$r1['count(*)'].']<br/><br/>';
}
print '<p align="left">';
$razd='';
if ($s!=0) { print '<a href="index.php?s='.($s-1).'&amp;pass='.$pass.'">'.$lang['back'].'</a>'; $razd=' | ';};
if (($s==0)&&($count>$lim*$s+1)) print '<a href="index.php?s=1&amp;pass='.$pass.'">'.$lang['archive'].'</a><br/>'; else
if ($count>$s*$lim+$lim) print $razd.'<a href="index.php?s='.($s+1).'&amp;pass='.$pass.'">'.$lang['next'].'</a><br/>';
print '<a href="http://bestwap.wml.su">bestwap.wml.su</a><br/>';
print '</p></body></html>';
?>