hacks to billing (this shit needs rewritten so badly)

git-svn-id: http://www.observium.org/svn/observer/trunk@2034 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-08 11:25:13 +00:00
parent 9b1ec8050d
commit e291e39781
3 changed files with 30 additions and 8 deletions

View File

@@ -9,9 +9,18 @@ if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted
$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']);
$datefrom = $day_data['0'];
$dateto = $day_data['1'];
# $day_data = getDates($bill['bill_day']);
# $datefrom = $day_data['0'];
# $dateto = $day_data['1'];
#print_r($day_data);
$datefrom = date('YmdHis', $_GET['from']);
$dateto = date('YmdHis', $_GET['to']);
$rates = getRates($_GET['id'], $datefrom, $dateto);
@@ -22,4 +31,4 @@ if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted
$auth = TRUE;
}
?>
?>

View File

@@ -28,8 +28,8 @@ $rra_out = "OUTOCTETS";
if($bill['bill_type'] == "cdr") {
$custom_graph = " COMMENT:'\\r' ";
$custom_graph .= " HRULE:" . $rates['rate_average'] * 1000 . "#cc0000:'95th %ile \: ".formatRates($rates['rate_95th']*1000)." (".$rates['dir_95th'].") (CDR\: ".formatRates($bill['bill_cdr']*1000).")'";
$custom_graph .= " HRULE:" . $rates['rate_average'] * 1000 * -1 . "#cc0000";
$custom_graph .= " HRULE:" . $rates['rate_95th'] * 1000 . "#cc0000:'95th %ile \: ".formatRates($rates['rate_95th']*1000)." (".$rates['dir_95th'].") (CDR\: ".formatRates($bill['bill_cdr']*1000).")'";
$custom_graph .= " HRULE:" . $rates['rate_95th'] * 1000 * -1 . "#cc0000";
} elseif($bill['bill_type'] == "quota") {
$custom_graph = " COMMENT:'\\r' ";
$custom_graph .= " HRULE:" . $rates['rate_average'] * 1000 . "#cc0000:'Usage \: ".formatStorage($rates['total_data']*1024*1024)." (".formatRates($rates['rate_average']*1000).")'";