$comms = new Comms();
- CBFWAddMessage("1", "i am a message");
+ CBFWAddMessage(rand(1,6), "i am a message");
echo "<pre>";
print_r($comms->getConfig(0));
echo "\n\n\n";
if(count($msgs) > 0) {
echo "<table>";
foreach($msgs as $key => $val) {
- $datetime = $val["timestamp"];
+ $datetime = strftime("%c", $val["timestamp"]);
$sev = $val["level"];
$message = $val["message"];
- echo "<tr><td>$datetime</td><td>$sev</td><td>$message</td></tr>";
+
+ $sevcolour = "#ddffdd";
+ switch($sev) {
+ case "1":
+ $sevcolour = "#ffaaaa";
+ break;
+ case "2":
+ $sevcolour = "#ffdddd";
+ break;
+ case "3":
+ $sevcolour = "#ffffdd";
+ break;
+ case "4":
+ $sevcolour = "#ddffdd";
+ break;
+ case "5":
+ $sevcolour = "#aaffaa";
+ break;
+ case "6":
+ $sevcolour = "#ccaaaa";
+ break;
+ }
+
+ echo "<tr bgcolor=\"$sevcolour\"><td><i>$datetime</i></td><td>$message ($sev)</td></tr>";
$show++;
if($show >= $maxshow) break;
}