Размер файла: 6.52Kb
<?php
include('nm.php');
include('head.php');
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
if($_SESSION['admin_name']=="")
{ header("Location: $error"); exit(); }
else
{
if($admin_name!=$_SESSION['admin_name'] && $admin_password!=$_SESSION['admin_password'])
{ header("Location: $error"); exit(); }}
//////////////////////////////////////////////////////////////////////////////
$Dt=date("dm");
//// //// ////
echo"<tr>";
echo"<td class=\"row1\">";
echo '<a href="run.php?set=0">Вчера</a>';
$data=date("d");
$mes=date("m");
if($data == 01)
{
if($mes == 01) { $xdn = 31; }
if($mes == 02) { $xdn = 31; }
if($mes == 03) { $xdn = 28; }
if($mes == 04) { $xdn = 31; }
if($mes == 05) { $xdn = 30; }
if($mes == 06) { $xdn = 31; } //май
if($mes == 07) { $xdn = 30; }
if($mes == 08) { $xdn = 31; }
if($mes == 09) { $xdn = 31; } //август
if($mes == 10) { $xdn = 30; }
if($mes == 11) { $xdn = 31; }
if($mes == 12) { $xdn = 30; } //ноябрь
$mesx = $mes-1;
if($mesx <= "10")
{
$nk=0;
$Dt="$xdn$nk$mesx";
}
else
{
$Dt="$xdn$mesx";
}
// первый месяц года
if($mes == "01")
{
$nk=12;
$Dt="$xdn$nk";
}
}
else
{
if($data <= "10")
{
$nk=0;
$x=$data-1;
$Dt="$nk$x$mes";
}
else
{
$x=$data-1;
$Dt="$x$mes";
}
}
//--
$tot=mysql_query("select count(*) from stat WHERE dt='".mysql_escape_string($Dt)."' ;");
$total=mysql_fetch_array($tot);
echo"<span class=\"red\">";
echo"[".$total['count(*)']."]<br>";
echo"</span>";
echo '<a href="run.php?set=1">Сегодня</a>';
$Dt=date("dm");
$tot=mysql_query("select count(*) from stat WHERE dt='".mysql_escape_string($Dt)."' ;");
$total=mysql_fetch_array($tot);
echo"<span class=\"red\">";
echo"[".$total['count(*)']."]<br>";
echo"</span>";
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
echo '<a href="run.php?set=2">Неделю</a>';
$est=date("d");
$tot=mysql_query("select count(*) from stat WHERE nd!='' ;");
$total=mysql_fetch_array($tot);
echo"<span class=\"red\">";
echo"[".$total['count(*)']."]<br>";
echo"</span>";
echo '<a href="run.php?set=3">Месяц</a>';
$Ms=date("my");
$tot=mysql_query("select count(*) from stat WHERE ms='".mysql_escape_string($Ms)."' ;");
$total=mysql_fetch_array($tot);
echo"<span class=\"red\">";
echo"[".$total['count(*)']."]<br>";
echo"</span>";
//
echo '<a href="run.php?set=4">Общая</a>';
$tot=mysql_query("select count(*) from stat ;");
$total=mysql_fetch_array($tot);
echo"<span class=\"red\">";
echo"[".$total['count(*)']."]<br>";
echo"</span>";
echo"</td>";
echo"</tr>";
//
$opst=mysql_query("select count(*) from stat_oper ;");
$ops=mysql_fetch_array($opst);
$op=$ops['count(*)'];
//if($ops['lit']=="")
//$op=0;
$bann=mysql_query("select count(*) from stat WHERE userban='1' ;");
if($bann) while($b=mysql_fetch_array($bann))
$bnd=$b['count(*)'];
$list_user=mysql_query("select count(*) from stat WHERE user!='' ;");
$hus=mysql_fetch_array($list_user);
$usreg=$hus['count(*)'];
$reyting_str=mysql_query("select count(*) from statstr ;");
$reyting=mysql_fetch_array($reyting_str);
$rey=$reyting['count(*)'];
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
echo"<tr>";
echo"<td class=\"row1\">";
echo"<a href='operst.php'>Операторы</a>";
echo"<span class=\"red\">";
echo"[$op]<br>";
echo"</span>";
echo "<a href='banlist.php'>Банлист</a>";
echo"<span class=\"red\">";
echo"[$bnd]<br>";
echo"</span>";
echo "<a href=userlist.php>Зареганых</a>";
echo"<span class=\"red\">";
echo"[$usreg]<br>";
echo"</span>";
echo "<a href=statstr.php>Рейтинг</a>";
echo"<span class=\"red\">";
echo"[$rey]<br>";
echo"</span>";
echo '<a href="delstat.php">Очистить БД</a>';
echo"</td>";
echo"</tr>";
$tot=mysql_query("select * from chet WHERE ch='1' ;");
$total=mysql_fetch_array($tot);
$xost=$total['xost'];
if($total['xost']=="") $xost=0;
$tot=mysql_query("select * from chet WHERE ch='1' ;");
$total=mysql_fetch_array($tot);
$xit=$total['xit'];
if($total['xit']=="") $xit=0;
$tot=mysql_query("select * from chet WHERE ch='1' ;");
$total=mysql_fetch_array($tot);
$vxost=$total['vxost'];
if($total['vxost']=="") $vxost=0;
$tot=mysql_query("select * from chet WHERE ch='1' ;");
$total=mysql_fetch_array($tot);
$vxit=$total['vxit'];
if($total['vxit']=="") $vxit=0;
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
$wine = 300;
$j=getenv("HTTP_USER_AGENT");
$z=getenv("REMOTE_ADDR");
$sql_update = "DELETE FROM onlin WHERE `unix`+$wine < ".time(). " OR `ip` = '$z.$j'";
$result_update = mysql_query($sql_update);
$sql_sel = "SELECT `id` FROM onlin";
$result_sel = mysql_query($sql_sel);
$onli = mysql_num_rows($result_sel);
echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"cp\">"; echo "Хосты сегодня: "; echo"</span>"; echo"<span class=\"yellow\">"; echo"[$xost]<br>"; echo"</span>";
echo"<span class=\"cp\">"; echo "Хосты всего: "; echo"</span>"; echo"<span class=\"yellow\">"; echo"[$vxost]<br>"; echo"</span>";
echo"<span class=\"cp\">"; echo "Хиты сегодня: "; echo"</span>"; echo"<span class=\"yellow\">"; echo"[$xit]<br>"; echo"</span>";
echo"<span class=\"cp\">"; echo "Хиты всего: "; echo"</span>"; echo"<span class=\"yellow\">"; echo"[$vxit]<br>"; echo"</span>";
echo"<span class=\"cp\">";
echo"<a href=\"ons.php\">Онлайн юзеров</a>";
echo"</span>";
echo"<span class=\"yellow\">"; echo"[$onli]<br>"; echo"</span>";
echo"</td>";
echo"</tr>";
include('foot.php');
////////////////////////////////////
// Автор: Swen //
// Statistics_of_visitings-v_2.5 //
// http://wipsoft.ru //
// 15.12.2008 //
////////////////////////////////////
?>