mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
remove PDO, test some dbFacile
git-svn-id: http://www.observium.org/svn/observer/trunk@2276 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -28,7 +28,7 @@ print_optionbar_start(62);
|
||||
<option value=''>All OSes</option>
|
||||
<?php
|
||||
|
||||
foreach($db->query('SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`') as $data)
|
||||
foreach(dbFetch('SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`') as $data)
|
||||
{
|
||||
if ($data['os'])
|
||||
{
|
||||
@@ -44,7 +44,7 @@ foreach($db->query('SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER
|
||||
<option value=''>All Versions</option>
|
||||
<?php
|
||||
|
||||
foreach($db->query('SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`') as $data)
|
||||
foreach(dbFetch('SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`') as $data)
|
||||
{
|
||||
if ($data['version'])
|
||||
{
|
||||
@@ -60,7 +60,7 @@ foreach($db->query('SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `versi
|
||||
<select name="hardware" id="hardware">
|
||||
<option value="">All Platforms</option>
|
||||
<?php
|
||||
foreach($db->query('SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hardware` ORDER BY `hardware`') as $data)
|
||||
foreach(dbFetch('SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hardware` ORDER BY `hardware`') as $data)
|
||||
{
|
||||
if ($data['hardware'])
|
||||
{
|
||||
@@ -76,7 +76,7 @@ foreach($db->query('SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hard
|
||||
<option value="">All Featuresets</option>
|
||||
<?php
|
||||
|
||||
foreach($db->query('SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `features` ORDER BY `features`') as $data)
|
||||
foreach(dbFetch('SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `features` ORDER BY `features`') as $data)
|
||||
{
|
||||
if ($data['features'])
|
||||
{
|
||||
@@ -123,7 +123,7 @@ if ($_GET['status'] == "alerted")
|
||||
echo('<table cellpadding="7" cellspacing="0" class="devicetable sortable" width="100%">
|
||||
<tr class="tablehead"><th></th><th>Device</th><th></th><th>Operating System</th><th>Platform</th><th>Uptime/Location</th></tr>');
|
||||
|
||||
foreach($db->query($sql) as $device)
|
||||
foreach(dbFetch($sql) as $device)
|
||||
{
|
||||
if (device_permitted($device['device_id']))
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ include_once($config['install_dir'] . "/includes/syslog.php");
|
||||
include_once($config['install_dir'] . "/includes/rewrites.php");
|
||||
include_once($config['install_dir'] . "/includes/snmp.inc.php");
|
||||
include_once($config['install_dir'] . "/includes/services.inc.php");
|
||||
include_once($config['install_dir'] . "/includes/dbFacile.php");
|
||||
|
||||
function mac_clean_to_readable($mac)
|
||||
{
|
||||
|
@@ -939,11 +939,11 @@ if (!$observium_link)
|
||||
}
|
||||
$observium_db = mysql_select_db($config['db_name'], $observium_link);
|
||||
|
||||
try {
|
||||
$db = new PDO('mysql:host='.$config['db_host'].';dbname='.$config['db_name'], $config['db_user'], $config['db_pass']);
|
||||
} catch (PDOException $e) {
|
||||
print "Error!: " . $e->getMessage() . "<br/>";
|
||||
}
|
||||
#try {
|
||||
# $db = new PDO('mysql:host='.$config['db_host'].';dbname='.$config['db_name'], $config['db_user'], $config['db_pass']);
|
||||
#} catch (PDOException $e) {
|
||||
# print "Error!: " . $e->getMessage() . "<br/>";
|
||||
#}
|
||||
|
||||
# Set some times needed by loads of scripts (it's dynamic, so we do it here!)
|
||||
|
||||
|
Reference in New Issue
Block a user