#1 Make drop downs auto populate

open-fixed
nobody
None
5
2011-02-16
2006-03-15
Erick Kinnee
No

// This builds our sensor list. 0 is ALL sensors.
// Format: <sensor ID>:<alias>:<description>
// Where sensorID is the sensors sid in the Sguil database
// Where alias is how you want it to appear in the list box
// Where description is something more descriptive than
the alias. Used for banners
// The alias just makes the dropdown cleaner if you
want huge descriptions.
// If you only have 1 sensor:
// $sensorList = "0:sen01:My only sensor";
$sensorList = "0:ALL:All Sensors";
$senq = mysql_query("SELECT sid,hostname FROM sensor");
while ($sens = mysql_fetch_array($senq, MYSQL_ASSOC)) {
$sensorList .= "," . $sens['sid'] . ":" .
$sens['hostname'] . ":" . $sens['hostname'];
}

Discussion

  • paulh
    paulh
    2011-02-16

    • status: open --> open-fixed