-
Notifications
You must be signed in to change notification settings - Fork 2
/
validator.php
72 lines (47 loc) · 1.86 KB
/
validator.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
<?php
include('Components/header.php');
include('config.php');
if (isset($_POST['submit'])) {
$index = $_POST['number_index'];
$capture_time = $_POST['time_val'];
$capture_date = $_POST['date_val'];
$validation = "Validation";
$name = "name";
$faculty = "school-of-ict";
$sql = "SELECT * FROM QR_DATA WHERE INDEX_NUMBER = '$index';";
$stmt = $conn->prepare($sql);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows() > 0) {
$validation = "User Validated Successfully";
$data_select = "SELECT STUDENT_NAME, FACULTY FROM QR_DATA WHERE INDEX_NUMBER = '$index';";
$stmt = $conn->prepare($data_select);
$stmt->execute();
$stmt->bind_result($name, $faculty);
$stmt->fetch();
} else {
$validation = "User Validation Failed";
}
}
?>
<html>
<body>
<div class="card text-center">
<div class="card-header">
Featured
</div>
<div class="card-body">
<h5 class="card-title"><?php echo $validation ?></h5>
<p class="card-text">all information from our primary database If there is a problem, contact the administrator</p>
<p style="font-size: 14px;" class="card-text">Student Name: <span class="badge bg-primary"><?php echo $name?></span></p>
<p style="font-size: 14px;" class="card-text">Student Based Faculty: <span class="badge bg-primary"><?php echo $faculty?></span></p>
<p style="font-size: 14px;" class="card-text">Date : <span class="badge bg-primary"><?php echo $capture_date?></span></p>
<p style="font-size: 14px;" class="card-text">Capture Time : <span class="badge bg-primary"><?php echo $capture_time?></span></p>
<a href="index.php" class="btn btn-primary">Go Scanner Page</a>
</div>
<div class="card-footer text-muted">
2 days ago
</div>
</div>
</body>
</html>