<?php

	# mark core  v1.0
    # author Drk in
	# date 24.10.19 	

	# core

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

	# meta

	$title = 'Админка » Мобильные WAP сайты';
	$description = system::check($config['description']);
	$keywords = system::check($config['keywords']);
	$tl = 'Админка';
	
	# adm

	system::adm();

	# head

	require_once ( head );

	# coutn

	$cn_user = DB :: $dbh -> querySingle("SELECT count(id) FROM user");   
	$cn_cat = DB :: $dbh -> querySingle("SELECT count(id) FROM cat");   
	$cn_gold = DB :: $dbh -> querySingle("SELECT count(id) FROM platforms WHERE mode = ? AND ban = ? AND gold > ? ", array(0,0,time()));	
	$cn_pf = DB :: $dbh -> querySingle("SELECT count(id) FROM platforms");	
	$cn_pf_d = DB :: $dbh -> querySingle("SELECT count(id) FROM platforms WHERE time > ?;", array(time()-86400));
	$cn_tk = DB :: $dbh -> querySingle("SELECT count(id) FROM tk");
	$cn_tk_d = DB :: $dbh -> querySingle("SELECT count(id) FROM tk WHERE time > ?;", array(time()-86400));
	$cn_tkcat = DB :: $dbh -> querySingle("SELECT count(id) FROM tkcat");


	echo '
	<div class="touch">- <a href="'.site.'admin/config">Настройки</a></div>
	<div class="touch">- <a href="'.site.'admin/cat">Категории</a>  ['.$cn_cat.']</div>
	<div class="touch">- <a href="'.site.'admin/platforms">Сайты</a> ['.$cn_pf.''.($cn_pf_d != 0 ? ' <font color ="red">+ '.$cn_pf_d.'</font> сегодня':'').']</div>
	<div class="touch">- <a href="'.site.'admin/gold">GOLD cайты</a> ['.$cn_gold.']</div>
	<div class="touch">- <a href="'.site.'admin/users">Пользователи</a> ['.$cn_user.']</div>
	<div class="touch">- <a href="'.site.'admin/tkcat">Тикеты категории</a> ['.$cn_tkcat.']</div>
	<div class="touch">- <a href="'.site.'admin/tk">Тикеты</a> ['.$cn_tk.''.($cn_tk_d != 0 ? ' <font color ="red">+ '.$cn_tk_d.'</font> сегодня':'').']</div>
	<div class="touch">- <a href="'.site.'admin/stats">Статистика</a></div>

	<a href="'.site.'" class="touch">« На главную</a>
	';

	# foot

	require_once ( foot ) ;
?>