Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('xml_cdr_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //additional includes require_once "xml_cdr_statistics_inc.php"; require_once "resources/header.php"; //search url $search_url = ''; if (permission_exists('xml_cdr_search_advanced')) { $search_url .= '&redirect=xml_cdr_statistics'; } if(permission_exists('xml_cdr_all') && ($_GET['showall'] === 'true')){ $search_url .= '&showall=true'; } if (strlen($_GET['direction']) > 0) { $search_url .= '&direction='.$_GET['direction']; } if (strlen($_GET['leg']) > 0) { $search_url .= '&leg='.$_GET['leg']; } if (strlen($_GET['caller_id_name']) > 0) { $search_url .= '&caller_id_name='.$_GET['caller_id_name']; } if (strlen($_GET['caller_extension_uuid']) > 0) { $search_url .= '&caller_extension_uuid='.$_GET['caller_extension_uuid']; } if (strlen($_GET['caller_id_number']) > 0) { $search_url .= '&caller_id_number='.$_GET['caller_id_number']; } if (strlen($_GET['destination_number']) > 0) { $search_url .= '&destination_number='.$_GET['destination_number']; } if (strlen($_GET['context']) > 0) { $search_url .= '&context='.$_GET['context']; } if (strlen($_GET['start_stamp_begin']) > 0) { $search_url .= '&start_stamp_begin='.$_GET['start_stamp_begin']; } if (strlen($_GET['start_stamp_end']) > 0) { $search_url .= '&start_stamp_end='.$_GET['start_stamp_end']; } if (strlen($_GET['answer_stamp_begin']) > 0) { $search_url .= '&answer_stamp_begin='.$_GET['answer_stamp_begin']; } if (strlen($_GET['answer_stamp_end']) > 0) { $search_url .= '&answer_stamp_end='.$_GET['answer_stamp_end']; } if (strlen($_GET['end_stamp_begin']) > 0) { $search_url .= '&end_stamp_begin='.$_GET['end_stamp_begin']; } if (strlen($_GET['end_stamp_end']) > 0) { $search_url .= '&end_stamp_end='.$_GET['end_stamp_end']; } if (strlen($_GET['duration']) > 0) { $search_url .= '&duration='.$_GET['duration']; } if (strlen($_GET['billsec']) > 0) { $search_url .= '&billsec='.$_GET['billsec']; } if (strlen($_GET['hangup_cause']) > 0) { $search_url .= '&hangup_cause='.$_GET['hangup_cause']; } if (strlen($_GET['uuid']) > 0) { $search_url .= '&uuid='.$_GET['uuid']; } if (strlen($_GET['bleg_uuid']) > 0) { $search_url .= '&bleg_uuid='.$_GET['bleg_uuid']; } if (strlen($_GET['accountcode']) > 0) { $search_url .= '&accountcode='.$_GET['accountcode']; } if (strlen($_GET['read_codec']) > 0) { $search_url .= '&read_codec='.$_GET['read_codec']; } if (strlen($_GET['write_codec']) > 0) { $search_url .= '&write_codec='.$_GET['write_codec']; } if (strlen($_GET['remote_media_ip']) > 0) { $search_url .= '&remote_media_ip='.$_GET['remote_media_ip']; } if (strlen($_GET['network_addr']) > 0) { $search_url .= '&network_addr='.$_GET['network_addr']; } if (strlen($_GET['mos_comparison']) > 0) { $search_url .= '&mos_comparison='.$_GET['mos_comparison']; } if (strlen($_GET['mos_score']) > 0) { $search_url .= '&mos_score='.$_GET['mos_score']; } //page title and description echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "
".$text['label-call-statistics']."\n"; echo " \n"; if (permission_exists('xml_cdr_search_advanced')) { echo " \n"; } if (permission_exists('xml_cdr_all')) { if ($_GET['showall'] != 'true') { echo "\n"; } } echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-call-statistics-description']." \n"; echo "
\n"; echo "
\n"; echo "
\n"; //set the style $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; ?>

\n"; echo "\n"; echo " ".$text['table-hours']."\n"; echo " ".$text['table-date']."\n"; echo " ".$text['table-time']."\n"; echo " Volume\n"; echo " ".$text['table-minutes']."\n"; echo " ".$text['table-calls-per-minute']."\n"; echo " ".$text['table-missed']."\n"; echo " ASR\n"; echo " ALOC\n"; echo "\n"; $i = 0; foreach ($stats as $row) { echo "\n"; if ($i <= $hours) { echo " ".($i+1)."\n"; } elseif ($i == $hours+1) { echo "

\n"; echo "\n"; echo "\n"; echo " \n"; echo "

\n"; echo " \n"; echo "\n"; echo "\n"; echo " ".$text['table-days']."\n"; echo " ".$text['table-date']."\n"; echo " ".$text['table-time']."\n"; echo " Volume\n"; echo " ".$text['table-minutes']."\n"; echo " ".$text['table-calls-per-minute']."\n"; echo " ".$text['table-missed']."\n"; echo " ASR\n"; echo " ALOC\n"; echo "\n"; echo "\n"; } if ($i > $hours) { echo " " . floor($row['hours']/24) . "\n"; } if ($i <= $hours) { echo " ".date('j M', $row['start_epoch'])."\n"; echo " ".date('H:i', $row['start_epoch'])." - ".date('H:i', $row['stop_epoch'])." \n"; } else { echo " ".date('j M', $row['start_epoch'])." \n"; echo " ".date('H:i', $row['start_epoch'])." - ".date('j M H:i', $row['stop_epoch'])." \n"; } echo " ".$row['volume']." \n"; echo " ".(round($row['minutes'],2))." \n"; echo " ".(round($row['avg_min'],2))." / ".(round($row['cpm_ans'],2))." \n"; echo " ".$row['missed']." \n"; echo " ".(round($row['asr'],2))." \n"; echo " ".(round($row['aloc'],2))." \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } $i++; } echo "\n"; echo "

"; //show the footer require_once "resources/footer.php"; ?>