Updated some code for associating and mac address displays
This commit is contained in:
1 parent
1166c879f5
commit
8e9686414d
3 files changed
+12
-6
No files matched your search
@@ -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> <br/><a href=\"?showmacs=0\">Hide people who haven't registered yet</a>";
|
||||
}
|
||||
else {
|
||||
echo "<li> <br/><a href=\"?showmacs=1\">Show people who haven't registered yet</a>";
|
||||
}
|
||||
echo "</ul>";
|
||||
|
||||
?>
|
||||
|
||||
Reference in new issue
Block a user