Файл: app/admin/support/index.php
Строк: 19
<?php
Core::only('level', 4);
$api = new Api;
$support = $api->query('support', []);
$smarty->header('Техническая поддержка');
if (isset($support['code']))
{
Core::show('error', 'Отказано в доступе');
$smarty->footer();
}
$listing[] = [
'title' => Lang::word('Создать тикет'),
'url' => '/admin/support/add',
'icon' => 'plus',
'div' => 'block'
];
$pages = new Pages($support['count_all'], $config['pages']);
if ($support['count_all'] == 0)
{
$posts[] = [
'title' => Lang::word('Нет сообщений.')
];
}
else
{
foreach($support['list'] AS $value)
{
$data[] = $value;
}
for($i = $start; $i < $support['count_all'] && $i < $config['pages'] * $page; $i++)
{
$posts[] = [
'title' => $data[$i]['title'],
'url' => '/admin/support/article?id=' . $data[$i]['id'],
'post' => Filter::output($data[$i]['text']),
'time' => Core::time($data[$i]['time']),
];
}
}
$smarty->assign([
'post' => $posts,
'listing' => $listing
]);
$smarty->display('listing.tpl');
$smarty->display('posts.tpl');
$pages->view('?');
$smarty->footer();