switchport-conn.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. $switch=get_record($db_link,'devices',"id=".$id);
  6. if (isset($_POST["remove"])) {
  7. $fid = $_POST["f_id"];
  8. while (list ($key, $val) = @each($fid)) {
  9. if (isset($val) and $val != 1) {
  10. LOG_INFO($db_link, "Remove connection id: $val");
  11. delete_record($db_link, "connections", "id=" . $val);
  12. }
  13. }
  14. header("Location: " . $_SERVER["REQUEST_URI"]);
  15. }
  16. unset($_POST);
  17. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
  18. print_editdevice_submenu($page_url,$id);
  19. ?>
  20. <div id="cont">
  21. <form name="def" action="switchport-conn.php?id=<? echo $id; ?>" method="post">
  22. <br>
  23. <?php print "<b>Список соединений на портах $switch[device_name] - $switch[ip]</b><br>\n"; ?>
  24. <table class="data">
  25. <tr>
  26. <td width=20><input type="checkbox" onClick="checkAll(this.checked);"></td>
  27. <td width=40><b>Порт</b></td>
  28. <td ><b>Юзер</b></td>
  29. <td width=100><input type="submit" name="remove" value="Удалить"></td>
  30. </tr>
  31. <?php
  32. $connections = get_records($db_link,"connections","device_id=$id ORDER BY port_id ASC");
  33. foreach ($connections as $key => $value) {
  34. print "<tr align=center>\n";
  35. print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_id[] value='{$value['id']}'></td>\n";
  36. $port = get_record($db_link,"device_ports","id=$value[port_id]");
  37. print "<td class=\"data\">". $port[port] . "</a></td>\n";
  38. print "<td class=\"data\">";
  39. print_auth_detail($db_link, $value[auth_id]);
  40. print "</td>\n";
  41. print "<td class=\"data\"></td>\n";
  42. print "</tr>";
  43. }
  44. print "</table>\n";
  45. ?>
  46. </form>
  47. <?
  48. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.small.php");
  49. ?>