mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -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).")'";
|
||||
|
||||
Reference in New Issue
Block a user