Hi I am building this website for a small hotel. The user interface is ready and I have a form as shown below: If I click on submit I can insert the data from the form into the database.My question is where do I go from here? Is my database design right? Besides inserting the form data I should select all unoccupied rooms, how do I do that? Here is what I have so far.
TABLES
bookings:
id int11 auto increment primary key
arrival date
departure date
adults int3
children int3
customers:
id int11 auto increment primary key
first_name varchar30
last_name varchar 30
address varchar100\phone int11
city varchar30
country varchar30
rooms:
roomID int11 auto increment primary key
location varchar20
room_number int11
room_typeID int11
room_types:
room_typeID int11 auto increment primary key
room_type vatchar20
num_beds int11
price_night int20
<form name="form1" method="post" action="process.php"> <table border="1" cellspacing="5" cellpadding="4"> <tr><td colspan="2" class="txt"><h2>Book Now</h2></td></tr> <tr><td colspan="2"> </td></tr> <tr><td class="txt">Arrival:</td><td><input type="text" name="arrival" size="15"></td></tr> <tr><td class="txt">Departure:</td><td><input type="text" name="departure" size="15"></td></tr> <tr><td class="txt">Adults:</td><td> <select id="adults" name="adults"> <option <?php if ($adults == 1 ) echo 'selected'; ?> value="1">1</option> <option <?php if ($adults == 2 ) echo 'selected'; ?> value="2">2</option> <option <?php if ($adults == 3 ) echo 'selected'; ?> value="3">3</option> <option <?php if ($adults == 4 ) echo 'selected'; ?> value="4">4</option> </select></td></tr> <tr> <td class="txt">Children:</td><td> <select id="children" name="children"> <option <?php if ($children == 0 ) echo 'selected'; ?> value="0">0</option> <option <?php if ($children == 1 ) echo 'selected'; ?> value="1">1</option> <option <?php if ($children == 2 ) echo 'selected'; ?> value="2">2</option> <option <?php if ($children == 3 ) echo 'selected'; ?> value="3">3</option> <option <?php if ($children == 4 ) echo 'selected'; ?> value="4">4</option> </select></td></tr> <tr><td colspan="2"> </td></tr> <tr><td> </td><td><input type="submit" name="submit" value="Submit"></td></tr> </table>