>Email admin</a></p> <h3>Alert history</h3> <ol> <?php function countresults($a) { $count = 0; foreach ($a["guards"] as $g) { if (!empty($g["result"])) { $count++; } } return $count; } $history = glob("r/{$id}/alert/*.json"); rsort($history); foreach ($history as $alog) { $a = json_decode(file_get_contents($alog), true); $c = countresults($a); echo "<li " . ($c == 0 ? "class=muted" : "") . "><a href={$alog}>" . date("c", basename($alog, ".json")) . "</a> {$c} responder(s) notified</li>\n"; } ?> </ol> <footer><a href=https://github.com/kaihendry/myresponder>MIT licensed source code</a> version <?php echo getenv("COMMIT"); ?> </footer> </body> </html>
{ $count = 0; foreach ($a["guards"] as $g) { if (!empty($g["result"])) { $count++; } } return $count; } $alerts = glob("../h/r/*/alert/*.json"); usort($alerts, create_function('$a,$b', 'return filemtime($a) - filemtime($b);')); foreach (array_slice(array_reverse($alerts), 0, 20) as $aj) { $a = json_decode(file_get_contents($aj), true); ?> <tr <?php echo countresults($a) == 0 ? "class=muted" : ""; ?> > <td> <?php $ft = date("c", basename($aj, ".json")); echo "<a href=\"//h." . getenv('HOST') . "/adisplay/?j=/r/" . substr($aj, 7) . "\"><time datetime={$ft}>{$ft}</time></a>"; ?> </td> <td><?php echo $a["raiser"]["name"]; ?> </td> <td><?php echo $a["raiser"]["address"]; ?>