diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php index 2c7b838f1e..3e8ddfced8 100644 --- a/html/pages/device/health/diskio.inc.php +++ b/html/pages/device/health/diskio.inc.php @@ -1,8 +1,5 @@ '); #echo(" @@ -14,7 +11,7 @@ echo(''); $row = 1; -while ($drive = mysql_fetch_assoc($query)) +foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY diskio_descr", array($device['device_id'])) as $drive) { if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } diff --git a/html/pages/device/health/mempool.inc.php b/html/pages/device/health/mempool.inc.php index 8e9554881a..c7eb956197 100644 --- a/html/pages/device/health/mempool.inc.php +++ b/html/pages/device/health/mempool.inc.php @@ -6,9 +6,8 @@ echo("
"); echo("
"); $i = '1'; -$mempools = mysql_query("SELECT * FROM `mempools` WHERE device_id = '" . $device['device_id'] . "'"); -while ($mempool = mysql_fetch_assoc($mempools)) +foreach (dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($device['device_id'])) as $mempool) { if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } diff --git a/html/pages/device/health/processor.inc.php b/html/pages/device/health/processor.inc.php index a0995caf15..5494130440 100644 --- a/html/pages/device/health/processor.inc.php +++ b/html/pages/device/health/processor.inc.php @@ -6,8 +6,7 @@ echo("
"); echo("
"); $i = '1'; -$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "'"); -while ($proc = mysql_fetch_assoc($procs)) +foreach (dbFetchRows("SELECT * FROM `processors` WHERE device_id = ?", array($device['device_id'])) as $proc) { $proc_url = "device/".$device['device_id']."/health/processor/"; diff --git a/html/pages/device/health/sensors.inc.php b/html/pages/device/health/sensors.inc.php index f71dd6f694..0eeee81c46 100644 --- a/html/pages/device/health/sensors.inc.php +++ b/html/pages/device/health/sensors.inc.php @@ -7,20 +7,20 @@ echo("
"); $row = 1; -while ($temp = mysql_fetch_assoc($query)) +foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_descr`", array($class, $device['device_id'])) as $sensor) { if (!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } echo(" - - - - - + + + + + \n"); echo("
" . $temp['sensor_descr'] . "" . $temp['sensor_type'] . "" . format_si($temp['sensor_current']) .$unit. "" . format_si($temp['sensor_limit']) . $unit . "" . format_si($temp['sensor_limit_low']) . $unit ."" . $sensor['sensor_descr'] . "" . $sensor['sensor_type'] . "" . format_si($sensor['sensor_current']) .$unit. "" . format_si($sensor['sensor_limit']) . $unit . "" . format_si($sensor['sensor_limit_low']) . $unit ."
"); - $graph_array['id'] = $temp['sensor_id']; + $graph_array['id'] = $sensor['sensor_id']; $graph_array['type'] = $graph_type; include("includes/print-quadgraphs.inc.php"); @@ -32,4 +32,4 @@ while ($temp = mysql_fetch_assoc($query)) echo("
"); -?> \ No newline at end of file +?> diff --git a/html/pages/device/health/storage.inc.php b/html/pages/device/health/storage.inc.php index 96d10bc00b..be1f4f4049 100644 --- a/html/pages/device/health/storage.inc.php +++ b/html/pages/device/health/storage.inc.php @@ -2,9 +2,6 @@ $graph_type = "storage_usage"; -$sql = "SELECT * FROM `storage` WHERE device_id = '" . $device['device_id'] . "' ORDER BY storage_descr"; -$query = mysql_query($sql); - echo(""); echo(" @@ -16,7 +13,7 @@ echo(" $row = 1; -while ($drive = mysql_fetch_assoc($query)) +foreach (dbFetchRows("SELECT * FROM `storage` WHERE device_id = ? ORDER BY storage_descr", array($device['device_id'])) as $drive) { if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }