File size: 2.33Kb
<?
include 'db.php';
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die (mysql_error());
mysql_select_db($DB_NAME);
$index = "guwap.org/kat";
$prishlo=mysql_query("SELECT sum(counter) FROM `users` where id!='';");
$prish=mysql_fetch_row($prishlo);
$pr=implode($prish);
$ushlo=mysql_query("SELECT sum(outcounter) FROM `users` where id!='';");
$ush=mysql_fetch_row($ushlo);
$us=implode($ush);
$alush=mysql_query("SELECT sum(allushlo) FROM `users` where id!='';");
$alus=mysql_fetch_row($alush);
$al=implode($alus);
$vse = mysql_query("select count(id) as vsego from users");
$vseg = mysql_fetch_array($vse);
$vsego = $vseg["vsego"];
$aktiv = mysql_query("select count(id) as akt from users where counter>0");
$akti = mysql_fetch_array($aktiv);
$akt = $akti["akt"];
/*Переколировка русских символов*/
function unicode ($s) { if ( (ord($s)>=192) & (ord($s)<=255) ) $hexvalue=dechex(ord($s)+848); if ($s=="Ё") $hexvalue="401"; if ($s=="ё") $hexvalue="451"; return("�".$hexvalue.";");}
function utf_encode ($s) { return(preg_replace("/[А-яЁё]/e","unicode('\\0')",$s));}
header("Content-type:text/vnd.wap.wml;charset=utf-8");
print '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">';
print '<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="main" title="Статистика">
<p align="left">';
print utf_encode("<u>Сайтов</u><br/>Зареганых:$vsego <br/>Активных:$akt <br/>:::::<br/>");
print utf_encode("<u>Переходов</u><br/>Сегодня пришло:$pr<br/>");
print utf_encode("Сегодня ушло:$us");
print '<br/>:::::<br/><a href="http://guwap.org/kat/index.php">В каталог</a><br/><a href="http://guwap.org/kat/index.php">На главную</a><br/>
</p></card></wml>';
?>