Hi,
I have the code below from an open source site which allows me to select a room, once selected it shows the available time to book the room. However, I wish to change the room drop down in to a checkbox instead so that the user can choose multiple time and book one shot instead of doing multiple booking through the earlier process. Can anyone help me with solving this issue please. Below are the source codes and DB details.
drop.php
<?php include_once "connection.php"; ?> Untitled 1
ROOM TYPE
Select Room
<?php
$query = "SELECT * FROM room";
//$result =mysqli_query($con,"SELECT * FROM roomtime WHERE room_timeavail = 1");
$result = mysqli_query($con, $query);
foreach ($result as $room) {
?>
<option value="<?php echo $room['roomid']; ?>"><?php echo $room['room_name']; ?></option>
<?php
}
?>
ROOM TIME
<?php
//$query = "SELECT * FROM roomtime WHERE room_timeavail = 1";
//$result =mysqli_query($con,"SELECT * FROM roomtime WHERE room_timeavail = 1");
//$result = mysqli_query($con, $query);
?>
getdata.php
<?php include_once "connection.php"; if(!empty($_POST['roomid'])) { $roomid = $_POST['roomid']; $query = "SELECT * FROM roomtime WHERE room_timeavail = 1"; $result = mysqli_query($con, $query); //roomid = $roomid, foreach ($result as $roomtime) { ?><option value="<?php echo $roomtime["roomtid"]; ?>"><?php echo $roomtime["room_time"]; ?></option>
<?php
}
}
?>
DB
first database is “room”
columns = roomid, room_name, room_timeavail
second database is “roomtime”
columns = roomtid, room_time, room_timeavail, roomid
Thank you in advance!