←':''; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){ header('location: index.php'); exit; } //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=communications'.$status.$search; //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v1/communications/'.$GET_VALUES; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;} //Return QueryTotal from API $api_url = '/v1/communications/'.$GET_VALUES.'&totals='; $query_total = ioServer($api_url,''); //Decode Payload if (!empty($query_total)){$query_total = decode_payload($query_total);}else{$query_total = null;} // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = $message_comm_1; } if ($_GET['success_msg'] == 2) { $success_msg = $message_comm_2; } if ($_GET['success_msg'] == 3) { $success_msg = $message_comm_3; } if ($_GET['success_msg'] == 4) { $success_msg = $message_comm_4; } } template_header('Communications', 'communications','view'); $view = '

'.$communication_h2.' ('.$query_total.')

'.$communication_p.'

'.$back_btn_orgin.'
'; if (isset($success_msg)){ $view .= '

'.$success_msg.'

'; } $view .= '
'.$button_create_communication.''; if (isAllowed('communication_send',$_SESSION['profile'],$_SESSION['permission'],'U') === 1){ $view .= ''.$button_create_communication_send.''; } $view .= '
'.$general_filters.'
'; $view .= '
'; if (empty($responses)){ $view .= ' '; } else { foreach ($responses as $response){ $status = 'coms_status_'.$response->status; $type = 'coms_type_'.$response->coms_type; $view .= ' '; } } $view .= '
'.$communication_status.' '.$communication_type.' '.$communication_partner.' '.$communication_email.' '.$communication_firmware.' '.$communication_service.' '.$communication_marketing.'
'.$message_no_communication.'
'.(($response->status == 1)? ''.$$status:''.$$status).' '.$$type.' '.$response->partnerID.' '.$response->email.' type_1 == 1 ?' checked':'').'/> type_2 == 1 ?' checked':'').'/> type_3 == 1 ?' checked':'').'/>
'; $view.=''; //OUTPUT echo $view; template_footer(); ?>