2010-07-31 21:08:35 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
### Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
|
|
|
|
|
2011-03-23 10:25:42 +00:00
|
|
|
include("../includes/billing.php");
|
|
|
|
|
2011-03-17 13:35:25 +00:00
|
|
|
if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted($_GET['id'])))
|
2010-07-31 21:08:35 +00:00
|
|
|
{
|
2011-03-26 19:12:24 +00:00
|
|
|
$bill_query = mysql_query("SELECT * FROM `bills` WHERE bill_id = '".mres($_GET['id'])."'");
|
2011-03-23 10:25:42 +00:00
|
|
|
$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);
|
|
|
|
|
2010-07-31 21:08:35 +00:00
|
|
|
$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");
|
|
|
|
|
2010-08-01 16:50:53 +00:00
|
|
|
$auth = TRUE;
|
2010-07-31 21:08:35 +00:00
|
|
|
}
|
|
|
|
|
2011-03-26 19:12:24 +00:00
|
|
|
?>
|