Файл: stats.php
Строк: 211
<?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);
}
$q = mysql_query("SELECT COUNT(`id`) FROM `users`;", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$all = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `status` > '2';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$active = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `status` = '2';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$block = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `banners`;", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$all_banners = $q['0'];
$q = mysql_query("SELECT COUNT(`id`) FROM `banners` WHERE `status` = '3';", $mysql);
$q = mysql_fetch_array($q) or $q['0'] = 0;
$active_banners = $q['0'];
$credit_active = $credit_bank = 0;
$q = mysql_query("SELECT `bank`, `credit` FROM `users` WHERE `bank` > '0' || `credit` > '0';", $mysql);
while($d = mysql_fetch_array($q)){ $credit_active += $d['credit']; $credit_bank += $d['bank']; }
$s1 = $s2 = $s3 = $c1 = $c2 = $c3 = $t1 = $t2 = $t3 = 0;
$q = mysql_query("SELECT `is1`, `is2`, `is3`, `ic1`, `ic2`, `ic3`, `it1`, `it2`, `it3` FROM `users`;", $mysql);
while($d = mysql_fetch_array($q)){
$s1 += $d['is1']; $s2 += $d['is2']; $s3 += $d['is3'];
$c1 += $d['ic1']; $c2 += $d['ic2']; $c3 += $d['ic3'];
$t1 += $d['it1']; $t2 += $d['it2']; $t3 += $d['it3'];
}
$config->start('stats', $lang['1006']);
if($config->vers == 'wml')
echo '<small>'.
$lang['1156'].': <b>'.$all.'</b><br/>'.
$lang['1157'].': <b>'.$active.'</b><br/>'.
$lang['1158'].': <b>'.$block.'</b><br/><br/>'.
$lang['1159'].': <b>'.$all_banners.'</b><br/>'.
$lang['1160'].': <b>'.$active_banners.'</b><br/><br/>'.
$lang['1161'].': <b>'.$credit_active.'</b><br/>'.
$lang['1162'].': <b>'.$credit_bank.'</b><br/><br/>'.
'<u>'.$lang['1163'].':</u><br/>'.
$lang['1166'].': <b>'.$s1.'</b><br/>'.
$lang['1167'].': <b>'.$s2.'</b><br/>'.
$lang['1168'].': <b>'.$s3.'</b><br/><br/>'.
'<u>'.$lang['1164'].':</u><br/>'.
$lang['1166'].': <b>'.$c1.'</b><br/>'.
$lang['1167'].': <b>'.$c2.'</b><br/>'.
$lang['1168'].': <b>'.$c3.'</b><br/><br/>'.
'<u>'.$lang['1165'].':</u><br/>'.
$lang['1166'].': <b>'.$t1.'</b><br/>'.
$lang['1167'].': <b>'.$t2.'</b><br/>'.
$lang['1168'].': <b>'.$t3.'</b><br/><br/>'.
$lang['1079'].': <b>'.round($c1/$s1, 3).'</b><br/>'.
$lang['1083'].': <b>'.round($c2/$s2, 3).'</b><br/>'.
$lang['1087'].': <b>'.round($c3/$s3, 3).'</b><br/><br/>'.
'<u>'.$lang['1088'].'</u><br/><br/>'.
'<a href="index.php?l='.$config->lang.'&v=wml">'.$lang['1003'].'</a>'.
'</small>';
else
if($config->vers == 'html')
echo $lang['1156'].': <font color="'.$lang['2r'].'">'.$all.'</font><br/>'.
$lang['1157'].': <font color="'.$lang['2r'].'">'.$active.'</font><br/>'.
$lang['1158'].': <font color="'.$lang['2r'].'">'.$block.'</font><br/><br/>'.
$lang['1159'].': <font color="'.$lang['2r'].'">'.$all_banners.'</font><br/>'.
$lang['1160'].': <font color="'.$lang['2r'].'">'.$active_banners.'</font><br/><br/>'.
$lang['1161'].': <font color="'.$lang['2r'].'">'.$credit_active.'</font><br/>'.
$lang['1162'].': <font color="'.$lang['2r'].'">'.$credit_bank.'</font><br/><br/>'.
'<u>'.$lang['1163'].':</u><br/>'.
$lang['1166'].': <font color="'.$lang['2r'].'">'.$s1.'</font><br/>'.
$lang['1167'].': <font color="'.$lang['2r'].'">'.$s2.'</font><br/>'.
$lang['1168'].': <font color="'.$lang['2r'].'">'.$s3.'</font><br/><br/>'.
'<u>'.$lang['1164'].':</u><br/>'.
$lang['1166'].': <font color="'.$lang['2r'].'">'.$c1.'</font><br/>'.
$lang['1167'].': <font color="'.$lang['2r'].'">'.$c2.'</font><br/>'.
$lang['1168'].': <font color="ffffff">'.$c3.'</font><br/><br/>'.
'<u>'.$lang['1165'].':</u><br/>'.
$lang['1166'].': <font color="'.$lang['2r'].'">'.$t1.'</font><br/>'.
$lang['1167'].': <font color="'.$lang['2r'].'">'.$t2.'</font><br/>'.
$lang['1168'].': <font color="'.$lang['2r'].'">'.$t3.'</font><br/><br/>'.
$lang['1079'].': <font color="'.$lang['2r'].'">'.round($c1/$s1, 3).'</font><br/>'.
$lang['1083'].': <font color="'.$lang['2r'].'">'.round($c2/$s2, 3).'</font><br/>'.
$lang['1087'].': <font color="'.$lang['2r'].'">'.round($c3/$s3, 3).'</font><br/><br/>'.
'<u>'.$lang['1088'].'</u><br/><br/>'.
'<a href="index.php?l='.$config->lang.'&v=html">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish();
?>