Просмотр файла run.php

Размер файла: 8.95Kb
<?php
header("Content-Type: text/html; charset=utf-8");
error_reporting(0);
ob_start('ob_gzhandler');
session_name("sid");
session_start();
include "nm.php";
////////////////////////////////////
// Автор:  Swen                    //
// E-mail: [email protected]  //
// ICQ:   437-565-058              //
//---------------------------------//
//  Statistics_of_visitings-v_2    //
//   http://wapsoft.net.ru         //
//       24.01.2008                //
////////////////////////////////////
if($_SESSION['admin_name']=="")
{ header("Location: http://wapsoft.net.ru"); exit(); }
else
{
if($admin_name!=$_SESSION['admin_name'] && $admin_password!=$_SESSION['admin_password'])
{ header("Location: http://wapsoft.net.ru"); exit(); }}
echo' <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">';
echo' <html>';
echo' <head>';
echo' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
echo" <title>$nazw</title>";
echo' <link rel="stylesheet" href="still.css" type="text/css">';
echo' </head>';
echo' <body>';

echo"<div style=\"border: 0px solid #33CC00 ; background: #33CC00 ; padding: 2px\">";
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
echo"<span class=\"red\">";
if($set==1) echo'Сегодня'; if($set==2) echo'За неделю';  if($set==3) echo'За месяц'; if($set==4) echo'Общая';
echo"</span>";
echo"</div>";

$pnumber=$amount;
if($s == "")
$s=1; $begin=($s-1)*$pnumber;

if($set=="1") // dt
{
$Dt=date("dm");
$thm=mysql_query("select * from stat WHERE dt='".mysql_escape_string($Dt)."' ORDER BY alt DESC limit $begin, $pnumber;");
$tot=mysql_query("select count(*) from stat WHERE dt='".mysql_escape_string($Dt)."' ;");
}

if($set=="2") // dt
{
$Ms=date("my");
$thm=mysql_query("select * from stat WHERE nd!='0' ORDER BY alt DESC limit $begin, $pnumber;");
$tot=mysql_query("select count(*) from stat WHERE nd!='0' ;");
}

if($set=="3") // dt
{
$Ms=date("my");
$thm=mysql_query("select * from stat WHERE ms='".mysql_escape_string($Ms)."' ORDER BY alt DESC limit $begin, $pnumber;");
$tot=mysql_query("select count(*) from stat WHERE ms='".mysql_escape_string($Ms)."' ;");
}

if($set=="4") // ms
{
$thm=mysql_query("select * from stat ORDER BY alt DESC limit $begin, $pnumber;");
$tot=mysql_query("select count(*) from stat ;");
}
if($thm && $tot)
	{

while($theme = mysql_fetch_array($thm))
{
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
echo "<small>".$theme['time']."</small><br>";
echo"<span class=\"red\">";
echo "".$theme['info']."<br>";
echo"</span>";
////////////////////////////////////
// Автор:  Swen                    //
// E-mail: [email protected]  //
// ICQ:   437-565-058              //
//---------------------------------//
//  Statistics_of_visitings-v_2    //
//   http://wapsoft.net.ru         //
//       24.01.2008                //
////////////////////////////////////
echo "<small>".$theme['tims']."</small><br>";
echo "<small>Посещений: <b>".$theme['alt']."</b></small><br>";
echo"<small>";
echo"<a href=\"delst.php?set=$set&amp;nm=".$theme['nm']."\">[Уд] </a>";
echo"<a href=\"ban.php?set=$set&amp;nm=".$theme['nm']."\">[Бан]</a>";
echo"</small>";
echo"</div>";
}
///////////////////////////////////////////////////////////////////////////////////////
if($set==1)   {
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xost="".$totalx['xost']."";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xit="".$totalx['xit']."";
echo"<small><u>За сегодня</u></small><br>";
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"[$xit]<br>";  echo"</span>";
echo"</div>"; }

if($set==2)   {
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xost="".$totalx['nxost']."";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xit="".$totalx['nxit']."";
echo"<small><u>За неделю</u></small><br>";
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"[$xit]<br>";  echo"</span>";
echo"</div>"; }
////////////////////////////////////
// Автор:  Swen                    //
// E-mail: [email protected]  //
// ICQ:   437-565-058              //
//---------------------------------//
//  Statistics_of_visitings-v_2    //
//   http://wapsoft.net.ru         //
//       24.01.2008                //
////////////////////////////////////
if($set==3)   {
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xost="".$totalx['mxost']."";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xit="".$totalx['mxit']."";
echo"<small><u>За месяц</u></small><br>";
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"[$xit]<br>";  echo"</span>";
echo"</div>"; }

if($set==4)   {
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xost="".$totalx['vxost']."";
$totx=mysql_query("select * from chet WHERE ch='1' ;");
$totalx=mysql_fetch_array($totx);
$xit="".$totalx['vxit']."";
echo"<small><u>Всего</u></small><br>";
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"[$xit]<br>";  echo"</span>";
echo"</div>"; }
//////////////////////////////////////////////////////////////////////////////////////////
echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
$total=mysql_fetch_array($tot);
$number = (int) ($total['count(*)']/$pnumber);
if($total['count(*)'] >= ($pnumber+1))
	{

if((float) ($total['count(*)']/$pnumber)-$number !=0) $number++;
echo"<span class=\"red\">";
if($s == 1) echo"&lt;&lt;.Пред. |";
echo"</span>";

if($begin>0) {
echo "<a href=\"run.php?s=".($s-1)."&amp;set=$set\">&lt;&lt;.Пред.</a>";
echo"<span class=\"red\">|</span>"; }

if($total['count(*)']>$begin+$pnumber) {
echo"<span class=\"red\">|</span>";
echo "<a href=\"run.php?s=".($s+1)."&amp;set=$set\">След.&gt;&gt;</a>"; }

echo"<span class=\"red\">";
if($number == $s) echo"| След.&gt;&gt;";
echo"</span>";

$all=ceil($total['count(*)'] / $pnumber); $i=1;   $c="";   $tt=$s;
while($i<=$all){
if($i<=3  || $i==$tt- 1  || $i==$tt || $i==$tt+1  || $i>=$all-2)
{$ii="<a href=\"run.php?s=".$i."&amp;set=$set\">".$i."</a>";
if($i==$tt) { if($i!=$all){ $c.= "<b>$i</b>,";}
else{$c.= "<b>$i</b>";} 
////////////////////////////////////
// Автор:  Swen                    //
// E-mail: [email protected]  //
// ICQ:   437-565-058              //
//---------------------------------//
//  Statistics_of_visitings-v_2    //
//   http://wapsoft.net.ru         //
//       24.01.2008                //
////////////////////////////////////
}
else { if($i!=$all){ $c.= "$ii,";} else{$c.= "$ii";} }}
else{$c.= "."; } $i++; }
$c=preg_replace("/[,][.]+/", "...",$c);
echo"<span class=\"red\">";
echo "<br>$c";
echo"</span>";
echo"</div>";

echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
echo"<span class=\"red\">";
echo"<b>Всего : ".$total['count(*)']."</b><br>";
echo"</span>"; } }
echo '<a href="./">Статистика</a><br>';
$Contents = ob_get_contents(); 
$gzib_file = strlen($Contents); 
$gzib_file_out = strlen(gzcompress($Contents,9));
if(!$vy){echo'<small>&#169; by Swen</small><br>';}else{echo'$kp';}
$gzib_pro=round(100-(100/($gzib_file/$gzib_file_out)),1); 
echo ' <small>Cжатие: '.$gzib_pro.'%</small>';
echo"</div>";
echo"</div>";
echo' </body>';
echo' </html>';
////////////////////////////////////
// Автор:  Swen                    //
// E-mail: [email protected]  //
// ICQ:   437-565-058              //
//---------------------------------//
//  Statistics_of_visitings-v_2    //
//   http://wapsoft.net.ru         //
//       24.01.2008                //
////////////////////////////////////
?>