-
Notifications
You must be signed in to change notification settings - Fork 39
/
logview.php
66 lines (63 loc) · 2.13 KB
/
logview.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
<?php
require_once('logger.php');
if (!empty($_POST['search'])) {
$sSearch = $_POST['search'];
$aItems = TwitterLogger::search($sSearch);
} else {
$aItems = TwitterLogger::view();
}
?><!DOCTYPE html>
<html>
<head>
<title>Twitter bots log</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1 style="margin-bottom: 1em;">Twitter bots log</h1>
<form method="post" action="logview.php" class="form-horizontal" role="form">
<?php if (!empty($sSearch)) { ?>
<input type="hidden" name="search" value="<?= htmlentities($sSearch) ?>" />
<?php } ?>
<label for="search" class="col-sm-1 control-label">Search</label>
<div class="col-sm-10" style="margin-bottom: 2em;">
<input type="text" id="search" name="search" class="form-control" value="<?= @$sSearch ?>" />
</div>
<div class="col-sm-1">
<input type="submit" class="btn btn-info" value="Search" />
</div>
</form>
<table class="table table-condensed table-hover">
<tr>
<th>Bot</th>
<th>Error</th>
<th>Source</th>
<th>Line</th>
<th>File</th>
<th>Timestamp</th>
</tr>
<?php foreach ($aItems as $aRow) { ?>
<tr class="table-striped">
<td><a href="https://twitter.com/<?= $aRow['botname'] ?>" target="_blank"><?= $aRow['botname'] ?></a></td>
<td><?= $aRow['error'] ?></td>
<td>
<?php if (!empty($aRow['source'])) { ?>
<a data-toggle="collapse" href="#source<?= $aRow['id'] ?>">show</a>
<?php } ?>
</td>
<td><?= $aRow['line'] ?></td>
<td><?= $aRow['file'] ?></td>
<td><?= $aRow['timestamp'] ?></td>
</tr>
<?php if (!empty($aRow['source'])) { ?>
<tr class="collapse" id="source<?= $aRow['id'] ?>">
<td colspan="6"><?= htmlentities($aRow['source']) ?></td>
</tr>
<?php } ?>
<?php } ?>
</table>
</div>
</body>
</html>