sports-arena-website / delete_order.php
delete_order.php
Raw
<?php
    include("conn.php");//add connection to the php page

    if(isset($_POST['deletedata']))
    {
        $oid = $_POST['delete_id'];
        $pid = $_POST['payment_id'];

        $sql = "DELETE FROM online_ordering WHERE Order_ID = '$oid'";
        $result = mysqli_query($conn, $sql);

        if($result)
        {
            echo '<script> alert("Data Deleted!");</script>';
            header("location:manager_online_sales_management.php");
        }
        else
        {
            echo '<script> alert("Data Not Deleted!");</script>';
            header("location:manager_online_sales_management.php");
        }

        $sql1 = "DELETE FROM online_payment WHERE Payment_ID = '$pid'";
        $result1 = mysqli_query($conn, $sql1);
    }
?>