Some small changes/fixes

master v0.2
Thomas Hooge 2 years ago
parent 2efd4ad0ab
commit 7322231d3e
  1. 2
      assignsubnettolocation.php
  2. 4
      assignvlantosubnet.php
  3. 6
      header.php
  4. 2
      index.php
  5. 2
      location.php
  6. 2
      search.php
  7. 2
      subnetedit.php
  8. 2
      vlanview.php

@ -11,7 +11,7 @@
mysql_query("INSERT INTO subnetlocation (location_id, subnet_id) VALUE ('$location_id', '$subnet_id')") or die(mysql_error());
header("Location: subnet.php");
header("Location: subnetview.php?subnet_id=" . $subnet_id);
}
$subnet_id = $_GET['subnet_id'];

@ -11,7 +11,7 @@
mysql_query("UPDATE subnet SET vlan_id='$vlan_id' WHERE subnet_id='$subnet_id'") or die(mysql_error());
header("location: vlan.php");
header("location: vlanview.php?vlan_id=" . $vlan_id);
}
$vlan_id = $_GET['vlan_id'];
@ -28,7 +28,7 @@
<select name="subnet_id">
<?php
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet ORDER BY subnet_address");
$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>';
}

@ -53,8 +53,14 @@
while ($row = mysql_fetch_object($result)) {
echo $displayname = $row->displayname . ' - ';
}
// TEMP display only if admin
if($_SESSION['suser_level'] >= 2) {
echo '<a href="nodeadd.php">Add new node</a> - ';
}
?>
<a href="options.php">Options</a> -
<a href="logout.php">Log out</a>
</td>

@ -21,7 +21,7 @@
<table border="0">
<tr>
<td>
<b>IP Reg <?php echo $config_version; ?></b>
<b>IP Reg <?php echo $config_version; ?></b><br>
</td>
</tr>
</table>

@ -4,7 +4,7 @@
function display_subnet ($location_id) {
$subnet = '';
$result = mysql_query("SELECT s.subnet_id, s.subnet_address, s.subnet_mask FROM subnet s INNER JOIN subnetlocation sl ON s.subnet_id=sl.subnet_id WHERE sl.location_id='$location_id' ORDER BY subnet_address");
$result = mysql_query("SELECT s.subnet_id, s.subnet_address, s.subnet_mask FROM subnet s INNER JOIN subnetlocation sl ON s.subnet_id=sl.subnet_id WHERE sl.location_id='$location_id' ORDER BY INET_ATON(subnet_address)");
while ($row = mysql_fetch_object($result)) {
$subnet .= '<a href="subnetview.php?subnet_id='. $row->subnet_id . '">' . $row->subnet_address . '/' . $row->subnet_mask . '</a><br>';
}

@ -75,7 +75,7 @@
}
// look for subnet
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet WHERE subnet_address LIKE '$needle' OR subnet_info LIKE '%$needle%' ORDER BY subnet_address");
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet WHERE subnet_address LIKE '$needle' OR subnet_info LIKE '%$needle%' ORDER BY INET_ATON(subnet_address)");
if (mysql_num_rows($result)>0) {
echo '<tr><td><b>Subnet(s):</b></td></tr>';
}

@ -58,7 +58,7 @@
VLAN
</td>
<td>
<select name="vlan_number">
<select name="vlan_id">
<option value="0">(none)</option>
<?php

@ -45,7 +45,7 @@
<td>
<?php
// get subnet info
$result = mysql_query("SELECT subnet_id, subnet_address FROM subnet WHERE vlan_id='$vlan_id' ORDER BY subnet_address");
$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>';
}