1
0

switchport-conn.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
  3. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
  4. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
  5. $device=get_record($db_link,'devices',"id=".$id);
  6. if (isset($_POST["remove"])) {
  7. $fid = $_POST["f_id"];
  8. foreach ($fid as $key => $val) {
  9. if (isset($val) and $val != 1) {
  10. LOG_VERBOSE($db_link, "Remove connection id: $val ".dump_record($db_link,'connections','id='.$val));
  11. delete_record($db_link, "connections", "id=" . $val);
  12. }
  13. }
  14. header("Location: " . $_SERVER["REQUEST_URI"]);
  15. exit;
  16. }
  17. unset($_POST);
  18. $user_info = get_record_sql($db_link,"SELECT * FROM User_list WHERE id=".$device['user_id']);
  19. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
  20. print_device_submenu($page_url);
  21. print_editdevice_submenu($page_url,$id,$device['device_type'],$user_info['login']);
  22. ?>
  23. <div id="contsubmenu">
  24. <form name="def" action="switchport-conn.php?id=<?php echo $id; ?>" method="post">
  25. <br>
  26. <?php print "<b>".WEB_device_port_connections."&nbsp".$device['device_name']." - ".$device['ip']."</b><br>\n"; ?>
  27. <table class="data">
  28. <tr>
  29. <td width=20><input type="checkbox" onClick="checkAll(this.checked);"></td>
  30. <td width=40><b><?php echo WEB_device_port_number; ?></b></td>
  31. <td ><b><?php echo WEB_cell_login; ?></b></td>
  32. <td width=100><input type="submit" onclick="return confirm('<?php echo WEB_msg_delete; ?>?')" name="remove" value="<?php echo WEB_btn_delete; ?>"></td>
  33. </tr>
  34. <?php
  35. $connections = get_records($db_link,"connections","device_id=$id ORDER BY port_id ASC");
  36. foreach ($connections as $key => $value) {
  37. print "<tr align=center>\n";
  38. print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_id[] value='{$value['id']}'></td>\n";
  39. $port = get_record($db_link,"device_ports","id=".$value['port_id']);
  40. print "<td class=\"data\">". $port['port'] . "</a></td>\n";
  41. print "<td class=\"data\">";
  42. print_auth_detail($db_link, $value['auth_id']);
  43. print "</td>\n";
  44. print "<td class=\"data\"></td>\n";
  45. print "</tr>";
  46. }
  47. print "</table>\n";
  48. ?>
  49. </form>
  50. <?php
  51. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.small.php");
  52. ?>