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->domain_uuid = $_SESSION['domain_uuid'];
$cdr->quick_select = $quick_select;
$cdr->start_stamp_begin = $start_stamp_begin;
$cdr->start_stamp_end = $start_stamp_end;
$cdr->include_internal = $include_internal;
$summary = $cdr->user_summary();
//set the http header
if ($_REQUEST['type'] == "csv") {
    //set the headers
    header('Content-type: application/octet-binary');
    header('Content-Disposition: attachment; filename=cdr-statistics.csv');
    //show the column names on the first line
    $z = 0;
    foreach ($summary[1] as $key => $val) {
        if ($z == 0) {
Ejemplo n.º 2
0
	The Initial Developer of the Original Code is
	Mark J Crane <*****@*****.**>
	Portions created by the Initial Developer are Copyright (C) 2016
	the Initial Developer. All Rights Reserved.

	Contributor(s):
	Mark J Crane <*****@*****.**>
*/
//check the permission
if (defined('STDIN')) {
    $document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
    preg_match("/^(.*)\\/app\\/.*\$/", $document_root, $matches);
    $document_root = $matches[1];
    set_include_path($document_root);
    $_SERVER["DOCUMENT_ROOT"] = $document_root;
    require_once "resources/require.php";
    $display_type = 'text';
    //html, text
} else {
    include "root.php";
    require_once "resources/require.php";
    require_once "resources/pdo.php";
}
//increase limits
set_time_limit(3600);
ini_set('memory_limit', '256M');
ini_set("precision", 6);
//import from the file system
$cdr = new xml_cdr();
$cdr->read_files();