Adam Amstrong d89b0632d8 improve billing graphs a little
git-svn-id: http://www.observium.org/svn/observer/trunk@1961 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-23 10:25:42 +00:00

31 lines
891 B
PHP

<?php
### Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
include("../includes/billing.php");
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 = mysql_fetch_assoc($bill_query);
$day_data = getDates($bill['bill_day']);
$datefrom = $day_data['0'];
$dateto = $day_data['1'];
$rates = getRates($_GET['id'], $datefrom, $dateto);
$ports = mysql_query("SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D
WHERE B.bill_id = '".mres($_GET['id'])."' AND P.interface_id = B.port_id
AND D.device_id = P.device_id");
$auth = TRUE;
}
?>