←':''; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){ header('location: index.php'); exit; } //Defaults $contract = [ 'type' => (isset($_GET['type'])? $_GET['type'] : ''), 'billing_plan' => (isset($_GET['billing_plan'])? $_GET['billing_plan'] : ''), 'year' => (isset($_GET['year'])? $_GET['year'] : ''), 'month' => (isset($_GET['month'])? $_GET['month'] : '') ]; //GET PARAMETERS $pagination_page = isset($_GET['p']) ? $_GET['p'] : 1; $status = isset($_GET['status']) ? '&status='.$_GET['status'] : ''; $search = isset($_GET['search']) ? '&search='.$_GET['search'] : ''; // Determine the URL $url = 'index.php?page=report_contracts_billing'.$status.$search; //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v2/billing/'.$GET_VALUES; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = null;} //Return QueryTotal from API $api_url = '/v2/billing/'.$GET_VALUES.'&totals='; $query_total = ioServer($api_url,''); //Decode Payload if (!empty($query_total)){$query_total = json_decode($query_total,true);}else{$query_total = 0;} template_header('reports', 'report_contracts_billing','view'); $view = '
'.$contract_p .'
| # | '.$contract_status.' | '.$contract_account.' | '.$contract_type.' | '.$contract_billinglabel.' | '.$contract_start_date.' | '.$contract_end_date.' | '.$contract_reference.' | '.$contract_billing_count.' | '.$contract_service_2.' | '.$contract_overrun.' | '.$contract_reference.' |
|---|---|---|---|---|---|---|---|---|---|---|---|
| '.$message_no_contract.' | |||||||||||
| '.$response['#'].' | '.(($response['Status'] == $contract_status1)? ''.$response['Status']: (($response['Status'] == $contract_status3) ? ''.$response['Status'] : ''.$response['Status'])).' | '.$response['Account'].' | '.$response['Type'].' | '.$response['Billingplan'].' | '.$response['Start date'].' | '.$response['End date'].' | '.$response['Reference'].' | '.$response['Consumed'].' | '.$response['Contracted'].' | '.$response['Deviation'].' | '.$response['Period'].' |