-
Notifications
You must be signed in to change notification settings - Fork 2
/
data_default.js
91 lines (86 loc) · 4.35 KB
/
data_default.js
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
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
//Tanggal Update
var a = document.getElementsByClassName("tgl_update");
var b = document.getElementsByClassName("spec_msg");
var spec_msg = 'Bismillah 2022 Normal';
var date = 'Update per Kamis, 16 September 2021 20:38 WIB'
var x_data = [4181309,3145,139919,237,3968152,14633,0,19411940,51621,23593249,0.0,3.35,54766];
a[0].innerHTML = a[1].innerHTML = date;
b[0].innerHTML = spec_msg;
document.getElementById("positif").innerHTML = numberWithCommas(x_data[0]);
document.getElementById("positif_note").innerHTML = numberWithCommas(x_data[1])
document.getElementById("new_case").innerHTML = numberWithCommas(x_data[1]);
document.getElementById("meninggal").innerHTML = numberWithCommas(x_data[2]);
document.getElementById("meninggal_note").innerHTML = numberWithCommas(x_data[3]);
document.getElementById("sembuh").innerHTML = numberWithCommas(x_data[4]);
document.getElementById("sembuh_note").innerHTML = numberWithCommas(x_data[5]);
document.getElementById("negatif").innerHTML = numberWithCommas(x_data[7]);
document.getElementById("negatif_note").innerHTML = numberWithCommas(x_data[8]);
document.getElementById("totaltes").innerHTML = numberWithCommas(x_data[9]);
document.getElementById("new_test").innerHTML = numberWithCommas(x_data[12]);
document.getElementById("percentage_increase").innerHTML = numberWithCommas(x_data[10]);
document.getElementById("ratio_meninggal").innerHTML = x_data[11];
// $.ajax({
// type: "GET",
// url: "https://docs.google.com/spreadsheets/d/e/2PACX-1vTmb1WvsO22hTIDE9b0MmBpOpOhuE4SRzcKJQtPKXkRkOqTnhr-VDPDhveMn9-kBkDTc9lTRTVbZ3kf/pub?gid=0&single=true&output=csv",
// success: function(response)
// {
// x_data = $.csv.toArrays(response);
// generateHtmlTable(x_data);
// }
// });
// function generateHtmlTable(x_data) {
// if(typeof(x_data[0]) === 'undefined') {
// return null;
// } else {
// $.each(x_data, function( index, row ) {
// if(index == 0){
// $.each(row, function( index, colData ) {
// if(index == 0){
// a[0].innerHTML = a[1].innerHTML = colData;
// }
// });
// }else{
// $.each(row, function( index, colData ) {
// switch(index){
// case 0:
// document.getElementById("positif").innerHTML = numberWithCommas(colData);
// break;
// case 2:
// document.getElementById("positif_note").innerHTML = document.getElementById("new_case").innerHTML = colData;
// break;
// case 3:
// document.getElementById("meninggal").innerHTML = numberWithCommas(colData);
// break;
// case 4:
// document.getElementById("meninggal_note").innerHTML = colData;
// break;
// case 5:
// document.getElementById("sembuh").innerHTML = numberWithCommas(colData);
// break;
// case 6:
// document.getElementById("sembuh_note").innerHTML = colData;
// break;
// case 8:
// document.getElementById("negatif").innerHTML = numberWithCommas(colData);
// break;
// case 9:
// document.getElementById("negatif_note").innerHTML = numberWithCommas(colData);
// break;
// case 10:
// document.getElementById("totaltes").innerHTML = numberWithCommas(colData);
// break;
// case 12:
// document.getElementById("percentage_increase").innerHTML = colData;
// break;
// case 13:
// document.getElementById("ratio_meninggal").innerHTML = colData;
// break;
// }
// });
// }
// });
// }
// }