-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
102 lines (87 loc) · 1.64 KB
/
Copy pathuser.php
File metadata and controls
102 lines (87 loc) · 1.64 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
<?php
require "lib/utilities.php";
// get ip
$ip = $_GET['ip'];
// fetch users
require "lib/connect_to_db.php";
$sql = "SELECT id, prompt, response, timestamp FROM chats WHERE ip = ?";
$chats = queryDB($mysqli, $sql, "s", $ip);
$mysqli->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Roq AI</title>
<style>
* {
font-family: system-ui;
margin: 0;
}
body {
background-color: #f5f5f5;
}
table {
width: 100%;
border-collapse: collapse;
}
td,
th {
border: 1px solid #aaa;
padding: 8px;
}
a {
text-decoration: none;
color: grey;
}
a:active,
a:hover {
color: #42b72a;
}
section {
padding: 10px;
}
.container {
max-width: fit-content;
margin: 0 auto;
background-color: #fff;
padding: 18px;
}
h2 {
margin-bottom: 18px;
}
</style>
</head>
<body>
<section>
<div class="container">
<?php if (count($chats)): ?>
<h2>Prompts from user: <?php echo $ip ?></h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Prompt</th>
<th>Response</th>
<th>Timestamp (UTC)</th>
</tr>
</thead>
<tbody>
<?php foreach ($chats as $chat): ?>
<tr>
<td><?php echo $chat['id'] ?></td>
<td><?php echo $chat['prompt'] ?></td>
<td><?php echo $chat['response'] ?></td>
<td><?php echo $chat['timestamp'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>No prompts from user: <b><?php echo $ip ?></b></p>
<?php endif; ?>
</div>
</section>
</body>
</html>