54
} else {
echo("
Message successfully sent!
");
}
}
}
// Delete the booking
else if(isset($_POST['delete'])) {
// Get the room to be updated
$q=
"SELECT
room_id
from
booking
where
user_id
=
'".$_SESSION["id"]."'";
$q
=
"DELETE
FROM
booking
WHERE
booking.user_id
=
'".$_SESSION["id"]."'";
$res = mysql_query($q) or die();
// Update the status in room table
$update = "UPDATE room SET status = 'available' WHERE id = '".$room."'";
mysql_query($update) or die();
}
?>
// View balance
|
Stud No: echo $_SESSION['id']; ?>
|
// Get the ref num for this student
$q = "SELECT ref_id FROM booking WHERE user_id = '".$_SESSION['id']."'";
55
$result = mysql_query($q);
$ref_num = mysql_fetch_array($result);
$q = "SELECT * FROM payment WHERE ref_id = '".$ref_num['ref_id']."'";
$result = mysql_query($q);
if(mysql_num_rows($result) < 1) {
echo
"
class
=\"perror\">Found
no
payments
on
the
database.
";