show tables filtering by instance id.
This commit is contained in:
parent
803409f151
commit
5780eb5bbe
2 changed files with 55 additions and 32 deletions
|
@ -174,6 +174,18 @@ class Application_Service_HistoryService
|
||||||
" LEFT JOIN {$filter} USING(history_id)";
|
" LEFT JOIN {$filter} USING(history_id)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
//Using the instance_id to filter the data.
|
||||||
|
|
||||||
|
if (isset($instanceId)) {
|
||||||
|
|
||||||
|
$mainSqlQuery.=
|
||||||
|
" WHERE history_range.instance_id = :instance";
|
||||||
|
|
||||||
|
$paramMap["instance"] = $instanceId;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
//need to count the total rows to tell Datatables.
|
//need to count the total rows to tell Datatables.
|
||||||
$stmt = $this->con->prepare($mainSqlQuery);
|
$stmt = $this->con->prepare($mainSqlQuery);
|
||||||
|
@ -189,17 +201,6 @@ class Application_Service_HistoryService
|
||||||
throw new Exception("Error: $msg");
|
throw new Exception("Error: $msg");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
//Using the instance_id to filter the data.
|
|
||||||
|
|
||||||
if (isset($instanceId)) {
|
|
||||||
|
|
||||||
$mainSqlQuery.=
|
|
||||||
" WHERE history_range.instance_id = :instance";
|
|
||||||
|
|
||||||
$paramMap["instance"] = $instanceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
//Using Datatables parameters to sort the data.
|
//Using Datatables parameters to sort the data.
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,11 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
var dateStartId = "#his_date_start",
|
var dateStartId = "#his_date_start",
|
||||||
timeStartId = "#his_time_start",
|
timeStartId = "#his_time_start",
|
||||||
dateEndId = "#his_date_end",
|
dateEndId = "#his_date_end",
|
||||||
timeEndId = "#his_time_end";
|
timeEndId = "#his_time_end",
|
||||||
|
|
||||||
|
oTableAgg,
|
||||||
|
oTableItem,
|
||||||
|
oTableShow;
|
||||||
|
|
||||||
function getSelectedLogItems() {
|
function getSelectedLogItems() {
|
||||||
var items = Object.keys(selectedLogItems);
|
var items = Object.keys(selectedLogItems);
|
||||||
|
@ -168,24 +172,23 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
//config: name, type, filemd, required
|
|
||||||
function createShowAccordSection(config) {
|
function createShowAccordSection(config) {
|
||||||
var template,
|
var template,
|
||||||
$el;
|
$el;
|
||||||
|
|
||||||
template =
|
template =
|
||||||
"<h3 " +
|
"<h3>" +
|
||||||
"data-instance='<%= instance %>' " +
|
|
||||||
"data-starts='<%= starts %>' " +
|
|
||||||
"data-ends='<%= ends %>'" +
|
|
||||||
">" +
|
|
||||||
"<a href='#'>" +
|
"<a href='#'>" +
|
||||||
"<span><%= name %></span>" +
|
"<span><%= name %></span>" +
|
||||||
"<span><%= starts %></span>" +
|
"<span><%= starts %></span>" +
|
||||||
"<span><%= ends %></span>" +
|
"<span><%= ends %></span>" +
|
||||||
"</a>" +
|
"</a>" +
|
||||||
"</h3>" +
|
"</h3>" +
|
||||||
"<div>First content panel</div>";
|
"<div " +
|
||||||
|
"data-instance='<%= instance %>' " +
|
||||||
|
"data-starts='<%= starts %>' " +
|
||||||
|
"data-ends='<%= ends %>'" +
|
||||||
|
"></div>";
|
||||||
|
|
||||||
template = _.template(template);
|
template = _.template(template);
|
||||||
$el = $(template(config));
|
$el = $(template(config));
|
||||||
|
@ -196,7 +199,19 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
//$el is the div in the accordian we should create the table on.
|
//$el is the div in the accordian we should create the table on.
|
||||||
function createShowTable($el) {
|
function createShowTable($el) {
|
||||||
|
|
||||||
oTableShow = itemHistoryTable("history_table_list");
|
var instance = $el.data("instance");
|
||||||
|
var $table = $("<table/>", {
|
||||||
|
'cellpadding': "0",
|
||||||
|
'cellspacing': "0",
|
||||||
|
'class': "datatable",
|
||||||
|
'id': "history_table_show"
|
||||||
|
});
|
||||||
|
|
||||||
|
//assign the retrieval function the show instance id.
|
||||||
|
fnServerData.instance = instance;
|
||||||
|
$el.append($table);
|
||||||
|
$el.css("height", "auto");
|
||||||
|
oTableShow = itemHistoryTable("history_table_show");
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawShowList(oShows) {
|
function drawShowList(oShows) {
|
||||||
|
@ -224,20 +239,18 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
$showList.accordion({
|
$showList.accordion({
|
||||||
create: function( event, ui ) {
|
create: function( event, ui ) {
|
||||||
var $div = $showList.find(".ui-accordion-content-active");
|
var $div = $showList.find(".ui-accordion-content-active");
|
||||||
|
createShowTable($div);
|
||||||
},
|
},
|
||||||
change: function( event, ui ) {
|
change: function( event, ui ) {
|
||||||
var x;
|
var $div = $(ui.newContent);
|
||||||
|
createShowTable($div);
|
||||||
},
|
},
|
||||||
changestart: function( event, ui ) {
|
changestart: function( event, ui ) {
|
||||||
var x;
|
$(ui.oldContent).empty();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawShowTable() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function createToolbarButtons ($el) {
|
function createToolbarButtons ($el) {
|
||||||
var $menu = $("<div class='btn-toolbar' />");
|
var $menu = $("<div class='btn-toolbar' />");
|
||||||
|
|
||||||
|
@ -399,9 +412,6 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
var oBaseDatePickerSettings,
|
var oBaseDatePickerSettings,
|
||||||
oBaseTimePickerSettings,
|
oBaseTimePickerSettings,
|
||||||
oTableAgg,
|
|
||||||
oTableItem,
|
|
||||||
oTableShow,
|
|
||||||
$hisDialogEl,
|
$hisDialogEl,
|
||||||
|
|
||||||
tabsInit = [
|
tabsInit = [
|
||||||
|
@ -409,18 +419,27 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
initialized: false,
|
initialized: false,
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
oTableItem = itemHistoryTable("history_table_list");
|
oTableItem = itemHistoryTable("history_table_list");
|
||||||
|
},
|
||||||
|
navigate: function() {
|
||||||
|
delete fnServerData.instance;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
initialized: false,
|
initialized: false,
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
oTableAgg = aggregateHistoryTable();
|
oTableAgg = aggregateHistoryTable();
|
||||||
|
},
|
||||||
|
navigate: function() {
|
||||||
|
delete fnServerData.instance;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
initialized: false,
|
initialized: false,
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
showSummaryList();
|
showSummaryList();
|
||||||
|
},
|
||||||
|
navigate: function() {
|
||||||
|
showSummaryList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -617,6 +636,9 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
tab.initialize();
|
tab.initialize();
|
||||||
tab.initialized = true;
|
tab.initialized = true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
tab.navigate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue