update 1907251557
This commit is contained in:
65
app-new/mc-owners-func.js
Normal file
65
app-new/mc-owners-func.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const companies = {
|
||||
|
||||
'CLs': 'CAROLINA LOGISTICS, Inc <span>70830516181943</span>',
|
||||
'DE': 'DELTA EXPRESS, Inc <span>70830515177576</span>',
|
||||
'DL': 'DELTA LOGISTICS, Inc <span>70830517302592</span>',
|
||||
'OT': 'ONTRACK TRANSPORTATION, Inc <span>70830517305886</span>',
|
||||
'PT': 'PRECISE TRANSPORTATION, Inc <span>70830517302433</span>',
|
||||
|
||||
'DES': 'DELTA EXPRESS SERVICES, Inc <span></span>',
|
||||
'RT': 'RAINIER TRANSPORTATION, Inc <span>70830517307425</span>',
|
||||
|
||||
};
|
||||
|
||||
const pad = 'style="padding: 12px 54px;">',
|
||||
hPad = '<th ' + pad, dPad = '<td ' + pad;
|
||||
let table = '<tr id="hdr">' + hPad + 'Company</th>' + hPad + 'Period 1</th>' + hPad + 'Period 2</th></tr>';
|
||||
|
||||
let compKeys = Object.keys(companies),
|
||||
mKeys = Object.keys(monthlySpreadsheets),
|
||||
lastPeriod = mKeys[0],
|
||||
lastMonth = lastPeriod.split('-')[1],
|
||||
lastYear = lastPeriod.split('-')[0],
|
||||
active = new Date >= new Date(lastMonth + ' 1, ' + lastYear),
|
||||
period1 = monthlySpreadsheets[mKeys[1]],
|
||||
period2 = monthlySpreadsheets[lastPeriod];
|
||||
|
||||
for (let i = 0; i < compKeys.length; i++) {
|
||||
|
||||
let sideHeader = hPad + companies[compKeys[i]] + '</th>',
|
||||
data1 = period1[compKeys[i]],
|
||||
data2 = period2[compKeys[i]];
|
||||
|
||||
let anchor1 = '<td></td>', anchor2 = '<td></td>';
|
||||
|
||||
let title = sideHeader.split('>')[1].split('<')[0].trim();
|
||||
|
||||
if (data1 && data1[0]) {
|
||||
|
||||
let monYr = mKeys[1].split('-')[1] + ' ' + mKeys[1].split('-')[0];
|
||||
|
||||
anchor1 = dPad + '<a class="h" target="_blank" href="https://docs.google.com/spreadsheets/d/';
|
||||
anchor1 += data1[0] + '/edit#gid=1165085359" title="' + title + '">';
|
||||
anchor1 += (data1[1]) ? monYr + '</a>' : '</a>' + monYr;
|
||||
anchor1 += '</td>';
|
||||
|
||||
}
|
||||
|
||||
if (data2 && data2[0]) {
|
||||
|
||||
let monYr = lastMonth + ' ' + lastYear;
|
||||
|
||||
anchor2 = dPad + '<a class="h" target="_blank" href="https://docs.google.com/spreadsheets/d/';
|
||||
anchor2 += data2[0] + '/edit#gid=1165085359" title="' + title + '">';
|
||||
anchor2 += (data2[1] && active) ? monYr + '</a>' : '</a>' + monYr;
|
||||
anchor2 += '</td>';
|
||||
|
||||
}
|
||||
|
||||
if (anchor1 == '<td></td>' && anchor2 == '<td></td>') sideHeader = sideHeader.replace('<th ', '<th class="redundant" ');
|
||||
|
||||
table += '<tr>' + sideHeader + anchor1 + anchor2 + '</tr>'
|
||||
|
||||
}
|
||||
|
||||
document.getElementById('omcMon').innerHTML = table;
|
||||
37
app-new/mc-owners-ss.js
Normal file
37
app-new/mc-owners-ss.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const monthlySpreadsheets = {
|
||||
|
||||
/*
|
||||
|
||||
'yyyy-mmmm': {
|
||||
|
||||
'CLs': ['', 1],
|
||||
'DE': ['', 1],
|
||||
'DL': ['', 1],
|
||||
'OT': ['', 1],
|
||||
'PT': ['', 1],
|
||||
|
||||
},
|
||||
|
||||
*/
|
||||
|
||||
'2019-August': {
|
||||
|
||||
'CLs': ['1QNYGrVphn1D7Bajr9m2vuZSoC_G2Pu0yf_CBfahhplE', 1],
|
||||
'DE': ['1MpWH4hVVALr-W21pG8JJ0TXtQYaFjpFjYStjRnHeF2o', 1],
|
||||
'DL': ['17vjSYZt2iP7XcjJRAjDS2a9qUY4IMVfU-SX9RpTx-Yg', 1],
|
||||
'OT': ['11xLawls0LBEwRpp5lc130-nun2-Guh-7Gym7RSQ_-XU', 1],
|
||||
'PT': ['1EDk1za4PVYkUEgUVvjCH1CCEo1mtI5FXC-f7fhUMz8k', 1],
|
||||
|
||||
},
|
||||
|
||||
'2019-July': {
|
||||
|
||||
'CLs': ['1r4kELYN33dsoxD6IGcivMsFGKSP5Qebci0iR8fMGOsI', 1],
|
||||
'DE': ['12GULr80IX1HED0_ccG7fkaT4YZb_nrZKfGGDd5Vjy1U', 1],
|
||||
'DL': ['1emjsj1mO4LqvKSBkWjWQQNmpQcrJQJauYsHW-0n7BT4', 1],
|
||||
'OT': ['1QyFoBuVNdVvXiCqsiRF9vAg4Wzph0q6NwhgrNpfcqA4', 1],
|
||||
'PT': ['11Hq6FpGAY8LTsdMgOiLjZJl2dwEa97A0eHpu1UNEEog', 1],
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
@@ -320,7 +320,8 @@
|
||||
<table id="omcMon" class="monit"></table>
|
||||
</fieldset>
|
||||
|
||||
<script src="../app/functions-owners.js"></script>
|
||||
<script src="../app-new/mc-owners-ss.js"></script>
|
||||
<script src="../app-new/mc-owners-func.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user