<?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 );

	$cn = DB :: $dbh -> querySingle("SELECT count(id) FROM tkcat");   

	if($cn == 0)echo '<div class="err">Cписок пуст!</div>';

	$query = DB :: $dbh -> query("SELECT id FROM tkcat ORDER BY id");

	while ($act = $query -> fetch()):

	$act = cache_tkcat::check($act['id']);	

	$cn_tk = DB :: $dbh -> querySingle("SELECT count(id) FROM tk WHERE cat = ?", array($act['id']));	

	echo '
	<div class="touch">
	<img src="'.ico.'icon.png" alt="*"><font color="#0097f6">'.system::check($act['name']).' ('.$cn_tk.') </font><br>
	<a href ="'.site.'admin/tkcat/edit/id'.$act['id'].'">Ред </a> |
	<a href ="'.site.'admin/tkcat/del/id'.$act['id'].'">Удалить </a>
	</div>
	';	

	endwhile;	

	echo '
	<a href="'.site.'admin/tkcat/add" class="touch">- Добавить</a>
	<a href="'.site.'admin" class="touch">« Назад</a>
	';

	# foot

	require_once ( foot ) ;
?>