<?php
define('GCMS',true);
require_once ('system/power.php');
$diz -> head('Список юзеров');
$count = $db -> dbcount('COUNT(`id`)','users');
$diz -> title('Список пользователей (Всего: <b>'.$count.'</b>)');
if($count>0){
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1; 
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$msg.='<div class="fon">';
$sql = $db -> query("SELECT `id`,`login`,`time`,`ava` FROM `users` ORDER BY `id` LIMIT ".$start.",".$num);
while ($users = $sql -> fetch_assoc()) {
if($aut==true){
if($users['ava']!='0.png'){$foto='../my/ava/'.$users['ava'].'';}else{
$foto='../styles/'.$ya['style'].'/images/noava.png';}
$av='<img src="system/resize.php?img='.$foto.'&width=30&height=30&i=0" alt="ава"/>';
}elseif($aut==false){
if($users['ava']!='0.png'){$foto='../my/ava/'.$users['ava'].'';}else{
$foto='../styles/'.$nastr['ststyle'].'/images/noava.png';}
$av='<img src="system/resize.php?img='.$foto.'&width=30&height=30&i=0" alt="ава"/>';
}
$user = $users['id'];
$msg .= '<table border="0" width="100%">
	<tr>
		<td height="0" width="26"><div class="avatar">'.$av.'</div></td>
 <td>
<div class="spisok">'. $func -> user($user).' [Рега: '.$func -> times(date('d m Y',$users['time'])).' ]</div></td>
	</tr>
</table>';
}
$act = 'users.php?';
$msg .= $func -> pagenav($act,$page,$total);
}else{$msg.='Пользователей ещё пока нет';}
$msg .= '</div><div class="levo">'.$diz -> img('home.png').'<a href="index.php">На главную</a></div>';
#####Копирайт#######
require_once ('system/kopy.php');
$diz -> out($msg);
?>