View file opsos_day.php

File size: 4.74Kb
<?php
#  Сщетчик переходов с статистикой по операторам ver 1.0
#  Автор скрипта Корнилов Александр aka GrOb
#  e-mail: [email protected]; [email protected]
#  ICQ: 191-171
#  WAP: http://o5wap.ru


 include ('config.php');
  if(!isset($_GET['go'])){
  header("Location: $site");
  exit;}
 include('header.php');
 $go=preg_replace("/[^0-9]/","",$_GET['go']);
 if (empty($_SESSION['pass'])) $_SESSION['pass']=$_GET['pass'];
 if ($_SESSION['pass']!=$admin)
 {
 echo $div['header'].'ОШИБКА!'.$div['end'];
 echo $div["div"]."Доступ запрещен!<br/>Или истекла сессия";
 echo $div['end'].$div['news'];
 echo "Пароль:";
 echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
 echo '<input name="pass" type="password"/><br/>';
 echo '<input class="ibutton" type="submit" value="Войти"/></form>';
 include ("footer.php");
 exit();
 }

 $qe = @mysql_query("select * from `click_user` where `id`='".$go."';");
 $fielde=@mysql_fetch_array($qe);
 $name=conv($fielde['name_link']);



 $m=@preg_replace("/[^0-9]/","",$_GET['m']);
 $y=date('Y');

   $q_mes = @mysql_query("select * from `click_opsos_mes` where `uid`='".$go."' and `m`='".$m."' and `y`='".$y."';");
   $field_mes=@mysql_fetch_array($q_mes);
   $hity_mes=@ceil($field_mes['hits']);
   $opsos_mes=@ceil($field_mes['0']);
   $all=$hity_mes-$opsos_mes;
   $op_procent=@ceil($all/($hity_mes/100));
   $neop_procent=100-$op_procent;

 echo $div['header'];
 echo "<big>".$name." go=".$go."<br/>Статистика операторов за:<br/> ".whatMonth(date($m))." ".$y."  (<b>".$op_procent."%</b> - ".$all." Кликов)</big><br/>";
 echo $div['end'];
 echo $div['news'];
 echo '<b><a href="'.$_SERVER['PHP_SELF'].'?go='.$go.'&amp;m='.$m.'&amp;'.session_name().'='.session_id().'">Обновить</a></b> - ';
 echo '<b><a href="opsos.php?go='.$go.'&amp;'.session_name().'='.session_id().'">Операторы кратко</a></b> - ';
 echo '<b><a href="admin.php?'.session_name().'='.session_id().'">В Статистику</a></b><br/>';


 for($i=1;$i<13;$i++){
 if($i<10)$i='0'.$i;
 echo '<a href="'.$_SERVER['PHP_SELF'].'?go='.$go.'&amp;m='.$i.'&amp;'.session_name().'='.session_id().'">'.whatMonth(date($i)).'</a> ';
  }

 echo '<small><table border="0" cellpadding="3" bgcolor="#CCCCCC">'."<tr>";
 echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>ОПЕРАТОРЫ / ДНИ</b></td>";

 for ($i=1;$i<32;$i++){
 $sql = @mysql_query("select * from `click_opsos` where `uid`='".$go."' and `d`='".$i."' and `m`='".$m."' and `y`='".$y."';");
 $field[$i]=@mysql_fetch_array($sql);

 echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\">".$i."</td>";
 }
 echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>За ".whatMonth(date($m))."</b></td>";
 echo "</tr>";


   echo "<tr>";
   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>Всего Кликов</b></td>";
   for ($a=1;$a<32;$a++){
   $hity=$field[$a]['hits'];
    if($a==1||$a==3||$a==5||$a==7||$a==9||$a==11||$a==13||$a==15||$a==17||$a==19||$a==21||$a==23||$a==25||$a==27||$a==29||$a==31){
    $color='#FFFF84';
    }else  $color='#BFFFFF';
   echo "<td align=\"center\" class=\"p\" bgcolor=\"".$color."\"><b>".$hity."</b></td>";
   }

   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>".$hity_mes."</b></td>";
   echo "</tr>";

   echo "<tr>";
   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>Нет IP в Базе</b></td>";
   for ($a=1;$a<32;$a++){
   $opsos_=$field[$a]['0'];
    if($a==1||$a==3||$a==5||$a==7||$a==9||$a==11||$a==13||$a==15||$a==17||$a==19||$a==21||$a==23||$a==25||$a==27||$a==29||$a==31){
    $color='#FFFF84';
    }else  $color='#BFFFFF';
   echo "<td align=\"center\" class=\"p\" bgcolor=\"".$color."\"><b>".$opsos_."</b></td>";
   }
   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>".$opsos_mes." (".$neop_procent."%)</b></td>";
   echo "</tr>";

  for ($i=1;$i<27;$i++){
   $oper=$i;
   include ("spop.php");
   echo "<tr>";
   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\">$oper_name</td>";
   for ($a=1;$a<32;$a++){
   $host=$field[$a][$i];
   $host=$host;
    if($a==1||$a==3||$a==5||$a==7||$a==9||$a==11||$a==13||$a==15||$a==17||$a==19||$a==21||$a==23||$a==25||$a==27||$a==29||$a==31){
    $color='#FFFF84';
    }else  $color='#BFFFFF';
   echo "<td align=\"center\" class=\"p\" bgcolor=\"".$color."\">".$host."</td>";
    }
   $host_mes=$field_mes[$i];
   $host_mes=ceil($host_mes);
   echo "<td align=\"center\" class=\"p\" bgcolor=\"#E8E8FF\"><b>".$host_mes."</b></td>";
   echo "</tr>";

 }
 echo '</table></small>';
 include('footer.php');
 @mysql_close($sesDB);
?>