mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
restructure/reindent/htmlfix html pages, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1897 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -11,16 +11,17 @@
|
||||
<option value="">All Parts</option>
|
||||
<?php
|
||||
$query = mysql_query("SELECT `entPhysicalModelName` FROM `entPhysical` GROUP BY `entPhysicalModelName` ORDER BY `entPhysicalModelName`");
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
while ($data = mysql_fetch_array($query))
|
||||
{
|
||||
echo("<option value='".$data['entPhysicalModelName']."'");
|
||||
if($data['entPhysicalModelName'] == $_POST['part']) { echo("selected"); }
|
||||
if ($data['entPhysicalModelName'] == $_POST['part']) { echo("selected"); }
|
||||
echo(">".$data['entPhysicalModelName']."</option>");
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
<label><strong>Serial</strong>
|
||||
<input type="text" name="serial" id="serial" value="<?php echo($_POST['serial']); ?>" />
|
||||
<input type="text" name="serial" id="serial" value="<?php echo($_POST['serial']); ?>" />
|
||||
</label>
|
||||
<label>
|
||||
<strong>Device</strong>
|
||||
@@ -28,10 +29,11 @@
|
||||
<option value="">All Devices</option>
|
||||
<?php
|
||||
$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`");
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
while ($data = mysql_fetch_array($query))
|
||||
{
|
||||
echo("<option value='".$data['device_id']."'");
|
||||
|
||||
if($data['device_id'] == $_POST['device']) { echo("selected"); }
|
||||
if ($data['device_id'] == $_POST['device']) { echo("selected"); }
|
||||
|
||||
echo(">".$data['hostname']."</option>");
|
||||
}
|
||||
@@ -45,30 +47,36 @@
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if($_POST['string']) {
|
||||
if ($_POST['string'])
|
||||
{
|
||||
$where .= " AND E.entPhysicalDescr LIKE '%".$_POST['string']."%'";
|
||||
}
|
||||
|
||||
if($_POST['device_string']) {
|
||||
if ($_POST['device_string'])
|
||||
{
|
||||
$where .= " AND D.hostname LIKE '%".$_POST['device_string']."%'";
|
||||
}
|
||||
|
||||
if($_POST['part']) {
|
||||
if ($_POST['part'])
|
||||
{
|
||||
$where .= " AND E.entPhysicalModelName = '".$_POST['part']."'";
|
||||
}
|
||||
|
||||
if($_POST['serial']) {
|
||||
if ($_POST['serial'])
|
||||
{
|
||||
$where .= " AND E.entPhysicalSerialNum LIKE '%".$_POST['serial']."%'";
|
||||
}
|
||||
|
||||
if($_POST['device']) {
|
||||
if ($_POST['device'])
|
||||
{
|
||||
$where .= " AND D.device_id = '".$_POST['device']."'";
|
||||
}
|
||||
|
||||
if($_SESSION['userlevel'] >= '5') {
|
||||
if ($_SESSION['userlevel'] >= '5')
|
||||
{
|
||||
$sql = "SELECT * from entPhysical AS E, devices AS D WHERE E.device_id = D.device_id $where ORDER BY D.hostname";
|
||||
} else {
|
||||
$sql = "SELECT * from entPhysical AS E, devices AS D, devices_perms AS P
|
||||
} else {
|
||||
$sql = "SELECT * from entPhysical AS E, devices AS D, devices_perms AS P
|
||||
WHERE E.device_id = D.device_id AND D.device_id = P.device_id $where ORDER BY D.hostname";
|
||||
}
|
||||
|
||||
@@ -77,14 +85,13 @@ echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
|
||||
echo("<tr><th>Hostname</th><th>Description</th><th>Name</th><th>Part No</th><th>Serial No</th></tr>");
|
||||
|
||||
while($entry = mysql_fetch_array($query)) {
|
||||
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
|
||||
echo("<tr style=\"background-color: $bg\"><td>" . generate_device_link($entry, shortHost($entry['hostname'])) . "</td><td>" . $entry['entPhysicalDescr'] .
|
||||
while ($entry = mysql_fetch_array($query))
|
||||
{
|
||||
if ($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
|
||||
echo("<tr style=\"background-color: $bg\"><td>" . generate_device_link($entry, shortHost($entry['hostname'])) . "</td><td>" . $entry['entPhysicalDescr'] .
|
||||
"</td><td>" . $entry['entPhysicalName'] . "</td><td>" . $entry['entPhysicalModelName'] . "</td><td>" . $entry['entPhysicalSerialNum'] . "</td></tr>");
|
||||
|
||||
}
|
||||
echo("</table>");
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
</table>
|
Reference in New Issue
Block a user