View file stat.php

File size: 4.36Kb
<?php
/**********************************
*	@year: 2015				      *
*	@author: Klubv	              *
*   @icq: 611940693			      *
*	@link: http://klubv.ru        *
**********************************/
include 'header/config.inc.php';
include 'header/function.inc.php';
include 'header/header.inc.php';
include 'header/connect.inc.php';
include 'header/click-club.class.php';
If (!isset($_GET['log'])) define("anybody","true");
include 'header/enter.inc.php';
include 'ban.php';

$_CONF['title']='Статистика клуба';

function kuser()
{
$time = time();
$result=mysql_query("SELECT `login` FROM `".prefix."users` ");
$num=mysql_num_rows($result);
$req = mysql_query("SELECT `login` FROM `".prefix."users` WHERE `ts` > ($time - 86400);");
$res = mysql_num_rows($req);
if ($res > 0)
$num = $num . '&nbsp;<font color="#FF0000">+' . $res . '</font>';
return $num;
}

$q = mysql_fetch_assoc(mysql_query("select * from `cclub_users` order by `id` desc limit 1"));

$cl=mysql_num_rows(mysql_query("SELECT `to` FROM `".prefix."clicks` "));

$num1=mysql_num_rows(mysql_query("SELECT `login` FROM `".prefix."users` WHERE `cfrom`>`cto`"));

$counter=mysql_num_rows(mysql_query("SELECT * FROM `ban`"));

$admin=mysql_num_rows(mysql_query("SELECT `login` FROM `".prefix."users` WHERE `admin`='1';"));




$moder=mysql_num_rows(mysql_query("SELECT * FROM `".prefix."moderka`"));


$url=mysql_num_rows(mysql_query("SELECT * FROM `".prefix."url` "));
$urla=mysql_num_rows(mysql_query("select * from `".prefix."url` where  `moder`='0'&& `activ`='0';"));
$urlm=mysql_num_rows(mysql_query("select * from `".prefix."url` where  `moder`='1' && `ban_prihin`='';"));
$urlb=mysql_num_rows(mysql_query("select * from `".prefix."url` where  `moder`='1' && `ban_prihin`!='';"));

$bank=mysql_result(mysql_query("SELECT SUM(bank) FROM cclub_users"),0);

$cfrom=mysql_result(mysql_query("SELECT SUM(cfrom) FROM cclub_users"),0);
$cto=mysql_result(mysql_query("SELECT SUM(cto) FROM cclub_users"),0);
$aktiv=$cfrom-$cto;
$money_in=mysql_result(mysql_query("SELECT SUM(summa) FROM `cclub_money_in`"),0);
$money_out=mysql_result(mysql_query("SELECT SUM(summa) FROM `cclub_money_out`"),0);
$moneyclub=mysql_result(mysql_query("SELECT SUM(money) FROM `users`"),0);
$birzha=mysql_result(mysql_query("SELECT SUM(kr) FROM `stavki`"),0);


echo '<div class="downsw">&bull; <b>Статистика клуба:</b></div>';
echo'<div class="menuindexom">';
echo '&bull; Всего юзеров: <b>'.kuser().'</b><br/>';
echo '&bull; Последний: <font color="red"><b>'.htmlspecialchars(stripslashes(trim($q['login']))).'</b></font></a><br/>
';
echo '&bull; Активных: <b>'.$num1.'</b><br/>';
echo '&bull; Забаненных юзеров: <b>'.$counter.'</b><br/>';
echo '&bull; Админов: <b>'.$admin.'</b><br/>';
echo '&bull; Модераторов: <b>'.$moder.'</b><br/>';
echo '&bull; Площадок всего: <b>'.$url.'</b><br/>';
echo '&bull; Активных: <b>'.$urla.'</b><br/>';
echo '&bull; На модерации: <b>'.$urlm.'</b><br/>';
echo '&bull; Забаненных: <b>'.$urlb.'</b><br/>';
echo '&bull; Кликов сегодня: <b>'.$cl.'</b><br/>';
echo '&bull; Кредитов в банке: <img src="/images/coins.png"/><b>'.$bank.'</b><br/>';
echo '&bull; Кредитов в активе: <img src="/images/pay.gif"/><b>'.$aktiv.'</b><br/>';
echo '&bull; Кредитов на бирже: <img src="/images/coins.png"/><b>'.$birzha.'</b><br/>';
echo '&bull; Денег в клубе: <img src="/images/money.png"/><b>'.$moneyclub.' руб.</b><br/>
&bull; Введено денег: <img src="/images/money.png"/><b>'.$money_in.' руб.</b><br/>
&bull; Выведено денег: <img src="/images/money.png"/><b>'.$money_out.' руб.</b></div>';

echo '<div class="downsw">&bull; <b>Рейтинги партнеров:</b></div>';

echo'<div class="menuindexom">';

$fs_query1 = mysql_query("SELECT `who`,  `cn` FROM `".prefix."stats` WHERE `ts`=CURDATE() GROUP BY `who` ORDER BY `cn` DESC ");

echo '&bull; <a href="enter.php'.$_zapros.'mode=full_stats&today">Лучшие сегодня</a> <b>('.mysql_num_rows($fs_query1).')</b><br/>
&bull; <a href="index.php?mode=rbank">Рейтинг банкиров</a><br/>
&bull; <a href="index.php?mode=r_money">Peйтинг пo дeньгaм</a><br/>
&bull; <a href="ref_rat.php">Рейтинг по рефералам</a><br/>
&bull; <a href="index.php?mode=best">Рейтинг пользователей</a><br/>
&bull; <a href="enter.php'.$_zapros.'mode=full_stats">Полная статистика</a><br/>
&bull; <a href="banlist.php'.$_zapros.'">Бан лист</a> <b>('.$counter.')</b></div>';

include "header/end.inc.php";
?>