View file operst.php

File size: 3.35Kb
<?php
include('nm.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(); }}
include('head.php');
echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"yellow\">";
echo"По операторам:";
echo"</span>";
echo"</td>";
echo"</tr>";

$pnumber=10;
if($s == "")
$s=1; $begin=($s-1)*$pnumber;
$stat_oper=mysql_query("SELECT * from stat_oper ORDER BY nm ASC limit $begin, $pnumber ;");
$tot=mysql_query("select count(*) from stat_oper ;");

if($stat_oper && $tot)
	{
while($exop = mysql_fetch_array($stat_oper))
{
echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"cp\">";
echo "".$exop['opername']." ";
echo"</span>";

echo "<b><small>(</small>";
echo"<span class=\"red\">";
echo $exop['count'] ;
echo"</span>";

echo"<small>)</small></b>";
echo"</td>";
echo"</tr>";
}
 ////////////////////////////////////
//       Автор:  Swen               //
//  Statistics_of_visitings-v_2.5    //
//   http://wipsoft.ru               //
//       15.12.2008                 //
 ////////////////////////////////////
echo"<tr>";
echo"<td class=\"row1\">";
$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=\"operst.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=\"operst.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=\"operst.php?s=".$i."&amp;set=$set\">".$i."</a>";
if($i==$tt) { if($i!=$all){ $c.= "<b>$i</b>,";}
else{$c.= "<b>$i</b>";} 
 ////////////////////////////////////
//       Автор:  Swen               //
//  Statistics_of_visitings-v_2.5    //
//   http://wipsoft.ru               //
//       15.12.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"</td>";
echo"</tr>";

echo"<tr>";
echo"<td class=\"row1\">";
echo"<span class=\"red\">";
echo"<b>Всего : ".$total['count(*)']."</b><br>";
echo"</span>"; } }
echo '<a href="./">Статистика</a><br>';
echo"</td>";
echo"</tr>";
include('foot.php');
 ////////////////////////////////////
//       Автор:  Swen               //
//  Statistics_of_visitings-v_2.5    //
//   http://wipsoft.ru               //
//       15.12.2008                 //
 ////////////////////////////////////
?>