Файл: statistik.php
Строк: 47
<?php
session_start();
define('IN_SCRIPT', true);
include "includes/ini.php";
include "includes/header.php";
If (!isset($_GET['do']) || !ereg("^[a-z0-9_-]{1,15}$",$_GET['do'])) $do=false; else $do=$_GET['do'];
switch ($do) {
case 'index':
default:
if (isset($_SESSION['auth'])){
$login = $_SESSION['login'];
$login = htmlspecialchars(trim($login));
$login = mysql_real_escape_string($login);
$count = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE login='$login'"));
$qy=mysql_query("select* from `inbox` where (`idto`='".$count['id']."' && `status`='0');");
$ne=mysql_num_rows($qy);
if($ne > 0){
echo '<div class="output_err"><center>У Вас <b><a href="mail.php?do=inbox">'.$ne.'</a></b> новых сообщений.</center></div>';
}
}
//////////////////////ПОЛЬЗОВАТЕЛИ//////////////////////////////////////
$user=mysql_num_rows(mysql_query("SELECT * FROM `users`"));
$user_blok=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `blok`='1'"));
$user_ok=$user-$user_blok;
////////////////////////////////ФИНАНСЫ////////////////////////////////////////////////////////////////////
$money=mysql_result(mysql_query("SELECT SUM(money) FROM `users`"),0);
$money = explode(".", $money);
////////////////////////////////Магазин////////////////////////////////////////////////////////////////////
$my_purchases=mysql_num_rows(mysql_query("SELECT * FROM `shoppokypki`"));
if ($my_purchases>0){
$shoppokypki=mysql_result(mysql_query("SELECT SUM(stoim) FROM `shoppokypki`"),0);
$pokypki = explode(".", $shoppokypki);
}else{
$shoppokypki='0.00';
$pokypki = explode(".", $shoppokypki);
}
$produkt = @mysql_num_rows(mysql_query("SELECT * FROM `shop`"));
$produkt_new = @mysql_num_rows(mysql_query("SELECT * FROM `shop` WHERE `status`='0'"));
$produkt_aktiv = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE `status`='1'"), 0);
$produkt_ban = mysql_result(mysql_query("SELECT COUNT(*) FROM `shop` WHERE `status`='2' "), 0);
echo '<div class="title_page"><img src="imag/st.png" >Статистика</div>';
echo '<div class="box_2">
Участников: '.$user.'<br/>
Активных: '.$user_ok.'<br/>
Заблокированых: '.$user_blok.'</div>';
echo '<div class="box_1">
В магазине: '.$money[0].' руб.<br/>
Покупок на: '.$pokypki[0].' руб.</div>';
echo '<div class="box_2">
Товара: '.$produkt.'<br/>
В продаже: '.$produkt_aktiv.'<br/>
На порверке: '.$produkt_new.'<br/>
Заблокированного: '.$produkt_ban.'</div>';
echo '<div class="title_page"><img src="imag/home.png" ><a href="index.php">Главная</a></div>';
break;
}
include "includes/footer.php";
mysql_close();
?>