예제 #1
0
require '../../include/easyscp-lib.php';
check_login(__FILE__);
$reseller_id = $_SESSION['user_created_by'];
if (!hasTicketSystem($reseller_id)) {
    user_goto('index.php');
}
$back_url = 'ticket_system.php';
$user_id = $_SESSION['user_id'];
if (isset($_GET['ticket_id']) && $_GET['ticket_id'] != '') {
    $ticket_id = $_GET['ticket_id'];
    $user_id = $_SESSION['user_id'];
    $query = "\n\t\tSELECT\n\t\t\t`ticket_status`\n\t\tFROM\n\t\t\t`tickets`\n\t\tWHERE\n\t\t\t`ticket_id` = ?\n\t\tAND\n\t\t\t(`ticket_from` = ? OR `ticket_to` = ?)\n\t;";
    $rs = exec_query($sql, $query, array($ticket_id, $user_id, $user_id));
    if ($rs->recordCount() == 0) {
        user_goto('ticket_system.php');
    }
    $back_url = getTicketStatus($ticket_id) == 0 ? 'ticket_closed.php' : 'ticket_system.php';
    deleteTicket($ticket_id);
    write_log(sprintf("%s: deletes support ticket %d", $_SESSION['user_logged'], $ticket_id));
    set_page_message(tr('Support ticket deleted successfully!'), 'info');
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'open') {
    deleteTickets('open', $user_id);
    write_log(sprintf("%s: deletes all open support tickets.", $_SESSION['user_logged']));
    set_page_message(tr('All open support tickets deleted successfully!'), 'info');
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'closed') {
    deleteTickets('closed', $user_id);
    write_log(sprintf("%s: deletes all closed support ticket.", $_SESSION['user_logged']));
    set_page_message(tr('All closed support tickets deleted successfully!'), 'info');
    $back_url = 'ticket_closed.php';
}
user_goto($back_url);
예제 #2
0
<?php

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
if (!defined("WHMCS")) {
    exit("This file cannot be accessed directly");
}
$result = select_query("tbltickets", "", array("id" => $ticketid));
$data = mysql_fetch_array($result);
$ticketid = $data['id'];
if (!$ticketid) {
    $apiresults = array("result" => "error", "message" => "Ticket ID not found");
    return null;
}
if (!function_exists("deleteTicket")) {
    require ROOTDIR . "/includes/ticketfunctions.php";
}
deleteTicket($ticketid);
$apiresults = array("result" => "success");
예제 #3
0
customerHasFeature('support') or showBadRequestErrorPage();
$userId = $_SESSION['user_id'];
$previousPage = 'ticket_system';
if (isset($_GET['ticket_id']) && !empty($_GET['ticket_id'])) {
    $ticketId = (int) $_GET['ticket_id'];
    $query = "\n\t\tSELECT\n\t\t\t`ticket_status`\n\t\tFROM\n\t\t\t`tickets`\n\t\tWHERE\n\t\t\t`ticket_id` = ?\n\t\tAND\n\t\t\t(`ticket_from` = ? OR `ticket_to` = ?)\n\t";
    $stmt = exec_query($query, array($ticketId, $userId, $userId));
    if ($stmt->rowCount() == 0) {
        set_page_message(tr("Ticket with Id '%d' was not found.", $ticketId), 'error');
        redirectTo($previousPage . '.php');
    }
    // The ticket status was 0 so we come from ticket_closed.php
    if ($stmt->fields['ticket_status'] == 0) {
        $previousPage = 'ticket_closed';
    }
    deleteTicket($ticketId);
    set_page_message(tr('Ticket successfully deleted.'), 'success');
    write_log(sprintf("%s: deleted ticket %d", $_SESSION['user_logged'], $ticketId), E_USER_NOTICE);
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'open') {
    deleteTickets('open', $userId);
    set_page_message(tr('All open tickets were successfully deleted.'), 'success');
    write_log(sprintf("%s: deleted all open tickets.", $_SESSION['user_logged']), E_USER_NOTICE);
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'closed') {
    deleteTickets('closed', $userId);
    set_page_message(tr('All closed tickets were successfully deleted.'), 'success');
    write_log(sprintf("%s: deleted all closed tickets.", $_SESSION['user_logged']), E_USER_NOTICE);
    $previousPage = 'ticket_closed';
} else {
    set_page_message(tr('Unknown action requested.'), 'error');
}
redirectTo($previousPage . '.php');
예제 #4
0
session_start();
require "checkLogin.php";
require "database/connect.php";
require "database/tickets.php";
require "database/users.php";
require "includes/common.php";
//retrieve message number
if (isset($HTTP_GET_VARS["msg"])) {
    $msg = $HTTP_GET_VARS["msg"];
} else {
    $msg = $_POST["msg"];
}
//delete message
if ($_POST["procedure"] == "DELETE") {
    deleteTicket($msg);
    if ($_SESSION["type"] == "3") {
        header('Location: tickets.php');
    } else {
        header('Location: main.php');
    }
}
//load message
if ($msg > "") {
    loadMessage($msg, &$message);
}
$pageTitle = "View Message";
if ($_SESSION["type"] == "3") {
    require 'includes/adminHeader.php';
} else {
    require 'includes/userHeader.php';
예제 #5
0
             }
             $keepfile = substr($keepfile, 0, 0 - 1);
             deleteFile($attachments_dir, $filetoremove);
             update_query("tbltickets", array("attachment" => $keepfile), array("id" => $idsd));
         } else {
             deleteFile($attachments_dir, $attachment);
             update_query("tbltickets", array("attachment" => ""), array("id" => $idsd));
         }
     }
     redir("action=viewticket&id=" . $id);
     exit;
 }
 if ($sub == "del") {
     check_token("WHMCS.admin.default");
     checkPermission("Delete Ticket");
     deleteTicket($id, $idsd);
     redir("action=viewticket&id=" . $id);
     exit;
 }
 if ($sub == "delnote") {
     check_token("WHMCS.admin.default");
     delete_query("tblticketnotes", array("id" => $idsd));
     addTicketLog($id, "Deleted Ticket Note ID " . $idsd);
     redir("action=viewticket&id=" . $id);
     exit;
 }
 if ($blocksender) {
     check_token("WHMCS.admin.default");
     $result = select_query("tbltickets", "userid,email", array("id" => $id));
     $data = get_query_vals("tbltickets", "userid,email", array("id" => $id));
     $userid = $data['userid'];
예제 #6
0
<?php

include_once '../function_header.php';
include '../common_server_functions.php';
//print_r($_REQUEST);
$response = array();
$ticket = $_REQUEST['ticketId'];
if ($ticket == '') {
    die(wrapError(ERROR_CODE_FIVE, 'INTERNAL ERROR'));
}
$inVendorInvoice = objectQuery($conexion, '*', 'supplierinvoiceticket JOIN supplierinvoice USING (supplierInvoiceId)', "ticketId = '{$ticketId}'");
if ($inVendorInvoice != null) {
    die(wrapError(ERROR_CODE_INVALID_VALUE, "This ticket is in vendor invoice [" . $inVendorInvoice['supplierInvoiceNumber'] . "]. Please delete the invoice first."));
}
$inBrokerInvoice = objectQuery($conexion, '*', 'reportticket', "ticketId = '{$ticketId}'");
if ($inBrokerInvoice != null) {
    die(wrapError(ERROR_CODE_INVALID_VALUE, "This ticket is in broker invoice [" . $inBrokerInvoice['reportId'] . "]. Please delete the invoice first."));
}
$inCustomerInvoice = objectQuery($conexion, '*', 'invoiceticket', "ticketId = '{$ticketId}'");
if ($inCustomerInvoice != null) {
    die(wrapError(ERROR_CODE_INVALID_VALUE, "This ticket is in customer invoice [" . $inVendorInvoice['invoiceId'] . "]. Please delete the invoice first."));
}
//die(wrapError(-2,'Feature not ready'));
$ticketId = deleteTicket($conexion, $ticket);
mysql_close($conexion);
echo wrapSubmitResponse(0, $ticketId);