Portions created by the Initial Developer are Copyright (C) 2008-2016 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane Luis Daniel Lucio Quiroz */ //includes require_once "root.php"; require_once "resources/require.php"; //permisisions require_once "resources/check_auth.php"; 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 "resources/header.php"; //retrieve submitted data $quick_select = check_str($_REQUEST['quick_select']); $start_stamp_begin = check_str($_REQUEST['start_stamp_begin']); $start_stamp_end = check_str($_REQUEST['start_stamp_end']); $include_internal = check_str($_REQUEST['include_internal']); $quick_select = (sizeof($_REQUEST) == 0) ? 1 : $quick_select; //set default //get the summary $cdr = new xml_cdr; $cdr->quick_select = $quick_select; $cdr->start_stamp_begin = $start_stamp_begin; $cdr->start_stamp_end = $start_stamp_end; $cdr->include_internal = $include_internal; $cdr->quick_select = $quick_select; $extensions = $cdr->extensions; $summary = $cdr->user_summary(); //page title and description echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['title-extension_summary']."

\n"; echo "
"; if (permission_exists('xml_cdr_all') && $_GET['showall'] != 'true') { echo " \n"; } echo "
\n"; echo "
\n"; if (permission_exists('xml_cdr_search')) { echo "
\n"; echo "\n"; echo " \n"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-preset']."\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-start_date_time']."\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-end_date_time']."\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-include_internal']."\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
"; echo " \n"; echo " \n"; echo "
"; echo "
"; echo "

"; } //show the results echo "\n"; echo " \n"; if ($_GET['showall'] && permission_exists('xml_cdr_all')) { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; if (isset($extensions)) foreach ($extensions as $extension => $row) { $seconds['inbound'] = $summary[$extension]['inbound']['seconds']; $seconds['outbound'] = $summary[$extension]['outbound']['seconds']; if ($summary[$extension]['missed'] == null) { $summary[$extension]['missed'] = 0; } if ($summary[$extension]['no_answer'] == null) { $summary[$extension]['no_answer'] = 0; } if ($summary[$extension]['busy'] == null) { $summary[$extension]['busy'] = 0; } //missed $missed = $summary[$extension]['missed']; //volume $volume = $summary[$extension]['inbound']['count'] + $summary[$extension]['outbound']['count']; //average length of call $summary[$extension]['aloc'] = $volume==0 ? 0 : ($seconds['inbound'] + $seconds['outbound']) / ($volume - $missed); $tr_link = "xhref='xml_cdr.php?'"; echo "\n"; if ($_GET['showall'] && permission_exists('xml_cdr_all')) { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; $c = ($c==0) ? 1 : 0; } echo "
".$text['label-domain']."".$text['label-extension']."".$text['label-number_alias']."".$text['label-missed']."".$text['label-no_answer']."".$text['label-busy']."".$text['label-aloc']."".$text['label-inbound_calls']."".$text['label-inbound_duration']."".$text['label-outbound_calls']."".$text['label-outbound_duration']."".$text['label-description']."
".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."".$extension."".$row['number_alias']." ".$summary[$extension]['missed']." ".$summary[$extension]['no_answer']." ".$summary[$extension]['busy']." ".gmdate("H:i:s",$summary[$extension]['aloc'])."  ".(($summary[$extension]['inbound']['count'] != '') ? $summary[$extension]['inbound']['count'] : "0")."".(($seconds['inbound'] != '') ? gmdate("G:i:s", $seconds['inbound']) : '0:00:00')." ".(($summary[$extension]['outbound']['count'] != '') ? $summary[$extension]['outbound']['count'] : "0")."".(($seconds['outbound'] != '') ? gmdate("G:i:s", $seconds['outbound']) : '0:00:00')."".$row['description']." 
"; echo "

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