Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. <form name="vlan" action="" method="post">
  2. <div class="row">
  3. <div class="col-md-6">
  4. <?php
  5. $con_string= "host=example port=xxxx dbname=example user=example password=example";
  6. $db_con = pg_connect($con_string);
  7. $dev = pg_query($db_con, "SELECT DISTINCT "Type" FROM "End_Devices"");
  8.  
  9. echo "
  10. <a class="current_page_item">Location NASID:</a>
  11. <input type="text" name="nasid" />
  12. <br>
  13. <a class="current_page_item">Device Name:</a>
  14. <input type="text" name="name" />
  15. <br>
  16. <input type="hidden" name="dvtype"/>
  17. <a class="current_page_item">Device Type:</a>
  18. <select name="slType" id="slType">";
  19.  
  20. while ($device = pg_fetch_array($dev))
  21. {
  22. echo "<option id="" .$device['Type']. "">" .$device['Type']. "</option>";
  23.  
  24. }
  25. echo "<script type="text/javascript">
  26.  
  27. $("#slType").chained("#slModel");
  28. $("#slType").on("change",function(){
  29. var slTypeID = $(this).val();
  30. $.post('inventoryTEST.php', {slTypeID:slTypeID}, function(data){
  31. $('#slModel').html(data);
  32. });
  33. });
  34.  
  35. </script>";
  36.  
  37.  
  38. echo "
  39. </select>
  40. <br>
  41. <a class="current_page_item">Device Model:</a>
  42. <select name="slModel" id="slModel" >";
  43.  
  44. if (isset($_POST['slTypeid']))
  45. {
  46. $selection = ($_POST(['slTypeid']));
  47.  
  48. }
  49.  
  50. $mod = pg_query($db_con, "SELECT "Model" FROM "End_Devices" WHERE "Type"="". $selection . """);
  51. while ($model = pg_fetch_array($mod))
  52. {
  53. echo $_POST[type];
  54. echo "<option id="" .$model['Model']. "">" .$model['Model']. "</option>";
  55. }
  56. echo "
  57. </select>
  58. <br>
  59. <a class="current_page_item">Physical Location:</a>
  60. <input type="text" name="location" />
  61. <br>
  62. <a class="current_page_item">Serial:</a>
  63. <input type="text" name="serial" />
  64. <br>
  65. <a class="current_page_item">IP Address:</a>
  66. <input type="text" name="ip" />
  67. <br>
  68. <a class="current_page_item">MAC:</a>
  69. <input type="text" name="mac" />
  70. <br>
  71. <a class="current_page_item">SSID:</a>
  72. <input type="text" name="ssid" />
  73. <br>
  74. <a class="current_page_item">WLAN Area:</a>
  75. <input type="text" name="wlan" />
  76. <br>
  77. <br>
  78. <br>
  79. ";
  80. ?>
  81. <!--SUBMIT INPUT-->
  82. <input type="submit" value="Save" name="submit" />
  83. </div>
  84. </div>
  85. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement