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-05-13 12:49:23 +00:00
$bill = dbFetchRow ( " SELECT * FROM `bills` WHERE bill_id = ? " , array ( $_GET [ 'id' ]));
2011-04-08 11:25:13 +00:00
2011-05-13 12:49:23 +00:00
$datefrom = date ( 'YmdHis' , $_GET [ 'from' ]);
$dateto = date ( 'YmdHis' , $_GET [ 'to' ]);
2011-03-23 10:25:42 +00:00
$rates = getRates ( $_GET [ 'id' ], $datefrom , $dateto );
2011-05-13 12:49:23 +00:00
$ports = dbFetchRows ( " SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = ? AND P.interface_id = B.port_id AND D.device_id = P.device_id " , array ( $_GET [ 'id' ]));
2010-07-31 21:08:35 +00:00
2010-08-01 16:50:53 +00:00
$auth = TRUE ;
2010-07-31 21:08:35 +00:00
}
2011-04-08 11:25:13 +00:00
?>