Update xml_cdr_statistics.php

This commit is contained in:
FusionPBX
2018-02-01 16:00:18 -07:00
committed by GitHub
parent 9ca50ca815
commit 37eefcd572

View File

@@ -23,16 +23,19 @@
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('xml_cdr_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//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;
@@ -42,27 +45,106 @@ else {
require_once "xml_cdr_statistics_inc.php";
require_once "resources/header.php";
//page title and description
//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 "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo " <td width='30%' align='left' valign='top' nowrap='nowrap'><b>".$text['label-call-statistics']."</b></td>\n";
echo " <td width='70%' align='right' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='xml_cdr.php'\" value='".$text['button-back']."'>\n";
if (permission_exists('xml_cdr_search_advanced')) {
$advenced_search_url = 'xml_cdr_search.php?redirect=xml_cdr_statistics';
if(permission_exists('xml_cdr_all') && (@$_GET['showall'] === 'true')){
$advenced_search_url .= '&showall=true';
}
echo " <input type='button' class='btn' value='".$text['button-advanced_search']."' onclick=\"window.location='$advenced_search_url';\">\n";
echo " <input type='button' class='btn' value='".$text['button-advanced_search']."' onclick=\"window.location='xml_cdr_search.php?type=advanced".$search_url."';\">\n";
}
if (permission_exists('xml_cdr_all')) {
if ($_GET['showall'] != 'true') {
echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='xml_cdr_statistics.php?showall=true';\">\n";
echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='xml_cdr_statistics.php?showall=true".$search_url."';\">\n";
}
}
echo " <input type='button' class='btn' value='".$text['button-extension_summary']."' onclick=\"document.location.href='xml_cdr_extension_summary.php';\">\n";
echo " <input type='button' class='btn' value='".$text['button-download_csv']."' onclick=\"document.location.href='xml_cdr_statistics_csv.php';\">\n";
echo " <input type='button' class='btn' value='".$text['button-download_csv']."' onclick=\"document.location.href='xml_cdr_statistics_csv.php?type=csv".$search_url."';\">\n";
echo " </td>\n";
echo "</tr>\n";
echo "<tr>\n";
@@ -253,4 +335,4 @@ else {
//show the footer
require_once "resources/footer.php";
?>
?>