Im strunggling to validate each box that my senior made and I dont know how
to figure it out.
TQ in advance! u guys rock!
<?php require_once('../Connections/mConn.php'); ?>
<?php
mysql_select_db($database_mConn, $mConn);
$query_rs1 = "SELECT * FROM admingeneral WHERE admingeneral.Id='1'";
$rs1 = mysql_query($query_rs1, $mConn) or die(mysql_error());
$row_rs1 = mysql_fetch_assoc($rs1);
$totalRows_rs1 = mysql_num_rows($rs1);
mysql_select_db($database_mConn, $mConn);
$query_rs = "SELECT * FROM facilities WHERE fac_id='".$HTTP_GET_VARS['fac_id']."'";
$rs = mysql_query($query_rs, $mConn) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
if (isset($_POST['submit'])) {
$fac_timeS = $HTTP_POST_VARS['timeFrom'].":".$HTTP_POST_VARS['timeFrom1'];
$fac_timeE = $HTTP_POST_VARS['timeTo'].":".$HTTP_POST_VARS['timeTo1'];
$fac_id = $HTTP_GET_VARS['fac_id'];
$fac_date = $HTTP_GET_VARS['facBooked_date'];
$facBooked_name = $HTTP_GET_VARS['fac_name'];
$updateGoTo = "user_facilitiesConfirm.php?facBooked_fac_id=$fac_id&facBooked_name=$facBooked_name&timeS=$fac_timeS&timeE=$fac_timeE&facBooked_date=$fac_date";
header("Location: $updateGoTo");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo $row_rs1['title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../pnec.css" rel="stylesheet" type="text/css">
<script type="text/javascript"> // this section im very confuse
function chkTime()
{
time = document.getElementById("time");
ars = time.value.search(/^(24):(00)|([01][0-9]|2[0-3]):([0-5][0-9])$/);
if (ars!=0)
{
window.alert("Invalid entry. Please press Reset button to clear and try again");
return false;
}
}
</script>
</head>
Welcome, <?php echo "".$_SESSION['username'];?>!</td>
<td> <img src="../frontpage-user/ec-layout-user-e5_23.gif" width="17" height="22" alt=""></td>
</tr>
<!-- ****************************************8Dropdown menu*******************************************8 -->
<tr>
<td colspan="9"></td>
</tr>
<tr>
<td></td>
<td colspan="7">
<table border="0" cellpadding="2" cellspacing="0" bgcolor="#FBE7C5">
<tr>
<td><div class="page_title_user"><font color="#9ACEDF">..</font> <font color="#6FB7D6">::</font> my Facilities Booking <font color="#6FB7D6">::</font><font color="#9ACEDF">..</font> </div></td>
</tr>
<tr bgcolor="#D6EDF0">
<td><div style="font-size:14px;" align="center"> Be mesmerized with the convenience of online facilities booking of community hall, badminton court, tennis court and other facilities provided for in the community. </div></td>
</tr>
<tr>
<td>
<?php
if(!isset($_POST['submit']))
{
?>
<form action="" method="post" onSubmit="return (chkTime();">
<table width="98%" height="301" border="0" cellpadding="10" cellspacing="0" bordercolor="#FFFFFF">
<!--Step 3 : Select Time-->
<tr>
<td style="border-width:1px; border-color:#A8B2C6; border-style:solid;" class="body" colspan="2">
<div style="font-size:18px; color:#007E8C; font-weight:bold;"> <font color="#cccccc">3. </font>Select Time</div>
<br>
</td>
</tr>
<tr>
<td width="15%" class="body-facilities">From:</td>
<td class="body-facilities">
<input type="text" name="timeFrom" size="1" maxlength="2">
:
<input type="text" name="timeFrom1" size="1" maxlength="2">
<sup style="color:#FF0000">eg: 08:00</sup> </td>
</tr>
<tr>
<td class="body-facilities">To:</td>
<td class="body-facilities">
<input type="text" name="timeTo" size="1" maxlength="2">
:
<input type="text" name="timeTo1" size="1" maxlength="2">
<sup style="color:#FF0000">eg: 23:00</sup></td>
</tr>
<tr>
<td class="body-facilities"><sub>Operating Hour:</sub></td>
<td class="body-facilities"><sub><?php echo $row_rs['fac_wkdayS'];?> to <?php echo $row_rs['fac_wkdayE'];?> (Monday to Friday)</sub><br>
<sub><?php echo $row_rs['fac_wkendS'];?> to <?php echo $row_rs['fac_wkendE'];?> (Saturday & Sunday)</sub></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="submit" value="Next" onClick="chkTime();">
<input type="reset" name="reset" value="Reset">
<input type="hidden" name="fac_id" value="<?php echo $fac_id;?>">
</td>
</tr>
</table>
</form>
<?php
}
?>
</td>
</tr>
</table>