} 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(); } } else { $error = $user->get_error; } } else { header('Location: http://' . $_SERVER['SERVER_NAME'] . '/newticket/index.php?error=1'); } } else { $error = htmlspecialchars($ticket->get_error(), ENT_QUOTES); } ?>