View file ticket/index.php

File size: 3.24Kb
<?php
#######################################
### Тикет система для JohnCMS 3.2.2 ###
###       Автор скрипта: desay      ###
###         ICQ: 640-976-131        ###
#######################################
define('_IN_JOHNCMS', 1);
$textl = 'Тикеты';
require_once('../incfiles/core.php');

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



require_once('../incfiles/head.php');
$array = array (
    'open',
    'smotr',
    'close',
    'add',
    'adm_open',
    'adm_smotr',
    'adm_close',
    'del_komm',
    'read',
    'edit',
    'say');
if (in_array($act, $array) && file_exists($act . '.php')) {
    require_once($act . '.php');
} else {

## Тип - 1-тикет 2-ответы к тикету
## Статус 1-открытый, 2-решается, 3-закрытый
##
    /////////////////////////////////////////////////////
    // Главное меню                                    //
    /////////////////////////////////////////////////////
    echo '<div class="phdr"><b>Тикеты</b></div>';
    if ($rights < 7) {
    echo '<div class="gmenu"><img src="img/add.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=add">Добавить тикет</a></div>';
    
    echo '<div class="list1"><p><h3><img src="img/tick.png" width="16" height="16" class="left" />&nbsp;Мои тикеты</h3>';
    
    echo '<img src="img/tn.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=open">Открытые</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '1' AND `user`='$user_id' AND `type`='1'"), 0) . ')';
   

    echo '<br/><img src="img/tr.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=smotr">Решается</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '2' AND `user`='$user_id' AND `type`='1' "), 0) . ')';
    
     echo '<br/><img src="img/tz.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=close">Закрытые</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '3' AND `user`='$user_id' AND `type`='1'"), 0) . ')';

    echo '</p></div>';

}else{
//Для руководства
    
    echo '<div class="list1"><p><h3><img src="img/tick.png" width="16" height="16" class="left" />&nbsp;Тикеты</h3>';
    
    echo '<img src="img/tn.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=adm_open">Открытые</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '1' AND `type`='1'"), 0) . ')';
   

    echo '<br/><img src="img/tr.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=adm_smotr">Решается</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '2' AND `type`='1' "), 0) . ')';
        
        echo '<br/><img src="img/tz.gif" width="16" height="16" class="left" />&nbsp;<a href="index.php?act=adm_close">Закрытые</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `ticket` WHERE `status` = '3' AND `type`='1' "), 0) . ')';

}

}

require_once('../incfiles/end.php');

?>