Disable limit and offset when exporting CDR to CSV.

This commit is contained in:
markjcrane
2016-05-04 22:35:05 -06:00
parent 097a5d8ade
commit f3ef1154e2

View File

@@ -299,6 +299,11 @@ else {
$rows_per_page = 50;
}
//disable the paging
if ($_REQUEST['export_format'] != "csv") {
$rows_per_page = 0;
}
//prepare to page the results
//$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; //set on the page that includes this page
$page = $_GET['page'];
@@ -348,11 +353,13 @@ else {
}
$sql .= $sql_where;
if (strlen($order_by)> 0) { $sql .= " order by ".$order_by." ".$order." "; }
if ($rows_per_page == 0) {
$sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 ";
}
else {
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
if ($_REQUEST['export_format'] != "csv") {
if ($rows_per_page == 0) {
$sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 ";
}
else {
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
}
}
$sql= str_replace(" ", " ", $sql);
$sql= str_replace("where and", "where", $sql);