ticketactions.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: ticketactions.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.12 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Ticket actions handler (close/reopen).
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- // default do
- $_REQUEST['do'] = trim($_REQUEST['do']);
- if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
- $_REQUEST['do'] = "view";
- }
- // globalise variables
- $global = array (
- array('ticketref')
- );
- rg($global);
- ############################### GENERAL PERMISSIONS ###############################
- // check ticket ref
- if (!$ticketref) {
- error("error_noticket");
- }
- check_user();
- $ticket = $db->query_return("
- SELECT ticket.*
- FROM ticket
- WHERE ticket.ref = '" . addslashes($ticketref) . "' AND
- ticket.userid = $session[userid]
- ");
- if (!$db->num_rows()) {
- // no result returned
- error('error_noticket');
- }
- ############################### REOPEN A CLOSED TICKET ###############################
- if ($_REQUEST['do'] == "reopen") {
- if ($settings[user_reopen] != "1") {
- echo error("VIEW_error_reopen");
- }
- $db->query("UPDATE ticket SET is_open = '1' WHERE id = '$ticket[id]'");
- ticketlog($ticket['id'], 'reopen');
- jump("view.php?ticketref=$ticketref", "redirect_ticket_opened");
- }
- ############################### CLOSE A OPEN TICKET ###############################
- if ($_REQUEST['do'] == "close") {
-
- $db->query("
- UPDATE ticket
- SET is_open = '0',
- date_closed = '" . mktime() . "'
- WHERE id = '$ticket[id]'
- ");
-
- ticketlog($ticket['id'], 'close');
- jump("ticketlist.php?open=1", "redirect_ticket_closed");
- }