IP Reg is a IPAM tool to keep track of assets, nodes (IP addresses, MAC addresses, DNS aliases) within different subnets, over different locations or even VLAN's. Written in PHP, used with a MySQL-database to have a unique insight in your local network.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ipreg/vlanview.php

83 lines
1.6 KiB

<?php
include("header.php");
// get id
$vlan_id = $_GET['vlan_id'];
// get vlan info
$result = mysql_query("SELECT vlan_name, vlan_number, vlan_info FROM vlan WHERE vlan_id='$vlan_id'");
while ($row = mysql_fetch_object($result)) {
$vlan_name = $row->vlan_name;
$vlan_number = $row->vlan_number;
$vlan_info = $row->vlan_info;
}
?>
<table border="0">
<tr>
<td>
<b>VLAN name:</b>
</td>
<td>
<?php echo $vlan_name; ?>
</td>
</tr>
<tr>
<td>
<b>VLAN ID:</b>
</td>
<td>
<?php echo $vlan_number; ?>
</td>
</tr>
<tr>
<td>
<b>VLAN info:</b>
</td>
<td>
<?php echo nl2br($vlan_info); ?>
</td>
</tr>
<tr>
<td>
<b>Subnet(s):</b>
</td>
<td>
<?php
// get subnet info
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet WHERE vlan_id='$vlan_id' ORDER BY INET_ATON(subnet_address)");
while ($row = mysql_fetch_object($result)) {
echo '<a href="subnetview.php?subnet_id=' . $row->subnet_id . '">' . $row->subnet_address . '</a><br>';
}
?>
</td>
</tr>
</table>
<?php
// display only if admin
if($_SESSION['suser_level'] >= 2) {
?>
<p>
<table border="0">
<tr>
<td>
<img src="images/arrow.gif" border="0"><a href="vlanedit.php?vlan_id=<?php echo $vlan_id; ?>">Modify</a>
</td>
</tr>
<tr>
<td>
<img src="images/arrow.gif" border="0"><a href="assignvlantosubnet.php?vlan_id=<?php echo $vlan_id; ?>">Assign subnet</a>
</td>
</tr>
</table>
<?php
// end display only if admin
}
include("footer.php");
?>