2010-01-09 02:10:34 +00:00
|
|
|
<?php print_optionbar_start(52); ?>
|
2009-08-07 16:10:52 +00:00
|
|
|
<table cellpadding=4 cellspacing=0 class=devicetable width=100%>
|
2009-03-20 13:25:19 +00:00
|
|
|
<form method='post' action=''>
|
2009-08-07 16:10:52 +00:00
|
|
|
<tr>
|
|
|
|
<td width='30' align=center valign=middle></td>
|
2009-03-20 13:25:19 +00:00
|
|
|
<td width='300'><span style='font-weight: bold; font-size: 14px;'></span>
|
|
|
|
<input type="text" name="hostname" id="hostname" size=40 value="<?php echo($_POST['hostname']); ?>" />
|
|
|
|
</td>
|
|
|
|
<td width='200'>
|
|
|
|
<select name='os' id='os'>
|
|
|
|
<option value=''>All OSes</option>
|
|
|
|
<?php
|
|
|
|
$query = mysql_query("SELECT `os` FROM `devices` GROUP BY `os` ORDER BY `os`");
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($data = mysql_fetch_array($query))
|
|
|
|
{
|
|
|
|
if ($data['os'])
|
|
|
|
{
|
|
|
|
echo("<option value='".$data['os']."'");
|
|
|
|
if ($data['os'] == $_POST['os']) { echo("selected"); }
|
|
|
|
echo(">".$data['os']."</option>");
|
|
|
|
}
|
2009-03-20 13:25:19 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<br />
|
|
|
|
<select name='version' id='version'>
|
|
|
|
<option value=''>All Versions</option>
|
|
|
|
<?php
|
|
|
|
$query = mysql_query("SELECT `version` FROM `devices` GROUP BY `version` ORDER BY `version`");
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($data = mysql_fetch_array($query))
|
|
|
|
{
|
|
|
|
if ($data['version'])
|
|
|
|
{
|
|
|
|
echo("<option value='".$data['version']."'");
|
|
|
|
if ($data['version'] == $_POST['version']) { echo("selected"); }
|
|
|
|
echo(">".$data['version']."</option>");
|
|
|
|
}
|
2009-03-20 13:25:19 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td width='200'>
|
|
|
|
<select name='hardware' id='hardware'>
|
|
|
|
<option value=''>All Platforms</option>
|
|
|
|
<?php
|
|
|
|
$query = mysql_query("SELECT `hardware` FROM `devices` GROUP BY `hardware` ORDER BY `hardware`");
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($data = mysql_fetch_array($query))
|
|
|
|
{
|
|
|
|
if ($data['hardware'])
|
|
|
|
{
|
|
|
|
echo("<option value='".$data['hardware']."'");
|
|
|
|
if ($data['hardware'] == $_POST['hardware']) { echo("selected"); }
|
|
|
|
echo(">".$data['hardware']."</option>");
|
|
|
|
}
|
2009-03-20 13:25:19 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<br />
|
|
|
|
<select name='features' id='features'>
|
|
|
|
<option value=''>All Featuresets</option>
|
|
|
|
<?php
|
|
|
|
$query = mysql_query("SELECT `features` FROM `devices` GROUP BY `features` ORDER BY `features`");
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($data = mysql_fetch_array($query))
|
|
|
|
{
|
|
|
|
if ($data['features'])
|
|
|
|
{
|
|
|
|
echo("<option value='".$data['features']."'");
|
|
|
|
if ($data['features'] == $_POST['features']) { echo("selected"); }
|
|
|
|
echo(">".$data['features']."</option>");
|
|
|
|
}
|
2009-03-20 13:25:19 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select name='location' id='location'>
|
|
|
|
<option value=''>All Locations</option>
|
|
|
|
<?php
|
|
|
|
$query = mysql_query("SELECT `location` FROM `devices` GROUP BY `location` ORDER BY `location`");
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($data = mysql_fetch_array($query))
|
|
|
|
{
|
|
|
|
if ($data['location'])
|
|
|
|
{
|
|
|
|
echo("<option value='".$data['location']."'");
|
|
|
|
if ($data['location'] == $_POST['location']) { echo("selected"); }
|
|
|
|
echo(">".$data['location']."</option>");
|
|
|
|
}
|
2009-03-20 13:25:19 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
2010-02-06 00:51:49 +00:00
|
|
|
<input class=submit type=submit value=Search>
|
2009-03-20 13:25:19 +00:00
|
|
|
</td>
|
|
|
|
<td width=10>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</form>
|
|
|
|
</table>
|
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
2010-01-09 02:10:34 +00:00
|
|
|
print_optionbar_end();
|
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2010-01-25 23:42:23 +00:00
|
|
|
if ($_POST['hostname']) { $where = " AND hostname LIKE '%".$_POST['hostname']."%'"; }
|
|
|
|
if ($_POST['os']) { $where = " AND os = '".$_POST['os']."'"; }
|
|
|
|
if ($_POST['version']) { $where .= " AND version = '".$_POST['version']."'"; }
|
|
|
|
if ($_POST['hardware']) { $where .= " AND hardware = '".$_POST['hardware']."'"; }
|
|
|
|
if ($_POST['features']) { $where .= " AND features = '".$_POST['features']."'"; }
|
|
|
|
if ($_POST['location']) { $where .= " AND location = '".$_POST['location']."'"; }
|
|
|
|
if ($_GET['location']) { $where = "AND location = '$_GET[location]'"; }
|
|
|
|
if ($_GET['location'] == "Unset") { $where = "AND location = ''"; }
|
|
|
|
if ($_GET['type']) { $where = "AND type = '$_GET[type]'"; }
|
2007-04-04 10:43:23 +00:00
|
|
|
|
2008-03-16 15:16:31 +00:00
|
|
|
$sql = "select * from devices WHERE 1 $where ORDER BY `ignore`, `status`, `hostname`";
|
2010-01-25 23:42:23 +00:00
|
|
|
if ($_GET['status'] == "alerted") {
|
2007-06-24 14:56:47 +00:00
|
|
|
$sql = "select * from devices " . $device_alert_sql . " GROUP BY `device_id` ORDER BY `ignore`, `status`, `os`, `hostname`";
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2009-12-30 21:02:05 +00:00
|
|
|
echo('<table cellpadding="7" cellspacing="0" class="devicetable" width="100%">
|
|
|
|
<tr class="tablehead"><th></th><th>Device</th><th>Operating System</th><th>Platform</th><th>Uptime</th></tr>');
|
2009-03-20 13:25:19 +00:00
|
|
|
|
|
|
|
$device_query = mysql_query($sql);
|
2010-01-25 23:42:23 +00:00
|
|
|
while ($device = mysql_fetch_array($device_query)) {
|
|
|
|
if ( devicepermitted($device['device_id']) ) {
|
2007-06-24 14:56:47 +00:00
|
|
|
include("includes/hostbox.inc");
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo("</table>");
|
|
|
|
|
|
|
|
?>
|