-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresult.php
More file actions
240 lines (206 loc) · 7.59 KB
/
result.php
File metadata and controls
240 lines (206 loc) · 7.59 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php include"header.php";?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>RDL _ Rwanda driving license</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/all.min.js"></script>
<script type="text/javascript" src="js/all.js"></script>
<script type="text/javascript" src="js/fontawesome.js"></script>
<script type="text/javascript" src="js/fontawesome.js"></script>
<script type="text/javascript" src="vendor/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="vendor/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/fontawesome.css">
<link rel="stylesheet" type="text/css" href="js/all.css">
<link rel="stylesheet" type="text/css" href="js/all.mini.css">
<link rel="stylesheet" type="text/css" href="js/fontawesome.min.css">
<style type="text/css">
table th{
color: rgba(245, 6, 170,0.90)
}
table tr{
border-bottom:1px solid rgba(245, 6, 170,0.90)
}
table{
overflow-x: hidden;
}
@media print{
body{
visibility: hidden;
}
h1{
visibility: visible;
}
.table {
visibility:visible;
}
#span{
visibility: visible;
}
}
</style>
</head>
<body>
<div class="container-fluid">
<a href="index.php" class="font-weight-bold sticky-top">Back home</a>
<div class="row mt-5 justify-content-center">
<div class="col-lg-12" style="color:rgba(245, 6, 170, 1);">
<h1 class="">Rwanda Driving License</h1>
<div class="d-flex flex-row">
<div class="flex-fill">
<p class="text-dark">Search your results</p>
</div>
<div>
<button onclick="window.print()" style="background-color:rgba(245, 6, 170, 1);" class="float-right bt-sm btn text-white ">Print</button>
</div>
</div>
<hr>
</div>
<div class="col-lg-9">
<form class="row" method="POST">
<div class="col-lg-5 mt-2">
<input type="number" class="form-control" name="id" placeholder="enter your national id number">
</div>
<div class="mt-2">
<button class="btn ml-4 " style="background-color:rgba(245, 6, 170, 1); color: white" name="search">Search</button>
</div>
</form>
</div>
<div class="col-lg-3">
<?php
if (isset($_POST['search'])) {
$id=$_POST['id'];
$selectall=mysqli_query($conn, "SELECT * FROM candidate where candidatanationalid='$id'")or die($conn->error);
if (mysqli_num_rows($selectall)>0) {
$sele=mysqli_query($conn,"SELECT * FROM grade where candidatanationalid='$id'")or die($conn->error);
$myfecthall=mysqli_fetch_array($selectall);
$myfeall=mysqli_fetch_array($sele);
if ($myfecthall['candidatanationalid']!=$myfeall['candidatanationalid']) {
$exam=$myfecthall['examdate'];
if ((date('Y-m-d'))<$myfecthall['examdate']) {
$colorfill="";
$textt="";
$linkapply="";
}else{
$colorfill="bg-danger text-white";
$textt="Outdated Exam_date | ";
$linkapply="<a href='index.php'>Apply Again</a>";
}
?>
<div class="alert alert-info"><p><i class='fa fa-info-circle'></i>User with this id<strong><?php echo$id?></strong> you did not pass any exam
but we have your record in registered candidate.</p>
Exam Date: <?php echo$exam?>
<hr> <span class="text-danger"><?php echo$textt; echo$linkapply?></span></div>
<?php
}
?>
</div>
<?php
}else{
?>
<?php
}
$selectall=mysqli_query($conn, "SELECT * FROM candidateapply where candidatanationalid='$id'")or die($conn->error);
if (mysqli_num_rows($selectall)>0) {?>
<div class="alert alert-info"><i class='fa fa-info-circle'></i> User with this id<strong><?php echo$id?></strong> your request is being proccessed please wait.</div>
<?php }elseif(mysqli_num_rows($selectall)<0){ ?>
<div class="alert alert-info"> <i class='fa fa-info-circle'></i> User with this id<strong><?php echo$id?></strong> There is no records in our system <a href="inde.php">Apply again</a></div>
<?php
}
}
?>
</div>
<div class="col-lg-12 mt-5">
<?php
if (isset($_POST['search'])) {
$id=$_POST['id'];
if (empty($id)) { ?>
<div class="text-danger">
<h4 class=""><i class="fa fa-info-circle"> </i>Type in your national id</h4>
</div>
<?php
}else{
?>
<span id='span'>Results for candidate with id <strong><?php echo$id?></strong></span>
<?php
$selectall=mysqli_query($conn, "SELECT * FROM candidate,grade where candidate.candidatanationalid='$id' and grade.candidatanationalid='$id' ")or die($conn->error);
if (mysqli_num_rows($selectall)>0) {?>
<div class="">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Candidate_national_id</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Gender</th>
<th>Dob</th>
<th>Exam_date</th>
<th>Phone_number</th>
<th>Licence_exam_category</th>
<th>Obtained_marks /20</th>
<th>Decision</th>
</tr>
</thead>
<?php
while ($myfecthall=mysqli_fetch_array($selectall)) {?>
<tbody>
<tr>
<td></td>
<td><?php echo$myfecthall['candidatanationalid']?></td>
<td><?php echo$myfecthall['firstname']?></td>
<td><?php echo$myfecthall['lastname']?></td>
<td><?php echo$myfecthall['gender']?></td>
<td><?php echo$myfecthall['dob']?></td>
<td><?php echo$myfecthall['examdate']?></td>
<td><?php echo$myfecthall['phonenumber']?></td>
<td>
<?php echo$myfecthall['licenceexamcategory']?>
</td>
<td>
<?php echo$myfecthall['obtainedmarks']?>
</td>
<td>
<?php if($myfecthall['decision']=='pass'){?>
<small class="badge badge-primary">Pass</small>
<?php
}else{?>
<small class="badge badge-danger">Fail</small>
<?php }
?>
</td>
</tr>
</tbody>
<?php
}
?>
</table>
</div>
<?php
}else{
?>
<div class='col-lg-12 text-center mt-5'>
<h1 class="text-muted mt-4"><i class="fa fa-info-circle"></i> no results found here.</h1><br>
<p><a href="" class="">Refresh again</a></p><br>
<a href="index.php" class="border p-2 mt-3">Get started</a>
</div>
<?php
}}
}else{
?>
<div class='col-lg-12 text-center mt-5'>
<h1 class="text-muted mt-4"><i class="fa fa-info-circle"></i> Type in your national id..</h1><br>
</div>
<?php
}
?>
</div>
</div>
</div>
</body>
</hmtl>