-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTable.html
163 lines (150 loc) · 7.16 KB
/
DataTable.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link href="https://fonts.googleapis.com/css2?family=Prompt:wght@400&display=swap" rel="stylesheet">
<link rel="stylesheet" href=" https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css" />
<link rel="stylesheet" href=" https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap5.min.css" />
<link rel="stylesheet" href=" https://cdn.datatables.net/responsive/2.2.9/css/responsive.bootstrap5.min.css" />
<!-- Popup Modal -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="https://ltschool.web.app/css/Bootstrapcolor.css" rel="stylesheet" type="text/css">
<style>
body {
font-family: "Prompt", sans-serif;
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-12 col-md-12" id="form1">
<nav class="navbar navbar-expand-lg navbar-light bd-blue-500 my-3">
<div class="container-fluid">
<a class="navbar-brand text-white"><i class="fa-solid fa-folder"></i> Document Viewer System</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<button type="botton" class="btn btn-info" onclick="goback()" id="goback"><i class="fas fa-cloud-upload-alt"></i>Upload Files</button>
</li>
</ul>
</div>
</div>
</nav>
<center>
<span id="resp-spinner5" class="spinner-grow spinner-grow-sm text-danger d-none" role="status" aria-hidden="true"></span>
<span id="resp-spinner6" class="spinner-grow spinner-grow-sm text-warning d-none" role="status" aria-hidden="true"></span>
<span id="resp-spinner7" class="spinner-grow spinner-grow-sm text-ligth d-none" role="status" aria-hidden="true"></span>
<span id="resp-spinner8" class="spinner-grow spinner-grow-sm text-info d-none" role="status" aria-hidden="true"></span>
<span id="resp-spinner9" class="spinner-grow spinner-grow-sm text-primary d-none" role="status" aria-hidden="true"></span>
<span id="resp-spinner10" class="spinner-grow spinner-grow-sm text-dark d-none" role="status" aria-hidden="true"></span>
</center>
<table id="data-table" class="table table-striped dt-responsive nowrap" style="width:100%">
<thead class="bd-blue-500"></thead>
</table>
</div>
</div>
</div>
<div class="col" id="form2" style="display : none">
<?!= include('index'); ?>
</div>
<script>
$(window).on('load',function(){
$('#form2').hide()
})
google.script.run.withSuccessHandler(showTable).getData();
document.getElementById('resp-spinner5').classList.remove("d-none");
document.getElementById('resp-spinner6').classList.remove("d-none");
document.getElementById('resp-spinner7').classList.remove("d-none");
document.getElementById('resp-spinner8').classList.remove("d-none");
document.getElementById('resp-spinner9').classList.remove("d-none");
document.getElementById('resp-spinner10').classList.remove("d-none");
function showTable(dataArray) {
$(document).ready(function(){
// $.LoadingOverlay("hide");
document.getElementById('resp-spinner5').classList.add("d-none");
document.getElementById('resp-spinner6').classList.add("d-none");
document.getElementById('resp-spinner7').classList.add("d-none");
document.getElementById('resp-spinner8').classList.add("d-none");
document.getElementById('resp-spinner9').classList.add("d-none");
document.getElementById('resp-spinner10').classList.add("d-none");
$('#data-table').DataTable({
//data: dataArray,
data: dataArray.slice(1),
columns: [
{ title: "Reference No." },
{ title: "File Name" },
{ title: "Date of Document" },
{ title: "Unit" },
{ title: "Category" },
{ title: "Projets" },
{ title: "Activity" },
{ title: "Tags" },
{
title: "Link",
render: function (data, type, row, meta) {
if (type === "display") {
data =' <a target="_blank" href="' + data + '" class="p-2 mb-2 bd-blue-500 text-white"><i class="fas fa-download"></i> Link</a>';
}
return data;
},
},
{ title: "Uploader" },
{ title: "Timestamp" },
],
"ordering": false,
destroy:true,
//pageLength: 5,
lengthMenu: [
[5, 10, 25, 50, 100, -1 ],
['5', '10', '25', '50','100', 'All' ]
],
// Sorting the data in a column asc = ascending desc = descending
order: [[2, "asc"], [2, "asc"], ],
language: {
sProcessing: "In Progress...",
sLengthMenu: "_MENU_ ",
sZeroRecords: "No Information Found",
sInfo: '<i class="fas fa-angle-double-left"></i> _START_ to _END_ from _TOTAL_ <i class="fas fa-angle-double-right"></i>',
sInfoEmpty: "Show 0 to 0 from 0 row",
sInfoFiltered: "(Filter _MAX_ eachRow)",
sInfoPostFix: "",
sSearch: '<i class="fas fa-search" fa-2x></i> Search:',
sUrl: "",
oPaginate: {
sFirst: "Home",
sPrevious: '<i class="fas fa-chevron-left fa-lg" ></i>',
sNext: '<i class="fas fa-chevron-right fa-lg" ></i>',
sLast: "Last Page"
}
},
});
});
}
function goback(){
$.LoadingOverlay("show", {image:"",fontawesome:"fa fa-solid fa-spinner fa-spin fa-xs"});
$('#form2').show()
$('#form1').hide()
$.LoadingOverlay("hide");
}
</script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/responsive.bootstrap5.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/loadingoverlay.min.js"></script>
</body>
</html>