<?php
define('NTOP', 1);
$title = 'Все пользователи';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('str/head.php');

$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."users`"));

echo '<div class="topik"><a href="/rating.php">Переходы</a> | <a href="/kredrat.php">Кредиты</a> | Все <b>['.$all.']</b></div>';

if($all != 0){
$total=intval(($all-1)/10)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($all/10);
$start=$page*10-10;
$top = mysql_query("SELECT * FROM `".$prefix."users` LIMIT ".$start.",10");

while($row = mysql_fetch_array($top)){
$kol = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$row['id']."'"));
$start++;
echo '<div class="topni">'.$start.'. <a href="/str/info.php?id='.$row['id'].'">'.$row['login'].'</a> ['.$kol.']</div>'; 
}
navigation($all,$page_top,$page,'users.php?',$total);
echo '<div class="faz"><b><< <a href="/str/office.php">В кабинет</a></b></div>';
}else{
echo '<div class="stat">Юзеров нет</div>';
}
require_once ('str/foot.php');
?>