Hi, am new in the forum. Please I need help concerning a hotel booking system am developing. The problem is when custumer wants to make room choice it can only allow 1 type of room when the available room information loads. If a customer wants to book 2 or more rooms but diffetype of room (maybe 1 suite and 1 single) they cant do so. The system can only handle reservation for the same room type for the number of room wanted. The code snippet is shown below.
<label style="margin-left: 11px;"><strong>Enter Number of rooms Needed: </strong></label>
<INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="no_rooms" class="ed">
<span id="errmsg"></span>
<br />
<br />
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("reserve", $con);
$result = mysql_query("SELECT * FROM room");
while($row = mysql_fetch_array($result))
{
$a=$row['room_id'];
$query = mysql_query("SELECT sum(qty_reserve) FROM roomin where arrival <= '$arrival' and departure >= '$departure' and room_id='$a'");
while($rows = mysql_fetch_array($query))
{
$inogbuwin=$rows['sum(qty_reserve)'];
}
$angavil = $row['qty'] - $ino;
echo '<div style="height: 117px;">';
echo '<div style="float: left; width: 100px; margin-left: px;">';
echo "<img width=120 height=90 alt='Unable to View' src='" . $row["image"] . "'>";
echo '</div>';
echo '<div class="cleaner_h20"> </div>';
echo '<p><div style="float: left; width: 575px; margin-top: -10px;">';
echo '<span class="style5">'.'Avalable Rooms: '.$avil.'</span>';
if ($angavil > 0){
echo '<input name="roomid" type="checkbox" value="' .$row["room_id"]. '" />';
echo '<input type="submit" name="Submit" value="reserve" onclick="setDifference(this.form);"/>';
}
if ($avil <= 0){
echo '<span class="style5">'.'check vacant'.'</span>';
}
echo '<br>';
echo '<span class="style5">'.'Room Type: '.$row['type'].'</span><br>';
echo '<span class="style5">'.'Room Rate: '.$row['rate'].'</span><br>';
echo '<span class="style5">'.'Max Child: '.$row['max_child'].'</span><br>';
echo '<input name="mchild" type="hidden" value="' .$row["max_child"]. '" />';
echo '<input name="avail" type="hidden" value="' .$angavil. '" />';
echo '<span class="style5">'.'Max Adult: '.$row['max_adult'].'</span><br>';
echo '<input name="madult" type="hidden" value="' .$row["max_adult"]. '" />';
echo '<span class="style5">'.'Room Description: '.$row['description'].'</span><br>';
echo '<div class="cleaner_h20"> </div>';
echo '<div class="cleaner_h20"> </div>';
echo '</div>';
echo '</div>';
}
mysql_close($con);
?>
<input type="hidden" name="result" id="result" />
</form>
Bold Text Here