Update xml_cdr_inc.php

This commit is contained in:
FusionPBX
2017-04-08 15:17:52 -06:00
committed by GitHub
parent 952a24a1bd
commit 099fcaa385
+5 -13
View File
@@ -300,18 +300,13 @@
//set a default number of rows to show //set a default number of rows to show
$num_rows = '0'; $num_rows = '0';
//set a default CDR limit
if (!isset($_SESSION['cdr']['limit']['numeric'])) {
$_SESSION['cdr']['limit']['numeric'] = 1000;
}
//disable the paging //disable the paging
if ($_REQUEST['export_format'] == "csv") { $rows_per_page = 0; } if ($_REQUEST['export_format'] == "csv") { $rows_per_page = 0; }
if ($_REQUEST['export_format'] == "pdf") { $rows_per_page = 0; } if ($_REQUEST['export_format'] == "pdf") { $rows_per_page = 0; }
//page results if rows_per_page is greater than zero //page results if rows_per_page is greater than zero
if ($rows_per_page > 0) { if ($rows_per_page > 0) {
if ($_SESSION['cdr']['count']['boolean'] == "true") {
//get the number of rows in the v_xml_cdr //get the number of rows in the v_xml_cdr
$sql = "select count(uuid) as num_rows from v_xml_cdr "; $sql = "select count(uuid) as num_rows from v_xml_cdr ";
$sql .= "where domain_uuid = '".$domain_uuid."' ".$sql_where; $sql .= "where domain_uuid = '".$domain_uuid."' ".$sql_where;
@@ -327,16 +322,13 @@
} }
} }
unset($prep_statement, $result); unset($prep_statement, $result);
}
else {
//limit the number of results //limit the number of results
if ($num_rows > $_SESSION['cdr']['limit']['numeric']) { if ($_SESSION['cdr']['limit']['numeric'] > 0) {
$num_rows = $_SESSION['cdr']['limit']['numeric']; $num_rows = $_SESSION['cdr']['limit']['numeric'];
} }
else {
$num_rows = '1000'; //set the default paging
}
}
if ($_SESSION['domain']['paging']['numeric'] != '' && $rows_per_page > $_SESSION['domain']['paging']['numeric']) { if ($_SESSION['domain']['paging']['numeric'] != '' && $rows_per_page > $_SESSION['domain']['paging']['numeric']) {
$rows_per_page = $_SESSION['domain']['paging']['numeric']; $rows_per_page = $_SESSION['domain']['paging']['numeric'];
} }