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

Размер файла: 4.57Kb
<?php
header("Content-Type: text/html; charset=utf-8");
error_reporting(0);
ob_start('ob_gzhandler');
include "nm.php";

////////////////////////////////////
// Автор: Swen                     //
// E-mail:[email protected]        //
// ICQ:   437565058                //
//---------------------------------//
//       31.12.2007                //
////////////////////////////////////

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>WAPsoft.net.ru</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\">";
if($set==1) echo'Сегодня'; if($set==2) echo'За месяц'; if($set==3) echo'Общая';
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 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=="3") // 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 "".$theme['info']."<br>";
////////////////////////////////////
// Автор: Swen                     //
// E-mail:[email protected]        //
// ICQ:   437565058                //
//---------------------------------//
//       31.12.2007                //
////////////////////////////////////
echo "<small>".$theme['tims']."</small><br>";
echo "<small>Посещений: <b>".$theme['alt']."</b></small><br>";

echo"</div>";
}

echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";

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++;
if($s == 1) echo"&lt;&lt;.Пред. |";
if($begin>0) echo "<a href=\"run.php?s=".($s-1)."&amp;set=$set\">&lt;&lt;.Пред.</a>|";

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

$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:   437565058                //
//---------------------------------//
//       31.12.2007                //
////////////////////////////////////
}
else { if($i!=$all){ $c.= "$ii,";} else{$c.= "$ii";} }}
else{$c.= "."; } $i++; }
$c=preg_replace("/[,][.]+/", "...",$c);
echo "<br>$c";

echo"</div>";

echo"<div style=\"border: 2px solid #33CC00 ; background: #00CCFF ; padding: 2px\">";
echo"<b>Всего : ".$total['count(*)']."</b><br>";} }
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:   437565058                //
//---------------------------------//
//       31.12.2007                //
////////////////////////////////////
?>