<?php
$security = 2;
include_once('../inclfiles/core.php');
$title = 'Удаленные сообщения в чате';
include_once('../inclfiles/head.php');
$all = mysql_num_rows(mysql_query("SELECT * FROM `chat` WHERE `deleted` > 0"));
if($all != 0){
	$total=intval(($all-1)/$set['napage'])+1;
	if(empty($page) OR $page < 0) $page = 1;
	if($page > $total) $page = $total;
	$past=intval($all/$set['napage']);
	$start=$page*$set['napage']-$set['napage'];
	$messages = mysql_query("SELECT * FROM `chat` WHERE `deleted` > 0 ORDER BY `time` DESC LIMIT ".$start.",".$set['napage']."");
	while($message= mysql_fetch_array($messages)){
		t1();
		echo time_right($message['time']).user($message['id_user']).deleted($message['deleted']).'<br/>';
 		echo smiles($message['message']);
		t2();
	}
	navigation($all,$set['napage'],$page,'chat_deleted.php?',$total);
}
else t('Нет удаленных сообщений');
if($user['level'] >= 2) a('index.php?','Панель управления','control_panel');
include_once('../inclfiles/foot.php');
?>