<?php
if (isset($_GET["trackid"])) {
    $trackid = $_GET["trackid"];

   include_once('connection.php');

    // Create connection
    
    // Check connection
    if ($con->connect_error) {
        die("Connection failed: " . $con->connect_error);
    }

    // Use prepared statement to prevent SQL injection
    $sql = "DELETE FROM consignment_details WHERE trackid=?";
    $stmt = $con->prepare($sql);
    
    // Bind parameters
    $stmt->bind_param("s", $trackid);

    // Execute the statement
    $stmt->execute();

    // Close the statement and connection
    $stmt->close();
    $con->close();
}

header("location: /logistics/Admins.php");
exit;
?>