<?php include("../cn.php"); ?>
<?php include("../info.php");
$id = $_REQUEST["booking"];
$driver = $_REQUEST["driver"];
$status = "assigned";

$query = "UPDATE `rentedcars`
SET
    driver_id = '$driver',
    `status` = '$status'
WHERE
    id = '$id'";

mysqli_query($connect, $query);
if($driveravailability==1){
$query = "UPDATE `driver`
SET
    driver_availability = 'no'
WHERE
    driver_id = '$driver'";

mysqli_query($connect, $query);
}
else {
    
}


header("location:../booking-detail.php?id=$id");

?>