<?php
$t = 'Личный кабинет пользователя';
require_once '../../wcore/core.php';
require_once '../../wcore/head.php';
iank();
$order_cats = array(
        'vhost' =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers` WHERE `type` = '1'")),
        'ress'  =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers` WHERE `type` = '2'")),
        'vds'   =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers` WHERE `type` = '3'")),
        'dedic' =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers` WHERE `type` = '4'")),
        'domain'=>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers` WHERE `type` = '5'")),
);
$orders_my = array(
        'vhost' =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '1' AND `orders`.`uid` = '$ank->id'")),
        'ress'  =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '2' AND `orders`.`uid` = '$ank->id'")),
        'vds'   =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '3' AND `orders`.`uid` = '$ank->id'")),
        'dedic' =>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '4' AND `orders`.`uid` = '$ank->id'")),
        'domain'=>  mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '5' AND `orders`.`uid` = '$ank->id'")),
);
$count_a_t = $ank->prv >1?mysqli_num_rows(mysqli_query($mysqli,"SELECT * FROM `tickets_list` WHERE `status` = 1 ")):0;
echo $twig->render('pages_cabinet.tpl', array('lang' =>$lang,'user'=>$ank,'orders'=>$order_cats,'my_orders'=>$orders_my,'count_tickets'=>$count_tickets,'count_a_t'=>$count_a_t));
require_once '../../wcore/foot.php';
?>