<?php 
include "../../connect/db.php";


if (isset($_POST['department'])) {
    $department = mysqli_real_escape_string($con, $_POST['department']);
    $ticket_id = mysqli_real_escape_string($con, $_POST['ticket_id']);
    $user = mysqli_real_escape_string($con, $_POST['user']);
    $message = mysqli_real_escape_string($con, $_POST['message']);


    // Insert the data into the database
    $sql = mysqli_query($con, "INSERT INTO support_tickets (user, department, message, status, ticket_id,name) VALUES ('$user', '$department', '$message', 'active', '$ticket_id','admin')");
    if ($sql) {
        echo "done";
    } else {
        echo mysqli_error($con);
    }
}
?>
