-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexp.html
More file actions
709 lines (658 loc) · 30.8 KB
/
exp.html
File metadata and controls
709 lines (658 loc) · 30.8 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>
<head>
<title>Masa Aktif Member</title>
<meta charset="UTF-8">
<meta name="author" content="Hardiansyah">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-scale=0.8, maximal-scale=1">
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="stockid_script/exp.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>-->
<link href="https://fonts.googleapis.com/css2?family=Rubik&display=swap" rel="stylesheet">
<meta name="theme-color" content="#3498DB">
<meta property="og:title" content="Masa Aktif Member Stock ID VIP">
<meta property="og:description" content="Cek Masa Aktifmu Disini Yaa!">
<meta property="og:image" content="stockid_gambar/thumb.jpg">
<meta property="og:url" content="https://webstockid.github.io/exp">
<meta property="og:type" content="website">
</head>
<body>
<h2>Masa Aktif Member Stock ID VIP</h2>
<!--<button onclick="exportData()">Export Data</button>
<input type="file" id="importFile" style="display:none" onchange="importData(event)">
<button onclick="document.getElementById('importFile').click()">Import Data</button>-->
<div class="controls">
<select id="filter">
<option value="all">Semua 🐉</option>
<option value="1">1 Bulan 🦎</option>
<option value="2">2 Bulan 🦖</option>
<option value="3">3 Bulan 🐲</option>
<option value="6">6 Bulan 🦚</option>
<option value="12">1 Tahun 🐦🔥</option>
<option value="expired">Expired 🐸</option>
</select>
<select id="sortMode">
<option value="active">Masa Aktif Terlama 🦈</option>
<option value="bentar">Masa Aktif Sebentar 🐬</option>
<option value="nameAZ">Nama A-Z 🐟</option>
<option value="nameZA">Nama Z-A 🐠</option>
</select>
</div>
<button onclick="toggleAdmin()" id="adminBtn" style="padding: 4px; font-size: 14px; color: snow; background: dodgerblue; border: 1px solid white; border-radius: 6px;">Aktifkan Mode Admin 🔐</button>
<button onclick="tambahMember()" class="tambahmember" style="margin: 4px; padding: 4px; font-size: 14px; color: snow; background: dodgerblue; border: 1px solid white; border-radius: 6px;">➕ Tambah Member</button>
<br><br>
<div id="list"></div>
<div class="stat-box" id="statistik"></div>
<div id="activeSummary" class="active-summary"></div>
<h4>Rekap Pembelian Kelas</h4>
<table border="1" cellpadding="8" cellspacing="0" style="border-collapse:collapse;width:100%;margin-bottom:20px;">
<thead>
<tr style="background:#222; color: #fff;">
<th>Kelas</th>
<th>Total Dibeli</th>
</tr>
</thead>
<tbody id="rekapTableBody"></tbody>
</table>
<div id="reminderModal" style="z-index: 99999; position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center;">
<div style="background: #222; color: white; padding: 20px; border-radius: 10px; width: 300px;">
<h3>Pilih Member Reminder</h3>
<select id="memberSelect" style="width: 100%; padding: 8px; margin-bottom: 10px;"></select>
<button onclick="simpanReminder()">Simpan</button>
</div>
</div>
<button id="themeToggle" class="theme-btn">
🌙 Soft Mode
</button>
<button onclick="enableNotif()" class="notif-btn">
<i class="fa fa-bullhorn"></i> Reminder 🦭
</button>
<input id="search" placeholder="🔎 Cari nama kamu... 🦧">
<script>
function bukaReminderModal() {
const select = document.getElementById("memberSelect");
select.innerHTML = "";
members.forEach((m, index) => {
select.innerHTML += `<option value="${index}">${m.nama}</option>`;
});
document.getElementById("reminderModal").style.display = "flex";
}
function simpanReminder() {
const index = document.getElementById("memberSelect").value;
localStorage.setItem("reminderMember", index);
document.getElementById("reminderModal").style.display = "none";
}
function cekReminder() {
const index = localStorage.getItem("reminderMember");
if (index === null) return;
const m = members[index];
if (!m || !m.expired) return;
const today = new Date();
const exp = new Date(m.expired);
const diffTime = exp - today;
const sisaHari = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
const levels = [10, 5, 3];
const sudahNotif = JSON.parse(localStorage.getItem("notifSent") || "{}");
if (levels.includes(sisaHari) && !sudahNotif[sisaHari]) {
Notification.requestPermission().then(permission => {
if (permission === "granted") {
new Notification(`Reminder ${m.nama}`, {
body: `Masa aktif tersisa ${sisaHari} hari`
});
}
});
sudahNotif[sisaHari] = true;
localStorage.setItem("notifSent", JSON.stringify(sudahNotif));
}
}
window.addEventListener("load", () => {
if (!localStorage.getItem("reminderMember")) {
bukaReminderModal();
}
cekReminder();
});
</script>
<script type="text/javascript">
/* ================= DATA MEMBER ================= */
const members = [
{ nama:"Mba. Kayla", whatsapp:"081357764067", expired:"2027-05-11", history:[2,12] },
{ nama:"Mas. Yayat", whatsapp:"82967078794", expired:"2027-03-08", history:[12] },
{ nama:"Mas. Dimas", whatsapp:"082288133212", expired:"2027-02-26", history:[1,12] },
{ nama:"Mas. Erick", whatsapp:"085704444633", expired:"2026-10-21", history:[1,6] },
{ nama:"Mas. Devan", whatsapp:"085800322160", expired:"2026-10-03", history:[1,6] },
{ nama:"Mas. Ardha", whatsapp:"081542779853", expired:"2026-09-09", history:[3,6] },
{ nama:"Mas. Vani", whatsapp:"0896622628826", expired:"2026-08-24", history:[6] },
{ nama:"Mas. Roid", whatsapp:"087819304040", expired:"2026-08-09", history:[1,2,3] },
{ nama:"Mas. Tito", whatsapp:"081270370727", expired:"2026-07-15", history:[3,3] },
{ nama:"Mas. Farhan", whatsapp:"088221513462", expired:"2026-07-07", history:[1,3] },
{ nama:"Mas. Yoga", whatsapp:"082382795953", expired:"2026-07-03", history:[3,3] },
{ nama:"Mas. Zacky", whatsapp:"089634164412", expired:"2026-06-25", history:[3] },
{ nama:"Mas. Dhio", whatsapp:"082349033673", expired:"2026-06-18", history:[1,1] },
{ nama:"Mas. Dika", whatsapp:"08131093311", expired:"2026-06-17", history:[3] },
{ nama:"Mas. Adam", whatsapp:"082140581317", expired:"2026-06-10", history:[3] },
{ nama:"Mas. Muazin", whatsapp:"081391334236", expired:"2026-06-08", history:[1,1,1] },
{ nama:"Mas. Tomy", whatsapp:"089609809039", expired:"2026-06-06", history:[1,2,2] },
{ nama:"Mas. Dedi", whatsapp:"0859515686282", expired:"2026-06-05", history:[1,3] },
{ nama:"Mas. Ferizo", whatsapp:"085608477897", expired:"2026-06-02", history:[2] },
{ nama:"Mas. Arif", whatsapp:"085265337779", expired:"2026-05-31", history:[1,3] },
{ nama:"Mas. Rama", whatsapp:"082146281427", expired:"2026-05-28", history:[3,1] },
{ nama:"Mas. Ananda", whatsapp:"082256863256", expired:"2026-05-27", history:[3] },
{ nama:"Mas. Ray", whatsapp:"08994666668", expired:"2026-05-26", history:[1,1] },
{ nama:"Mas. Anggoro", whatsapp:"089525567420", expired:"2026-05-25", history:[3] },
{ nama:"Mba. Puspita", whatsapp:"082146281427", expired:"2026-05-25", history:[3] },
{ nama:"Mba. Putri", whatsapp:"081554559971", expired:"2026-05-24", history:[2,2,1] },
{ nama:"Mas. Christian", whatsapp:"085358872343", expired:"2026-05-23", history:[2] },
{ nama:"Mas. Faisal", whatsapp:"085727473240", expired:"2026-05-22", history:[1,2] },
{ nama:"Mas. Abdul", whatsapp:"085704755602", expired:"2026-05-21", history:[1,2] },
{ nama:"Mba. Fauziah", whatsapp:"085753648079", expired:"2026-05-20", history:[1,2] },
{ nama:"Mas. Hendra", whatsapp:"089504229094", expired:"2026-05-19", history:[1,2] },
{ nama:"Mas. Ardan", whatsapp:"08888136363", expired:"2026-05-13", history:[2] },
{ nama:"Mas. Ofeng", whatsapp:"085739500212", expired:"2026-05-13", history:[1] },
{ nama:"Mas. Febry", whatsapp:"085602252302", expired:"2026-05-13", history:[1] },
{ nama:"Mas. Dwiky", whatsapp:"081163836288", expired:"2026-05-12", history:[1,1,2] },
{ nama:"Mas. Ihsan", whatsapp:"082215352174", expired:"2026-05-12", history:[2] },
{ nama:"Mas. Pandya", whatsapp:"081286977138", expired:"2026-05-12", history:[1,1] },
{ nama:"Mba. Dhila", whatsapp:"089528936511", expired:"2026-05-11", history:[1,1] },
{ nama:"Mas. Rezky", whatsapp:"082221981889", expired:"2026-05-11", history:[1] },
{ nama:"Mas. Made", whatsapp:"081353043869", expired:"2026-05-09", history:[1,2] },
{ nama:"Mba. Tati", whatsapp:"085773015045", expired:"2026-05-06", history:[2] },
{ nama:"Mba. Linda", whatsapp:"08112630261", expired:"2026-05-06", history:[2] },
{ nama:"Mas. Thoriq", whatsapp:"082246243349", expired:"2026-05-05", history:[1] },
{ nama:"Mas. Purna", whatsapp:"089627939527", expired:"2026-05-04", history:[1,2] },
{ nama:"Mas. Ian", whatsapp:"081329990494", expired:"2026-05-04", history:[1] },
{ nama:"Mas. Jajang", whatsapp:"085714009445", expired:"2026-05-04", history:[1] },
{ nama:"Mas. Tomin", whatsapp:"082241230030", expired:"2026-04-26", history:[1] },
{ nama:"Mas. Danny", whatsapp:"081932677981", expired:"2026-04-24", history:[2] },
{ nama:"Mas. Zidan", whatsapp:"082146281427", expired:"2026-04-24", history:[2] },
{ nama:"Mba. Viani", whatsapp:"082146281427", expired:"2026-04-24", history:[2] },
{ nama:"Mas. Choirul", whatsapp:"085749461105", expired:"2026-04-23", history:[1] },
{ nama:"Mas. Daud", whatsapp:"08176604110", expired:"2026-04-20", history:[1] },
{ nama:"Mas. Ridho", whatsapp:"085839352252", expired:"2026-04-19", history:[1,1] },
{ nama:"Mas. Bayu", whatsapp:"082145928235", expired:"2026-04-19", history:[1,1] },
{ nama:"Mas. Rachmad", whatsapp:"088989669913", expired:"2026-04-18", history:[1,1] },
{ nama:"Mas. Resky", whatsapp:"082125867841", expired:"2026-04-18", history:[1] },
{ nama:"Mba. Zulia", whatsapp:"082245155065", expired:"2026-04-18", history:[1] },
{ nama:"Mas. Gias", whatsapp:"085974635148", expired:"2026-04-16", history:[1] },
{ nama:"Mba. Lukita", whatsapp:"082244816942", expired:"2026-04-16", history:[1] },
{ nama:"Mas. Januar", whatsapp:"081281496941", expired:"2026-04-16", history:[1] },
{ nama:"Mas. Irham", whatsapp:"081367662689", expired:"2026-04-16", history:[1] },
{ nama:"Mas. Rizal", whatsapp:"082190537612", expired:"2026-04-15", history:[1] },
{ nama:"Mas. Iram", whatsapp:"081391330905", expired:"2026-04-15", history:[1] },
{ nama:"Mas. Alvi", whatsapp:"082112373026", expired:"2026-04-14", history:[1,1] },
{ nama:"Mas. Agung", whatsapp:"081907273068", expired:"2026-04-14", history:[1] },
{ nama:"Mas. Erwin", whatsapp:"082284955923", expired:"2026-04-14", history:[1] },
{ nama:"Mas. Ahmad", whatsapp:"089610006606", expired:"2026-04-14", history:[1] },
{ nama:"Mas. Ega", whatsapp:"082371646313", expired:"2026-04-14", history:[1] },
{ nama:"Mba. Jasmine", whatsapp:"089527787810", expired:"2026-04-14", history:[1] },
{ nama:"Mba. Jasmine", whatsapp:"089527787810", expired:"2026-04-13", history:[1] },
{ nama:"Mas. Rahman", whatsapp:"081233704317", expired:"2026-04-11", history:[1] },
{ nama:"Mas. Annur", whatsapp:"08558895157", expired:"2026-04-11", history:[1] },
{ nama:"Mas. Hadi", whatsapp:"081934151515", expired:"2026-04-11", history:[1] },
{ nama:"Mas. Hamid", whatsapp:"085546399043", expired:"2026-04-11", history:[1] },
{ nama:"Mas. Izzudin", whatsapp:"081910019807", expired:"2026-04-10", history:[1] },
{ nama:"Mas. Satya", whatsapp:"085263019463", expired:"2026-04-10", history:[1] },
{ nama:"Mas. Hilmi", whatsapp:"081231012358", expired:"2026-04-10", history:[1] },
{ nama:"Mas. Nofal", whatsapp:"0895340339030", expired:"2026-04-10", history:[1,1] },
{ nama:"Mas. Ilham", whatsapp:"082229069298", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Jefri", whatsapp:"0895322198674", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Paolo", whatsapp:"082285682337", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Japa", whatsapp:"085156154004", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Wandi", whatsapp:"085185742517", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Zayyin", whatsapp:"0882003064529", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Alpin", whatsapp:"085743157505", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Stepanus", whatsapp:"082245465893", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Rasyid", whatsapp:"087796722146", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Ali", whatsapp:"082117932375", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Yusuf", whatsapp:"081342480684", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Rafli", whatsapp:"818094352275", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Simanjuntak", whatsapp:"085121000159", expired:"2026-04-09", history:[1] },
{ nama:"Mas. Daniar", whatsapp:"087722353893", expired:"2026-04-08", history:[1] },
{ nama:"Mba. Rizka", whatsapp:"087867772787", expired:"2026-04-08", history:[1] },
{ nama:"Mba. Ina", whatsapp:"085921648659", expired:"2026-04-08", history:[1] },
{ nama:"Mba. Cinta", whatsapp:"085691048600", expired:"2026-04-08", history:[1] },
{ nama:"Mba. Rahayu", whatsapp:"083181557626", expired:"2026-04-08", history:[1] },
{ nama:"Mas. Madani", whatsapp:"081399052389", expired:"2026-04-08", history:[1] },
{ nama:"Mas. Willy", whatsapp:"088747941100", expired:"2026-04-07", history:[1,1] },
{ nama:"Mas. Adit", whatsapp:"085773102128", expired:"2026-04-07", history:[3] },
{ nama:"Mas. Tama", whatsapp:"083823750527", expired:"2026-04-07", history:[1] },
{ nama:"Mas. Seii", whatsapp:"089516172663", expired:"2026-04-04", history:[1,1] },
{ nama:"Mas. Baharudin", whatsapp:"081328333319", expired:"2026-04-04", history:[1] },
{ nama:"Mas. Ikhwan", whatsapp:"08813986613", expired:"2026-04-04", history:[3] },
{ nama:"Mas. Evan", whatsapp:"085649261450", expired:"2026-04-02", history:[1] },
{ nama:"Mas. Juan", whatsapp:"081218500883", expired:"2026-04-02", history:[1] },
{ nama:"Mba. Caca", whatsapp:"082131643877", expired:"2026-04-02", history:[1] },
{ nama:"Mas. Ulil", whatsapp:"085624417898", expired:"2026-04-02", history:[1] },
{ nama:"Mba. Febrina", whatsapp:"082257554848", expired:"2026-04-01", history:[1] },
{ nama:"Mas. Suba", whatsapp:"085851202129", expired:"2026-03-31", history:[1] },
{ nama:"Mas. Kevin", whatsapp:"081288374247", expired:"2026-03-30", history:[1] },
{ nama:"Mas. Ramadhan", whatsapp:"085717458562", expired:"2026-03-29", history:[1] },
{ nama:"Mas. Fahmi", whatsapp:"085725250834", expired:"2026-03-27", history:[1,1] },
{ nama:"Mas. Farid", whatsapp:"082216890335", expired:"2026-03-27", history:[1] },
{ nama:"Mas. Juno", whatsapp:"081388971102", expired:"2026-03-27", history:[1] },
{ nama:"Mas. Yogi", whatsapp:"081388943988", expired:"2026-03-27", history:[1] },
{ nama:"Mas. Nanang", whatsapp:"0895335867519", expired:"2026-03-27", history:[1,1] },
{ nama:"Mas. Candra", whatsapp:"085878590179", expired:"2026-03-27", history:[1] },
{ nama:"Mas. Salim", whatsapp:"085804210460", expired:"2026-03-27", history:[1] },
{ nama:"Mas. Rayhan", whatsapp:"082146281427", expired:"2026-03-27", history:[1] },
{ nama:"Mba. Siska", whatsapp:"087759946405", expired:"2026-03-25", history:[1,1] },
{ nama:"Mas. Ardika", whatsapp:"082170239819", expired:"2026-03-21", history:[3] },
{ nama:"Mas. Sefian", whatsapp:"085876926793", expired:"2026-03-21", history:[1,1] },
{ nama:"Mas. Widi", whatsapp:"083191133606", expired:"2026-03-20", history:[1] },
{ nama:"Mas. Natan", whatsapp:"085380369595", expired:"2026-03-18", history:[1] },
{ nama:"Mas. Anggit", whatsapp:"081542766503", expired:"2026-03-18", history:[2] },
{ nama:"Mas. Aka", whatsapp:"085959776370", expired:"2026-03-17", history:[1] },
{ nama:"Mas. Dani", whatsapp:"081939198806", expired:"2026-02-12", history:[1,1] },
{ nama:"Mas. Saputra", whatsapp:"0895320471571", expired:"2026-02-10", history:[1] },
{ nama:"Mas. Atok", whatsapp:"081222455926", expired:"2026-02-10", history:[1] },
{ nama:"Mas. Noval", whatsapp:"085714184573", expired:"2026-02-10", history:[1] },
{ nama:"Mas. Neko", whatsapp:"082286867964", expired:"2026-02-10", history:[1,2] },
{ nama:"Pak. Yanto", whatsapp:"082374750189", expired:"2026-02-04", history:[3] },
{ nama:"Mas. Panji", whatsapp:"081383928774", expired:"2026-02-03", history:[1,1] },
{ nama:"Mba. Annisa", whatsapp:"083829116408", expired:"2026-02-03", history:[1] },
{ nama:"Mas. Dio", whatsapp:"087872855134", expired:"2026-02-02", history:[1] },
{ nama:"Mba. Rosita", whatsapp:"085746010654", expired:"2026-02-02", history:[1] },
{ nama:"Mas. Ahlis", whatsapp:"082374750189", expired:"2026-01-30", history:[2] },
{ nama:"Mas. Jordan", whatsapp:"085361158771", expired:"2026-01-27", history:[1] },
{ nama:"Mas. Farieq", whatsapp:"083813693914", expired:"2026-01-26", history:[1] },
{ nama:"Mba. Riani", whatsapp:"082288593696", expired:"2026-01-25", history:[1] },
{ nama:"Mas. Rey", whatsapp:"087760777890", expired:"2026-01-23", history:[1] },
{ nama:"Mas. Sodik", whatsapp:"085156271181", expired:"2026-01-22", history:[1] },
{ nama:"Mba. Tia", whatsapp:"081360698004", expired:"2026-01-22", history:[1] },
{ nama:"Mas. Miko", whatsapp:"08989735180", expired:"2026-01-18", history:[1] },
{ nama:"Mas. Niko", whatsapp:"085659115395", expired:"2026-01-17", history:[1,1] },
{ nama:"Mas. Fajar", whatsapp:"088980615045", expired:"2026-01-12", history:[1] },
{ nama:"Mas. Winsen", whatsapp:"082374750189", expired:"2026-01-10", history:[1] },
{ nama:"Mas. Dandy", whatsapp:"081257215624", expired:"2026-01-09", history:[1] },
{ nama:"Mas. Ando", whatsapp:"082353546274", expired:"2026-01-09", history:[1] },
{ nama:"Mas. Adi", whatsapp:"081802037746", expired:"2026-01-09", history:[1] },
{ nama:"Mas. Lisbeth", whatsapp:"085211556086", expired:"2026-01-09", history:[1] },
{ nama:"Mas. Yudha", whatsapp:"081809326902", expired:"2026-01-02", history:[1] },
{ nama:"Mas. Azka", whatsapp:"085691639152", expired:"2025-12-29", history:[1] },
{ nama:"Mas. Fathan", whatsapp:"087763704096", expired:"2025-12-29", history:[1] },
{ nama:"Mas. Nijar", whatsapp:"082299282454", expired:"2025-12-29", history:[1] },
{ nama:"Mas. Gilang", whatsapp:"083131965957", expired:"2025-12-28", history:[1] },
{ nama:"Mas. Radit", whatsapp:"0895324937129", expired:"2025-12-28", history:[1] },
{ nama:"Mas. Alive", whatsapp:"08151471961", expired:"2025-12-25", history:[1] },
{ nama:"Mas. Abraham", whatsapp:"087725999740", expired:"2025-12-15", history:[1] },
{ nama:"Sandi", whatsapp:"082146281427", expired:"2025-04-20", history:[1,1] }
];
</script>
<script type="text/javascript">
function hitungRekapKelas() {
const rekap = {};
members.forEach(m => {
if (Array.isArray(m.history)) {
m.history.forEach(kelas => {
rekap[kelas] = (rekap[kelas] || 0) + 1;
});
}
});
return rekap;
}
</script>
<script type="text/javascript">/*
const search = document.getElementById("search");
const container = document.getElementById("memberContainer");
const badge = document.getElementById("resultBadge");
const emptyState = document.getElementById("emptyState");
function debounce(func, delay) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), delay);
};
}
function highlight(text, keyword) {
if (!keyword) return text;
const safeKey = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const regex = new RegExp(`(${safeKey})`, "gi");
return text.replace(regex, `<span class="highlight">$1</span>`);
}*/
let isAdmin = false;
function toggleAdmin() {
isAdmin = !isAdmin;
const btn = document.getElementById("adminBtn");
if (isAdmin) {
btn.textContent = "Nonaktifkan Mode Admin";
} else {
btn.textContent = "Aktifkan Mode Admin";
}
render();
}
function tambahHistory(index) {
const bulan = prompt("Masukkan kelas (1 / 2 / 3 / 6 / 12):");
if (!bulan) return;
if (!members[index].history) {
members[index].history = [];
}
members[index].history.push(Number(bulan));
alert("History berhasil ditambahkan! 🐔");
render();
}
</script>
<script>
function tambahMember() {
const nama = prompt("Nama Member:");
if(!nama) return;
const whatsapp = prompt("Nomor WhatsApp:");
if(!whatsapp) return;
const expired = prompt("Tanggal Expired (YYYY-MM-DD):");
if(!expired) return;
const kelas = prompt("Kelas pertama (1 / 2 / 3 / 6 / 12 bulan):");
const newMember = {
nama:nama,
whatsapp:whatsapp,
expired:expired,
history:[Number(kelas)]
};
members.push(newMember);
alert("Member baru berhasil ditambahkan 🐍");
render();
}
</script>
<script>
function editMember(index) {
const m = members[index];
const nama = prompt("Edit Nama:", m.nama);
if(!nama) return;
const whatsapp = prompt("Edit WhatsApp:", m.whatsapp);
if(!whatsapp) return;
const expired = prompt("Edit Expired (YYYY-MM-DD):", m.expired);
if(!expired) return;
m.nama = nama;
m.whatsapp = whatsapp;
m.expired = expired;
alert("Data member berhasil diupdate 🦜");
render();
}
</script>
<script type="text/javascript">
const DAY=86400000,HOUR=3600000,MIN=60000,SEC=1000;
const lastMonth=m=>m.history.at(-1)||0;
const target=d=>new Date(d+"T00:00:00").getTime();
/* ================= FORMAT ================= */
function sisa(ms) {
if (ms<=0) return "Expired";
const h=Math.floor(ms/DAY);
const j=Math.floor(ms%DAY/HOUR);
const m=Math.floor(ms%HOUR/MIN);
const d=Math.floor(ms%MIN/SEC);
return `${h} Hari ${j} Jam ${m} Menit ${d} Detik`;
}
function kelas(b,ms) {
if (ms<=0) return "expired";
if (b==1) return "satu";
if (b==2) return "dua";
if (b==3) return "tiga";
if (b==6) return "enam";
if (b==12) return "setahun";
}
function badge(arr) {
if (arr.length==1) return `+${arr[0]} bulan`;
return `+${arr.slice(0,-1).join(", ")} & ${arr.at(-1)} bulan`;
}
function join(arr) {
return arr.map(b=>`${b} Bulan`).join(" + ");
}
/* ================= STAT ================= */
function renderStat(data) {
const box=document.getElementById("statistik");
box.innerHTML="";
const map={1:0,2:0,3:0,6:0,12:0,x:0};
data.forEach(m=> {
if (m.ms<=0) map.x++;
else map[lastMonth(m)]++;
});
const rows=[
[1,"1 Bulan","b1"],
[2,"2 Bulan","b2"],
[3,"3 Bulan","b3"],
[6,"6 Bulan","b6"],
[12,"1 Tahun","b12"],
["x","Expired","bx"]
];
const max=Math.max(...Object.values(map),1);
rows.forEach(r=> {
const val=map[r[0]];
const el=document.createElement("div");
el.className="stat-row";
el.innerHTML=`
<div class="stat-label">${r[1]} (${val})</div>
<div class="bar">
<div class="bar-fill ${r[2]}" style="--w:${val/max*30}%"></div>
</div>`;
box.appendChild(el);
});
}
function initStat() {
members.forEach(m => m.ms = target(m.expired) - Date.now());
const sorted = [...members].sort((a,b)=>b.ms - a.ms);
renderStat(sorted);
}
</script>
<script type="text/javascript">
/* ================= RENDER ================= */
function render() {
const rekapBody = document.getElementById("rekapTableBody");
const rekapData = hitungRekapKelas();
rekapBody.innerHTML = "";
Object.keys(rekapData).sort((a, b) => Number(a) - Number(b)).forEach(kelas => {
rekapBody.innerHTML += `
<tr>
<td>Kelas ${kelas} Bulan</td>
<td>${rekapData[kelas]}x</td>
</tr>
`;
});
const list=document.getElementById("list");
list.innerHTML="";
const key = search.value.toLowerCase();
const f=filter.value;
members.forEach(m=>m.ms=target(m.expired)-Date.now());
const mode = sortMode.value;
let sorted = [...members];
if (mode === "active") {
sorted.sort((a,b)=>b.ms - a.ms);
}
if (mode === "bentar") {
//members.sort((a,b)=>new Date(b.expired) - new Date(a.expired));
sorted.sort((a,b)=>a.ms - b.ms);
}
if (mode === "nameAZ") {
sorted.sort((a,b)=>a.nama.localeCompare(b.nama));
}
if (mode === "nameZA") {
sorted.sort((a,b)=>b.nama.localeCompare(a.nama));
}
// ====== HAPUS DUPLIKAT BERDASARKAN NAMA ======
const seen = new Set();
sorted = sorted.filter(m => {
if (seen.has(m.nama)) return false;
seen.add(m.nama);
return true;
});
//renderStat(sorted);
//sorted.forEach(m=> {
sorted.forEach((m,index)=> {
const lm=lastMonth(m);
if (!m.nama.toLowerCase().includes(key)) return;
if (f==="expired" && m.ms>0) return;
if (f!=="all" && f!=="expired" && lm!=f) return;
//const div=document.createElement("div");
//div.className="member "+kelas(lm,m.ms);
const div=document.createElement("div");
let urgentClass = "";
const daysLeft = Math.floor(m.ms / DAY);
if (m.ms > 0) {
if (daysLeft <= 3) urgentClass = "h3";
else if (daysLeft <= 7) urgentClass = "h7";
else if (daysLeft <= 14) urgentClass = "h14";
}
div.className = "member " + kelas(lm,m.ms) + " " + urgentClass;
div.innerHTML=`
<b><i class='fa fa-user-circle-o'></i> Nama: ${m.nama}</b><br>
<b><i class='fa fa-spinner fa-spin'></i> Expired: ${m.expired}</b><br>
<b><i class='fa fa-circle-o-notch fa-spin'></i> Sisa Waktu: <span class="countdown" data-expired="${m.expired}">${sisa(m.ms)}</span></b>
<span class="badge">${badge(m.history)}</span>
<div class="history">
<i class='fa fa-phone'></i> Nomor: ${m.whatsapp}
<br>
<i class='fa fa-vcard-o'></i> Join Kelas: ${join(m.history)}
</div>
${isAdmin ? `
<button class="tambah" onclick="tambahHistory(${index})">🐝 Tambah Kelas</button>
<button class="tambah" onclick="editMember(${index})">🐱 Edit</button>
` : ""}
`;
list.appendChild(div);
});
/*if (w) {
const key=notifKey(m,w);
if (!localStorage.getItem(key)) {
let title="⏰ Masa Aktif Member";
let msg="";
if (w=="h7") msg=`${m.nama} akan expired 7 hari lagi`;
if (w=="h3") msg=`${m.nama} tinggal 3 hari lagi`;
if (w=="expired") msg=`${m.nama} sudah EXPIRED`;
pushNotif (title,msg);
localStorage.setItem(key,"1");
}
}*/
}
search.oninput = render;
filter.onchange = render;
sortMode.onchange = render; //baru
initStat();
render();
</script>
<script type="text/javascript">
setInterval(() => {
const countdowns = document.querySelectorAll(".countdown");
countdowns.forEach(el => {
const expiredDate = el.getAttribute("data-expired");
if (!expiredDate || expiredDate === "Expired") {
el.textContent = "Expired";
return;
}
const ms = new Date(expiredDate + "T00:00:00").getTime() - Date.now();
if (ms <= 0) {
el.textContent = "Masa Aktif Habis";
return;
}
const h = Math.floor(ms / DAY);
const j = Math.floor(ms % DAY / HOUR);
const m = Math.floor(ms % HOUR / MIN);
const d = Math.floor(ms % MIN / SEC);
el.textContent = `${h} Hari ${j} Jam ${m} Menit ${d} Detik`;
});
}, 1000);
</script>
<script type="text/javascript">
function enableNotif () {
if (!("Notification" in window)) {
alert("Browser tidak mendukung notifikasi");
return;
}
Notification.requestPermission().then(p=> {
if (p==="granted") alert("Aktif 🐿️");
});
}
function pushNotif (title, body) {
if (Notification.permission!=="granted") return;
new Notification(title,{body:body,icon:"stockid_gambar/alert.jpg",vibrate:[200,100,200]});
document.getElementById("notifSound").play().catch(()=> {});
}
</script>
<script type="text/javascript">
/*if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(reg=> {
alert("Service Worker Registered 🦤", reg);
}).catch(err=> {
alert("SW Registration failed: ", err);
});
navigator.serviceWorker.addEventListener('message', e=> {
if (e.data.type === 'check-reminder') {
render(); // trigger reminder H-7, H-3, Expired
}
});
}*/
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(reg => {
// cek apakah sudah pernah tampilkan notif
const swNotifShown = localStorage.getItem("swNotifShown");
if (!swNotifShown) {
alert("Service Worker berhasil diaktifkan 🦤");
// simpan agar tidak muncul lagi
localStorage.setItem("swNotifShown", "true");
}
}).catch(err => {
console.log("SW Registration failed:", err);
});
navigator.serviceWorker.addEventListener('message', e => {
if (e.data.type === 'check-reminder') {
render(); // trigger reminder H-7, H-3, Expired
}
});
}
</script>
<script type="text/javascript">
function exportData() {
const dataStr = JSON.stringify(members, null, 2);
const blob = new Blob([dataStr], {type: "application/json"});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "backup_members.json";
a.click();
}
function importData(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = function(e) {
const imported = JSON.parse(e.target.result);
if (Array.isArray(imported)) {
members.length = 0;
imported.forEach(m => members.push(m));
alert("Data berhasil di-import ✅");
render();
}
};
reader.readAsText(file);
}
</script>
<script type="text/javascript">
const toggleBtn = document.getElementById("themeToggle");
function applyTheme(theme) {
document.body.classList.add("theme-switching");
setTimeout(() => {
document.body.setAttribute("data-theme", theme);
localStorage.setItem("theme", theme);
toggleBtn.textContent = theme === "dark" ? "☀ Light Mode" : "🌙 Dark Mode";
}, 150);
setTimeout(() => {
document.body.classList.remove("theme-switching");
}, 400);
}
toggleBtn.onclick = () => {
const current = document.body.getAttribute("data-theme") || "dark";
applyTheme(current === "dark" ? "light" : "dark");
};
// Load saved theme
const savedTheme = localStorage.getItem("theme");
if (savedTheme) {
applyTheme(savedTheme);
} else { // optional: ikut sistem device
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
applyTheme(prefersDark ? "dark" : "light");
}
</script>
<audio id="audiomember" src="stockid_suara/member.mp3"></audio>
<audio id="audiocari" src="stockid_suara/cari.mp3"></audio>
<audio id="audiofilter" src="stockid_suara/filter.mp3"></audio>
<audio id="notifSound" src="stockid_suara/notif.mp3"></audio>
</body>
</html>