View file rated/stat.php

File size: 1.22Kb
<?php
  // основная статистика
  include "config.inc.php";
  include "unicode.lib.php";
  
  include "header.php";  
  
  print "<card id=\"Statistic\" title=\"Statistic\">\n";
  print "<p>";

  if (!@mysql_connect($db_host,$db_user,$db_pass)) {
   print "Ошибка соединения с mysql!<br/>";
  }
  else {
   if (!@mysql_select_db($db_name)) {
    print "Ошибка, такой базы не существует!<br/>";
   }
  }

  $db_result=0;$db_result = array(); $ibx = 0; 
  $db_query = mysql_query("select name,url,description,date,views,today from $table_wapcat where today>0 order by today desc");
  while ($row = mysql_fetch_row($db_query)) $db_result[$ibx++] = $row;

  $all_count = count($db_result);

  for ($i=0;$i<count($db_result);$i++) {
   $today_views		= $today_views + $db_result[$i][5];
   $all_views		= $all_views + $db_result[$i][4];
  }

  print utf_encode("<i>Статистика каталога:</i><br/>");
  print utf_encode("Всего сайтов в каталоге: ".$all_count."<br/>");  
  print utf_encode("Общих показов сегодня: ".$today_views."<br/>");  
  print utf_encode("Общих показов всего: ".$all_views."<br/>");  
  print utf_encode("<a href=\"index.php\">Главная</a><br/>");

  print "</p></card>";
  include "footer.php";
?>