First commit based on v0.1
This commit is contained in:
53
assignvlantosubnet.php
Normal file
53
assignvlantosubnet.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
include("header.php");
|
||||
|
||||
// display only if admin
|
||||
if($_SESSION['suser_level'] >= 2) {
|
||||
|
||||
// check for submit
|
||||
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
|
||||
$vlan_id = $_POST['vlan_id'];
|
||||
$subnet_id = $_POST['subnet_id'];
|
||||
|
||||
mysql_query("UPDATE subnet SET vlan_id='$vlan_id' WHERE subnet_id='$subnet_id'") or die(mysql_error());
|
||||
|
||||
header("location: vlan.php");
|
||||
}
|
||||
|
||||
$vlan_id = $_GET['vlan_id'];
|
||||
?>
|
||||
|
||||
<form method="POST" action="assignvlantosubnet.php">
|
||||
<input type="hidden" name="vlan_id" value="<?php echo $vlan_id; ?>">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<b>Assign to:</b><br>
|
||||
</td>
|
||||
<td>
|
||||
<select name="subnet_id">
|
||||
|
||||
<?php
|
||||
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet ORDER BY subnet_address");
|
||||
while ($row = mysql_fetch_object($result)) {
|
||||
echo '<option value="' . $row->subnet_id . '">' . $row->subnet_address . '</option>';
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="submit" value="Submit"><input type="reset" value="Reset">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// end display only if admin
|
||||
}
|
||||
|
||||
include("footer.php");
|
||||
?>
|
||||
Reference in New Issue
Block a user