Updated some code for associating and mac address displays

This commit is contained in:
2012-08-13 18:52:50 -07:00
parent 1166c879f5
commit 8e9686414d
3 changed files with 12 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ include('header-inc.php');
$result = http_parse_message(http_get("http://localhost/pamela/data.php"));
$result = preg_replace("/\s/","",$result->body); // get rid of linebreaks
$result = preg_replace("/[\r|\n]/","",$result->body); // get rid of linebreaks
$decode = json_decode($result);
$decode = preg_replace("/^([0-9a-f]{2}([:]|$)){6}$/i",'{$0}',$decode);
@@ -16,12 +16,20 @@ echo "<h2>Who's here right now?</h2>";
echo "<ul>";
foreach($array as $entry) {
if(substr($entry,0,1) == "{") {
echo "<li class='macaddr'>".$entry."</li>";
if($_GET['showmacs'] == "1") {
echo "<li class='macaddr'>".$entry."</li>";
}
}
else{
echo "<li>".$entry."</li>";
}
}
if($_GET['showmacs'] == "1") {
echo "<li>&nbsp;<br/><a href=\"?showmacs=0\">Hide people who haven't registered yet</a>";
}
else {
echo "<li>&nbsp;<br/><a href=\"?showmacs=1\">Show people who haven't registered yet</a>";
}
echo "</ul>";
?>