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

    if(isset($_POST['updatedata']))
    {
        $bid = $_POST['bid'];
        $cid = $_POST['cid'];
        $starttime = $_POST['starttime'];
        $endtime = $_POST['endtime'];
        $duration = $_POST['duration'];
        $status = $_POST['status'];

        $sql = "UPDATE badminton_court_booking SET Court_ID = '$cid', Start_Time = '$starttime', End_Time = '$endtime', Duration = '$duration', Payment_Status = '$status' WHERE Booking_ID = '$bid'";
        $result = mysqli_query($conn, $sql);

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