diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index a7587d2d3..003ef41a8 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -174,20 +174,6 @@ class Application_Service_HistoryService " LEFT JOIN {$filter} USING(history_id)"; } - //---------------------------------------------------------------------- - //need to count the total rows to tell Datatables. - $stmt = $this->con->prepare($mainSqlQuery); - foreach ($paramMap as $param => $v) { - $stmt->bindValue($param, $v); - } - - if ($stmt->execute()) { - $totalRows = $stmt->rowCount(); - } - else { - $msg = implode(',', $stmt->errorInfo()); - throw new Exception("Error: $msg"); - } //----------------------------------------------------------------------- //Using the instance_id to filter the data. @@ -199,6 +185,21 @@ class Application_Service_HistoryService $paramMap["instance"] = $instanceId; } + + //---------------------------------------------------------------------- + //need to count the total rows to tell Datatables. + $stmt = $this->con->prepare($mainSqlQuery); + foreach ($paramMap as $param => $v) { + $stmt->bindValue($param, $v); + } + + if ($stmt->execute()) { + $totalRows = $stmt->rowCount(); + } + else { + $msg = implode(',', $stmt->errorInfo()); + throw new Exception("Error: $msg"); + } //------------------------------------------------------------------------ //Using Datatables parameters to sort the data. diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 9d9a7c750..5baeb3f26 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -53,7 +53,11 @@ var AIRTIME = (function(AIRTIME) { var dateStartId = "#his_date_start", timeStartId = "#his_time_start", dateEndId = "#his_date_end", - timeEndId = "#his_time_end"; + timeEndId = "#his_time_end", + + oTableAgg, + oTableItem, + oTableShow; function getSelectedLogItems() { var items = Object.keys(selectedLogItems); @@ -168,24 +172,23 @@ var AIRTIME = (function(AIRTIME) { } ); } - //config: name, type, filemd, required function createShowAccordSection(config) { var template, $el; template = - "