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:
+15
-2
@@ -33,6 +33,8 @@ if (bill_permitted($bill_id))
|
||||
$day_data = getDates($dayofmonth);
|
||||
$datefrom = $day_data['0'];
|
||||
$dateto = $day_data['1'];
|
||||
$lastfrom = $day_data['2'];
|
||||
$lastto = $day_data['3'];
|
||||
$rate_data = getRates($bill_id,$datefrom,$dateto);
|
||||
$rate_95th = $rate_data['rate_95th'];
|
||||
$dir_95th = $rate_data['dir_95th'];
|
||||
@@ -57,6 +59,9 @@ if (bill_permitted($bill_id))
|
||||
$unixfrom = mysql_result(mysql_query("SELECT UNIX_TIMESTAMP('$datefrom')"), 0);
|
||||
$unixto = mysql_result(mysql_query("SELECT UNIX_TIMESTAMP('$dateto')"), 0);
|
||||
|
||||
$unix_prev_from = mysql_result(mysql_query("SELECT UNIX_TIMESTAMP('$lastfrom')"), 0);
|
||||
$unix_prev_to = mysql_result(mysql_query("SELECT UNIX_TIMESTAMP('$lastto')"), 0);
|
||||
|
||||
echo("<font face=\"Verdana, Arial, Sans-Serif\"><h2>
|
||||
Bill : " . $bill_name . "</h2>");
|
||||
|
||||
@@ -186,6 +191,12 @@ if (bill_permitted($bill_id))
|
||||
$yesterday = mysql_result(mysql_query("SELECT UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 DAY))"), 0);
|
||||
$rightnow = date(U);
|
||||
|
||||
|
||||
$li = "<img src='graph.php?type=bill_bits&id=" . $bill_id;
|
||||
$li .= "&from=" . $unix_prev_from . "&to=" . $unix_prev_to;
|
||||
$li .= "&width=715&height=200&total=1'>";
|
||||
|
||||
|
||||
# $di = "<img src='billing-graph.php?bill_id=" . $bill_id . "&bill_code=" . $_GET['bill_code'];
|
||||
# $di = $di . "&from=" . $yesterday . "&to=" . $rightnow . "&x=715&y=250";
|
||||
# $di = $di . "$type'>";
|
||||
@@ -247,7 +258,9 @@ if (bill_permitted($bill_id))
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("<h3>Billing View</h3>$bi<h3>24 Hour View</h3>$di");
|
||||
echo("<h3>Billing View</h3>$bi");
|
||||
echo("<h3>Previous Bill View</h3>$li");
|
||||
echo("<h3>24 Hour View</h3>$di");
|
||||
echo("<h3>Monthly View</h3>$mi");
|
||||
# echo("<br /><a href=\"rate.php?" . $_SERVER['QUERY_STRING'] . "&all=yes\">Graph All Data (SLOW)</a>");
|
||||
}
|
||||
@@ -258,4 +271,4 @@ else
|
||||
include("includes/error-no-perm.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user