-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
53 lines (45 loc) · 1.34 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!Doctype HTML>
<html>
<head>
<title>Welcome to Smart Taxi Billing System</title>
</head>
<body>
<header>
<center><h1>Welcome to Smart Taxi Billing System</h1></cenrter><hr/>
</header>
<center style="min-height: 400px">
<?php
// Required Files
require_once( 'functions.php' );
$con = db_connection();
/* Recieve & truncating unneccessary data from input */
if( $_GET['pID'] ) $pID = trim(strip_tags($_GET['pID']));
if( $_GET['dID'] ) $dID = trim(strip_tags($_GET['dID']));
if( $_GET['distance'] ) $distance = trim(strip_tags($_GET['distance']));
if( $_GET['jamTime'] ) $jamTime = trim(strip_tags($_GET['jamTime']));
if( $_GET['request'] ) $request = trim(strip_tags($_GET['request']));
/* Do as asked from input */
if ($request == "checkBalance"){
$msg = checkBalance( ($pID)? $pID: ($dID? $dID: -1), $con);
}
elseif($request == "payment"){
$msg = payment($pID, $dID, getFair($distance, $jamTime), $con);
}
elseif($request == "getFair"){
// When off
$msg = getFair($distance, $jamTime);
}
else
{
$msg = "Bad Request";
}
echo $msg;
/* Display All User Information */
displayAllUserInfo($con);
?>
</center>
<footer>
<br/><hr/><center><p style="color:gray;">This project is done by Shuvasis Datta, Md. Shahab Uddin & Mir Rifat Siyam and supervised by Dr. Mohammad Rubaiyat Tanvir Hossain</p></center>
</footer>
</body>
</html>