forked from deve-sh/Permit-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewstatus.php
141 lines (132 loc) · 3.59 KB
/
viewstatus.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
session_start();
// PHP File to find out the status of a permit. Approved or Declined and Visited or Not.
require_once('./inc/checker.php');
require_once('./inc/config.php');
?>
<!DOCTYPE html>
<html>
<head>
<title>
<?php
echo isset($config['appname'])?$config['appname']:"Permit System";
?>
</title>
<?php
include './inc/styles.html';
?>
</head>
<body>
<div id="root" class="container-fluid viewstatuspage">
<div class="main">
<?php include './header.php'; ?>
<div class="viewcontainer">
<div class="view">
<h2>View Application Status</h2>
<br/>
<form action="" method="POST" align='left'>
Date :
<br/>
<input type="date" class="form-control" name="date" required/>
<br/>
Vehicle Number :
<br/>
<input type="text" name="vehicleno" class="form-control" required/>
<br/>
<button type="submit" class="proceed btn btn-success">View Status</button>
</form>
</div>
</div>
<div class="statusviewer">
<?php
if(!$_POST['date'] || !$_POST['vehicleno']){
echo "<br><div align='center'>View Status Here.<br></div>";
}
else{
// If the user entered all the details.
$date = $db->escape($_POST['date']);
$vehicleno = $db->escape($_POST['vehicleno']);
$query = "SELECT * FROM ".$config['tableprefix']."permits WHERE pdate = '".$date."' AND vehicle_no = '".$vehicleno."'";
$queried = $db->query($query);
if($db->numrows($queried) <= 0){
echo "<br><div align='center'>Application Not Found.</div><br>";
}
else{
$details = $db->fetch($queried);
// Printing a table of details.
?>
<div align="center" class="printheading">
<h2>Application Details</h2>
</div>
<br/>
<div class="tablecontainer" align="center">
<table id='applicationtable'>
<tr>
<th class="headingfields">Fields</th>
<th class="headingfields">Details</th>
</tr>
<tr>
<th>Permit Number</th>
<td><?php echo $details['permitid']; ?></td>
</tr>
<tr>
<th>Date</th>
<td>
<?php echo $details['pdate']; ?>
</td>
</tr>
<tr>
<th>Vehicle No</th>
<td><?php echo $details['vehicle_no'];?></td>
</tr>
<tr>
<th>Name</th>
<td><?php echo $details['applicant_name']; ?></td>
</tr>
<tr>
<th>Email</th>
<td><?php echo $details['applicant_email']; ?></td>
</tr>
<tr>
<th>Phone</th>
<td>
<?php echo $details['applicant_phone']; ?>
</td>
</tr>
<tr>
<th>Approved</th>
<td><?php echo ($details['approved'] == 0)?"Not Approved":"Approved"; ?></td>
</tr>
<tr>
<th>Visited</th>
<td><?php echo ($details['visited'] == 0)?"Not Visited":"Visited"; ?></td>
</tr>
<tr>
<th>Application Time</th>
<td><?php
echo $details['appl_time']
?></td>
</tr>
</table>
</div>
<br/>
<p align='center'>Kindly Carry your Identity Proofs and Vehicle Papers if your Application is Approved.</p>
<div align="center">
<button onclick="window.print()" class="printbutton btn btn-info">Print</button>
<br/>
<br/>
<a href="./">
<button class="btn btn-primary">
Home
</button>
</a>
</div>
<?php
}
}
?>
</div>
</div>
</div>
</body>
</html>