-
Notifications
You must be signed in to change notification settings - Fork 0
/
live_suspect_details.php
90 lines (72 loc) · 2.03 KB
/
live_suspect_details.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="2">
<title>Suspect Details</title>
<style>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 50vh;
}
table {
border-collapse: collapse;
width: 80%;
}
table, th, td {
border: 1px solid black;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
img {
display: block;
margin: auto;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<center><h1>Matched Suspects</h1></center>
<div class="container">
<center>
<a href="#" onclick="window.history.back(); return false;"><i style="font-size:24px" class="fa"></i></a>
<a href="dashboard.php"><i style="font-size:24px;color:blue;" class="fa"></i></a>
<br/><br/>
<?php
include('Includes/connection.php');
// Read the detected names from the file
$detected_names_file = "live_suspect.txt";
$detected_names = file($detected_names_file, FILE_IGNORE_NEW_LINES);
// Prepare SQL query to retrieve suspect details
$sql = "SELECT * FROM suspect_details WHERE name IN ('" . implode("','", $detected_names) . "')";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Output table header
echo "<table border='1'>";
echo "<tr><th>Name</th><th>Age</th><th>Address</th><th>Image</th><th>Previous Crimes</th></tr>";
// Output data of each row
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["age"] . "</td>";
echo "<td>" . $row["address"] . "</td>";
echo "<td><img src='./" . $row["image"] . "' width='100'></td>";
echo "<td>" . $row["prev_crimes"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "No matching suspects found.";
}
$conn->close();
?>
</div>
</body>
</html>