View file ticket/adm_open.php

File size: 2.67Kb
<?php
#######################################
### Тикет система для JohnCMS 3.2.2 ###
###       Автор скрипта: desay      ###
###         ICQ: 640-976-131        ###
#######################################
defined('_IN_JOHNCMS') or die('Error: restricted access');

$headmod = 'ticket';
$textl = 'Открытые тикеты';

if ($rights < 7) {
    header('Location: index.php');
    exit;
}


        $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` where `status`='1' AND `type`='1';"), 0);
        
$req = mysql_query("SELECT * FROM `ticket` where `status`='1' and `type`='1' order by `prior` DESC LIMIT $start, $kmess;");

if ($total != '0') {
    echo '<div class="phdr"><a href="index.php"><b>Тикеты</b></a> | Открытые</div>';

    while ($arr = mysql_fetch_array($req)) {
        echo ($i % 2) ? '<div class="list1">' : '<div class="list2">';
       
  $requ = mysql_query("SELECT `name` FROM `users` where `id`='$arr[user]' LIMIT 1");
  $arru = mysql_fetch_array($requ);        
        
        echo 'Добавил: <a href="../str/anketa.php?user='.$arr[user].'">'.$arru[name].'</a><br/>';
        
        echo 'Время: ' . date("d.m.Y / H:i", $arr['time'] + $set_user['sdvig'] * 3600) . '<br/>';
        $prior = array (
        1 => 'Низкий',
        2 => 'Средний',
        3 => 'Высокий');
        echo 'Приоритет: '.$prior[$arr[prior]].'<br />';
                        $text = $arr['text'];
                        if(mb_strlen($text) > 100){
                        $text = mb_substr($text, 0, 95);
                        $text = checkout($text, 1, 0);
                        $text = notags($text);
                        $text = preg_replace('#\[c\](.*?)\[/c\]#si', '<div class="quote">\1</div>', $text);
                       }else {$text = checkout($text, 1, 0);
                        $text = notags($text);}
                
        echo '<a href="index.php?act=read&amp;id=' . $arr['id'] . '">' .$text.'  &gt;&gt;</a><br/>';
        
        echo '</div>';
        ++$i;
    }
	        if ($total > $kmess) {
            echo '<p>' . pagenav('index.php?act=adm_open&amp;', $start, $total, $kmess) .
                '</p>';
            echo '<p><form action="index.php?act=adm_open&amp;" method="post"><input type="text" name="page" size="2"/><input type="submit" value="К странице &gt;&gt;"/></form></p>';
        }


   

}else {echo '<div class="rmenu">Не найдено открытых тикетов!</div>';}

echo '<div class="phdr">Всего: ' . $total . '</div>';
echo '<p><a href="index.php">Назад</a></p>';

?>