2010-07-31 21:08:35 +00:00
< ? php
2012-05-25 12:24:34 +00:00
// Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
2015-07-10 13:36:21 +02:00
require '../includes/billing.php' ;
2010-07-31 21:08:35 +00:00
2015-07-10 13:36:21 +02:00
if ( is_numeric ( $_GET [ 'id' ]) && ( $auth || bill_permitted ( $_GET [ 'id' ]))) {
$bill = dbFetchRow ( 'SELECT * FROM `bills` WHERE bill_id = ?' , array ( $_GET [ 'id' ]));
2011-03-23 10:25:42 +00:00
2015-07-10 13:36:21 +02:00
$datefrom = date ( 'YmdHis' , $_GET [ 'from' ]);
$dateto = date ( 'YmdHis' , $_GET [ 'to' ]);
2011-04-08 11:25:13 +00:00
2015-07-10 13:36:21 +02:00
$rates = getRates ( $_GET [ 'id' ], $datefrom , $dateto );
2011-03-23 10:25:42 +00:00
2015-07-10 13:36:21 +02:00
$ports = dbFetchRows ( 'SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = ? AND P.port_id = B.port_id AND D.device_id = P.device_id' , array ( $_GET [ 'id' ]));
2011-03-23 10:25:42 +00:00
2015-07-10 13:36:21 +02:00
$auth = true ;
2010-07-31 21:08:35 +00:00
}