mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2329 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -7,8 +7,7 @@
|
||||
<select name="device_id" id="device_id">
|
||||
<option value="">All Devices</option>
|
||||
<?php
|
||||
$query = mysql_query("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hostname` ORDER BY `hostname`");
|
||||
while ($data = mysql_fetch_assoc($query))
|
||||
foreach (dbFetchRows("SELECT `device_id`,`hostname` FROM `devices` GROUP BY `hostname` ORDER BY `hostname`") as $data)
|
||||
{
|
||||
echo('<option value="'.$data['device_id'].'"');
|
||||
if ($data['device_id'] == $_POST['device_id']) { echo("selected"); }
|
||||
@@ -40,18 +39,25 @@ print_optionbar_end();
|
||||
|
||||
echo('<table width="100%" cellspacing="0" cellpadding="5">');
|
||||
|
||||
if (is_numeric($_POST['device_id'])) { $where .= " AND I.device_id = '".$_POST['device_id']."'"; }
|
||||
if ($_POST['interface']) { $where .= " AND I.ifDescr LIKE '".mres($_POST['interface'])."'"; }
|
||||
$query = "SELECT * FROM `ipv6_addresses` AS A, `ports` AS I, `devices` AS D, `ipv6_networks` AS N WHERE I.interface_id = A.interface_id AND I.device_id = D.device_id AND N.ipv6_network_id = A.ipv6_network_id ";
|
||||
|
||||
$sql = "SELECT * FROM `ipv6_addresses` AS A, `ports` AS I, `devices` AS D, `ipv6_networks` AS N WHERE I.interface_id = A.interface_id AND I.device_id = D.device_id AND N.ipv6_network_id = A.ipv6_network_id $where ORDER BY A.ipv6_address";
|
||||
|
||||
$query = mysql_query($sql);
|
||||
if (is_numeric($_POST['device_id']))
|
||||
{
|
||||
$query .= " AND I.device_id = ?";
|
||||
$param[] = $_POST['device_id'];
|
||||
}
|
||||
if ($_POST['interface'])
|
||||
{
|
||||
$query .= " AND I.ifDescr LIKE ?";
|
||||
$param[] = $_POST['interface'];
|
||||
}
|
||||
$query .= " ORDER BY A.ipv6_address";
|
||||
|
||||
echo('<tr class="tablehead"><th>Device</a></th><th>Interface</th><th>Address</th><th>Description</th></tr>');
|
||||
|
||||
$row = 1;
|
||||
|
||||
while ($interface = mysql_fetch_assoc($query))
|
||||
foreach (dbFetchRows($query, $param) as $interface)
|
||||
{
|
||||
if ($_POST['address'])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user