Файл: pages/rewrite_chas.php
Строк: 42
<?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';
        $for=round(date('H'));
        for($i=0; $i<=$for; ++$i)
         {
            if(strlen($i)==1)
                print '<b>0'.$i.':00</b>';
             else
                print '<b>'.$i.':00</b>';
            $ot=mktime($i,0,0,date('m'),date('d'), date('Y'));
            $do=mktime(($i+1),0,0,date('m'),date('d'),date('Y'));
            print ' - <i>'.((int)mysql_result(mysql_query('SELECT SUM(`hit`) as `hit` FROM `statistic` WHERE `for`=''.$id.'' and `time` BETWEEN ''.$ot.'' AND ''.$do.'';'),0)).'</i><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;
     }
?>