|
@@ -1,4 +1,5 @@
|
|
|
var tables = [];
|
|
var tables = [];
|
|
|
|
|
+var table_updates = [];
|
|
|
var editors = [];
|
|
var editors = [];
|
|
|
var rows = {};
|
|
var rows = {};
|
|
|
|
|
|
|
@@ -9,6 +10,7 @@ function initializeRoutes()
|
|
|
router('/logout', routes['logout']);
|
|
router('/logout', routes['logout']);
|
|
|
router('/sd', routes['sd']);
|
|
router('/sd', routes['sd']);
|
|
|
|
|
|
|
|
|
|
+ router('/', routes['login']);
|
|
|
router('*', routes['login']);
|
|
router('*', routes['login']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -26,9 +28,7 @@ var routes =
|
|
|
logout: function()
|
|
logout: function()
|
|
|
{
|
|
{
|
|
|
$.post('api/logout.php');
|
|
$.post('api/logout.php');
|
|
|
-
|
|
|
|
|
- showPage('login');
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
router('/');
|
|
router('/');
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -76,7 +76,7 @@ function showPage(page)
|
|
|
|
|
|
|
|
function loadAllData()
|
|
function loadAllData()
|
|
|
{
|
|
{
|
|
|
- $.post('api/getAllData.php', 'json')
|
|
|
|
|
|
|
+ $.post('api/getRows.php', 'json')
|
|
|
.done(function(companies)
|
|
.done(function(companies)
|
|
|
{
|
|
{
|
|
|
//go through each company and add a tab if one isn't present
|
|
//go through each company and add a tab if one isn't present
|
|
@@ -109,11 +109,13 @@ function loadAllData()
|
|
|
//add table
|
|
//add table
|
|
|
$('<div id="table-' + id_company + '-container" class="tab-pane fade in">'
|
|
$('<div id="table-' + id_company + '-container" class="tab-pane fade in">'
|
|
|
+ '<table id="table-' + id_company + '" class="table table-striped editable" width="100%"></table>'
|
|
+ '<table id="table-' + id_company + '" class="table table-striped editable" width="100%"></table>'
|
|
|
|
|
+ + '<table id="table-updates-' + id_company + '" class="table table-striped editable" width="100%"></table>'
|
|
|
+ '</div>')
|
|
+ '</div>')
|
|
|
.appendTo('#screen-sd .tab-content');
|
|
.appendTo('#screen-sd .tab-content');
|
|
|
|
|
|
|
|
//create the datatable
|
|
//create the datatable
|
|
|
tables[id_company] = createTable(id_company, '#screen-sd #table-' + id_company);
|
|
tables[id_company] = createTable(id_company, '#screen-sd #table-' + id_company);
|
|
|
|
|
+ table_updates[id_company] = createUpdatesTable(id_company, '#screen-sd #table-updates-' + id_company);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -122,6 +124,8 @@ function loadAllData()
|
|
|
|
|
|
|
|
//load the data into the data
|
|
//load the data into the data
|
|
|
tables[id_company].rows.add(company['file_rows']).draw();
|
|
tables[id_company].rows.add(company['file_rows']).draw();
|
|
|
|
|
+
|
|
|
|
|
+ table_updates[id_company].rows.add(company['row_updates']).draw();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if($('#screen-sd ul.nav-tabs > li.active').length === 0)
|
|
if($('#screen-sd ul.nav-tabs > li.active').length === 0)
|
|
@@ -184,7 +188,7 @@ function createTable(id_company, table_dom)
|
|
|
'language':
|
|
'language':
|
|
|
{
|
|
{
|
|
|
'search': '',
|
|
'search': '',
|
|
|
- 'searchPlaceholder': "Search"
|
|
|
|
|
|
|
+ 'searchPlaceholder': "Search Active"
|
|
|
},
|
|
},
|
|
|
'deferRender': true,
|
|
'deferRender': true,
|
|
|
'lengthChange': false,
|
|
'lengthChange': false,
|
|
@@ -241,7 +245,7 @@ function createTable(id_company, table_dom)
|
|
|
|
|
|
|
|
|
|
|
|
|
//send the update up to the server thru api
|
|
//send the update up to the server thru api
|
|
|
- $.post('api/updateCell.php?id_file_row=' + id_file_row, row_partial)
|
|
|
|
|
|
|
+ $.post('api/CreateRowUpdate.php?id_file_row=' + id_file_row, row_partial)
|
|
|
.done(function(response)
|
|
.done(function(response)
|
|
|
{
|
|
{
|
|
|
console.log(response);
|
|
console.log(response);
|
|
@@ -280,5 +284,33 @@ function createTable(id_company, table_dom)
|
|
|
});
|
|
});
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+ return table;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+function createUpdatesTable(id_company, table_dom)
|
|
|
|
|
+{
|
|
|
|
|
+ var table = $(table_dom).DataTable(
|
|
|
|
|
+ {
|
|
|
|
|
+ 'data': [],
|
|
|
|
|
+ 'order': [[0, 'date_modified']],
|
|
|
|
|
+ 'columns':
|
|
|
|
|
+ [
|
|
|
|
|
+ { 'title': 'Date', 'data': 'date_modified', 'defaultContent': ' ', 'className': 'date_modified' },
|
|
|
|
|
+ { 'title': 'User', 'data': 'user_name', 'defaultContent': ' ', 'className': 'user_name' },
|
|
|
|
|
+
|
|
|
|
|
+ { 'title': 'Pickup Time', 'data': 'time_pickup', 'defaultContent': ' ', 'className': 'time_pickup' },
|
|
|
|
|
+ { 'title': 'Depart Time', 'data': 'time_depart', 'defaultContent': ' ', 'className': 'time_depart' },
|
|
|
|
|
+ { 'title': 'BOL Delivered', 'data': 'bol_delivered', 'defaultContent': ' ', 'className': 'bol_delivered' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'language':
|
|
|
|
|
+ {
|
|
|
|
|
+ 'search': '',
|
|
|
|
|
+ 'searchPlaceholder': "Search Updates"
|
|
|
|
|
+ },
|
|
|
|
|
+ 'deferRender': true,
|
|
|
|
|
+ 'lengthChange': false
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
return table;
|
|
return table;
|
|
|
}
|
|
}
|