if (isset($_POST['action']) && $_POST['action'] == 'Close' && $admin) { $close = $ticket->close_ticket($_GET['tid']); if (!$close) { $error = htmlspecialchars($staff->get_error(), ENT_QUOTES); } } if (isset($_POST['action']) && $_POST['action'] == 'Open' && $admin) { $open = $ticket->close_ticket($_GET['tid'], TRUE); if (!$open) { $error = htmlspecialchars($staff->get_error(), ENT_QUOTES); } } if (isset($_POST['message'])) { $reply = new reply(); $reply->db_open(); if (!($addreply = $reply->add_reply($tid, $_SESSION['uid'], $_POST['message'], $admin))) { $newreplyerror = htmlspecialchars($reply->get_error(), ENT_QUOTES); } } $ticketdetails = $ticket->get_ticket($tid); if ($ticketdetails) { if ($ticketdetails['uid'] == $_SESSION['uid'] || $admin) { if ($userdetails = $user->get_userdata($ticketdetails['uid'])) { if ($ticketdetails) { $reply = new reply(); $reply->db_open(); if (!($getreplies = $reply->get_ticket_replies($tid))) { $replyerror = htmlspecialchars($reply->get_error(), ENT_QUOTES); } } else { $error = $user->get_error();