nodebb-plugin-niki-loyalty 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +15 -90
- package/package.json +1 -1
- package/static/widgets/niki-kasa-debug.html +1020 -0
- package/static/widgets/niki-kasa-isolated.html +419 -0
- package/static/widgets/niki-kasa-simple.html +623 -0
- package/static/widgets/niki-kasa-widget.html +506 -0
- package/templates/niki-kasa.tpl +54 -409
|
@@ -0,0 +1,1020 @@
|
|
|
1
|
+
<script src="https://unpkg.com/html5-qrcode" type="text/javascript"></script>
|
|
2
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
|
|
3
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/locale/tr.min.js"></script>
|
|
4
|
+
|
|
5
|
+
<style>
|
|
6
|
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
|
|
7
|
+
|
|
8
|
+
body.niki-kasa-body {
|
|
9
|
+
background-color: #000;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#content {
|
|
16
|
+
padding: 0 !important;
|
|
17
|
+
margin: 0 !important;
|
|
18
|
+
width: 100% !important;
|
|
19
|
+
background: #000;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.start-view {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
background: #111;
|
|
29
|
+
z-index: 100;
|
|
30
|
+
color: #fff;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
font-family: 'Poppins', sans-serif;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.logo-box {
|
|
39
|
+
width: 90px;
|
|
40
|
+
height: 90px;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
border: 3px solid #C5A065;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
margin-bottom: 30px;
|
|
47
|
+
box-shadow: 0 0 30px rgba(197, 160, 101, 0.2);
|
|
48
|
+
background: #000;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.btn-start {
|
|
52
|
+
background: #C5A065;
|
|
53
|
+
color: #000;
|
|
54
|
+
padding: 18px 40px;
|
|
55
|
+
border-radius: 14px;
|
|
56
|
+
font-weight: 700;
|
|
57
|
+
border: none;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 10px;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
margin-bottom: 15px;
|
|
64
|
+
width: 260px;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
box-shadow: 0 5px 15px rgba(197, 160, 101, 0.3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.btn-hist {
|
|
70
|
+
background: #222;
|
|
71
|
+
color: #fff;
|
|
72
|
+
padding: 18px 40px;
|
|
73
|
+
border-radius: 14px;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
border: 1px solid #333;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: 10px;
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
width: 260px;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.camera-ui {
|
|
86
|
+
position: fixed;
|
|
87
|
+
top: 0;
|
|
88
|
+
left: 0;
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
background: #000;
|
|
92
|
+
display: none;
|
|
93
|
+
z-index: 200;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
#reader {
|
|
97
|
+
width: 100% !important;
|
|
98
|
+
height: 100% !important;
|
|
99
|
+
border: none !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#reader video {
|
|
103
|
+
object-fit: cover !important;
|
|
104
|
+
width: 100% !important;
|
|
105
|
+
height: 100% !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.session-bar-bg {
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
width: 100%;
|
|
113
|
+
height: 6px;
|
|
114
|
+
background: rgba(255, 255, 255, 0.2);
|
|
115
|
+
z-index: 220;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.session-bar-fill {
|
|
119
|
+
height: 100%;
|
|
120
|
+
background: #C5A065;
|
|
121
|
+
width: 100%;
|
|
122
|
+
transition: width 1s linear;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.top-ctrl {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: 20px;
|
|
128
|
+
left: 0;
|
|
129
|
+
width: 100%;
|
|
130
|
+
padding: 0 20px;
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
z-index: 230;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.badge-live {
|
|
138
|
+
background: rgba(0, 0, 0, 0.6);
|
|
139
|
+
color: #C5A065;
|
|
140
|
+
padding: 6px 14px;
|
|
141
|
+
border-radius: 20px;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
border: 1px solid rgba(197, 160, 101, 0.4);
|
|
145
|
+
backdrop-filter: blur(4px);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.btn-x {
|
|
149
|
+
background: rgba(255, 255, 255, 0.2);
|
|
150
|
+
width: 40px;
|
|
151
|
+
height: 40px;
|
|
152
|
+
border-radius: 50%;
|
|
153
|
+
border: none;
|
|
154
|
+
color: #fff;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
font-size: 18px;
|
|
157
|
+
backdrop-filter: blur(4px);
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.scan-guide {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 50%;
|
|
166
|
+
left: 50%;
|
|
167
|
+
transform: translate(-50%, -50%);
|
|
168
|
+
width: 70vw;
|
|
169
|
+
height: 70vw;
|
|
170
|
+
max-width: 300px;
|
|
171
|
+
max-height: 300px;
|
|
172
|
+
box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.85);
|
|
173
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
174
|
+
border-radius: 24px;
|
|
175
|
+
pointer-events: none;
|
|
176
|
+
z-index: 210;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.scan-guide::before {
|
|
180
|
+
content: '';
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: -2px;
|
|
183
|
+
left: -2px;
|
|
184
|
+
width: 40px;
|
|
185
|
+
height: 40px;
|
|
186
|
+
border-top: 5px solid #C5A065;
|
|
187
|
+
border-left: 5px solid #C5A065;
|
|
188
|
+
border-radius: 20px 0 0 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.scan-guide::after {
|
|
192
|
+
content: '';
|
|
193
|
+
position: absolute;
|
|
194
|
+
bottom: -2px;
|
|
195
|
+
right: -2px;
|
|
196
|
+
width: 40px;
|
|
197
|
+
height: 40px;
|
|
198
|
+
border-bottom: 5px solid #C5A065;
|
|
199
|
+
border-right: 5px solid #C5A065;
|
|
200
|
+
border-radius: 0 0 20px 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.laser {
|
|
204
|
+
width: 100%;
|
|
205
|
+
height: 2px;
|
|
206
|
+
background: #C5A065;
|
|
207
|
+
position: absolute;
|
|
208
|
+
top: 50%;
|
|
209
|
+
box-shadow: 0 0 15px #C5A065;
|
|
210
|
+
animation: scanAnim 2s infinite ease-in-out;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@keyframes scanAnim {
|
|
214
|
+
0% {
|
|
215
|
+
top: 10%;
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
50% {
|
|
220
|
+
opacity: 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
100% {
|
|
224
|
+
top: 90%;
|
|
225
|
+
opacity: 0;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.scan-hint {
|
|
230
|
+
position: absolute;
|
|
231
|
+
bottom: 60px;
|
|
232
|
+
width: 100%;
|
|
233
|
+
text-align: center;
|
|
234
|
+
color: #fff;
|
|
235
|
+
font-size: 13px;
|
|
236
|
+
opacity: 0.8;
|
|
237
|
+
z-index: 220;
|
|
238
|
+
letter-spacing: 0.5px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.res-modal {
|
|
242
|
+
position: fixed;
|
|
243
|
+
bottom: 0;
|
|
244
|
+
left: 0;
|
|
245
|
+
width: 100%;
|
|
246
|
+
background: #1a1a1a;
|
|
247
|
+
border-radius: 30px 30px 0 0;
|
|
248
|
+
padding: 40px 20px;
|
|
249
|
+
text-align: center;
|
|
250
|
+
transform: translateY(110%);
|
|
251
|
+
transition: transform 0.3s;
|
|
252
|
+
z-index: 600;
|
|
253
|
+
box-sizing: border-box;
|
|
254
|
+
border-top: 1px solid #333;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.res-modal.active {
|
|
258
|
+
transform: translateY(0);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.icon-big {
|
|
262
|
+
font-size: 60px;
|
|
263
|
+
margin-bottom: 15px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.res-title {
|
|
267
|
+
color: #fff;
|
|
268
|
+
font-size: 24px;
|
|
269
|
+
font-weight: 700;
|
|
270
|
+
margin-bottom: 10px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.res-msg {
|
|
274
|
+
color: #aaa;
|
|
275
|
+
font-size: 15px;
|
|
276
|
+
margin-bottom: 30px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.btn-new {
|
|
280
|
+
background: #fff;
|
|
281
|
+
color: #000;
|
|
282
|
+
width: 100%;
|
|
283
|
+
padding: 18px;
|
|
284
|
+
border-radius: 16px;
|
|
285
|
+
font-size: 16px;
|
|
286
|
+
font-weight: 700;
|
|
287
|
+
border: none;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.hist-modal {
|
|
292
|
+
position: fixed;
|
|
293
|
+
top: 0;
|
|
294
|
+
left: 0;
|
|
295
|
+
width: 100%;
|
|
296
|
+
height: 100%;
|
|
297
|
+
background: #0a0a0a;
|
|
298
|
+
z-index: 700;
|
|
299
|
+
display: none;
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
font-family: 'Poppins', sans-serif;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.hist-head {
|
|
305
|
+
padding: 16px 20px;
|
|
306
|
+
background: linear-gradient(180deg, #151515, #1a1a1a);
|
|
307
|
+
color: #fff;
|
|
308
|
+
display: flex;
|
|
309
|
+
justify-content: space-between;
|
|
310
|
+
align-items: center;
|
|
311
|
+
border-bottom: 1px solid #222;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.hist-head-title {
|
|
315
|
+
font-weight: 700;
|
|
316
|
+
letter-spacing: 1px;
|
|
317
|
+
font-size: 16px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.hist-stats {
|
|
321
|
+
display: grid;
|
|
322
|
+
grid-template-columns: repeat(3, 1fr);
|
|
323
|
+
gap: 12px;
|
|
324
|
+
padding: 16px 20px;
|
|
325
|
+
background: #0f0f0f;
|
|
326
|
+
border-bottom: 1px solid #1a1a1a;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.stat-card {
|
|
330
|
+
background: linear-gradient(145deg, #1a1a1a, #141414);
|
|
331
|
+
border-radius: 14px;
|
|
332
|
+
padding: 14px 12px;
|
|
333
|
+
text-align: center;
|
|
334
|
+
border: 1px solid #222;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.stat-value {
|
|
338
|
+
font-size: 24px;
|
|
339
|
+
font-weight: 700;
|
|
340
|
+
color: #C5A065;
|
|
341
|
+
margin-bottom: 4px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.stat-label {
|
|
345
|
+
font-size: 11px;
|
|
346
|
+
color: #777;
|
|
347
|
+
text-transform: uppercase;
|
|
348
|
+
letter-spacing: 0.5px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.hist-filters {
|
|
352
|
+
padding: 14px 20px;
|
|
353
|
+
background: #0d0d0d;
|
|
354
|
+
border-bottom: 1px solid #1a1a1a;
|
|
355
|
+
display: flex;
|
|
356
|
+
flex-wrap: wrap;
|
|
357
|
+
gap: 10px;
|
|
358
|
+
align-items: center;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.filter-group {
|
|
362
|
+
display: flex;
|
|
363
|
+
flex-direction: column;
|
|
364
|
+
gap: 4px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.filter-group label {
|
|
368
|
+
font-size: 10px;
|
|
369
|
+
color: #666;
|
|
370
|
+
text-transform: uppercase;
|
|
371
|
+
letter-spacing: 0.5px;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.filter-input {
|
|
375
|
+
background: #1a1a1a;
|
|
376
|
+
border: 1px solid #2a2a2a;
|
|
377
|
+
border-radius: 10px;
|
|
378
|
+
padding: 10px 14px;
|
|
379
|
+
color: #fff;
|
|
380
|
+
font-size: 13px;
|
|
381
|
+
min-width: 130px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.filter-input:focus {
|
|
385
|
+
outline: none;
|
|
386
|
+
border-color: #C5A065;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.filter-select {
|
|
390
|
+
background: #1a1a1a;
|
|
391
|
+
border: 1px solid #2a2a2a;
|
|
392
|
+
border-radius: 10px;
|
|
393
|
+
padding: 10px 14px;
|
|
394
|
+
color: #fff;
|
|
395
|
+
font-size: 13px;
|
|
396
|
+
min-width: 140px;
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.filter-btn {
|
|
401
|
+
background: #C5A065;
|
|
402
|
+
color: #000;
|
|
403
|
+
border: none;
|
|
404
|
+
border-radius: 10px;
|
|
405
|
+
padding: 10px 16px;
|
|
406
|
+
font-weight: 600;
|
|
407
|
+
font-size: 13px;
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
display: flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
gap: 6px;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.filter-btn.secondary {
|
|
415
|
+
background: #2a2a2a;
|
|
416
|
+
color: #fff;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.action-buttons {
|
|
420
|
+
margin-left: auto;
|
|
421
|
+
display: flex;
|
|
422
|
+
gap: 8px;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.btn-csv {
|
|
426
|
+
background: linear-gradient(145deg, #2E7D32, #1B5E20);
|
|
427
|
+
color: #fff;
|
|
428
|
+
border: none;
|
|
429
|
+
border-radius: 10px;
|
|
430
|
+
padding: 10px 16px;
|
|
431
|
+
font-weight: 600;
|
|
432
|
+
font-size: 13px;
|
|
433
|
+
cursor: pointer;
|
|
434
|
+
display: flex;
|
|
435
|
+
align-items: center;
|
|
436
|
+
gap: 6px;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.hist-body {
|
|
440
|
+
flex: 1;
|
|
441
|
+
overflow-y: auto;
|
|
442
|
+
padding: 10px 0;
|
|
443
|
+
list-style: none;
|
|
444
|
+
margin: 0;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.hist-row {
|
|
448
|
+
display: flex;
|
|
449
|
+
align-items: center;
|
|
450
|
+
padding: 14px 20px;
|
|
451
|
+
margin: 8px 16px;
|
|
452
|
+
border-radius: 14px;
|
|
453
|
+
background: linear-gradient(145deg, #161616, #121212);
|
|
454
|
+
border: 1px solid #1f1f1f;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.hist-u-img {
|
|
458
|
+
width: 48px;
|
|
459
|
+
height: 48px;
|
|
460
|
+
border-radius: 50%;
|
|
461
|
+
margin-right: 14px;
|
|
462
|
+
border: 2px solid #2a2a2a;
|
|
463
|
+
object-fit: cover;
|
|
464
|
+
background: #1a1a1a;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.hist-info {
|
|
468
|
+
flex: 1;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.hist-u-name {
|
|
472
|
+
display: block;
|
|
473
|
+
font-weight: 700;
|
|
474
|
+
font-size: 14px;
|
|
475
|
+
color: #f0f0f0;
|
|
476
|
+
margin-bottom: 3px;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.hist-meta {
|
|
480
|
+
display: flex;
|
|
481
|
+
align-items: center;
|
|
482
|
+
gap: 8px;
|
|
483
|
+
flex-wrap: wrap;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.hist-time {
|
|
487
|
+
font-size: 12px;
|
|
488
|
+
color: #666;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.hist-staff {
|
|
492
|
+
font-size: 11px;
|
|
493
|
+
color: #888;
|
|
494
|
+
background: #1f1f1f;
|
|
495
|
+
padding: 3px 8px;
|
|
496
|
+
border-radius: 6px;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.hist-reward-badge {
|
|
500
|
+
font-size: 11px;
|
|
501
|
+
color: #C5A065;
|
|
502
|
+
background: rgba(197, 160, 101, 0.15);
|
|
503
|
+
padding: 3px 8px;
|
|
504
|
+
border-radius: 6px;
|
|
505
|
+
border: 1px solid rgba(197, 160, 101, 0.3);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.hist-val {
|
|
509
|
+
background: rgba(198, 40, 40, 0.15);
|
|
510
|
+
border: 1px solid rgba(198, 40, 40, 0.3);
|
|
511
|
+
color: #ef5350;
|
|
512
|
+
padding: 10px 14px;
|
|
513
|
+
border-radius: 12px;
|
|
514
|
+
font-size: 14px;
|
|
515
|
+
font-weight: 700;
|
|
516
|
+
min-width: 70px;
|
|
517
|
+
text-align: center;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.hist-empty {
|
|
521
|
+
text-align: center;
|
|
522
|
+
padding: 60px 20px;
|
|
523
|
+
color: #555;
|
|
524
|
+
list-style: none;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.hist-empty i {
|
|
528
|
+
font-size: 48px;
|
|
529
|
+
margin-bottom: 16px;
|
|
530
|
+
display: block;
|
|
531
|
+
opacity: 0.5;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.hist-loading {
|
|
535
|
+
text-align: center;
|
|
536
|
+
padding: 40px;
|
|
537
|
+
color: #666;
|
|
538
|
+
list-style: none;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.hist-loading .spinner {
|
|
542
|
+
display: inline-block;
|
|
543
|
+
width: 30px;
|
|
544
|
+
height: 30px;
|
|
545
|
+
border: 3px solid #333;
|
|
546
|
+
border-top-color: #C5A065;
|
|
547
|
+
border-radius: 50%;
|
|
548
|
+
animation: spin 1s linear infinite;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
@keyframes spin {
|
|
552
|
+
to {
|
|
553
|
+
transform: rotate(360deg);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.start-view {
|
|
558
|
+
background: radial-gradient(1200px 700px at 50% 10%, rgba(197, 160, 101, 0.18), transparent 60%), linear-gradient(180deg, #0b0b0b, #111 55%, #0b0b0b);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.btn-group {
|
|
562
|
+
display: grid;
|
|
563
|
+
gap: 12px;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.res-close {
|
|
567
|
+
position: absolute;
|
|
568
|
+
top: 14px;
|
|
569
|
+
right: 14px;
|
|
570
|
+
width: 42px;
|
|
571
|
+
height: 42px;
|
|
572
|
+
border-radius: 50%;
|
|
573
|
+
background: rgba(255, 255, 255, 0.12);
|
|
574
|
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
575
|
+
color: #fff;
|
|
576
|
+
display: flex;
|
|
577
|
+
align-items: center;
|
|
578
|
+
justify-content: center;
|
|
579
|
+
cursor: pointer;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
@media (max-width: 600px) {
|
|
583
|
+
.hist-stats {
|
|
584
|
+
grid-template-columns: repeat(2, 1fr);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.hist-filters {
|
|
588
|
+
flex-direction: column;
|
|
589
|
+
align-items: stretch;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.filter-group {
|
|
593
|
+
width: 100%;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.filter-input,
|
|
597
|
+
.filter-select {
|
|
598
|
+
width: 100%;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.action-buttons {
|
|
602
|
+
width: 100%;
|
|
603
|
+
margin-left: 0;
|
|
604
|
+
margin-top: 8px;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
</style>
|
|
608
|
+
|
|
609
|
+
<div id="start-view" class="start-view">
|
|
610
|
+
<div class="logo-box"><i class="fa fa-qrcode" style="font-size:45px; color:#C5A065;"></i></div>
|
|
611
|
+
<h2 style="margin:0 0 5px; font-size:24px;">NIKI POS</h2>
|
|
612
|
+
<p style="color:#888; font-size:13px; margin:0 0 40px;">Yetkili Personel Terminali</p>
|
|
613
|
+
<div class="btn-group">
|
|
614
|
+
<button class="btn-start" onclick="initSession()"><i class="fa fa-camera"></i> OTURUMU BAŞLAT</button>
|
|
615
|
+
<button class="btn-hist" onclick="openHistory()"><i class="fa fa-history"></i> İŞLEM GEÇMİŞİ</button>
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
<div id="camera-ui" class="camera-ui">
|
|
620
|
+
<div class="session-bar-bg">
|
|
621
|
+
<div class="session-bar-fill" id="timer-bar"></div>
|
|
622
|
+
</div>
|
|
623
|
+
<div class="top-ctrl">
|
|
624
|
+
<div class="badge-live">● CANLI</div>
|
|
625
|
+
<button class="btn-x" onclick="stopSession()"><i class="fa fa-times"></i></button>
|
|
626
|
+
</div>
|
|
627
|
+
<div id="reader"></div>
|
|
628
|
+
<div class="scan-guide">
|
|
629
|
+
<div class="laser"></div>
|
|
630
|
+
</div>
|
|
631
|
+
<div class="scan-hint">QR Kodu karenin içine tutun</div>
|
|
632
|
+
</div>
|
|
633
|
+
|
|
634
|
+
<div id="res-view" class="res-modal">
|
|
635
|
+
<button class="res-close" onclick="stopSession()"><i class="fa fa-times"></i></button>
|
|
636
|
+
<div id="res-icon" class="icon-big"></div>
|
|
637
|
+
<div id="res-title" class="res-title">...</div>
|
|
638
|
+
<div id="res-msg" class="res-msg">...</div>
|
|
639
|
+
<button class="btn-new" onclick="resumeScan()">YENİ İŞLEM</button>
|
|
640
|
+
</div>
|
|
641
|
+
|
|
642
|
+
<div id="hist-view" class="hist-modal">
|
|
643
|
+
<div class="hist-head">
|
|
644
|
+
<span class="hist-head-title"><i class="fa fa-history"></i> İŞLEM GEÇMİŞİ</span>
|
|
645
|
+
<button onclick="closeHistory()"
|
|
646
|
+
style="background:none; border:none; color:#fff; font-size:20px; cursor:pointer;"><i
|
|
647
|
+
class="fa fa-times"></i></button>
|
|
648
|
+
</div>
|
|
649
|
+
<div class="hist-stats">
|
|
650
|
+
<div class="stat-card">
|
|
651
|
+
<div class="stat-value" id="stat-total">0</div>
|
|
652
|
+
<div class="stat-label">Toplam İşlem</div>
|
|
653
|
+
</div>
|
|
654
|
+
<div class="stat-card">
|
|
655
|
+
<div class="stat-value" id="stat-points">0</div>
|
|
656
|
+
<div class="stat-label">Toplam Puan</div>
|
|
657
|
+
</div>
|
|
658
|
+
<div class="stat-card">
|
|
659
|
+
<div class="stat-value" id="stat-today">0</div>
|
|
660
|
+
<div class="stat-label">Bugün</div>
|
|
661
|
+
</div>
|
|
662
|
+
</div>
|
|
663
|
+
<div class="hist-filters">
|
|
664
|
+
<div class="filter-group">
|
|
665
|
+
<label>Başlangıç</label>
|
|
666
|
+
<input type="date" class="filter-input" id="filter-start">
|
|
667
|
+
</div>
|
|
668
|
+
<div class="filter-group">
|
|
669
|
+
<label>Bitiş</label>
|
|
670
|
+
<input type="date" class="filter-input" id="filter-end">
|
|
671
|
+
</div>
|
|
672
|
+
<div class="filter-group">
|
|
673
|
+
<label>Ara</label>
|
|
674
|
+
<input type="text" class="filter-input" id="filter-search" placeholder="Kullanıcı adı...">
|
|
675
|
+
</div>
|
|
676
|
+
<div class="filter-group">
|
|
677
|
+
<label>Ödül Tipi</label>
|
|
678
|
+
<select class="filter-select" id="filter-reward">
|
|
679
|
+
<option value="all">Tümü</option>
|
|
680
|
+
</select>
|
|
681
|
+
</div>
|
|
682
|
+
<button class="filter-btn" onclick="applyFilters()"><i class="fa fa-filter"></i> Filtrele</button>
|
|
683
|
+
<button class="filter-btn secondary" onclick="clearFilters()"><i class="fa fa-refresh"></i> Sıfırla</button>
|
|
684
|
+
<div class="action-buttons">
|
|
685
|
+
<button class="btn-csv" onclick="exportCSV()"><i class="fa fa-download"></i> CSV İndir</button>
|
|
686
|
+
</div>
|
|
687
|
+
</div>
|
|
688
|
+
<ul id="hist-list" class="hist-body"></ul>
|
|
689
|
+
</div>
|
|
690
|
+
|
|
691
|
+
<script>
|
|
692
|
+
console.log('=== NIKI POS WIDGET LOADED ===');
|
|
693
|
+
|
|
694
|
+
var html5QrCode;
|
|
695
|
+
var isProcessing = false;
|
|
696
|
+
var sessionTimer;
|
|
697
|
+
var currentHistoryData = [];
|
|
698
|
+
|
|
699
|
+
// Moment.js locale
|
|
700
|
+
if (typeof moment !== 'undefined') {
|
|
701
|
+
moment.locale('tr');
|
|
702
|
+
console.log('[NIKI] moment.js loaded, locale:', moment.locale());
|
|
703
|
+
} else {
|
|
704
|
+
console.error('[NIKI] moment.js NOT loaded!');
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function initSession() {
|
|
708
|
+
console.log('[NIKI] initSession called');
|
|
709
|
+
$('#start-view').fadeOut(200);
|
|
710
|
+
$('#camera-ui').fadeIn(300);
|
|
711
|
+
startTimer(600);
|
|
712
|
+
html5QrCode = new Html5Qrcode("reader");
|
|
713
|
+
Html5Qrcode.getCameras().then(function (devices) {
|
|
714
|
+
if (devices && devices.length) {
|
|
715
|
+
var cameraId = devices[devices.length - 1].id;
|
|
716
|
+
for (var i = 0; i < devices.length; i++) {
|
|
717
|
+
var label = devices[i].label.toLowerCase();
|
|
718
|
+
if (label.indexOf("back") > -1 || label.indexOf("arka") > -1 || label.indexOf("environment") > -1) {
|
|
719
|
+
cameraId = devices[i].id;
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
html5QrCode.start(cameraId, { fps: 15, aspectRatio: window.innerWidth / window.innerHeight }, onScanSuccess);
|
|
724
|
+
} else {
|
|
725
|
+
alert("Kamera bulunamadı!");
|
|
726
|
+
stopSession();
|
|
727
|
+
}
|
|
728
|
+
}).catch(function (err) {
|
|
729
|
+
alert("Kamera Başlatılamadı: " + err);
|
|
730
|
+
stopSession();
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
function startTimer(duration) {
|
|
735
|
+
var timeLeft = duration;
|
|
736
|
+
$('#timer-bar').css('width', '100%');
|
|
737
|
+
clearInterval(sessionTimer);
|
|
738
|
+
sessionTimer = setInterval(function () {
|
|
739
|
+
timeLeft--;
|
|
740
|
+
var pct = (timeLeft / duration) * 100;
|
|
741
|
+
$('#timer-bar').css('width', pct + '%');
|
|
742
|
+
if (timeLeft <= 0) { alert("Oturum doldu."); stopSession(); }
|
|
743
|
+
}, 1000);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
function onScanSuccess(decodedText) {
|
|
747
|
+
if (isProcessing) return;
|
|
748
|
+
isProcessing = true;
|
|
749
|
+
html5QrCode.pause();
|
|
750
|
+
$.post('/api/niki-loyalty/scan-qr', { token: decodedText, _csrf: config.csrf_token }, function (res) {
|
|
751
|
+
if (res.success) {
|
|
752
|
+
$('#res-icon').html('<i class="fa fa-check-circle" style="color:#2E7D32"></i>');
|
|
753
|
+
$('#res-title').text('ÖDEME ALINDI');
|
|
754
|
+
$('#res-msg').html('<b>' + res.customer.username + '</b><br>' + res.cost + ' Puan Tahsil Edildi.');
|
|
755
|
+
} else {
|
|
756
|
+
$('#res-icon').html('<i class="fa fa-times-circle" style="color:#C62828"></i>');
|
|
757
|
+
$('#res-title').text('HATA');
|
|
758
|
+
$('#res-msg').text(res.message);
|
|
759
|
+
}
|
|
760
|
+
$('#res-view').addClass('active');
|
|
761
|
+
}).fail(function () { alert("Sunucu Hatası!"); resumeScan(); });
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function resumeScan() {
|
|
765
|
+
$('#res-view').removeClass('active');
|
|
766
|
+
setTimeout(function () { isProcessing = false; html5QrCode.resume(); }, 300);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function stopSession() {
|
|
770
|
+
clearInterval(sessionTimer);
|
|
771
|
+
if (html5QrCode) html5QrCode.stop().then(function () { html5QrCode.clear(); }).catch(function () { });
|
|
772
|
+
$('#camera-ui').hide();
|
|
773
|
+
$('#res-view').removeClass('active');
|
|
774
|
+
$('#start-view').fadeIn(200);
|
|
775
|
+
isProcessing = false;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// =============================
|
|
779
|
+
// İŞLEM GEÇMİŞİ - DEBUG VERSİYON
|
|
780
|
+
// =============================
|
|
781
|
+
|
|
782
|
+
function openHistory() {
|
|
783
|
+
console.log('[NIKI] openHistory called');
|
|
784
|
+
var histView = document.getElementById('hist-view');
|
|
785
|
+
console.log('[NIKI] hist-view element:', histView);
|
|
786
|
+
if (histView) {
|
|
787
|
+
histView.style.display = 'flex';
|
|
788
|
+
console.log('[NIKI] hist-view displayed');
|
|
789
|
+
} else {
|
|
790
|
+
console.error('[NIKI] hist-view NOT FOUND!');
|
|
791
|
+
}
|
|
792
|
+
loadHistory();
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function closeHistory() {
|
|
796
|
+
console.log('[NIKI] closeHistory called');
|
|
797
|
+
var histView = document.getElementById('hist-view');
|
|
798
|
+
if (histView) histView.style.display = 'none';
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function loadHistory(filters) {
|
|
802
|
+
console.log('[NIKI] === loadHistory START ===');
|
|
803
|
+
filters = filters || {};
|
|
804
|
+
|
|
805
|
+
var list = document.getElementById('hist-list');
|
|
806
|
+
console.log('[NIKI] hist-list element:', list);
|
|
807
|
+
|
|
808
|
+
if (!list) {
|
|
809
|
+
console.error('[NIKI] CRITICAL: hist-list element NOT FOUND!');
|
|
810
|
+
alert('HATA: hist-list elementi bulunamadı!');
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
console.log('[NIKI] Setting loading state...');
|
|
815
|
+
list.innerHTML = '<li class="hist-loading"><div class="spinner"></div><br>Yükleniyor...</li>';
|
|
816
|
+
console.log('[NIKI] Loading state set. Current innerHTML length:', list.innerHTML.length);
|
|
817
|
+
|
|
818
|
+
var url = '/api/niki-loyalty/kasa-history';
|
|
819
|
+
console.log('[NIKI] Fetching from:', url);
|
|
820
|
+
|
|
821
|
+
$.ajax({
|
|
822
|
+
url: url,
|
|
823
|
+
method: 'GET',
|
|
824
|
+
dataType: 'json',
|
|
825
|
+
success: function (response) {
|
|
826
|
+
console.log('[NIKI] === API SUCCESS ===');
|
|
827
|
+
console.log('[NIKI] Response type:', typeof response);
|
|
828
|
+
console.log('[NIKI] Response:', response);
|
|
829
|
+
|
|
830
|
+
var dataToRender = [];
|
|
831
|
+
|
|
832
|
+
if (Array.isArray(response)) {
|
|
833
|
+
console.log('[NIKI] Response is ARRAY with', response.length, 'items');
|
|
834
|
+
dataToRender = response;
|
|
835
|
+
} else if (response && response.data) {
|
|
836
|
+
console.log('[NIKI] Response is OBJECT with data array of', response.data.length, 'items');
|
|
837
|
+
dataToRender = response.data;
|
|
838
|
+
|
|
839
|
+
// Stats güncelle
|
|
840
|
+
if (response.stats) {
|
|
841
|
+
var statTotal = document.getElementById('stat-total');
|
|
842
|
+
var statPoints = document.getElementById('stat-points');
|
|
843
|
+
if (statTotal) statTotal.textContent = response.stats.totalTransactions || dataToRender.length;
|
|
844
|
+
if (statPoints) statPoints.textContent = (response.stats.totalPoints || 0).toLocaleString('tr-TR');
|
|
845
|
+
}
|
|
846
|
+
} else {
|
|
847
|
+
console.log('[NIKI] Response format unknown, setting empty array');
|
|
848
|
+
dataToRender = [];
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
console.log('[NIKI] dataToRender length:', dataToRender.length);
|
|
852
|
+
console.log('[NIKI] First item sample:', dataToRender[0]);
|
|
853
|
+
|
|
854
|
+
currentHistoryData = dataToRender;
|
|
855
|
+
|
|
856
|
+
// Render çağır
|
|
857
|
+
console.log('[NIKI] Calling renderHistoryList...');
|
|
858
|
+
renderHistoryList(dataToRender);
|
|
859
|
+
console.log('[NIKI] === loadHistory END ===');
|
|
860
|
+
},
|
|
861
|
+
error: function (xhr, status, error) {
|
|
862
|
+
console.error('[NIKI] === API ERROR ===');
|
|
863
|
+
console.error('[NIKI] Status:', status);
|
|
864
|
+
console.error('[NIKI] Error:', error);
|
|
865
|
+
console.error('[NIKI] Response:', xhr.responseText);
|
|
866
|
+
if (list) {
|
|
867
|
+
list.innerHTML = '<li class="hist-empty"><i class="fa fa-exclamation-circle"></i> API Hatası: ' + error + '</li>';
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
function renderHistoryList(data) {
|
|
874
|
+
console.log('[NIKI] === renderHistoryList START ===');
|
|
875
|
+
console.log('[NIKI] Data received:', data);
|
|
876
|
+
console.log('[NIKI] Data length:', data ? data.length : 'null/undefined');
|
|
877
|
+
|
|
878
|
+
var list = document.getElementById('hist-list');
|
|
879
|
+
console.log('[NIKI] hist-list in render:', list);
|
|
880
|
+
|
|
881
|
+
if (!list) {
|
|
882
|
+
console.error('[NIKI] CRITICAL: hist-list NOT FOUND in renderHistoryList!');
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Listeyi temizle
|
|
887
|
+
console.log('[NIKI] Clearing list...');
|
|
888
|
+
list.innerHTML = '';
|
|
889
|
+
console.log('[NIKI] List cleared. Children count:', list.children.length);
|
|
890
|
+
|
|
891
|
+
if (!data || data.length === 0) {
|
|
892
|
+
console.log('[NIKI] No data to render, showing empty message');
|
|
893
|
+
list.innerHTML = '<li class="hist-empty"><i class="fa fa-inbox"></i> İşlem bulunamadı</li>';
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
console.log('[NIKI] Starting to render', data.length, 'items...');
|
|
898
|
+
|
|
899
|
+
for (var i = 0; i < data.length; i++) {
|
|
900
|
+
var item = data[i];
|
|
901
|
+
|
|
902
|
+
if (i === 0) {
|
|
903
|
+
console.log('[NIKI] Rendering first item:', item);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
var timeAgo = 'Bilinmiyor';
|
|
907
|
+
var exactTime = '';
|
|
908
|
+
try {
|
|
909
|
+
if (typeof moment !== 'undefined' && item.ts) {
|
|
910
|
+
timeAgo = moment(item.ts).fromNow();
|
|
911
|
+
exactTime = moment(item.ts).format('DD MMM YYYY, HH:mm');
|
|
912
|
+
}
|
|
913
|
+
} catch (e) {
|
|
914
|
+
console.error('[NIKI] Moment error:', e);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
var customerName = item.cust || 'Bilinmeyen';
|
|
918
|
+
var staffName = item.staffName || '';
|
|
919
|
+
var rewardName = item.reward || 'İşlem';
|
|
920
|
+
var amount = item.amt || 250;
|
|
921
|
+
var picture = item.picture || 'https://via.placeholder.com/50';
|
|
922
|
+
|
|
923
|
+
var staffBadge = '';
|
|
924
|
+
if (staffName) {
|
|
925
|
+
staffBadge = '<span class="hist-staff"><i class="fa fa-user-circle"></i> ' + staffName + '</span>';
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
var li = document.createElement('li');
|
|
929
|
+
li.className = 'hist-row';
|
|
930
|
+
li.innerHTML =
|
|
931
|
+
'<img src="' + picture + '" class="hist-u-img" onerror="this.src=\'https://via.placeholder.com/50\'">' +
|
|
932
|
+
'<div class="hist-info">' +
|
|
933
|
+
'<span class="hist-u-name">' + customerName + '</span>' +
|
|
934
|
+
'<div class="hist-meta">' +
|
|
935
|
+
'<span class="hist-time" title="' + exactTime + '">' + timeAgo + '</span>' +
|
|
936
|
+
staffBadge +
|
|
937
|
+
'<span class="hist-reward-badge">' + rewardName + '</span>' +
|
|
938
|
+
'</div>' +
|
|
939
|
+
'</div>' +
|
|
940
|
+
'<div class="hist-val">-' + amount + '</div>';
|
|
941
|
+
|
|
942
|
+
list.appendChild(li);
|
|
943
|
+
|
|
944
|
+
if (i === 0) {
|
|
945
|
+
console.log('[NIKI] First item appended. List children:', list.children.length);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
console.log('[NIKI] === renderHistoryList END ===');
|
|
950
|
+
console.log('[NIKI] Final list children count:', list.children.length);
|
|
951
|
+
console.log('[NIKI] Final list innerHTML length:', list.innerHTML.length);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
function applyFilters() {
|
|
955
|
+
loadHistory({
|
|
956
|
+
startDate: document.getElementById('filter-start').value,
|
|
957
|
+
endDate: document.getElementById('filter-end').value,
|
|
958
|
+
search: document.getElementById('filter-search').value,
|
|
959
|
+
rewardType: document.getElementById('filter-reward').value
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function clearFilters() {
|
|
964
|
+
document.getElementById('filter-start').value = '';
|
|
965
|
+
document.getElementById('filter-end').value = '';
|
|
966
|
+
document.getElementById('filter-search').value = '';
|
|
967
|
+
document.getElementById('filter-reward').value = 'all';
|
|
968
|
+
loadHistory();
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function exportCSV() {
|
|
972
|
+
$.get('/api/niki-loyalty/kasa-history?exportAll=true', function (response) {
|
|
973
|
+
var data = response.data || response || [];
|
|
974
|
+
if (!data.length) { alert('Veri yok'); return; }
|
|
975
|
+
var headers = ['Tarih', 'Müşteri', 'Ödül', 'Puan'];
|
|
976
|
+
var rows = [];
|
|
977
|
+
for (var i = 0; i < data.length; i++) {
|
|
978
|
+
var item = data[i];
|
|
979
|
+
rows.push([
|
|
980
|
+
moment(item.ts).format('DD.MM.YYYY HH:mm'),
|
|
981
|
+
'"' + (item.cust || '') + '"',
|
|
982
|
+
'"' + (item.reward || '') + '"',
|
|
983
|
+
item.amt || 0
|
|
984
|
+
].join(';'));
|
|
985
|
+
}
|
|
986
|
+
var csv = '\uFEFF' + headers.join(';') + '\n' + rows.join('\n');
|
|
987
|
+
var blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
|
988
|
+
var link = document.createElement('a');
|
|
989
|
+
link.href = URL.createObjectURL(blob);
|
|
990
|
+
link.download = 'niki-kasa.csv';
|
|
991
|
+
link.click();
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
// Yetki kontrolü
|
|
996
|
+
$(document).ready(function () {
|
|
997
|
+
console.log('[NIKI] Document ready');
|
|
998
|
+
console.log('[NIKI] app.user:', typeof app !== 'undefined' ? app.user : 'app undefined');
|
|
999
|
+
|
|
1000
|
+
if (typeof app !== 'undefined' && !app.user.isAdmin && !app.user.isGlobalMod) {
|
|
1001
|
+
console.log('[NIKI] User not authorized');
|
|
1002
|
+
$('.start-view').remove();
|
|
1003
|
+
$('body').html('<div style="text-align:center;padding:50px;color:#fff;"><h3>⛔ Yetkisiz Giriş</h3></div>');
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Tarih varsayılanları
|
|
1007
|
+
var today = new Date().toISOString().slice(0, 10);
|
|
1008
|
+
var monthAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString().slice(0, 10);
|
|
1009
|
+
var filterEnd = document.getElementById('filter-end');
|
|
1010
|
+
var filterStart = document.getElementById('filter-start');
|
|
1011
|
+
if (filterEnd) filterEnd.value = today;
|
|
1012
|
+
if (filterStart) filterStart.value = monthAgo;
|
|
1013
|
+
|
|
1014
|
+
console.log('[NIKI] Initial setup complete');
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
$(window).on('action:ajaxify.start', function () { stopSession(); closeHistory(); });
|
|
1018
|
+
|
|
1019
|
+
console.log('=== NIKI POS WIDGET SCRIPT END ===');
|
|
1020
|
+
</script>
|