generated from susom/redcap-em-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinfo.php
53 lines (48 loc) · 1.36 KB
/
info.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
<?php
namespace Stanford\WhatsAppAlerts;
/** @var WhatsAppAlerts $module */
?>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.23/b-1.6.5/b-colvis-1.6.5/b-html5-1.6.5/b-print-1.6.5/r-2.2.7/rg-1.1.2/sl-1.3.1/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.23/b-1.6.5/b-colvis-1.6.5/b-html5-1.6.5/b-print-1.6.5/r-2.2.7/rg-1.1.2/sl-1.3.1/datatables.min.js"></script>
<?php
# Get all logs
$fields = [
"log_id",
"source",
"source_id",
"timestamp",
"record",
"number",
"message",
"event_id",
"event_name",
"instance",
"log_field",
"log_event_id",
"sid",
"status",
"status_update",
"status_modified"
];
$project_id = $module->getProjectId();
$sql = "select " . implode(",", $fields) . " where project_id = ?";
$module->emDebug($sql);
$q = $module->queryLogs($sql, [ $project_id ]);
$module->emDebug($q);
?>
<h3>What's App Logs</h3>
<?php
print "<table id='logs'><thead><tr><th>" . implode("</th><th>", $fields) . "</th></tr></thead><tbody>";
while ($row = db_fetch_assoc($q)) {
print "<tr><td>" . implode("</td><td>",$row) . "</td></tr>";
}
print "</tbody></table>\n\n";
?>
<script>
$(document).ready( function() {
// console.log('here');
$('#logs').DataTable({
select: true
});
});
</script>