diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 6f1219edf7..b4462a49fb 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2014 the Initial Developer. All Rights Reserved. Contributor(s): diff --git a/app/xml_cdr/xml_cdr_csv.php b/app/xml_cdr/xml_cdr_csv.php index 47bb49b729..71263a13aa 100644 --- a/app/xml_cdr/xml_cdr_csv.php +++ b/app/xml_cdr/xml_cdr_csv.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -45,7 +45,7 @@ else { //set the csv headers $z = 0; foreach($result[0] as $key => $val) { - if ($key != "xml_cdr") { + if ($key != "xml" && $key != "json") { if ($z == 0) { echo '"'.$key.'"'; } @@ -62,7 +62,7 @@ else { while(true) { $z = 0; foreach($result[0] as $key => $val) { - if ($key != "xml_cdr") { + if ($key != "xml" && $key != "json") { if ($z == 0) { echo '"'.$result[$x][$key].'"'; } @@ -80,4 +80,5 @@ else { //$row++; } + ?> \ No newline at end of file diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index bc8ef7a6ef..e28d719b2a 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -191,9 +191,14 @@ else { if (strlen($order_by) == 0) { $order_by = "start_epoch"; } if (strlen($order) == 0) { $order = "desc"; } -//set the default +//set a default number of rows to show $num_rows = '0'; +//set a default CDR limit + if (!isset($_SESSION['cdr']['limit']['numeric'])) { + $_SESSION['cdr']['limit']['numeric'] = 800; + } + //page results if rows_per_page is greater than zero if ($rows_per_page > 0) { //get the number of rows in the v_xml_cdr @@ -210,6 +215,14 @@ else { } } unset($prep_statement, $result); + + //limit the number of results + if ($num_rows > $_SESSION['cdr']['limit']['numeric']) { + $num_rows = $_SESSION['cdr']['limit']['numeric']; + } + if ($rows_per_page > $_SESSION['cdr']['limit']['numeric']) { + $rows_per_page = $_SESSION['cdr']['limit']['numeric']; + } //prepare to page the results //$rows_per_page = 150; //set on the page that includes this page @@ -222,7 +235,10 @@ else { //get the results from the db $sql = "select * from v_xml_cdr where domain_uuid = '".$domain_uuid."' ".$sql_where; if (strlen($order_by)> 0) { $sql .= " order by ".$order_by." ".$order." "; } - if ($rows_per_page > 0) { + if ($rows_per_page == 0) { + $sql .= " limit ".$_SESSION['cdr']['limit']['numeric']." offset 0 "; + } + else { $sql .= " limit ".$rows_per_page." offset ".$offset." "; } $prep_statement = $db->prepare(check_sql($sql));