<?
error_reporting(E_ALL ^ E_NOTICE); //<--
session_start();
require ('../data/config.php');
require ('../data/mysql.php');
require ('../data/functions.php');
if (!authenticateUser( $cookie_user, $cookie_passwd))
{
header("Location:/index.php?err=falce");
exit();
}
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.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>'; ?>
<card title="<?print "$site_title";?>">
<p>
<?require ('../html/up_user.php');?>
<small>
<b>Статистика</b><br/><br/>
<?
$result= mysql_query("SELECT * FROM accounts WHERE user_login='$cookie_user'");
$row = mysql_fetch_array($result);
print "
Вы показали
показы/
клики/
CRT,%/<br/>
сегодня
";
$mm=date("m",time());
$dd=date("d",time());
$yy=date("Y",time());
$today=mktime(0,0,0,$mm,$dd,$yy);
$r1= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='view' AND date>='$today'");
print mysql_num_rows($r1);
print "/
";
$r2= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='click' AND date>='$today'");
print mysql_num_rows($r2);
print" /
";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
вчера
";
$mm=date("m",time());
$dd=date("d",time());
$yy=date("Y",time());
$today=mktime(0,0,0,$mm,$dd,$yy);
$yesterday=$today-86400;
$r1= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='view' AND date<='$today' AND date>='$yesterday'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='click' AND date<='$today' AND date>='$yesterday'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print " /<br/>
за 7 дней ";
$week=time()-604800;
$r1= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='view' AND date>='$week'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='click' AND date>='$week'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "
/<br/>
за 30 дней ";
$week=time()-2592000;
$r1= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='view' AND date>='$week'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='click' AND date>='$week'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
всего ";
$r1= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='view'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat WHERE id_account='$row[id]' AND action='click'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
<br/>
Ваши баннеры<br/>
показы
клики/
CRT,%/<br/>
сегодня
";
$mm=date("m",time());
$dd=date("d",time());
$yy=date("Y",time());
$today=mktime(0,0,0,$mm,$dd,$yy);
$r1= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='view' AND date>='$today'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='click' AND date>='$today'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
вчера
";
$mm=date("m",time());
$dd=date("d",time());
$yy=date("Y",time());
$today=mktime(0,0,0,$mm,$dd,$yy);
$yesterday=$today-86400;
$r1= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='view' AND date<='$today' AND date>='$yesterday'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='click' AND date<='$today' AND date>='$yesterday'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
за 7 дней ";
$week=time()-604800;
$r1= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='view' AND date>='$week'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='click' AND date>='$week'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
за 30 дней ";
$week=time()-2592000;
$r1= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='view' AND date>='$week'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='click' AND date>='$week'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/<br/>
всего ";
$week=time()-2592000;
$r1= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='view'");
print mysql_num_rows($r1);
print "/";
$r2= mysql_query("SELECT * FROM stat_acc WHERE id_account='$row[id]' AND action='click'");
print mysql_num_rows($r2);
print"/";
if (mysql_num_rows($r1)<>0)
print round((mysql_num_rows($r2)/mysql_num_rows($r1))*100,1);
print "/
<br/>
";
?>
<br/>
<br/>
<a href="index.php">Управление аккаунтом</a> <br/>
</small> </p>
</card>
</wml>