code standard/cleanups

git-svn-id: http://www.observium.org/svn/observer/trunk@1978 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-26 19:12:24 +00:00
parent ec7535c25a
commit 7454791074
19 changed files with 239 additions and 229 deletions
+2 -6
View File
@@ -7,8 +7,7 @@ include("../includes/functions.php"); ## FIXME zeropad()
if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted($_GET['id'])))
{
$bill_query = mysql_query("SELECT * FROM `bills` WHERE bill_id = '".mres($_GET['id'])."'");
$bill_query = mysql_query("SELECT * FROM `bills` WHERE bill_id = '".mres($_GET['id'])."'");
$bill = mysql_fetch_assoc($bill_query);
$day_data = getDates($bill['bill_day']);
@@ -22,9 +21,6 @@ if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted
AND D.device_id = P.device_id");
$auth = TRUE;
}
?>
?>
+4 -4
View File
@@ -4,10 +4,10 @@ $i = 1;
foreach (explode(",", $id) as $ifid)
{
if(strstr($ifid, "!"))
{
$rrd_inverted[$i] = TRUE;
$ifid = str_replace("!", "", $ifid);
if (strstr($ifid, "!"))
{
$rrd_inverted[$i] = TRUE;
$ifid = str_replace("!", "", $ifid);
}
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . $ifid . "' AND I.device_id = D.device_id");
@@ -51,6 +51,7 @@ while ($acc = mysql_fetch_array($query))
$mac = formatmac($acc['mac']);
$name = $mac;
$addy = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_mac where mac_address = '".$acc['mac']."' AND interface_id = '".$acc['interface_id']."'"));
if ($addy)
{
$name = $addy['ipv4_address'] . " (".$mac.")";
@@ -69,8 +70,9 @@ while ($acc = mysql_fetch_array($query))
$peer_info = mysql_fetch_array($peer_query);
$name .= " - AS".$peer_info['bgpPeerRemoteAs'];
}
if ($peer_info) {
if ($peer_info)
{
$asn = "AS".$peer_info['bgpPeerRemoteAs']; $astext = $peer_info['astext'];
} else {
unset ($as); unset ($astext); unset($asn);
+1 -1
View File
@@ -13,7 +13,7 @@ $rrd_options .= " COMMENT:' Size Free % Used\\n'";
$hostname = gethostbyid($storage['device_id']);
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
elseif ($iter=="4") { $colour="73880A"; } elseif ($iter=="5") { $colour="D01F3C"; } elseif ($iter=="6") { $colour="36393D"; }
elseif ($iter=="7") { $colour="FF0084"; $iter = "0"; }