-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (104 loc) · 4.21 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Chart of Accounts - Standar Akuntansi Pemerintahan!</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="#">Chart of Accounts - Standar Akuntansi Pemerintahan</a>
</div>
</nav>
<div class="container">
<div class="row mt-2">
<div class="col-12">
<label for="">Berdasarkan PP 64 Tahun 2013</label>
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<label for="" class="form-label">Search</label>
<input type="text" name="" id="search-box" class="form-control" placeholder="Nama Akun atau Kode">
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<table class="table table-hover" id="coa">
<tbody>
<!-- <th>#</th> -->
<th>Kode Akun</th>
<th>Nama Akun</th>
</tbody>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- Optional JavaScript; choose one of the two! -->
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
$(document).ready(function () {
tdload();
function tdload() {
// $('tbody').innerHTML = "";
console.log('fetching data...');
const categories = [
"assets",
"liabilities",
"equities",
"revenues",
"expenditures",
"transfers",
"financing",
"revenues-lo",
"expenses"
];
// console.log(accounts.length);
// var totalrows = 0;
for (let i = 0; i < categories.length; i++) {
console.log('fetching ' + categories[i]);
fetch('data/sap.accounts.' + categories[i] + '.json')
.then(response => {
return response.json();
})
.then(data => {
for (let a = 0; a < data.length; a++) {
$('#coa').append("<tr><td>" + data[a].code + "</td><td>" + data[a].name + "</td></tr>");
}
console.log('loaded ' + data.length + ' accounts from ' + categories[i]);
});
}
// console.log(totalrows);
};
// function jsonload(file) {
// $.ajax({
// url: file,
// method: 'GET',
// success: (result) => {
// return result;
// }
// })
// }
$('#search-box').on('keyup', function () {
var value = $(this).val().toLowerCase();
$('#coa tr').filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
});
});
});
</script>
</body>
</html>