syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@3185 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-05-15 15:18:57 +00:00
parent 1f9eae3699
commit 4985943822
44 changed files with 65 additions and 97 deletions

View File

@@ -11,23 +11,23 @@
data.addRows([
<?php
foreach(getlocations() as $location)
foreach (getlocations() as $location)
{
$devices = array();
$devices_down = array();
$count = 0;
$down = 0;
foreach(dbFetchRows("SELECT * FROM devices WHERE location = ?", array($location)) as $device)
foreach (dbFetchRows("SELECT * FROM devices WHERE location = ?", array($location)) as $device)
{
$devices[] = $device['hostname'];
$count++;
if($device['status'] == "0") { $down++; $devices_down[] = $device['hostname']; }
if ($device['status'] == "0") { $down++; $devices_down[] = $device['hostname']; }
}
if(empty($devices_down)) { $devices_down[] = "No Problems"; }
if (empty($devices_down)) { $devices_down[] = "No Problems"; }
if($down > 0) { $state = 0; } else { $state = 100; }
if ($down > 0) { $state = 0; } else { $state = 100; }
$locations[] = "['".$location."',".$state.", '".implode(", ", $devices_down)."']";
@@ -55,11 +55,8 @@ echo(implode(",\n", $locations));
</script>
<div style="margin:0 auto;" id='chart_div'></div>
<?php
function generate_front_box ($background, $content)