You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
2 years ago
|
<?php
|
||
|
include("header.php");
|
||
|
|
||
|
// display only if admin
|
||
|
if($_SESSION['suser_level'] >= 2) {
|
||
|
|
||
|
// check for submit
|
||
|
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
|
||
|
$location_id = $_POST['location_id'];
|
||
|
$subnet_id = $_POST['subnet_id'];
|
||
|
|
||
|
mysql_query("INSERT INTO subnetlocation (location_id, subnet_id) VALUE ('$location_id', '$subnet_id')") or die(mysql_error());
|
||
|
|
||
|
header("Location: location.php");
|
||
|
}
|
||
|
|
||
|
$location_id = $_GET['location_id'];
|
||
|
?>
|
||
|
|
||
|
<form method="POST" action="assignlocationtosubnet.php">
|
||
|
<input type="hidden" name="location_id" value="<?php echo $location_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 INET_ATON(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");
|
||
|
?>
|