<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle('Служба поддержки - Мои обращения');

///Подключаем шапку
$title->GetHeader();
echo '<div class="container-fluid page_header"><div class="container"><div class="row"><div class="col-xs-12 col-sm-8 col-md-9 col-lg-9"><h1>Служба поддержки </h1><ol class="breadcrumb" xmlns:v="http://'.homeurl.'/#"><li typeof="v:Breadcrumb"><a href="/" rel="v:url" property="v:title">'.homeurl.'</a></li><li typeof="v:Breadcrumb"><a href="/support" rel="v:url" property="v:title">Служба поддержки</a></li><li class="active" typeof="v:Breadcrumb"><span property="v:title">Мои обращения</span></li></ol></div><div class="col-xs-12 col-sm-4 col-md-3 col-lg-3 text-right page_header_sidebar"></div></div></div></div>';
echo'<div class="container page_body"><div class="row"><div class="col-xs-12 page_content col-lg-9"><div class="navbar page_content_navbar collapse hidden-lg"><div class="container-fluid"><div class="navbar-collapse"></div></div></div><div class="text_box hidden-lg pr_block_small hidden"></div><div class="container-fluid cols_table">';

echo '<div class="catSides"> <a href="/support">Служба поддержки</a> - Мои обращения</div>';
$look = DB::$dbs->querySingle("SELECT COUNT(id) FROM `support` WHERE `user_id` = ?", [$b['id']]);
if ($look == 0) {
echo'<div class="error"> Вы еще не обращались в службу поддержки!</div>';
}
$num = 10;
$k_page = k_page($look, $num);
$page = page($k_page);
$start = $num*$page-$num;
$sql = DB::$dbs->query("SELECT * FROM `support` WHERE `user_id` = ? ORDER BY `time` DESC LIMIT $start,$num", [$b['id']]);
while($a = $sql->fetch()) {
$last = DB::$dbs->queryFetch("SELECT * FROM `support_mess` WHERE `tid` = ? ORDER BY `time` DESC LIMIT 1", [$a['id']]);
echo '<ul class="nav nav-pills nav-stacked"><li><a href="view.html?id='.$a['id'].'"><i class="md-forum"></i>  '.$a['name'].' ('.vr($a['time']).')</a></ul>';
}
if ($k_page > 1) {
str('?',$k_page,$page);
}

///Подключаем меню
$title->GetMenu();


///Подключаем футер
$title->GetFooter();
?>