Файл: pages/rewrite_phone.php
Строк: 48
<?php # Created by Up
include_once '../sistem/start.php';
include_once $config['OTS'].'sistem/config.php';
include_once $config['OTS'].'sistem/function.php';
include_once $config['OTS'].'sistem/db.php';
//include_once $config['OTS'].'sistem/users.php';
if(isset($_GET['id']))
{
$id=((int)abs($_GET['id']));
if(mysql_num_rows($sql=mysql_query('SELECT * FROM `site` where `id`=''.$id.'' LIMIT 1;'))>=1)
{
$arr=mysql_fetch_assoc($sql);
$config['TITLE']='Статистика по телефонам '.$arr['name'];
$config['description']=$arr['opisanie'];
include_once $config['OTS'].'sistem/head.php';
$ua=array(2=>'SonyEricsson',3=>'Nokia',4=>'Samsung',5=>'Siemens',6=>'Motorola',7=>'Lg',8=>'Sagem',9=>'Opera',10=>'Panasonic',11=>'Fly',12=>'Sharp',13=>'Philips',14=>'Alcatel',15=>'Компьютеры',1=>'Другие');
$sql=mysql_query('SELECT DISTINCT `phone`, SUM(`hit`) AS `hit` FROM `statistic` WHERE `for`=''.$id.'' GROUP BY `phone` ORDER BY 2 DESC;');
if(mysql_num_rows($sql)>=1)
{
while($s=mysql_fetch_assoc($sql))
print '<b>'.$ua[$s['phone']].'</b> - <i>'.(round((($s['hit']/$arr['hit'])*100),1)).'%</i><br />';
}
else
print 'Еще нету статистики по моделям телефонов!<br />';
print '<a href="index.php">Страница сайта</a><br />';
include_once $config['OTS'].'sistem/foot.php';
}
}
#else
{
header('location: '.$config['home'].'/?act=error&error=404');
exit;
}
?>