// Get info from database in the users table.[Operation 1] $query = "SELECT * FROM users WHERE id ='".$_POST["user"]."' AND
pass_dob='".$_POST["pass"]."'";
include("connect.php");
$result = mysql_query($query) or die("Unable to verify the user because :"
.mysql_error());
$row = mysql_fetch_array($result);
if ($row) {
session_start();
$_SESSION["id"] = $row['id'];
// Check user type[Operation 2] $user = $row['type'];
if($user == "admin") {
51
header("Location: admin.php");
exit;
}else if($user == "coord") {
header("Location: coordinator.php");
exit;
}
else if($user == "stud") {
header("Location: booking.php");
exit;
}
}
mysql_free_result($result);
mysql_close($conn); }
?>
7.4 Booking codes documentation /**
***************************************************************************
*payment.php
***************************************************************************
*Author: IRABA Maire Louise
*Email: 2960564@uwc.ac.za
***************************************************************************
this page(payment.php) comes when the user login as Admin. It has the button
Submit which
helps the Admin to update the payment table and a Search Button which helps him
to find out
the student details. This page also has a link "Balance Statement" which shows the
payment statement.
***************************************************************************
this page containts:
connect.php : it helps to connect to the database
Mail.php: it helps to send an email.
***************************************************************************
In this page every query has its comment. The code also includes some other
important comments.
**/?>