Размер файла: 701B
<?php
require_once('../wu_init.php');
if (!wu_token()) { exit('wu-error'); }
if (!USER_LOGGED) { exit('wu-error'); }
include('wu_checkadmin.php');
if(isset($_POST['id'])){
if(!empty($_POST['id'])){
$id = intval($_POST['id']);
$ticket = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,new_a FROM `".DB_PREFIX."_tickets_main` WHERE id='$id' LIMIT 1"));
if (empty($ticket['id'])) { exit('wu-error'); }
if ($ticket['new_a'] == 1) { exit('0'); }
mysqli_query($connect_db, "DELETE FROM `".DB_PREFIX."_tickets_main` WHERE id = '$id'");
mysqli_query($connect_db, "DELETE FROM `".DB_PREFIX."_tickets_msg` WHERE tid = '$id'");
exit('1');
} else { exit('wu-error'); }
} else { exit('wu-error'); }
?>