Файл: users.php
Строк: 105
<?php
//error_reporting(2047|2048);
error_reporting(0);
include 'config.php';
class_exists('config') or die('Error load config class');
$config = new config(1, 1, 1);
$lang = $config->parse_lang() or die('Error parse lang file');
if(!$mysql = mysql_connect($config->mysql['host'], $config->mysql['user'], $config->mysql['pass'])){
$config->start('error', $lang['1014']);
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1010'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1010'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
$config->finish(true);
}
if(!mysql_select_db($config->mysql['db'], $mysql)){
$config->start('error', $lang['1014']);
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1011'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1011'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$config->start('users', $lang['1008']);
if($config->vers == 'wml') print '<small>';
$q = mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `is1` > '0' || `it1` > '0';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$count = $q['0'];
if($count < 1) print '<u>'.$lang['1169'].'</u><br/><br/>';
else{
$page = intval($_GET['p']);
if($page < 1) $page = 1;
$limit = $page*10-10;
if($limit >= $count){ $limit = 0; $page = 1; }
$pages = round($count/10);
if($pages*10 < $count) $pages++;
$q = mysql_query("SELECT `id`, `is1`, `ic1`, `it1`, `site` FROM `users` WHERE `is1` > '0' || `it1` > '0' ORDER BY `ic1` DESC LIMIT $limit, 10;", $mysql);
echo '<u>'.$lang['1170'].': <b>'.$count.'</b></u><br/><br/>';
$num = 1;
while($d = mysql_fetch_array($q)){
echo '<b>'.($limit+$num).'.</b>'.
' <a href="http://'.$d['site'].'">'.$d['site'].'</a> '.
'[id='.$d['id'].'; ctr='.round($d['ic1']/$d['is1'], 3).'; '.$d['ic1'].'/'.$d['is1'].'/'.$d['it1'].']<br/>';
$num++;
}
print '<br/>';
if($page > 1 || $page < $pages){
if($page > 1)
print '<a href="users.php?l='.$config->lang.'&v='.$config->vers.'&p='.($page-1).'"><--</a> ';
if($page < $pages)
print '<a href="users.php?l='.$config->lang.'&v='.$config->vers.'&p='.($page+1).'">--></a>';
print '<br/><br/>';
}
}
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
if($config->vers == 'wml') print '</small>';
mysql_close($mysql); $config->finish();
?>