update 1902111151
This commit is contained in:
31558
reports/local-costs/Report.json
Normal file
31558
reports/local-costs/Report.json
Normal file
File diff suppressed because it is too large
Load Diff
11
reports/local-costs/report.html
Normal file
11
reports/local-costs/report.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Local Payroll and Expenses Report</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table id="table"></table>
|
||||||
|
<script src="script.js" charset="utf-8"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
19
reports/local-costs/script.js
Normal file
19
reports/local-costs/script.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
function getReportFromServer() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onload = function() {
|
||||||
|
if (xhr.status >= 200 && xhr.status < 400) {
|
||||||
|
var repObj = JSON.parse(xhr.responseText),
|
||||||
|
repKeys = Object.keys(repObj);
|
||||||
|
var table = document.getElementById('table'),
|
||||||
|
content = '<tr><th>Week</th><th>Total Payroll</th><th>Total Expense</th></tr>';
|
||||||
|
for (var i = 0; i < repKeys.length; i++) {
|
||||||
|
content += '<tr><th>' + repKeys[i] + '</th>';
|
||||||
|
content += '<td>' + repObj[repKeys[i]].payroll.total + '</td>';
|
||||||
|
content += '<td>' + repObj[repKeys[i]].expense.total + '</td></tr>'
|
||||||
|
}
|
||||||
|
table.innerHTML = content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.open('GET', 'Report.json', true);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user