Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="vlan" action="" method="post">
- <div class="row">
- <div class="col-md-6">
- <?php
- $con_string= "host=example port=xxxx dbname=example user=example password=example";
- $db_con = pg_connect($con_string);
- $dev = pg_query($db_con, "SELECT DISTINCT "Type" FROM "End_Devices"");
- echo "
- <a class="current_page_item">Location NASID:</a>
- <input type="text" name="nasid" />
- <br>
- <a class="current_page_item">Device Name:</a>
- <input type="text" name="name" />
- <br>
- <input type="hidden" name="dvtype"/>
- <a class="current_page_item">Device Type:</a>
- <select name="slType" id="slType">";
- while ($device = pg_fetch_array($dev))
- {
- echo "<option id="" .$device['Type']. "">" .$device['Type']. "</option>";
- }
- echo "<script type="text/javascript">
- $("#slType").chained("#slModel");
- $("#slType").on("change",function(){
- var slTypeID = $(this).val();
- $.post('inventoryTEST.php', {slTypeID:slTypeID}, function(data){
- $('#slModel').html(data);
- });
- });
- </script>";
- echo "
- </select>
- <br>
- <a class="current_page_item">Device Model:</a>
- <select name="slModel" id="slModel" >";
- if (isset($_POST['slTypeid']))
- {
- $selection = ($_POST(['slTypeid']));
- }
- $mod = pg_query($db_con, "SELECT "Model" FROM "End_Devices" WHERE "Type"="". $selection . """);
- while ($model = pg_fetch_array($mod))
- {
- echo $_POST[type];
- echo "<option id="" .$model['Model']. "">" .$model['Model']. "</option>";
- }
- echo "
- </select>
- <br>
- <a class="current_page_item">Physical Location:</a>
- <input type="text" name="location" />
- <br>
- <a class="current_page_item">Serial:</a>
- <input type="text" name="serial" />
- <br>
- <a class="current_page_item">IP Address:</a>
- <input type="text" name="ip" />
- <br>
- <a class="current_page_item">MAC:</a>
- <input type="text" name="mac" />
- <br>
- <a class="current_page_item">SSID:</a>
- <input type="text" name="ssid" />
- <br>
- <a class="current_page_item">WLAN Area:</a>
- <input type="text" name="wlan" />
- <br>
- <br>
- <br>
- ";
- ?>
- <!--SUBMIT INPUT-->
- <input type="submit" value="Save" name="submit" />
- </div>
- </div>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement