View file _modules/admin/stat/index.php

File size: 3.59Kb
<?php

	# author Drk in

	require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );

	# meta

	$title = 'Cтатистика';
	$tl    = 'Кэш';

	# admin

	system::access('admin');

	# head

	require_once ( head );
	
	$cn_view_day = DB :: $dbh -> querySingle("SELECT count(*) FROM `view` WHERE `time`>?;", array(time()-86400));
	$cn_view_today = DB :: $dbh -> querySingle("SELECT count(*) FROM `view` WHERE `time`>?;", array(time()-172800));
	$cn_view = DB :: $dbh -> querySingle("SELECT count(*) FROM `view`;");
	
	$cn_like_day = DB :: $dbh -> querySingle("SELECT count(*) FROM `like` WHERE `time`>?;", array(time()-86400));
	$cn_like_today = DB :: $dbh -> querySingle("SELECT count(*) FROM `like` WHERE `time`>?;", array(time()-172800));
	$cn_like = DB :: $dbh -> querySingle("SELECT count(*) FROM `like`;");
	
	$cn_dizlike_day = DB :: $dbh -> querySingle("SELECT count(*) FROM `dizlike` WHERE `time`>?;", array(time()-86400));
	$cn_dizlike_today = DB :: $dbh -> querySingle("SELECT count(*) FROM `dizlike` WHERE `time`>?;", array(time()-172800));
	$cn_dizlike = DB :: $dbh -> querySingle("SELECT count(*) FROM `dizlike`;");

	$cn_download_day = DB :: $dbh -> querySingle("SELECT count(*) FROM `download` WHERE `time`>?;", array(time()-86400));
	$cn_download_today = DB :: $dbh -> querySingle("SELECT count(*) FROM `download` WHERE `time`>?;", array(time()-172800));
	$cn_download = DB :: $dbh -> querySingle("SELECT count(*) FROM `download`;");

	echo '
	<div class="tl">Вес кэша <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.system::show_size(cache,$patch = true).' </span></div>
	<div class="tl">Файлов кэша<span class="btn-sm btn-warning" style="margin-left: 5px;"> '.system::file_cn().' </span></div>
	<div class="tl">Папок кэша<span class="btn-sm btn-warning" style="margin-left: 5px;"> 7 </span></div>	
	<div class="tl"><h1>Просмотры</h1></div>	
	<div class="tl">Всего <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_view.' </span></div>	
	<div class="tl">Сегодня <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_view_day.' </span></div>
	<div class="tl">Вчера <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_view_today.' </span></div>
	<div class="tl"><h1>Лайки</h1></div>	
	<div class="tl">Всего <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_like.' </span></div>	
	<div class="tl">Сегодня <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_like_day.' </span></div>
	<div class="tl">Вчера <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_like_today.' </span></div>
	<div class="tl"><h1>Дизлайки</h1></div>	
	<div class="tl">Всего <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_dizlike.' </span></div>	
	<div class="tl">Сегодня <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_dizlike_day.' </span></div>
	<div class="tl">Вчера <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_dizlike_today.' </span></div>
	<div class="tl"><h1>Скачано</h1></div>	
	<div class="tl">Всего <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_download.' </span></div>	
	<div class="tl">Сегодня <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_download_day.' </span></div>
	<div class="tl">Вчера <span class="btn-sm btn-warning" style="margin-left: 5px;"> '.$cn_download_today.' </span></div>
	<div class="tl"><a href ="/admin"> - Назад </a></div>';


	# foot

	require_once ( foot ) ;
?>