kotaku
10-04-03, 08:00 PM
<html>
<head>
<title>Testing PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$db=mysql_connect("scettech.sund.ac.uk","username","password");
mysql_select_db("cb1nar_db",$db);
mysql_query("SELECT * FROM $aboutapar",$db);
if ((($sadd || $sddd) == '31') && ($monthyear == 'Jun,2003' || 'Sep,2003' || 'Nov,2003' || 'Feb,2003' || 'Apr,2003')) {
echo ("Dates are not recognizable. Please click back to select again.");
}
else {
$ida = mysql_query("SELECT * FROM $aboutapar WHERE (day=$sadd) && (monthyear=$sammyy)",$db);
while ($arr = mysql_fetch_array($ida)) {
$arr = $dayfirst;
}
$idd = mysql_query("SELECT * FROM $aboutapar WHERE (day=$sddd) && (monthyear=$sdmmyy)",$db);
while ($dep = mysql_fetch_array($idd)) {
$dep[id] = $daylast;
}
for ($totalnight=$dayfirst; $totalnight<=$daylast; $totalnight++)
$totalnight;
echo("totalnight = $totalnight");
$price = mysql_query("SELECT * FROM $aboutapar",$db);
while ($pricepernight = mysql_fetch_array($price)) {
$pricepernight[deposit] = $pernight;
}
$totalamount = $pernight * $totalnight;
if ($totalnight <= 3) {
echo ("Sorry! Minimum of stay is 3 nights. Please click back & select new Arrival or Departure date.<br>");
}
elseif ($totalnight >= 3) {
while ($avai = mysql_fetch_array($ida)) {
if ($avai[id] == $dayfirst) && ($availibility == open)
$dayfirst++;
}
elseif {
echo ("Sorry! The chosen apartment has already been booked between the selected date.<br>") ;
echo ("We suggest you either:<br>");
echo ("a) Select a different Arrival or Departure date, or<br>");
echo ("b) Select a different Type of Apartment<br>");
echo ("Back to Check Availibility Form<br>");
}
elseif ($dayfirst = $totalnight) {
echo ("Availibility has been found!<br>");
echo ("Apartment details: 1 master bedroom, $rooms twin bedrooms. Maximum person of $max<br>");
echo ("For $sadd $samm $sayy until $sddd $sdmm $sdyy. Total of $totalnight nights<br>");
echo ("Amount of first night rental: $pernight<br>");
echo ("Total Amount: $totalamount<br>");
echo ("Pay online now! or by Telephone/Fax<br>");
/* $totalnight, $totalamount, $pernight must be inserted to Customer */
}
}
}
?>
</body>
</html>
--------------
fed up arrrr
[i]sorokkan usename dan password - B.H.
P/S: kotaku jangan putus asa. Kalu aku ader masa aku tengok²kan. Panjang giler kod nye :)
<head>
<title>Testing PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$db=mysql_connect("scettech.sund.ac.uk","username","password");
mysql_select_db("cb1nar_db",$db);
mysql_query("SELECT * FROM $aboutapar",$db);
if ((($sadd || $sddd) == '31') && ($monthyear == 'Jun,2003' || 'Sep,2003' || 'Nov,2003' || 'Feb,2003' || 'Apr,2003')) {
echo ("Dates are not recognizable. Please click back to select again.");
}
else {
$ida = mysql_query("SELECT * FROM $aboutapar WHERE (day=$sadd) && (monthyear=$sammyy)",$db);
while ($arr = mysql_fetch_array($ida)) {
$arr = $dayfirst;
}
$idd = mysql_query("SELECT * FROM $aboutapar WHERE (day=$sddd) && (monthyear=$sdmmyy)",$db);
while ($dep = mysql_fetch_array($idd)) {
$dep[id] = $daylast;
}
for ($totalnight=$dayfirst; $totalnight<=$daylast; $totalnight++)
$totalnight;
echo("totalnight = $totalnight");
$price = mysql_query("SELECT * FROM $aboutapar",$db);
while ($pricepernight = mysql_fetch_array($price)) {
$pricepernight[deposit] = $pernight;
}
$totalamount = $pernight * $totalnight;
if ($totalnight <= 3) {
echo ("Sorry! Minimum of stay is 3 nights. Please click back & select new Arrival or Departure date.<br>");
}
elseif ($totalnight >= 3) {
while ($avai = mysql_fetch_array($ida)) {
if ($avai[id] == $dayfirst) && ($availibility == open)
$dayfirst++;
}
elseif {
echo ("Sorry! The chosen apartment has already been booked between the selected date.<br>") ;
echo ("We suggest you either:<br>");
echo ("a) Select a different Arrival or Departure date, or<br>");
echo ("b) Select a different Type of Apartment<br>");
echo ("Back to Check Availibility Form<br>");
}
elseif ($dayfirst = $totalnight) {
echo ("Availibility has been found!<br>");
echo ("Apartment details: 1 master bedroom, $rooms twin bedrooms. Maximum person of $max<br>");
echo ("For $sadd $samm $sayy until $sddd $sdmm $sdyy. Total of $totalnight nights<br>");
echo ("Amount of first night rental: $pernight<br>");
echo ("Total Amount: $totalamount<br>");
echo ("Pay online now! or by Telephone/Fax<br>");
/* $totalnight, $totalamount, $pernight must be inserted to Customer */
}
}
}
?>
</body>
</html>
--------------
fed up arrrr
[i]sorokkan usename dan password - B.H.
P/S: kotaku jangan putus asa. Kalu aku ader masa aku tengok²kan. Panjang giler kod nye :)