1
0

mactable.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
  3. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . $language . ".php");
  4. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
  5. ?>
  6. <html>
  7. <head>
  8. <title>Панель администратора</title>
  9. <link rel="stylesheet" type="text/css" href=<? echo "\"/$style.css\""; ?>>
  10. <meta http-equiv="content-type" content="application/xhtml+xml">
  11. <meta charset="UTF-8">
  12. </head>
  13. <body>
  14. <div id="cont">
  15. <?php
  16. $dev = get_record($db_link,'devices',"id=$id");
  17. $ports = get_records($db_link,'device_ports',"device_id=$id AND uplink=0 ORDER BY port");
  18. print "<b>Список маков активных на свиче ".$dev['device_name']." (".$dev['ip']."):</b>\n";
  19. $fdb = get_fdb_table($dev['ip'], $dev['community'], $dev['snmp_version']);
  20. print "<table class=\"data\" cellspacing=\"1\" cellpadding=\"4\">\n";
  21. print "<tr>";
  22. print "<td>Port</td>\n";
  23. print "<td>User</td>\n";
  24. print "<td>Mac</td>\n";
  25. print "</tr>";
  26. foreach ($ports as $port) {
  27. foreach ($fdb as $a_mac => $a_port) {
  28. if ($a_port == $port['port']) {
  29. print "<tr>";
  30. print "<td class=\"data\">" . $a_port . "</td>\n";
  31. $auth = get_auth_by_mac($db_link, dec_to_hex($a_mac));
  32. print "<td class=\"data\">" .$auth['auth'] . "</td><td class=\"data\">". $auth['mac']."</td>\n";
  33. print "</tr>";
  34. }
  35. }
  36. }
  37. print "</table>\n";
  38. ?>
  39. </body>
  40. </html>