If show all is used on the export then remove the domain name from the file name.

This commit is contained in:
markjcrane 2016-02-23 19:33:16 -07:00
parent 2874807570
commit e44cfabcb9
1 changed files with 219 additions and 209 deletions

View File

@ -42,12 +42,22 @@ else {
$rows_per_page = 0;
require_once "xml_cdr_inc.php";
//get the format
$export_format = check_str($_REQUEST['export_format']);
//get the format
$showall = check_str($_REQUEST['showall']);
//exprot the csv
if ($export_format == 'csv') {
//define file name
if ($_REQUEST['showall'] == 'true') {
$csv_filename = "cdr_".date("Ymd_His").".csv";
}
else {
$csv_filename = "cdr_".$_SESSION['domain_name']."_".date("Ymd_His").".csv";
}
//set the http headers
header('Content-type: application/octet-binary');
@ -88,11 +98,11 @@ if ($export_format == 'csv') {
if ($x > ($result_count-1)) {
break;
}
//$row++;
}
}
}
else if ($export_format == 'pdf') {
//export as a PDF
if ($export_format == 'pdf') {
//load pdf libraries
require_once("resources/tcpdf/tcpdf.php");