-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecords.php
55 lines (46 loc) · 1.3 KB
/
records.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
<?php
include dirname(__FILE__) . "/app/app.php";
include dirname(__FILE__) . "/app/app.login.php";
$website = isset($_GET['website']) ? $_GET['website'] : array();
$limit = isset($_GET['limit']) ? $_GET['limit'] : 20;
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Records | WebChangesTracker</title>
<link rel="stylesheet" href="./style.css?v=7">
</head>
<body>
<h1>Records</h1>
<form action="./records.php">
<?php
if(count($website) == 0) {
echo '<p><em>No selected websites</em></p>';
} else {
foreach($website as $id) {
echo '<input type="hidden" name="website[]" value="'.$id.'" />';
}
}
?>
<p><a href="./">« back</a></p>
<hr />
<p>
<label for="limit">Limit:</label>
<input type="number" name="limit" min="20" step="20" max="1000" value="<?php echo $limit; ?>" />
</p>
<p>
<input type="submit" value="Show records" />
</p>
<?php
$records = $db->records()->where("website_id", $website)->order("occurrence_last DESC")->limit($limit);
foreach($records as $record) {
$template = $App->getMessageTemplate($record['website_id']);
echo '<div class="preview">';
echo $App->createMessage($template, $record);
echo '</div>';
}
?>
</form>
</body>
</html>