query($sql); if ($result->num_rows == 0) { redirect(SITE_URL . '/my-tickets.php'); } $ticket = $result->fetch_assoc(); // Handle form submission if ($_SERVER['REQUEST_METHOD'] === 'POST') { $user_reply = clean_input($_POST['user_reply']); if (empty($user_reply)) { $error = "Please enter your response"; } else { // Append user reply to the message $updated_message = $ticket['message'] . "\n\n--- User Response ---\n" . $user_reply; $updated_message = clean_input($updated_message); // Update ticket with user's response and change status to new $update_sql = "UPDATE contact_messages SET message = '$updated_message', ticket_status = 'new' WHERE id = $ticket_id"; if ($conn->query($update_sql)) { $success = "Your response has been submitted successfully! Our support team will review and respond to your follow-up question."; // Refresh ticket data $result = $conn->query($sql); $ticket = $result->fetch_assoc(); } else { $error = "Failed to submit response. Please try again."; } } } $page_title = 'Respond to Ticket'; include 'includes/header.php'; ?>
← Back to My Tickets

Respond to Ticket #

'background: #ffc107; color: #000;', 'in_progress' => 'background: #17a2b8; color: #fff;', 'resolved' => 'background: #28a745; color: #fff;', 'closed' => 'background: #6c757d; color: #fff;' ]; $status_text = ucfirst(str_replace('_', ' ', $ticket['ticket_status'])); ?>

📧 What happens next:

  • Our support team will review your follow-up question
  • We will respond within 24 hours
  • You'll receive an email notification when we reply
  • You can view the response in your "My Tickets" section
View My Tickets Go to Dashboard

Ticket Created:

Support Team Response:

Replied on:

Your Original Message:

'; echo '

Previous Follow-ups:

'; foreach ($parts as $index => $response) { $response = trim($response); if (!empty($response)) { echo '

Follow-up #' . ($index + 1) . ':

' . nl2br(htmlspecialchars($response)) . '

'; } } echo '
'; } } ?>

💬 Add Your Follow-up

Have additional questions or need clarification? Type your follow-up message below and our support team will respond.

We will review your follow-up and respond to your email within 24 hours.
📌 Note: After submitting your follow-up, our support team will review and respond within 24 hours. You will receive an email notification and can view the response in your "My Tickets" section.