garwil
06-07-2011, 02:41 PM
Hi,
I have a page on which data is displayed via clicking a record hyperlink on another page. The user can change the record details or add a new record. I want them to be able to delete a record as well and this is where I have come unstuck..
The form originally had 2 buttons, one SUBMIT which will either UPDATE or ADD a new record which both work fine. I have added a DELETE button so that a retrieved record can be deleted entirely but am battling to get it to actually delete the record. I get the message 'Query was Empty'. I have verified that the variable I am using in the delete query has the correct value taken from the url but just cannot get it to work.. is probably right under my nose but yet I cannot see it... can anyone with eagle eyes see what I have done wrong? Would appreciate any help...
If I substitute WHERE id = '$roomid'"; with WHERE id = 3"; with 3 being the actual ID of the record, then the delete statement works fine..
My code looks like this (have edited it down as too many characters for the post)..
<?php
include '../dbfunctions.php';
session_start();
$link = dbConnect();
checkVenueLogin();
if( isset($_POST['Submit']) ) {
$facs = "";
foreach( $_POST as $k => $v )
if( substr($k,0,4) == "fac_" ) $facs .= $v;
if( $_POST['roomid'] == "" ) //new room
$query = "INSERT INTO roomcategories (`venueid`, `roomname`, `class`, `nobeds`, `bedtype`, `sleeps`, `basis`, `facilities`,`mixed`, `description`) VALUES ('".$_SESSION['venueid']."', '".$_POST['roomname']."', '".$_POST['class']."', '".$_POST['nobeds']."', '".$_POST['bedtype']."', '".$_POST['sleeps']."', '".$_POST['basis']."', '".$facs."', '".$_POST['mixed']."', '".$_POST['description']."')";
else //update
$query = "UPDATE roomcategories SET `roomname` = '".$_POST['roomname']."', `class` = '".$_POST['class']."', `nobeds` = '".$_POST['nobeds']."', `bedtype` = '".$_POST['bedtype']."', `sleeps` = '".$_POST['sleeps']."', `basis` = '".$_POST['basis']."', `facilities` = '".$facs."', `mixed` = '".$_POST['mixed']."', `description` = '".$_POST['description']."' WHERE id = '".$roomid."'";
}
elseif(isset($_POST['delete']))
{
$sql = "DELETE FROM `roomcategories` WHERE id = '$roomid'";
$result = mysql_query($sql) or die( "Error: " . mysql_error() );
}
if( $_POST['roomname'] != "" ) $result = mysql_query($query, $link) or die("Query failed : ".$query."<br>". mysql_error());
// }
if( isset($_GET['id']) ) $roomid = $_GET['id']; else $roomid = "";
$rooms = dbGetRows("roomcategories", "id = '".$roomid."'");
$room = mysql_fetch_array($rooms, MYSQL_ASSOC);
$venues = dbGetRows("venues", "id = '".$_SESSION['venueid']."'");
$venue = mysql_fetch_array($venues, MYSQL_ASSOC);
$roomid = $_GET['id'];
echo $roomid;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modify Room</title>
<link href="../bb.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFF4DC" <?php if(isset($_POST['Submit']) && $result) echo "onLoad=\"window.close(); opener.location.reload(true);\""; ?>>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="32"><img src="images/admin_03.gif"></td>
<td width="0*" bgcolor="#FFFFFF" background="images/admin_04.gif" style="background-repeat: repeat-x;"> </td>
<td width="35"><img src="images/admin_07.gif" width="32" height="33"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" background="images/admin_15.gif" style="background-repeat: repeat-y;"></td>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-left: 10px; margin-right: 10px;">
<tr>
<td>
<font size="3"><b>
<?php if( $roomid != "") echo "MODIFY CATEGORY"; else echo "ADD NEW CATEGORY"; ?>
</b></font><br>
<font size=1>
Enter a category below to specify a type of room available at your venue.<br>
E.g. You could create a 'standard' room type which would be used to describe all three of your 'standard' room.</font><br>
<br>
<?php
if( isset($_POST['roomname']) && $_POST['roomname'] == "") echo "<font color=\"#FF0000\">Please enter a room name!</font><br><br>";
if(isset($_POST['Delete']) && $result) {
echo "<font size=\"3\"><b>UPDATE SUCCESSFUL</b></font><br><br>
Your details have been updated.<br><br>
<a href=\"javascript:;\" onClick=\"window.close(); opener.location.reload(true);\">[CLOSE WINDOW]</a></a><br>
</td>
<td bgcolor=\"#FFFFFF\" align=\"right\" background=\"images/admin_14.gif\" style=\"background-position: right; background-repeat: repeat-y;\"></td>
</tr>
<tr>
<td><img src=\"images/admin_21.gif\" width=\"32\" height=\"33\"></td>
<td bgcolor=\"#FFFFFF\" background=\"images/admin_23.gif\" style=\"background-position: bottom; background-repeat: repeat-x;\"></td>
<td><img src=\"images/admin_20.gif\" width=\"32\" height=\"33\"></td>
</tr>
</table>
</body></html>";
die();
}
?>
<form name="form1" method="post" action="modifyroom.php">
<table width="449" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="104"><b>Room Type Name</b></td>
<td width="235" valign="top"><input type="text" name="roomname" value="<?php echo $room['roomname']; ?>">
<a href="javascript:;" onClick="alert('Enter a descriptive name for this room type\n\nExamples could be `Luxury Room` or `Standard Room` or `Sea-Facing Room`');">[?]</a><input type="hidden" name="roomid" value="<?php echo $roomid; ?>"> </td>
</tr>
<tr>
<td valign="top"><b>Description</b></td>
<td valign="top"><textarea name="description"><?php echo $room['description']; ?></textarea>
<a href="javascript:;" onClick="alert('Enter full description for this type of room\n\nAn example could be `A luxury room with en-suite and majestic views over the valley.`');">[?]</a></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><b> Room Class</b></td>
<td> <select name="class">
<option value="stateroom" <?php if($room['class'] == "stateroom") echo "selected"; ?>>Stateroom</option>
<option value="suite" <?php if($room['class'] == "suite") echo "selected"; ?>>Suite</option>
<option value="superior" <?php if($room['class'] == "superior") echo "selected"; ?>>Superior</option>
<option value="first class" <?php if($room['class'] == "first class") echo "selected"; ?>>First
Class</option>
<option value="standard" <?php if($room['class'] == "standard") echo "selected"; ?>>Standard</option>
<option value="budget" <?php if($room['class'] == "budget") echo "selected"; ?>>Budget</option>
<option value="dormitory" <?php if($room['class'] == "dormitory") echo "selected"; ?>>Dormitory</option>
<option value="caravan" <?php if($room['class'] == "caravan") echo "selected"; ?>>Caravan</option>
<option vlue="Trailer" <?php if($room['class'] == "trailer") echo "selected"; ?>>Trailer</option>
<option vlue="Tent" <?php if($room['class'] == "tent") echo "selected"; ?>>Tent</option>
</select></td>
</tr>
<tr>
<td><b>No. of Beds</b></td>
<td><select name="nobeds">
<option value="1" <?php if( $room['nobeds'] == "1") echo "selected"; ?>>1</option>
<option value="2" <?php if( $room['nobeds'] == "2") echo "selected"; ?>>2</option>
<option value="3" <?php if( $room['nobeds'] == "3") echo "selected"; ?>>3</option>
<option value="4" <?php if( $room['nobeds'] == "4") echo "selected"; ?>>4</option>
<option value="5" <?php if( $room['nobeds'] == "5") echo "selected"; ?>>5</option>
<option value="6" <?php if( $room['nobeds'] == "6") echo "selected"; ?>>6</option>
<option value="7" <?php if( $room['nobeds'] == "7") echo "selected"; ?>>7</option>
<option value="8" <?php if( $room['nobeds'] == "8") echo "selected"; ?>>8</option>
<option value="9" <?php if( $room['nobeds'] == "9") echo "selected"; ?>>9</option>
<option value="10" <?php if( $room['nobeds'] == "10") echo "selected"; ?>>10</option>
<option value="11" <?php if( $room['nobeds'] == "11") echo "selected"; ?>>11</option>
<option value="12" <?php if( $room['nobeds'] == "12") echo "selected"; ?>>12</option>
<option value="13" <?php if( $room['nobeds'] == "13") echo "selected"; ?>>13</option>
<option value="14" <?php if( $room['nobeds'] == "14") echo "selected"; ?>>14</option>
<option value="15" <?php if( $room['nobeds'] == "15") echo "selected"; ?>>15</option>
<option value="16" <?php if( $room['nobeds'] == "16") echo "selected"; ?>>16</option>
<option value="17" <?php if( $room['nobeds'] == "17") echo "selected"; ?>>17</option>
<option value="18" <?php if( $room['nobeds'] == "18") echo "selected"; ?>>18</option>
<option value="19" <?php if( $room['nobeds'] == "19") echo "selected"; ?>>19</option>
<option value="20" <?php if( $room['nobeds'] == "20") echo "selected"; ?>>20</option>
<option value="21" <?php if( $room['nobeds'] == "21") echo "selected"; ?>>21</option>
<option value="22" <?php if( $room['nobeds'] == "22") echo "selected"; ?>>22</option>
<option value="23" <?php if( $room['nobeds'] == "23") echo "selected"; ?>>23</option>
<option value="24" <?php if( $room['nobeds'] == "24") echo "selected"; ?>>24</option>
<option value="25" <?php if( $room['nobeds'] == "25") echo "selected"; ?>>25</option>
<option value="26" <?php if( $room['nobeds'] == "26") echo "selected"; ?>>26</option>
<option value="27" <?php if( $room['nobeds'] == "27") echo "selected"; ?>>27</option>
<option value="28" <?php if( $room['nobeds'] == "28") echo "selected"; ?>>28</option>
<option value="29" <?php if( $room['nobeds'] == "29") echo "selected"; ?>>29</option>
<option value="30" <?php if( $room['nobeds'] == "30") echo "selected"; ?>>30</option>
</select></td>
</tr>
<tr>
<td><b>Type of Bed(s)</b></td>
<td> <select name="bedtype">
<option value="queen" <?php if($room['bedtype'] == "queen") echo "selected"; ?>>Queen</option>
<option value="king" <?php if($room['bedtype'] == "king") echo "selected"; ?>>King</option>
<option value="double" <?php if($room['bedtype'] == "double") echo "selected"; ?>>Double</option>
<option value="three-quarter" <?php if($room['bedtype'] == "three-quarter") echo "selected"; ?>>Three-Quarter</option>
<option value="single" <?php if($room['bedtype'] == "single") echo "selected"; ?>>Single</option>
<option value="bunk" <?php if($room['bedtype'] == "bunk") echo "selected"; ?>>Bunk</option>
<option value="berth" <?php if($room['bedtype'] == "berth") echo "selected"; ?>>Berth</option>
<option value="mixed" <?php if($room['bedtype'] == "mixed") echo "selected"; ?>>Mixed</option>
</select></td>
</tr>
<tr>
<td><b>Sleeps</b></td>
<td><select name="sleeps">
<option value="1" <?php if( $room['sleeps'] == "1") echo "selected"; ?>>1</option>
<option value="2" <?php if( $room['sleeps'] == "2") echo "selected"; ?>>2</option>
</select></td>
</tr>
<tr>
<td><strong>How Do you charge for this room?</strong></td>
<td><select name="basis">
<option value="per room" <?php if( $room['basis'] == "per room") echo "selected"; ?>>Per Room</option>
<option value="per person" <?php if( $room['basis'] == "per person") echo "selected"; ?>>Per Person</option>
</select> </td>
</tr>
<tr>
<td><strong>Mixed</strong></td>
<td><label>
<select name="mixed">
<option value="yes" <?php if( $room['mixed'] == "yes") echo "selected"; ?>>Yes</option>
<option value="no" <?php if( $room['mixed'] == "no") echo "selected"; ?>>No</option>
</select>
</label></td>
</tr>
<tr>
<td colspan="2"><strong>Please note</strong>: If you charge a base rate for the room <strong>PLUS</strong> a per person rate then select "<strong>Yes</strong>" above.</td>
</tr>
</table>
<br>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right"><input type="submit" name="Submit" value="Add / Update">
<input type="button" name="Cancel" value="Close Window" onClick="window.close();">
<label>
<input type="submit" name="delete" value="Delete Room">
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</table></td>
I have a page on which data is displayed via clicking a record hyperlink on another page. The user can change the record details or add a new record. I want them to be able to delete a record as well and this is where I have come unstuck..
The form originally had 2 buttons, one SUBMIT which will either UPDATE or ADD a new record which both work fine. I have added a DELETE button so that a retrieved record can be deleted entirely but am battling to get it to actually delete the record. I get the message 'Query was Empty'. I have verified that the variable I am using in the delete query has the correct value taken from the url but just cannot get it to work.. is probably right under my nose but yet I cannot see it... can anyone with eagle eyes see what I have done wrong? Would appreciate any help...
If I substitute WHERE id = '$roomid'"; with WHERE id = 3"; with 3 being the actual ID of the record, then the delete statement works fine..
My code looks like this (have edited it down as too many characters for the post)..
<?php
include '../dbfunctions.php';
session_start();
$link = dbConnect();
checkVenueLogin();
if( isset($_POST['Submit']) ) {
$facs = "";
foreach( $_POST as $k => $v )
if( substr($k,0,4) == "fac_" ) $facs .= $v;
if( $_POST['roomid'] == "" ) //new room
$query = "INSERT INTO roomcategories (`venueid`, `roomname`, `class`, `nobeds`, `bedtype`, `sleeps`, `basis`, `facilities`,`mixed`, `description`) VALUES ('".$_SESSION['venueid']."', '".$_POST['roomname']."', '".$_POST['class']."', '".$_POST['nobeds']."', '".$_POST['bedtype']."', '".$_POST['sleeps']."', '".$_POST['basis']."', '".$facs."', '".$_POST['mixed']."', '".$_POST['description']."')";
else //update
$query = "UPDATE roomcategories SET `roomname` = '".$_POST['roomname']."', `class` = '".$_POST['class']."', `nobeds` = '".$_POST['nobeds']."', `bedtype` = '".$_POST['bedtype']."', `sleeps` = '".$_POST['sleeps']."', `basis` = '".$_POST['basis']."', `facilities` = '".$facs."', `mixed` = '".$_POST['mixed']."', `description` = '".$_POST['description']."' WHERE id = '".$roomid."'";
}
elseif(isset($_POST['delete']))
{
$sql = "DELETE FROM `roomcategories` WHERE id = '$roomid'";
$result = mysql_query($sql) or die( "Error: " . mysql_error() );
}
if( $_POST['roomname'] != "" ) $result = mysql_query($query, $link) or die("Query failed : ".$query."<br>". mysql_error());
// }
if( isset($_GET['id']) ) $roomid = $_GET['id']; else $roomid = "";
$rooms = dbGetRows("roomcategories", "id = '".$roomid."'");
$room = mysql_fetch_array($rooms, MYSQL_ASSOC);
$venues = dbGetRows("venues", "id = '".$_SESSION['venueid']."'");
$venue = mysql_fetch_array($venues, MYSQL_ASSOC);
$roomid = $_GET['id'];
echo $roomid;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modify Room</title>
<link href="../bb.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFF4DC" <?php if(isset($_POST['Submit']) && $result) echo "onLoad=\"window.close(); opener.location.reload(true);\""; ?>>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="32"><img src="images/admin_03.gif"></td>
<td width="0*" bgcolor="#FFFFFF" background="images/admin_04.gif" style="background-repeat: repeat-x;"> </td>
<td width="35"><img src="images/admin_07.gif" width="32" height="33"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" background="images/admin_15.gif" style="background-repeat: repeat-y;"></td>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-left: 10px; margin-right: 10px;">
<tr>
<td>
<font size="3"><b>
<?php if( $roomid != "") echo "MODIFY CATEGORY"; else echo "ADD NEW CATEGORY"; ?>
</b></font><br>
<font size=1>
Enter a category below to specify a type of room available at your venue.<br>
E.g. You could create a 'standard' room type which would be used to describe all three of your 'standard' room.</font><br>
<br>
<?php
if( isset($_POST['roomname']) && $_POST['roomname'] == "") echo "<font color=\"#FF0000\">Please enter a room name!</font><br><br>";
if(isset($_POST['Delete']) && $result) {
echo "<font size=\"3\"><b>UPDATE SUCCESSFUL</b></font><br><br>
Your details have been updated.<br><br>
<a href=\"javascript:;\" onClick=\"window.close(); opener.location.reload(true);\">[CLOSE WINDOW]</a></a><br>
</td>
<td bgcolor=\"#FFFFFF\" align=\"right\" background=\"images/admin_14.gif\" style=\"background-position: right; background-repeat: repeat-y;\"></td>
</tr>
<tr>
<td><img src=\"images/admin_21.gif\" width=\"32\" height=\"33\"></td>
<td bgcolor=\"#FFFFFF\" background=\"images/admin_23.gif\" style=\"background-position: bottom; background-repeat: repeat-x;\"></td>
<td><img src=\"images/admin_20.gif\" width=\"32\" height=\"33\"></td>
</tr>
</table>
</body></html>";
die();
}
?>
<form name="form1" method="post" action="modifyroom.php">
<table width="449" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="104"><b>Room Type Name</b></td>
<td width="235" valign="top"><input type="text" name="roomname" value="<?php echo $room['roomname']; ?>">
<a href="javascript:;" onClick="alert('Enter a descriptive name for this room type\n\nExamples could be `Luxury Room` or `Standard Room` or `Sea-Facing Room`');">[?]</a><input type="hidden" name="roomid" value="<?php echo $roomid; ?>"> </td>
</tr>
<tr>
<td valign="top"><b>Description</b></td>
<td valign="top"><textarea name="description"><?php echo $room['description']; ?></textarea>
<a href="javascript:;" onClick="alert('Enter full description for this type of room\n\nAn example could be `A luxury room with en-suite and majestic views over the valley.`');">[?]</a></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><b> Room Class</b></td>
<td> <select name="class">
<option value="stateroom" <?php if($room['class'] == "stateroom") echo "selected"; ?>>Stateroom</option>
<option value="suite" <?php if($room['class'] == "suite") echo "selected"; ?>>Suite</option>
<option value="superior" <?php if($room['class'] == "superior") echo "selected"; ?>>Superior</option>
<option value="first class" <?php if($room['class'] == "first class") echo "selected"; ?>>First
Class</option>
<option value="standard" <?php if($room['class'] == "standard") echo "selected"; ?>>Standard</option>
<option value="budget" <?php if($room['class'] == "budget") echo "selected"; ?>>Budget</option>
<option value="dormitory" <?php if($room['class'] == "dormitory") echo "selected"; ?>>Dormitory</option>
<option value="caravan" <?php if($room['class'] == "caravan") echo "selected"; ?>>Caravan</option>
<option vlue="Trailer" <?php if($room['class'] == "trailer") echo "selected"; ?>>Trailer</option>
<option vlue="Tent" <?php if($room['class'] == "tent") echo "selected"; ?>>Tent</option>
</select></td>
</tr>
<tr>
<td><b>No. of Beds</b></td>
<td><select name="nobeds">
<option value="1" <?php if( $room['nobeds'] == "1") echo "selected"; ?>>1</option>
<option value="2" <?php if( $room['nobeds'] == "2") echo "selected"; ?>>2</option>
<option value="3" <?php if( $room['nobeds'] == "3") echo "selected"; ?>>3</option>
<option value="4" <?php if( $room['nobeds'] == "4") echo "selected"; ?>>4</option>
<option value="5" <?php if( $room['nobeds'] == "5") echo "selected"; ?>>5</option>
<option value="6" <?php if( $room['nobeds'] == "6") echo "selected"; ?>>6</option>
<option value="7" <?php if( $room['nobeds'] == "7") echo "selected"; ?>>7</option>
<option value="8" <?php if( $room['nobeds'] == "8") echo "selected"; ?>>8</option>
<option value="9" <?php if( $room['nobeds'] == "9") echo "selected"; ?>>9</option>
<option value="10" <?php if( $room['nobeds'] == "10") echo "selected"; ?>>10</option>
<option value="11" <?php if( $room['nobeds'] == "11") echo "selected"; ?>>11</option>
<option value="12" <?php if( $room['nobeds'] == "12") echo "selected"; ?>>12</option>
<option value="13" <?php if( $room['nobeds'] == "13") echo "selected"; ?>>13</option>
<option value="14" <?php if( $room['nobeds'] == "14") echo "selected"; ?>>14</option>
<option value="15" <?php if( $room['nobeds'] == "15") echo "selected"; ?>>15</option>
<option value="16" <?php if( $room['nobeds'] == "16") echo "selected"; ?>>16</option>
<option value="17" <?php if( $room['nobeds'] == "17") echo "selected"; ?>>17</option>
<option value="18" <?php if( $room['nobeds'] == "18") echo "selected"; ?>>18</option>
<option value="19" <?php if( $room['nobeds'] == "19") echo "selected"; ?>>19</option>
<option value="20" <?php if( $room['nobeds'] == "20") echo "selected"; ?>>20</option>
<option value="21" <?php if( $room['nobeds'] == "21") echo "selected"; ?>>21</option>
<option value="22" <?php if( $room['nobeds'] == "22") echo "selected"; ?>>22</option>
<option value="23" <?php if( $room['nobeds'] == "23") echo "selected"; ?>>23</option>
<option value="24" <?php if( $room['nobeds'] == "24") echo "selected"; ?>>24</option>
<option value="25" <?php if( $room['nobeds'] == "25") echo "selected"; ?>>25</option>
<option value="26" <?php if( $room['nobeds'] == "26") echo "selected"; ?>>26</option>
<option value="27" <?php if( $room['nobeds'] == "27") echo "selected"; ?>>27</option>
<option value="28" <?php if( $room['nobeds'] == "28") echo "selected"; ?>>28</option>
<option value="29" <?php if( $room['nobeds'] == "29") echo "selected"; ?>>29</option>
<option value="30" <?php if( $room['nobeds'] == "30") echo "selected"; ?>>30</option>
</select></td>
</tr>
<tr>
<td><b>Type of Bed(s)</b></td>
<td> <select name="bedtype">
<option value="queen" <?php if($room['bedtype'] == "queen") echo "selected"; ?>>Queen</option>
<option value="king" <?php if($room['bedtype'] == "king") echo "selected"; ?>>King</option>
<option value="double" <?php if($room['bedtype'] == "double") echo "selected"; ?>>Double</option>
<option value="three-quarter" <?php if($room['bedtype'] == "three-quarter") echo "selected"; ?>>Three-Quarter</option>
<option value="single" <?php if($room['bedtype'] == "single") echo "selected"; ?>>Single</option>
<option value="bunk" <?php if($room['bedtype'] == "bunk") echo "selected"; ?>>Bunk</option>
<option value="berth" <?php if($room['bedtype'] == "berth") echo "selected"; ?>>Berth</option>
<option value="mixed" <?php if($room['bedtype'] == "mixed") echo "selected"; ?>>Mixed</option>
</select></td>
</tr>
<tr>
<td><b>Sleeps</b></td>
<td><select name="sleeps">
<option value="1" <?php if( $room['sleeps'] == "1") echo "selected"; ?>>1</option>
<option value="2" <?php if( $room['sleeps'] == "2") echo "selected"; ?>>2</option>
</select></td>
</tr>
<tr>
<td><strong>How Do you charge for this room?</strong></td>
<td><select name="basis">
<option value="per room" <?php if( $room['basis'] == "per room") echo "selected"; ?>>Per Room</option>
<option value="per person" <?php if( $room['basis'] == "per person") echo "selected"; ?>>Per Person</option>
</select> </td>
</tr>
<tr>
<td><strong>Mixed</strong></td>
<td><label>
<select name="mixed">
<option value="yes" <?php if( $room['mixed'] == "yes") echo "selected"; ?>>Yes</option>
<option value="no" <?php if( $room['mixed'] == "no") echo "selected"; ?>>No</option>
</select>
</label></td>
</tr>
<tr>
<td colspan="2"><strong>Please note</strong>: If you charge a base rate for the room <strong>PLUS</strong> a per person rate then select "<strong>Yes</strong>" above.</td>
</tr>
</table>
<br>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right"><input type="submit" name="Submit" value="Add / Update">
<input type="button" name="Cancel" value="Close Window" onClick="window.close();">
<label>
<input type="submit" name="delete" value="Delete Room">
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</table></td>