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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="tr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Admin - Harmon Yazılım</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
9
+ <style>
10
+ * {
11
+ margin: 0;
12
+ padding: 0;
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ body {
17
+ margin: 0;
18
+ padding: 0;
19
+ min-height: 100vh;
20
+ font-family: 'Inter', sans-serif;
21
+ background: #0a0a0a;
22
+ color: #e1e1e1;
23
+ font-size: 14px;
24
+ }
25
+
26
+ .login-container {
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ min-height: 100vh;
31
+ padding: 20px;
32
+ background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
33
+ }
34
+
35
+ .login-form {
36
+ background: #1a1a1a;
37
+ padding: 30px;
38
+ border-radius: 12px;
39
+ width: 100%;
40
+ max-width: 400px;
41
+ box-shadow: 0 8px 16px rgba(0,0,0,0.2);
42
+ }
43
+
44
+ .login-form h1 {
45
+ font-size: 24px;
46
+ margin-bottom: 20px;
47
+ }
48
+
49
+ .form-group {
50
+ margin-bottom: 20px;
51
+ }
52
+
53
+ .form-group label {
54
+ display: block;
55
+ margin-bottom: 8px;
56
+ font-size: 14px;
57
+ }
58
+
59
+ .form-group input {
60
+ width: 100%;
61
+ padding: 10px;
62
+ border: 1px solid #2d3748;
63
+ border-radius: 6px;
64
+ background: #0a0a0a;
65
+ color: #e1e1e1;
66
+ font-size: 14px;
67
+ }
68
+
69
+ .btn {
70
+ padding: 10px 20px;
71
+ font-size: 14px;
72
+ border-radius: 6px;
73
+ cursor: pointer;
74
+ border: none;
75
+ background: #3498db;
76
+ color: white;
77
+ transition: all 0.3s ease;
78
+ }
79
+
80
+ .btn:hover {
81
+ background: #2980b9;
82
+ }
83
+
84
+ .admin-container {
85
+ display: none;
86
+ min-height: 100vh;
87
+ margin-left: 250px;
88
+ }
89
+
90
+ .sidebar {
91
+ width: 250px;
92
+ position: fixed;
93
+ left: 0;
94
+ top: 0;
95
+ height: 100vh;
96
+ background: #1a1a1a;
97
+ padding: 20px;
98
+ box-sizing: border-box;
99
+ }
100
+
101
+ .sidebar-header {
102
+ padding: 0 0 20px 0;
103
+ margin-bottom: 20px;
104
+ border-bottom: 1px solid #2d3748;
105
+ }
106
+
107
+ .sidebar-header h2 {
108
+ font-size: 20px;
109
+ color: #3498db;
110
+ }
111
+
112
+ .sidebar-menu {
113
+ list-style: none;
114
+ padding: 0;
115
+ margin: 0;
116
+ }
117
+
118
+ .sidebar-menu li {
119
+ margin-bottom: 10px;
120
+ }
121
+
122
+ .sidebar-menu a {
123
+ display: flex;
124
+ align-items: center;
125
+ padding: 12px 15px;
126
+ color: #e1e1e1;
127
+ text-decoration: none;
128
+ border-radius: 6px;
129
+ transition: all 0.3s ease;
130
+ }
131
+
132
+ .sidebar-menu a.active {
133
+ background: #3498db;
134
+ color: white;
135
+ }
136
+
137
+ .sidebar-menu a:hover {
138
+ background: rgba(52, 152, 219, 0.1);
139
+ }
140
+
141
+ .sidebar-menu a.active:hover {
142
+ background: #3498db;
143
+ }
144
+
145
+ .sidebar-menu i {
146
+ margin-right: 10px;
147
+ width: 20px;
148
+ }
149
+
150
+ .navbar {
151
+ position: fixed;
152
+ top: 0;
153
+ right: 0;
154
+ left: 250px;
155
+ height: 8vh;
156
+ background: #1a1a1a;
157
+ padding: 0 20px;
158
+ display: flex;
159
+ align-items: center;
160
+ justify-content: space-between;
161
+ z-index: 100;
162
+ }
163
+
164
+ .navbar-brand {
165
+ display: flex;
166
+ align-items: center;
167
+ gap: 0.5rem;
168
+ color: #3498db;
169
+ font-size: 1.25rem;
170
+ font-weight: 600;
171
+ }
172
+
173
+ .navbar-menu {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 1rem;
177
+ }
178
+
179
+ .navbar-menu .btn {
180
+ padding: 0.5rem 1rem;
181
+ min-width: auto;
182
+ }
183
+
184
+ .content-area {
185
+ padding: 10vh 20px 20px;
186
+ }
187
+
188
+ .page-title {
189
+ margin-bottom: 2rem;
190
+ color: #3498db;
191
+ font-size: 1.5rem;
192
+ font-weight: 600;
193
+ }
194
+
195
+ .user-list {
196
+ display: grid;
197
+ gap: 1.5rem;
198
+ }
199
+
200
+ .user-card {
201
+ background: #1a1a1a;
202
+ border-radius: 8px;
203
+ padding: 15px;
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 10px;
207
+ word-wrap: break-word;
208
+ overflow-wrap: break-word;
209
+ }
210
+
211
+ .user-header {
212
+ margin-bottom: 20px;
213
+ }
214
+
215
+ .user-stats {
216
+ display: grid;
217
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
218
+ gap: 15px;
219
+ margin-bottom: 20px;
220
+ }
221
+
222
+ .stat-item {
223
+ background: #0a0a0a;
224
+ padding: 15px;
225
+ border-radius: 6px;
226
+ }
227
+
228
+ .user-actions {
229
+ display: flex;
230
+ gap: 1rem;
231
+ flex-wrap: wrap;
232
+ }
233
+
234
+ .user-actions .btn {
235
+ flex: 1;
236
+ min-width: 120px;
237
+ padding: 0.75rem 1rem;
238
+ }
239
+
240
+ .btn-secondary {
241
+ background-color: transparent;
242
+ border: 2px solid #3498db;
243
+ color: #3498db;
244
+ }
245
+
246
+ .btn-secondary:hover {
247
+ background-color: rgba(52,152,219,0.1);
248
+ transform: translateY(-1px);
249
+ }
250
+
251
+ .btn-danger {
252
+ background-color: #e74c3c;
253
+ color: white;
254
+ }
255
+
256
+ .btn-danger:hover {
257
+ background-color: #c0392b;
258
+ }
259
+
260
+ .status-badge {
261
+ padding: 4px 8px;
262
+ border-radius: 4px;
263
+ font-size: 12px;
264
+ display: inline-flex;
265
+ align-items: center;
266
+ gap: 4px;
267
+ }
268
+
269
+ .status-badge.verified {
270
+ background-color: #2ecc71;
271
+ color: white;
272
+ }
273
+
274
+ .status-badge.unverified {
275
+ background-color: #e74c3c;
276
+ color: white;
277
+ }
278
+
279
+ .stat-value {
280
+ word-break: break-all;
281
+ max-height: 15vh;
282
+ overflow-y: auto;
283
+ padding-right: 5px;
284
+ }
285
+
286
+ .api-details {
287
+ background: #0a0a0a;
288
+ padding: 1rem;
289
+ border-radius: 4px;
290
+ overflow-x: auto;
291
+ color: #e1e1e1;
292
+ font-family: monospace;
293
+ font-size: 0.9rem;
294
+ white-space: pre-wrap;
295
+ word-wrap: break-word;
296
+ max-height: 50vh;
297
+ overflow-y: auto;
298
+ }
299
+
300
+ .modal-body {
301
+ padding: 1rem;
302
+ max-height: 80vh;
303
+ overflow-y: auto;
304
+ word-wrap: break-word;
305
+ overflow-wrap: break-word;
306
+ }
307
+
308
+ .user-auth {
309
+ word-break: break-all;
310
+ max-width: 100%;
311
+ display: inline-block;
312
+ }
313
+
314
+ /* Custom scrollbar styles */
315
+ .stat-value::-webkit-scrollbar,
316
+ .api-details::-webkit-scrollbar,
317
+ .modal-body::-webkit-scrollbar {
318
+ width: 8px;
319
+ height: 8px;
320
+ }
321
+
322
+ .stat-value::-webkit-scrollbar-track,
323
+ .api-details::-webkit-scrollbar-track,
324
+ .modal-body::-webkit-scrollbar-track {
325
+ background: #1a1a1a;
326
+ border-radius: 4px;
327
+ }
328
+
329
+ .stat-value::-webkit-scrollbar-thumb,
330
+ .api-details::-webkit-scrollbar-thumb,
331
+ .modal-body::-webkit-scrollbar-thumb {
332
+ background: #2d3748;
333
+ border-radius: 4px;
334
+ }
335
+
336
+ .stat-value::-webkit-scrollbar-thumb:hover,
337
+ .api-details::-webkit-scrollbar-thumb:hover,
338
+ .modal-body::-webkit-scrollbar-thumb:hover {
339
+ background: #3498db;
340
+ }
341
+
342
+ @media (max-width: 768px) {
343
+ .admin-container {
344
+ margin-left: 0;
345
+ }
346
+
347
+ .sidebar {
348
+ transform: translateX(-100%);
349
+ z-index: 1001;
350
+ box-shadow: 2px 0 10px rgba(0,0,0,0.5);
351
+ }
352
+
353
+ .sidebar.active {
354
+ transform: translateX(0);
355
+ }
356
+
357
+ .navbar {
358
+ left: 0;
359
+ padding: 0 0.8rem;
360
+ height: 7vh;
361
+ }
362
+
363
+ .navbar-brand {
364
+ font-size: 1.1rem;
365
+ }
366
+
367
+ .content-area {
368
+ padding: 8vh 0.8rem 0.8rem;
369
+ }
370
+
371
+ .user-stats {
372
+ grid-template-columns: 1fr;
373
+ gap: 0.8rem;
374
+ }
375
+
376
+ .user-actions {
377
+ flex-direction: column;
378
+ gap: 0.8rem;
379
+ }
380
+
381
+ .user-actions .btn {
382
+ width: 100%;
383
+ min-width: unset;
384
+ }
385
+
386
+ .user-card {
387
+ padding: 0.8rem;
388
+ }
389
+
390
+ .modal-content {
391
+ width: 95%;
392
+ padding: 1rem;
393
+ margin: 0.8rem;
394
+ }
395
+
396
+ .detail-grid {
397
+ grid-template-columns: 1fr;
398
+ }
399
+
400
+ .input-group {
401
+ flex-direction: column;
402
+ gap: 0.8rem;
403
+ }
404
+
405
+ .input-group .btn {
406
+ width: 100%;
407
+ }
408
+
409
+ .settings-form {
410
+ padding: 0.8rem;
411
+ }
412
+ }
413
+
414
+ @media (max-width: 480px) {
415
+ .login-form {
416
+ padding: 1rem;
417
+ margin: 0.8rem;
418
+ }
419
+
420
+ .navbar {
421
+ padding: 0 0.6rem;
422
+ height: 6vh;
423
+ }
424
+
425
+ .navbar-brand {
426
+ font-size: 1rem;
427
+ }
428
+
429
+ .navbar-menu .btn {
430
+ padding: 0.35rem 0.6rem;
431
+ font-size: 0.85rem;
432
+ }
433
+
434
+ .content-area {
435
+ padding: 7vh 0.6rem 0.6rem;
436
+ }
437
+
438
+ .page-title {
439
+ font-size: 1.2rem;
440
+ margin-bottom: 1rem;
441
+ }
442
+
443
+ .user-card {
444
+ padding: 0.6rem;
445
+ }
446
+
447
+ .user-header {
448
+ margin-bottom: 0.8rem;
449
+ }
450
+
451
+ .stat-item {
452
+ padding: 0.6rem;
453
+ }
454
+
455
+ .form-group {
456
+ margin-bottom: 0.8rem;
457
+ }
458
+
459
+ .form-group input {
460
+ padding: 0.4rem;
461
+ font-size: 0.9rem;
462
+ }
463
+
464
+ .btn {
465
+ padding: 0.35rem 0.6rem;
466
+ font-size: 0.85rem;
467
+ }
468
+
469
+ .modal-content {
470
+ padding: 0.8rem;
471
+ }
472
+
473
+ .modal-header {
474
+ padding: 0.6rem;
475
+ }
476
+
477
+ .modal-body {
478
+ padding: 0.6rem;
479
+ }
480
+
481
+ .detail-section {
482
+ padding: 0.6rem;
483
+ margin-bottom: 0.8rem;
484
+ }
485
+
486
+ .detail-section h4 {
487
+ font-size: 1rem;
488
+ margin-bottom: 0.8rem;
489
+ }
490
+
491
+ .api-details {
492
+ padding: 0.6rem;
493
+ font-size: 0.8rem;
494
+ }
495
+
496
+ .status-badge {
497
+ padding: 0.25rem 0.5rem;
498
+ font-size: 0.75rem;
499
+ }
500
+ }
501
+
502
+ .mobile-menu-toggle {
503
+ display: none;
504
+ background: none;
505
+ border: none;
506
+ color: #3498db;
507
+ font-size: 1.5rem;
508
+ cursor: pointer;
509
+ }
510
+
511
+ @media (max-width: 768px) {
512
+ .mobile-menu-toggle {
513
+ display: block;
514
+ }
515
+ }
516
+
517
+ .modal {
518
+ position: fixed;
519
+ top: 0;
520
+ left: 0;
521
+ width: 100%;
522
+ height: 100vh;
523
+ background: rgba(0, 0, 0, 0.8);
524
+ display: flex;
525
+ align-items: center;
526
+ justify-content: center;
527
+ z-index: 1000;
528
+ }
529
+
530
+ .modal-content {
531
+ background: #1a1a1a;
532
+ padding: 20px;
533
+ border-radius: 12px;
534
+ width: 90%;
535
+ max-width: 600px;
536
+ max-height: 90vh;
537
+ overflow-y: auto;
538
+ }
539
+
540
+ .modal-header {
541
+ padding: 1rem;
542
+ border-bottom: 1px solid #2c2c2c;
543
+ display: flex;
544
+ justify-content: space-between;
545
+ align-items: center;
546
+ }
547
+
548
+ .detail-section {
549
+ background: #1f1f1f;
550
+ border-radius: 8px;
551
+ padding: 1.5rem;
552
+ margin-bottom: 1.5rem;
553
+ }
554
+
555
+ .detail-section h4 {
556
+ color: #3498db;
557
+ margin-bottom: 1rem;
558
+ display: flex;
559
+ align-items: center;
560
+ gap: 0.5rem;
561
+ font-size: 1.1rem;
562
+ }
563
+
564
+ .detail-grid {
565
+ display: grid;
566
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
567
+ gap: 1rem;
568
+ }
569
+
570
+ .detail-item {
571
+ background: #2c2c2c;
572
+ padding: 1rem;
573
+ border-radius: 6px;
574
+ display: flex;
575
+ flex-direction: column;
576
+ gap: 0.5rem;
577
+ }
578
+
579
+ .detail-label {
580
+ color: #888;
581
+ font-size: 0.9rem;
582
+ display: flex;
583
+ align-items: center;
584
+ gap: 0.5rem;
585
+ }
586
+
587
+ .detail-value {
588
+ color: #e1e1e1;
589
+ font-size: 1rem;
590
+ display: flex;
591
+ align-items: center;
592
+ gap: 0.5rem;
593
+ flex-wrap: wrap;
594
+ }
595
+
596
+ .input-group {
597
+ display: flex;
598
+ gap: 0.5rem;
599
+ flex-wrap: wrap;
600
+ }
601
+
602
+ .input-group .form-control {
603
+ flex: 1;
604
+ min-width: 200px;
605
+ padding: 0.5rem;
606
+ background: #2c2c2c;
607
+ border: 1px solid #3d3d3d;
608
+ border-radius: 4px;
609
+ color: #e1e1e1;
610
+ }
611
+
612
+ .input-group .btn {
613
+ white-space: nowrap;
614
+ }
615
+
616
+ .btn-sm {
617
+ padding: 0.25rem 0.5rem;
618
+ font-size: 0.875rem;
619
+ }
620
+
621
+ .status-badge {
622
+ padding: 0.25rem 0.5rem;
623
+ border-radius: 4px;
624
+ font-size: 0.875rem;
625
+ display: inline-flex;
626
+ align-items: center;
627
+ gap: 0.25rem;
628
+ font-weight: 500;
629
+ }
630
+
631
+ /* Responsive container */
632
+ .container {
633
+ width: 100%;
634
+ max-width: 100%;
635
+ padding: 10px;
636
+ box-sizing: border-box;
637
+ margin-left: 250px;
638
+ }
639
+
640
+ /* Responsive cards */
641
+ .stat-cards {
642
+ display: grid;
643
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
644
+ gap: 15px;
645
+ margin-bottom: 20px;
646
+ }
647
+
648
+ .stat-card {
649
+ background: #1a1a1a;
650
+ padding: 15px;
651
+ border-radius: 8px;
652
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
653
+ }
654
+
655
+ /* Responsive tables */
656
+ .table-responsive {
657
+ overflow-x: auto;
658
+ margin: 15px 0;
659
+ }
660
+
661
+ table {
662
+ width: 100%;
663
+ border-collapse: collapse;
664
+ }
665
+
666
+ th, td {
667
+ padding: 12px;
668
+ text-align: left;
669
+ border-bottom: 1px solid #2d3748;
670
+ }
671
+
672
+ /* Alert düzeltmesi */
673
+ .alert {
674
+ padding: 12px;
675
+ border-radius: 6px;
676
+ margin-bottom: 15px;
677
+ }
678
+
679
+ .alert-success {
680
+ background: #2ecc71;
681
+ color: white;
682
+ }
683
+
684
+ .alert-error {
685
+ background: #e74c3c;
686
+ color: white;
687
+ }
688
+
689
+ /* Scrollbar düzeltmesi */
690
+ ::-webkit-scrollbar {
691
+ width: 8px;
692
+ }
693
+
694
+ ::-webkit-scrollbar-track {
695
+ background: #1a1a1a;
696
+ }
697
+
698
+ ::-webkit-scrollbar-thumb {
699
+ background: #2d3748;
700
+ border-radius: 4px;
701
+ }
702
+
703
+ /* Ana içerik alanı */
704
+ .main-content {
705
+ margin-top: 60px;
706
+ padding: 15px;
707
+ box-sizing: border-box;
708
+ }
709
+
710
+ @media (max-width: 768px) {
711
+ .main-content {
712
+ margin-top: 50px;
713
+ padding: 10px;
714
+ }
715
+ }
716
+
717
+ /* Kullanıcı kartları */
718
+ .user-cards {
719
+ display: grid;
720
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
721
+ gap: 15px;
722
+ padding: 15px;
723
+ }
724
+
725
+ .user-card {
726
+ background: #1a1a1a;
727
+ border-radius: 8px;
728
+ padding: 15px;
729
+ display: flex;
730
+ flex-direction: column;
731
+ gap: 10px;
732
+ }
733
+
734
+ @media (max-width: 480px) {
735
+ .user-cards {
736
+ grid-template-columns: 1fr;
737
+ padding: 10px;
738
+ }
739
+
740
+ .user-card {
741
+ padding: 10px;
742
+ }
743
+ }
744
+
745
+ /* Domain listesi */
746
+ .domain-list {
747
+ display: grid;
748
+ gap: 10px;
749
+ padding: 10px;
750
+ max-height: 60vh;
751
+ }
752
+
753
+ .domain-item {
754
+ background: #1a1a1a;
755
+ border-radius: 8px;
756
+ padding: 10px;
757
+ display: grid;
758
+ grid-template-columns: 1fr auto;
759
+ align-items: center;
760
+ gap: 10px;
761
+ }
762
+
763
+ @media (max-width: 480px) {
764
+ .domain-list {
765
+ padding: 5px;
766
+ }
767
+
768
+ .domain-item {
769
+ grid-template-columns: 1fr;
770
+ padding: 8px;
771
+ }
772
+ }
773
+
774
+ /* Ayarlar formu */
775
+ .settings-form {
776
+ max-width: 600px;
777
+ margin: 0 auto;
778
+ padding: 15px;
779
+ }
780
+
781
+ .settings-form .form-group {
782
+ margin-bottom: 15px;
783
+ }
784
+
785
+ @media (max-width: 480px) {
786
+ .settings-form {
787
+ padding: 10px;
788
+ }
789
+ }
790
+
791
+ /* Loading spinner */
792
+ .loading-spinner {
793
+ width: 20px;
794
+ height: 20px;
795
+ border: 2px solid #f3f3f3;
796
+ border-top: 2px solid #3498db;
797
+ border-radius: 50%;
798
+ animation: spin 1s linear infinite;
799
+ }
800
+
801
+ @keyframes spin {
802
+ 0% { transform: rotate(0deg); }
803
+ 100% { transform: rotate(360deg); }
804
+ }
805
+
806
+ /* Uzun metinler için */
807
+ .text-truncate {
808
+ white-space: nowrap;
809
+ overflow: hidden;
810
+ text-overflow: ellipsis;
811
+ max-width: 100%;
812
+ }
813
+
814
+ /* Grid layout için */
815
+ .grid-container {
816
+ display: grid;
817
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
818
+ gap: 10px;
819
+ padding: 10px;
820
+ }
821
+
822
+ /* Flex container için */
823
+ .flex-container {
824
+ display: flex;
825
+ flex-wrap: wrap;
826
+ gap: 10px;
827
+ padding: 10px;
828
+ }
829
+
830
+ /* Tooltip için */
831
+ .tooltip {
832
+ position: relative;
833
+ display: inline-block;
834
+ }
835
+
836
+ .tooltip .tooltip-text {
837
+ visibility: hidden;
838
+ background-color: #2d3748;
839
+ color: #e1e1e1;
840
+ text-align: center;
841
+ padding: 5px;
842
+ border-radius: 4px;
843
+ position: absolute;
844
+ z-index: 1;
845
+ bottom: 125%;
846
+ left: 50%;
847
+ transform: translateX(-50%);
848
+ font-size: 11px;
849
+ white-space: nowrap;
850
+ }
851
+
852
+ .tooltip:hover .tooltip-text {
853
+ visibility: visible;
854
+ }
855
+
856
+ .modal-close {
857
+ background: none;
858
+ border: none;
859
+ color: #e1e1e1;
860
+ font-size: 1.5rem;
861
+ cursor: pointer;
862
+ padding: 0.5rem;
863
+ transition: color 0.3s ease;
864
+ }
865
+
866
+ .modal-close:hover {
867
+ color: #3498db;
868
+ }
869
+
870
+ /* Add new styles for stats and search */
871
+ .stats-bar {
872
+ display: flex;
873
+ gap: 20px;
874
+ margin-bottom: 20px;
875
+ flex-wrap: wrap;
876
+ }
877
+
878
+ .stat-box {
879
+ background: #1a1a1a;
880
+ padding: 15px 20px;
881
+ border-radius: 8px;
882
+ display: flex;
883
+ align-items: center;
884
+ gap: 15px;
885
+ flex: 1;
886
+ min-width: 200px;
887
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
888
+ }
889
+
890
+ .stat-box i {
891
+ font-size: 24px;
892
+ color: #3498db;
893
+ }
894
+
895
+ .stat-info {
896
+ display: flex;
897
+ flex-direction: column;
898
+ }
899
+
900
+ .stat-label {
901
+ font-size: 14px;
902
+ color: #888;
903
+ }
904
+
905
+ .stat-value {
906
+ font-size: 24px;
907
+ font-weight: 600;
908
+ color: #e1e1e1;
909
+ }
910
+
911
+ .search-bar {
912
+ margin-bottom: 20px;
913
+ }
914
+
915
+ .search-bar input {
916
+ width: 100%;
917
+ padding: 12px;
918
+ border: 1px solid #2d3748;
919
+ border-radius: 8px;
920
+ background: #1a1a1a;
921
+ color: #e1e1e1;
922
+ font-size: 14px;
923
+ transition: all 0.3s ease;
924
+ }
925
+
926
+ .search-bar input:focus {
927
+ border-color: #3498db;
928
+ box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
929
+ outline: none;
930
+ }
931
+
932
+ .user-item.hidden,
933
+ .domain-item.hidden {
934
+ display: none;
935
+ }
936
+
937
+ /* Add styles for copy button */
938
+ .btn-icon {
939
+ background: none;
940
+ border: none;
941
+ color: #3498db;
942
+ cursor: pointer;
943
+ padding: 5px;
944
+ margin-left: 5px;
945
+ border-radius: 4px;
946
+ transition: all 0.3s ease;
947
+ }
948
+
949
+ .btn-icon:hover {
950
+ background: rgba(52, 152, 219, 0.1);
951
+ transform: scale(1.1);
952
+ }
953
+
954
+ .user-auth {
955
+ display: flex;
956
+ align-items: center;
957
+ gap: 5px;
958
+ }
959
+
960
+ /* Add new styles for verification badges */
961
+ .status-badges {
962
+ display: flex;
963
+ gap: 8px;
964
+ align-items: center;
965
+ }
966
+
967
+ .status-badge.verified {
968
+ background: #2ecc71;
969
+ color: white;
970
+ }
971
+
972
+ .status-badge.unverified {
973
+ background: #e67e22;
974
+ color: white;
975
+ }
976
+
977
+ .btn-success {
978
+ background: #2ecc71;
979
+ color: white;
980
+ }
981
+
982
+ .btn-success:hover {
983
+ background: #27ae60;
984
+ }
985
+
986
+ .user-card[data-auth="1r2yvw8guhpd1rzu29uarxkm4nveqxf2"] {
987
+ border: 1px solid #3498db;
988
+ box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
989
+ }
990
+
991
+ .reseller-list {
992
+ display: grid;
993
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
994
+ gap: 1rem;
995
+ padding: 1rem 0;
996
+ }
997
+
998
+ .reseller-card {
999
+ background: #1f1f1f;
1000
+ border-radius: 8px;
1001
+ padding: 1.5rem;
1002
+ display: flex;
1003
+ flex-direction: column;
1004
+ gap: 1rem;
1005
+ transition: all 0.3s ease;
1006
+ border: 1px solid #2c2c2c;
1007
+ }
1008
+
1009
+ .reseller-card:hover {
1010
+ transform: translateY(-2px);
1011
+ box-shadow: 0 4px 12px rgba(0,0,0,0.2);
1012
+ border-color: #3498db;
1013
+ }
1014
+
1015
+ .reseller-header {
1016
+ display: flex;
1017
+ align-items: center;
1018
+ gap: 1rem;
1019
+ }
1020
+
1021
+ .reseller-avatar {
1022
+ width: 60px;
1023
+ height: 60px;
1024
+ border-radius: 50%;
1025
+ object-fit: cover;
1026
+ border: 2px solid #3498db;
1027
+ }
1028
+
1029
+ .reseller-info {
1030
+ flex: 1;
1031
+ }
1032
+
1033
+ .reseller-name {
1034
+ font-size: 1.1rem;
1035
+ font-weight: 500;
1036
+ color: #3498db;
1037
+ margin-bottom: 0.25rem;
1038
+ }
1039
+
1040
+ .reseller-website {
1041
+ font-size: 0.9rem;
1042
+ color: #888;
1043
+ text-decoration: none;
1044
+ transition: color 0.3s ease;
1045
+ }
1046
+
1047
+ .reseller-website:hover {
1048
+ color: #3498db;
1049
+ }
1050
+
1051
+ .reseller-description {
1052
+ color: #e1e1e1;
1053
+ font-size: 0.9rem;
1054
+ line-height: 1.4;
1055
+ }
1056
+
1057
+ .form-group textarea {
1058
+ width: 100%;
1059
+ min-height: 150px;
1060
+ resize: vertical;
1061
+ padding: 10px;
1062
+ border: 1px solid #2d3748;
1063
+ border-radius: 6px;
1064
+ background: #0a0a0a;
1065
+ color: #e1e1e1;
1066
+ font-size: 14px;
1067
+ font-family: 'Inter', sans-serif;
1068
+ line-height: 1.5;
1069
+ }
1070
+
1071
+ .form-group textarea:focus {
1072
+ border-color: #3498db;
1073
+ outline: none;
1074
+ box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
1075
+ }
1076
+
1077
+ .user-avatar {
1078
+ width: 60px;
1079
+ height: 60px;
1080
+ border-radius: 50%;
1081
+ border: 2px solid #3498db;
1082
+ flex-shrink: 0;
1083
+ background: #1a1a1a;
1084
+ position: relative;
1085
+ overflow: hidden;
1086
+ }
1087
+
1088
+ .user-avatar img {
1089
+ width: 100%;
1090
+ height: 100%;
1091
+ object-fit: cover;
1092
+ object-position: center;
1093
+ }
1094
+
1095
+ .user-header {
1096
+ display: flex;
1097
+ align-items: center;
1098
+ gap: 1rem;
1099
+ }
1100
+
1101
+ .user-info {
1102
+ flex: 1;
1103
+ }
1104
+
1105
+ .user-info h3 {
1106
+ color: #3498db;
1107
+ margin-bottom: 0.25rem;
1108
+ }
1109
+
1110
+ .user-info a {
1111
+ color: #888;
1112
+ text-decoration: none;
1113
+ font-size: 0.9rem;
1114
+ transition: color 0.3s ease;
1115
+ }
1116
+
1117
+ .user-info a:hover {
1118
+ color: #3498db;
1119
+ }
1120
+
1121
+ #toastContainer {
1122
+ position: fixed;
1123
+ top: 20px;
1124
+ right: 20px;
1125
+ z-index: 9999;
1126
+ }
1127
+
1128
+ .toast {
1129
+ background: #333;
1130
+ color: white;
1131
+ padding: 12px 24px;
1132
+ border-radius: 4px;
1133
+ margin-bottom: 10px;
1134
+ min-width: 200px;
1135
+ box-shadow: 0 2px 5px rgba(0,0,0,0.2);
1136
+ animation: slideIn 0.3s ease-in-out;
1137
+ }
1138
+
1139
+ .toast.toast-success {
1140
+ background: #2ecc71;
1141
+ }
1142
+
1143
+ .toast.toast-error {
1144
+ background: #e74c3c;
1145
+ }
1146
+
1147
+ .toast.toast-warning {
1148
+ background: #f1c40f;
1149
+ }
1150
+
1151
+ .toast.fade-out {
1152
+ animation: slideOut 0.3s ease-in-out forwards;
1153
+ }
1154
+
1155
+ @keyframes slideIn {
1156
+ from {
1157
+ transform: translateX(100%);
1158
+ opacity: 0;
1159
+ }
1160
+ to {
1161
+ transform: translateX(0);
1162
+ opacity: 1;
1163
+ }
1164
+ }
1165
+
1166
+ @keyframes slideOut {
1167
+ from {
1168
+ transform: translateX(0);
1169
+ opacity: 1;
1170
+ }
1171
+ to {
1172
+ transform: translateX(100%);
1173
+ opacity: 0;
1174
+ }
1175
+ }
1176
+
1177
+ .detail-item {
1178
+ display: flex;
1179
+ align-items: center;
1180
+ gap: 8px;
1181
+ }
1182
+
1183
+ .detail-item .btn-sm {
1184
+ padding: 2px 8px;
1185
+ font-size: 12px;
1186
+ }
1187
+
1188
+ .detail-value.user-auth {
1189
+ display: flex;
1190
+ align-items: center;
1191
+ gap: 1rem;
1192
+ flex-wrap: wrap;
1193
+ background: #1a1a1a;
1194
+ padding: 0.5rem;
1195
+ border-radius: 4px;
1196
+ font-family: monospace;
1197
+ }
1198
+
1199
+ .detail-value.user-auth .input-group {
1200
+ margin-top: 0.5rem;
1201
+ width: 100%;
1202
+ }
1203
+
1204
+ .detail-value.user-auth .btn-sm {
1205
+ padding: 0.25rem 0.5rem;
1206
+ font-size: 0.75rem;
1207
+ }
1208
+
1209
+ .detail-value.user-auth .form-control {
1210
+ background: #2c2c2c;
1211
+ border: 1px solid #3d3d3d;
1212
+ color: #e1e1e1;
1213
+ padding: 0.25rem 0.5rem;
1214
+ border-radius: 4px;
1215
+ font-family: monospace;
1216
+ }
1217
+ </style>
1218
+ </head>
1219
+ <body>
1220
+ <div class="login-container" id="loginContainer">
1221
+ <form class="login-form" id="loginForm" onsubmit="login(event)">
1222
+ <h1>Admin Girişi</h1>
1223
+ <div class="form-group">
1224
+ <label>Kullanıcı Adı</label>
1225
+ <input type="text" id="username" required>
1226
+ </div>
1227
+ <div class="form-group">
1228
+ <label>Şifre</label>
1229
+ <input type="password" id="password" required>
1230
+ </div>
1231
+ <button type="submit" class="btn">Giriş Yap</button>
1232
+ </form>
1233
+ </div>
1234
+
1235
+ <div class="admin-container" id="adminContainer">
1236
+ <aside class="sidebar" id="sidebar">
1237
+ <div class="sidebar-header">
1238
+ <h2>Admin Panel</h2>
1239
+ </div>
1240
+ <ul class="sidebar-menu">
1241
+ <li>
1242
+ <a href="#" data-page="users" onclick="changePage('users')" class="active">
1243
+ <i class="fas fa-users"></i>
1244
+ Kullanıcılar
1245
+ </a>
1246
+ </li>
1247
+ <li>
1248
+ <a href="#" data-page="domains" onclick="changePage('domains')">
1249
+ <i class="fas fa-globe"></i>
1250
+ Domainler
1251
+ </a>
1252
+ </li>
1253
+ <li>
1254
+ <a href="#" data-page="promo" onclick="changePage('promo')">
1255
+ <i class="fas fa-gift"></i>
1256
+ Promo Kodları
1257
+ </a>
1258
+ </li>
1259
+ <li>
1260
+ <a href="#" data-page="settings" onclick="changePage('settings')">
1261
+ <i class="fas fa-cog"></i>
1262
+ Ayarlar
1263
+ </a>
1264
+ </li>
1265
+ <li>
1266
+ <a href="#" data-page="resellers" onclick="changePage('resellers')">
1267
+ <i class="fas fa-user-check"></i>
1268
+ Resellerlar
1269
+ </a>
1270
+ </li>
1271
+ </ul>
1272
+ </aside>
1273
+
1274
+ <nav class="navbar">
1275
+ <button class="mobile-menu-toggle" onclick="toggleSidebar()">
1276
+ <i class="fas fa-bars"></i>
1277
+ </button>
1278
+ <div class="navbar-brand">
1279
+ <i class="fas fa-shield-alt"></i>
1280
+ Admin - Harmon Yazılım
1281
+ </div>
1282
+ <div class="navbar-menu">
1283
+ <button class="btn btn-secondary" onclick="logout()">
1284
+ <i class="fas fa-sign-out-alt"></i>
1285
+ Çıkış Yap
1286
+ </button>
1287
+ </div>
1288
+ </nav>
1289
+
1290
+ <main class="content-area">
1291
+ <div id="usersPage" class="page active">
1292
+ <h1 class="page-title">Kullanıcı Yönetimi</h1>
1293
+ <div class="stats-bar">
1294
+ <div class="stat-box">
1295
+ <i class="fas fa-users"></i>
1296
+ <div class="stat-info">
1297
+ <span class="stat-label">Toplam Kullanıcı</span>
1298
+ <span class="stat-value" id="totalUserCount">0</span>
1299
+ </div>
1300
+ </div>
1301
+ </div>
1302
+ <div class="search-bar">
1303
+ <input type="text" id="userSearch" placeholder="Kullanıcı ara..." onkeyup="searchUsers()">
1304
+ </div>
1305
+ <div class="user-list" id="userList">
1306
+ <!-- Users will be loaded here -->
1307
+ </div>
1308
+ </div>
1309
+
1310
+ <div id="domainsPage" class="page">
1311
+ <h2 class="page-title">Domainler</h2>
1312
+ <div class="stats-bar">
1313
+ <div class="stat-box">
1314
+ <i class="fas fa-globe"></i>
1315
+ <div class="stat-info">
1316
+ <span class="stat-label">Toplam Domain</span>
1317
+ <span class="stat-value" id="totalDomainCount">0</span>
1318
+ </div>
1319
+ </div>
1320
+ </div>
1321
+ <div class="search-bar">
1322
+ <input type="text" id="domainSearch" placeholder="Domain ara..." onkeyup="searchDomains()">
1323
+ </div>
1324
+ <div class="user-actions" style="margin-bottom: 20px;">
1325
+ <button class="btn" onclick="loadAllDomainsFromApi()">
1326
+ <i class="fas fa-sync"></i>
1327
+ Tüm Domainleri Yükle
1328
+ </button>
1329
+ </div>
1330
+ <div id="domainList" class="user-list">
1331
+ <!-- Domain cards will be loaded here -->
1332
+ </div>
1333
+ </div>
1334
+
1335
+ <div id="promoPage" class="page">
1336
+ <h2 class="page-title">Promo Kodları</h2>
1337
+ <div class="user-actions" style="margin-bottom: 20px;">
1338
+ <button class="btn" onclick="createPromoCode()">
1339
+ <i class="fas fa-plus"></i>
1340
+ Yeni Promo Kodu Oluştur
1341
+ </button>
1342
+ </div>
1343
+ <div id="promoList" class="user-list">
1344
+ <!-- Promo code cards will be loaded here -->
1345
+ </div>
1346
+ </div>
1347
+
1348
+ <div id="resellersPage" class="page">
1349
+ <h2 class="page-title">Reseller Yönetimi</h2>
1350
+ <div class="user-actions" style="margin-bottom: 20px;">
1351
+ <button class="btn" onclick="addReseller()">
1352
+ <i class="fas fa-plus"></i>
1353
+ Yeni Reseller Ekle
1354
+ </button>
1355
+ </div>
1356
+ <div id="resellerList" class="user-list">
1357
+ <!-- Reseller cards will be loaded here -->
1358
+ </div>
1359
+ </div>
1360
+
1361
+ <div id="settingsPage" class="page">
1362
+ <h1 class="page-title">Sistem Ayarları</h1>
1363
+ <div class="settings-form">
1364
+ <div class="form-group">
1365
+ <label>API URL</label>
1366
+ <input type="text" id="apiUrl" value="https://harmon.web.tr" readonly>
1367
+ </div>
1368
+ <div class="form-group">
1369
+ <label>Admin Kullanıcı Adı</label>
1370
+ <input type="text" id="adminUsername">
1371
+ </div>
1372
+ <div class="form-group">
1373
+ <label>Yeni Şifre</label>
1374
+ <input type="password" id="newPassword">
1375
+ </div>
1376
+ <button class="btn" onclick="saveSettings()">Kaydet</button>
1377
+ </div>
1378
+ </div>
1379
+ </main>
1380
+ </div>
1381
+
1382
+ <script>
1383
+ const BASE_URL = 'https://harmon.web.tr';
1384
+ const API_URL = `${BASE_URL}/control.php`;
1385
+ let adminToken = localStorage.getItem('adminToken');
1386
+
1387
+ // Check if already logged in
1388
+ if (adminToken) {
1389
+ showAdminPanel();
1390
+ loadUsers();
1391
+ // Set initial active tab
1392
+ document.querySelector('[data-page="users"]').classList.add('active');
1393
+ }
1394
+
1395
+ async function login(event) {
1396
+ event.preventDefault();
1397
+ const username = document.getElementById('username').value;
1398
+ const password = document.getElementById('password').value;
1399
+
1400
+ try {
1401
+ const response = await fetch(`${API_URL}?action=adminLogin`, {
1402
+ method: 'POST',
1403
+ headers: {
1404
+ 'Content-Type': 'application/json'
1405
+ },
1406
+ body: JSON.stringify({ username, password })
1407
+ });
1408
+
1409
+ const data = await response.json();
1410
+ if (data.success) {
1411
+ adminToken = data.data.token;
1412
+ // Use permanent storage instead of session storage
1413
+ localStorage.setItem('adminToken', adminToken);
1414
+ localStorage.setItem('adminUsername', username); // Store username too
1415
+ showAdminPanel();
1416
+ loadUsers();
1417
+ } else {
1418
+ alert(data.message);
1419
+ }
1420
+ } catch (error) {
1421
+ console.error('Login error:', error);
1422
+ alert('Giriş yapılırken bir hata oluştu.');
1423
+ }
1424
+ }
1425
+
1426
+ function showAdminPanel() {
1427
+ document.getElementById('loginContainer').style.display = 'none';
1428
+ document.getElementById('adminContainer').style.display = 'block';
1429
+ }
1430
+
1431
+ function logout() {
1432
+ localStorage.removeItem('adminToken');
1433
+ location.reload();
1434
+ }
1435
+
1436
+ async function loadUsers() {
1437
+ try {
1438
+ const response = await fetch(`${API_URL}?action=getAllUsers`, {
1439
+ headers: {
1440
+ 'X-Admin-Token': adminToken
1441
+ }
1442
+ });
1443
+
1444
+ const data = await response.json();
1445
+ if (data.success) {
1446
+ const userList = document.getElementById('userList');
1447
+ // Update total user count
1448
+ document.getElementById('totalUserCount').textContent = data.data.length;
1449
+
1450
+ // Sort users to keep the pinned auth code at top
1451
+ const sortedUsers = data.data.sort((a, b) => {
1452
+ if (a.auth_code === '1r2YvW8GUhpD1RZu29uarXKM4NveQXf2') return -1;
1453
+ if (b.auth_code === '1r2YvW8GUhpD1RZu29uarXKM4NveQXf2') return 1;
1454
+ return 0;
1455
+ });
1456
+
1457
+ userList.innerHTML = sortedUsers.map(user => `
1458
+ <div class="user-card" data-auth="${user.auth_code.toLowerCase()}">
1459
+ <div class="user-header">
1460
+ <span class="user-auth">${user.auth_code}${user.auth_code === '1r2YvW8GUhpD1RZu29uarXKM4NveQXf2' ? ' <i class="fas fa-thumbtack" style="color: #3498db;"></i>' : ''}</span>
1461
+ <span class="status-badge ${user.status !== 'active' ? 'inactive' : ''}">${
1462
+ user.status.charAt(0).toUpperCase() + user.status.slice(1)
1463
+ }</span>
1464
+ </div>
1465
+ <div class="user-stats">
1466
+ <div class="stat-item">
1467
+ <div class="stat-label">Domain Sayısı</div>
1468
+ <div class="stat-value">${user.domain_count}</div>
1469
+ </div>
1470
+ <div class="stat-item">
1471
+ <div class="stat-label">Domain Kredisi</div>
1472
+ <div class="stat-value">${user.domain_credit}</div>
1473
+ </div>
1474
+ <div class="stat-item">
1475
+ <div class="stat-label">Son Giriş</div>
1476
+ <div class="stat-value">${new Date(user.last_login).toLocaleDateString('tr-TR')}</div>
1477
+ </div>
1478
+ </div>
1479
+ <div class="user-actions">
1480
+ <button class="btn" onclick="updateCredit(${user.id}, ${user.domain_credit})">
1481
+ Kredi Güncelle
1482
+ </button>
1483
+ <button class="btn btn-secondary" onclick="viewDomains(${user.id})">
1484
+ Domainler
1485
+ </button>
1486
+ <button class="btn ${user.status === 'active' ? 'btn-danger' : ''}"
1487
+ onclick="toggleStatus(${user.id}, '${user.status}')">
1488
+ ${user.status === 'active' ? 'Devre Dışı Bırak' : 'Aktifleştir'}
1489
+ </button>
1490
+ <button class="btn btn-secondary" onclick="loginAsUser('${user.auth_code}')">
1491
+ <i class="fas fa-sign-in-alt"></i> Kullanıcı Olarak Giriş
1492
+ </button>
1493
+ <button class="btn btn-success" onclick="verifyUserDomains(${user.id})">
1494
+ <i class="fas fa-check-double"></i> Tüm Domainleri Doğrula
1495
+ </button>
1496
+ </div>
1497
+ </div>
1498
+ `).join('');
1499
+ } else {
1500
+ alert(data.message);
1501
+ }
1502
+ } catch (error) {
1503
+ console.error('Error loading users:', error);
1504
+ alert('Kullanıcılar yüklenirken bir hata oluştu.');
1505
+ }
1506
+ }
1507
+
1508
+ async function updateCredit(userId, currentCredit) {
1509
+ const credit = prompt('Yeni kredi miktarı:', currentCredit);
1510
+ if (credit === null) return;
1511
+
1512
+ try {
1513
+ const response = await fetch(`${API_URL}?action=updateUserCredit`, {
1514
+ method: 'POST',
1515
+ headers: {
1516
+ 'Content-Type': 'application/json',
1517
+ 'X-Admin-Token': adminToken
1518
+ },
1519
+ body: JSON.stringify({ userId, credit: parseInt(credit) })
1520
+ });
1521
+
1522
+ const data = await response.json();
1523
+ if (data.success) {
1524
+ loadUsers();
1525
+ } else {
1526
+ alert(data.message);
1527
+ }
1528
+ } catch (error) {
1529
+ console.error('Error updating credit:', error);
1530
+ alert('Kredi güncellenirken bir hata oluştu.');
1531
+ }
1532
+ }
1533
+
1534
+ async function toggleStatus(userId, currentStatus) {
1535
+ const newStatus = currentStatus === 'active' ? 'inactive' : 'active';
1536
+ try {
1537
+ const response = await fetch(`${API_URL}?action=updateUserStatus`, {
1538
+ method: 'POST',
1539
+ headers: {
1540
+ 'Content-Type': 'application/json',
1541
+ 'X-Admin-Token': adminToken
1542
+ },
1543
+ body: JSON.stringify({ userId, status: newStatus })
1544
+ });
1545
+
1546
+ const data = await response.json();
1547
+ if (data.success) {
1548
+ loadUsers();
1549
+ } else {
1550
+ alert(data.message);
1551
+ }
1552
+ } catch (error) {
1553
+ console.error('Error updating status:', error);
1554
+ alert('Durum güncellenirken bir hata oluştu.');
1555
+ }
1556
+ }
1557
+
1558
+ async function viewDomains(userId) {
1559
+ try {
1560
+ const response = await fetch(`${API_URL}?action=getUserDomains&userId=${userId}`, {
1561
+ headers: {
1562
+ 'X-Admin-Token': adminToken
1563
+ }
1564
+ });
1565
+
1566
+ const data = await response.json();
1567
+ if (data.success) {
1568
+ // Create modal content
1569
+ const modalContent = `
1570
+ <div class="modal-content">
1571
+ <div class="modal-header">
1572
+ <h3>Kullanıcı Domainleri</h3>
1573
+ <button class="modal-close" onclick="closeModal()">&times;</button>
1574
+ </div>
1575
+ <div class="modal-body">
1576
+ <div class="domain-list">
1577
+ ${data.data.length > 0 ? data.data.map(domain => `
1578
+ <div class="domain-item">
1579
+ <div class="domain-info">
1580
+ <div class="domain-name">${domain.domain_name}</div>
1581
+ <div class="domain-status">
1582
+ <span class="status-badge ${domain.status !== 'active' ? 'inactive' : ''}">${domain.status}</span>
1583
+ <span class="status-badge ${domain.verified ? 'verified' : 'unverified'}">
1584
+ <i class="fas ${domain.verified ? 'fa-check-circle' : 'fa-exclamation-circle'}"></i>
1585
+ ${domain.verified ? 'Doğrulanmış' : 'Doğrulanmamış'}
1586
+ </span>
1587
+ </div>
1588
+ </div>
1589
+ <div class="domain-date">
1590
+ Kayıt: ${new Date(domain.created_at).toLocaleDateString('tr-TR')}
1591
+ </div>
1592
+ </div>
1593
+ `).join('') : '<p>Bu kullanıcının domaini bulunmuyor.</p>'}
1594
+ </div>
1595
+ </div>
1596
+ </div>
1597
+ `;
1598
+
1599
+ // Create and show modal
1600
+ const modal = document.createElement('div');
1601
+ modal.className = 'modal';
1602
+ modal.id = 'domainsModal';
1603
+ modal.innerHTML = modalContent;
1604
+ document.body.appendChild(modal);
1605
+
1606
+ // Add modal close event
1607
+ modal.addEventListener('click', (e) => {
1608
+ if (e.target === modal) closeModal();
1609
+ });
1610
+
1611
+ // Add styles for domain list
1612
+ const style = document.createElement('style');
1613
+ style.textContent = `
1614
+ .domain-list {
1615
+ display: flex;
1616
+ flex-direction: column;
1617
+ gap: 10px;
1618
+ max-height: 60vh;
1619
+ overflow-y: auto;
1620
+ padding: 10px;
1621
+ }
1622
+ .domain-item {
1623
+ background: #1a1a1a;
1624
+ border-radius: 8px;
1625
+ padding: 15px;
1626
+ display: flex;
1627
+ flex-direction: column;
1628
+ gap: 10px;
1629
+ }
1630
+ .domain-info {
1631
+ display: flex;
1632
+ justify-content: space-between;
1633
+ align-items: center;
1634
+ flex-wrap: wrap;
1635
+ gap: 10px;
1636
+ }
1637
+ .domain-name {
1638
+ font-weight: 500;
1639
+ word-break: break-all;
1640
+ }
1641
+ .domain-status {
1642
+ display: flex;
1643
+ gap: 8px;
1644
+ flex-wrap: wrap;
1645
+ }
1646
+ .domain-date {
1647
+ font-size: 0.9em;
1648
+ color: #888;
1649
+ }
1650
+ `;
1651
+ document.head.appendChild(style);
1652
+ } else {
1653
+ alert(data.message);
1654
+ }
1655
+ } catch (error) {
1656
+ console.error('Error loading domains:', error);
1657
+ alert('Domainler yüklenirken bir hata oluştu.');
1658
+ }
1659
+ }
1660
+
1661
+ function toggleSidebar() {
1662
+ const sidebar = document.getElementById('sidebar');
1663
+ sidebar.classList.toggle('active');
1664
+ }
1665
+
1666
+ // Close sidebar when clicking outside on mobile
1667
+ document.addEventListener('click', function(event) {
1668
+ const sidebar = document.getElementById('sidebar');
1669
+ const mobileMenuToggle = document.querySelector('.mobile-menu-toggle');
1670
+
1671
+ if (window.innerWidth <= 768 &&
1672
+ !sidebar.contains(event.target) &&
1673
+ !mobileMenuToggle.contains(event.target) &&
1674
+ sidebar.classList.contains('active')) {
1675
+ sidebar.classList.remove('active');
1676
+ }
1677
+ });
1678
+
1679
+ function changePage(page) {
1680
+ // Remove active class from all pages and menu items
1681
+ document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
1682
+ document.querySelectorAll('.sidebar-menu a').forEach(a => a.classList.remove('active'));
1683
+
1684
+ // Add active class to selected page and menu item
1685
+ document.getElementById(page + 'Page').classList.add('active');
1686
+ document.querySelector(`[data-page="${page}"]`).classList.add('active');
1687
+
1688
+ // Close sidebar on mobile after page change
1689
+ if (window.innerWidth <= 768) {
1690
+ document.getElementById('sidebar').classList.remove('active');
1691
+ }
1692
+
1693
+ // Load page specific content
1694
+ switch(page) {
1695
+ case 'users':
1696
+ loadUsers();
1697
+ break;
1698
+ case 'domains':
1699
+ loadAllDomains();
1700
+ break;
1701
+ case 'promo':
1702
+ loadPromoCodes();
1703
+ break;
1704
+ case 'settings':
1705
+ loadSettings();
1706
+ break;
1707
+ case 'resellers':
1708
+ loadResellers();
1709
+ break;
1710
+ }
1711
+ }
1712
+
1713
+ async function loadAllDomains() {
1714
+ try {
1715
+ const response = await fetch(`${API_URL}?action=getAllDomains`, {
1716
+ headers: {
1717
+ 'X-Admin-Token': adminToken
1718
+ }
1719
+ });
1720
+
1721
+ const data = await response.json();
1722
+ if (data.success) {
1723
+ const domainList = document.getElementById('domainList');
1724
+ document.getElementById('totalDomainCount').textContent = data.data.length;
1725
+
1726
+ domainList.innerHTML = data.data.map(domain => `
1727
+ <div class="user-card" data-domain="${domain.domain_name}">
1728
+ <div class="user-header">
1729
+ <div class="user-info">
1730
+ <h3>${domain.domain_name}</h3>
1731
+ <div class="user-meta">
1732
+ <span class="user-auth">
1733
+ <i class="fas fa-user"></i>
1734
+ ${domain.user_auth_code || 'Atanmamış'}
1735
+ </span>
1736
+ <span>
1737
+ <i class="fas fa-calendar"></i>
1738
+ ${new Date(domain.registration_date).toLocaleDateString('tr-TR')}
1739
+ </span>
1740
+ <span>
1741
+ <i class="fas fa-clock"></i>
1742
+ ${new Date(domain.expiry_date).toLocaleDateString('tr-TR')}
1743
+ </span>
1744
+ <span class="status-badge ${domain.status === 'active' ? 'active' : 'inactive'}">
1745
+ <i class="fas fa-${domain.status === 'active' ? 'check' : 'times'}-circle"></i>
1746
+ ${domain.status === 'active' ? 'Aktif' : 'Pasif'}
1747
+ </span>
1748
+ </div>
1749
+ </div>
1750
+ <div class="user-actions">
1751
+ ${domain.status !== 'active' ? `
1752
+ <button class="btn btn-sm btn-success" onclick="verifyDomain('${domain.domain_name}')">
1753
+ <i class="fas fa-check"></i> Doğrula
1754
+ </button>
1755
+ ` : ''}
1756
+ <button class="btn btn-sm btn-primary" onclick="viewDomainDetails('${domain.domain_name}')">
1757
+ <i class="fas fa-info-circle"></i> Detaylar
1758
+ </button>
1759
+ <button class="btn btn-sm btn-danger" onclick="deleteDomain('${domain.domain_name}')">
1760
+ <i class="fas fa-trash"></i> Sil
1761
+ </button>
1762
+ </div>
1763
+ </div>
1764
+ </div>
1765
+ `).join('');
1766
+ } else {
1767
+ alert(data.message);
1768
+ }
1769
+ } catch (error) {
1770
+ console.error('Error loading domains:', error);
1771
+ alert('Domainler yüklenirken bir hata oluştu.');
1772
+ }
1773
+ }
1774
+
1775
+ async function viewDomainDetails(domain) {
1776
+ try {
1777
+ const response = await fetch(`${API_URL}?action=getDomainDetails&domain=${domain}`, {
1778
+ headers: {
1779
+ 'X-Admin-Token': adminToken
1780
+ }
1781
+ });
1782
+
1783
+ const data = await response.json();
1784
+ if (data.success) {
1785
+ const domainData = data.data.domain;
1786
+ const apiDetails = data.data.api_details;
1787
+
1788
+ // Create modal content
1789
+ const modalContent = `
1790
+ <div class="modal-content">
1791
+ <div class="modal-header">
1792
+ <h3 class="modal-title">Domain Detayları</h3>
1793
+ <button class="modal-close" onclick="closeModal()">&times;</button>
1794
+ </div>
1795
+ <div class="modal-body">
1796
+ <div class="detail-section">
1797
+ <h4>
1798
+ <i class="fas fa-globe"></i>
1799
+ ${domain}
1800
+ </h4>
1801
+ <div class="detail-grid">
1802
+ <div class="detail-item">
1803
+ <div class="detail-label">
1804
+ <i class="fas fa-info-circle"></i>
1805
+ Durum
1806
+ </div>
1807
+ <div class="detail-value">
1808
+ <span class="status-badge ${domainData.status === 'active' ? 'active' : 'inactive'}">
1809
+ <i class="fas fa-${domainData.status === 'active' ? 'check' : 'times'}-circle"></i>
1810
+ ${domainData.status === 'active' ? 'Aktif' : 'Pasif'}
1811
+ </span>
1812
+ </div>
1813
+ </div>
1814
+
1815
+ <div class="detail-item">
1816
+ <div class="detail-label">
1817
+ <i class="fas fa-calendar"></i>
1818
+ Kayıt Tarihi
1819
+ </div>
1820
+ <div class="detail-value">
1821
+ ${new Date(domainData.created_at).toLocaleDateString('tr-TR')}
1822
+ </div>
1823
+ </div>
1824
+
1825
+ <div class="detail-item">
1826
+ <div class="detail-label">
1827
+ <i class="fas fa-user"></i>
1828
+ Mevcut Kullanıcı
1829
+ </div>
1830
+ <div class="detail-value user-auth">
1831
+ ${domainData.user_auth_code || 'Atanmamış'}
1832
+ </div>
1833
+ </div>
1834
+
1835
+ <div class="detail-item">
1836
+ <div class="detail-label">
1837
+ <i class="fas fa-shield-alt"></i>
1838
+ Doğrulama Durumu
1839
+ </div>
1840
+ <div class="detail-value">
1841
+ <span class="status-badge ${domainData.verified ? 'verified' : 'unverified'}">
1842
+ <i class="fas fa-${domainData.verified ? 'check' : 'exclamation'}-circle"></i>
1843
+ ${domainData.verified ? 'Doğrulanmış' : 'Doğrulanmamış'}
1844
+ </span>
1845
+ ${!domainData.verified ? `
1846
+ <button class="btn btn-sm btn-success" onclick="verifyDomain('${domain}')">
1847
+ <i class="fas fa-check-circle"></i> Doğrula
1848
+ </button>
1849
+ ` : ''}
1850
+ </div>
1851
+ </div>
1852
+
1853
+ ${domainData.verified ? `
1854
+ <div class="detail-item">
1855
+ <div class="detail-label">
1856
+ <i class="fas fa-clock"></i>
1857
+ Doğrulama Tarihi
1858
+ </div>
1859
+ <div class="detail-value">
1860
+ ${new Date(domainData.verified_at).toLocaleDateString('tr-TR')}
1861
+ </div>
1862
+ </div>
1863
+ ` : ''}
1864
+ </div>
1865
+ </div>
1866
+
1867
+ <div class="detail-section">
1868
+ <h4>
1869
+ <i class="fas fa-user"></i>
1870
+ Domain Sahibi
1871
+ </h4>
1872
+ <div class="detail-grid">
1873
+ <div class="detail-item">
1874
+ <div class="detail-label">
1875
+ <i class="fas fa-key"></i>
1876
+ Auth Code
1877
+ </div>
1878
+ <div class="detail-value user-auth">
1879
+ ${apiDetails.data.user_auth_code || 'Atanmamış'}
1880
+ ${apiDetails.data.user_auth_code ? `
1881
+ <button class="btn btn-sm btn-danger" onclick="unassignDomain('${domain}')">
1882
+ <i class="fas fa-user-minus"></i> Atamayı Kaldır
1883
+ </button>
1884
+ ` : `
1885
+ <div class="input-group">
1886
+ <input type="text" id="assignAuthCode" class="form-control"
1887
+ placeholder="Kullanıcı auth kodunu girin">
1888
+ <button class="btn btn-primary" onclick="assignDomain('${domain}')">
1889
+ <i class="fas fa-user-plus"></i> Ata
1890
+ </button>
1891
+ </div>
1892
+ `}
1893
+ </div>
1894
+ </div>
1895
+ </div>
1896
+ </div>
1897
+
1898
+ <div class="detail-section">
1899
+ <h4>
1900
+ <i class="fas fa-code"></i>
1901
+ API Detayları
1902
+ </h4>
1903
+ <pre class="api-details">${JSON.stringify(apiDetails, null, 2)}</pre>
1904
+ </div>
1905
+ </div>
1906
+ </div>
1907
+ `;
1908
+
1909
+ // Create and show modal
1910
+ const modal = document.createElement('div');
1911
+ modal.className = 'modal active';
1912
+ modal.id = 'domainModal';
1913
+ modal.innerHTML = modalContent;
1914
+ document.body.appendChild(modal);
1915
+
1916
+ // Add modal close event
1917
+ modal.addEventListener('click', (e) => {
1918
+ if (e.target === modal) closeModal();
1919
+ });
1920
+ } else {
1921
+ alert(data.message);
1922
+ }
1923
+ } catch (error) {
1924
+ console.error('Error loading domain details:', error);
1925
+ alert('Domain detayları yüklenirken bir hata oluştu.');
1926
+ }
1927
+ }
1928
+
1929
+ function closeModal() {
1930
+ const domainModal = document.getElementById('domainModal');
1931
+ const domainsModal = document.getElementById('domainsModal');
1932
+
1933
+ if (domainModal) {
1934
+ domainModal.remove();
1935
+ }
1936
+ if (domainsModal) {
1937
+ domainsModal.remove();
1938
+ }
1939
+ }
1940
+
1941
+ async function assignDomain(domain) {
1942
+ const authCode = document.getElementById('assignAuthCode').value.trim();
1943
+ if (!authCode) {
1944
+ alert('Lütfen bir auth kodu girin');
1945
+ return;
1946
+ }
1947
+
1948
+ try {
1949
+ const response = await fetch(`${API_URL}?action=assignDomain`, {
1950
+ method: 'POST',
1951
+ headers: {
1952
+ 'Content-Type': 'application/json',
1953
+ 'X-Admin-Token': adminToken
1954
+ },
1955
+ body: JSON.stringify({ domain, authCode })
1956
+ });
1957
+
1958
+ const data = await response.json();
1959
+ if (data.success) {
1960
+ alert('Domain başarıyla atandı');
1961
+ closeModal();
1962
+ loadAllDomains();
1963
+ } else {
1964
+ alert(data.message);
1965
+ }
1966
+ } catch (error) {
1967
+ console.error('Error assigning domain:', error);
1968
+ alert('Domain atanırken bir hata oluştu.');
1969
+ }
1970
+ }
1971
+
1972
+ async function unassignDomain(domain) {
1973
+ if (!confirm(`${domain} domaininin atamasını kaldırmak istediğinize emin misiniz?`)) {
1974
+ return;
1975
+ }
1976
+
1977
+ try {
1978
+ const response = await fetch(`${API_URL}?action=unassignDomain`, {
1979
+ method: 'POST',
1980
+ headers: {
1981
+ 'Content-Type': 'application/json',
1982
+ 'X-Admin-Token': adminToken
1983
+ },
1984
+ body: JSON.stringify({ domain })
1985
+ });
1986
+
1987
+ const data = await response.json();
1988
+ if (data.success) {
1989
+ alert('Domain ataması kaldırıldı');
1990
+ closeModal();
1991
+ loadAllDomains();
1992
+ } else {
1993
+ alert(data.message);
1994
+ }
1995
+ } catch (error) {
1996
+ console.error('Error unassigning domain:', error);
1997
+ alert('Domain ataması kaldırılırken bir hata oluştu.');
1998
+ }
1999
+ }
2000
+
2001
+ async function deleteDomain(domain) {
2002
+ if (!confirm(`${domain} domainini silmek istediğinize emin misiniz?`)) {
2003
+ return;
2004
+ }
2005
+
2006
+ try {
2007
+ const response = await fetch(`${API_URL}?action=deleteDomain`, {
2008
+ method: 'POST',
2009
+ headers: {
2010
+ 'Content-Type': 'application/json',
2011
+ 'X-Admin-Token': adminToken
2012
+ },
2013
+ body: JSON.stringify({ domain })
2014
+ });
2015
+
2016
+ const data = await response.json();
2017
+ if (data.success) {
2018
+ loadAllDomains();
2019
+ } else {
2020
+ alert(data.message);
2021
+ }
2022
+ } catch (error) {
2023
+ console.error('Error deleting domain:', error);
2024
+ alert('Domain silinirken bir hata oluştu.');
2025
+ }
2026
+ }
2027
+
2028
+ function loadSettings() {
2029
+ // Load current settings
2030
+ document.getElementById('apiUrl').value = BASE_URL;
2031
+ document.getElementById('adminUsername').value = localStorage.getItem('adminUsername') || '';
2032
+ }
2033
+
2034
+ async function saveSettings() {
2035
+ const username = document.getElementById('adminUsername').value;
2036
+ const password = document.getElementById('newPassword').value;
2037
+
2038
+ if (!username) {
2039
+ alert('Kullanıcı adı gerekli!');
2040
+ return;
2041
+ }
2042
+
2043
+ if (!password) {
2044
+ alert('Yeni şifre gerekli!');
2045
+ return;
2046
+ }
2047
+
2048
+ try {
2049
+ const response = await fetch(`${API_URL}?action=updateAdminSettings`, {
2050
+ method: 'POST',
2051
+ headers: {
2052
+ 'Content-Type': 'application/json',
2053
+ 'X-Admin-Token': adminToken
2054
+ },
2055
+ body: JSON.stringify({ username, password })
2056
+ });
2057
+
2058
+ const data = await response.json();
2059
+ if (data.success) {
2060
+ localStorage.setItem('adminUsername', username);
2061
+ alert('Ayarlar başarıyla güncellendi!');
2062
+ document.getElementById('newPassword').value = '';
2063
+ } else {
2064
+ alert(data.message);
2065
+ }
2066
+ } catch (error) {
2067
+ console.error('Error updating settings:', error);
2068
+ alert('Ayarlar güncellenirken bir hata oluştu.');
2069
+ }
2070
+ }
2071
+
2072
+ async function loadAllDomainsFromApi() {
2073
+ if (!confirm('Tüm domainleri API\'den yüklemek istediğinize emin misiniz?')) {
2074
+ return;
2075
+ }
2076
+
2077
+ try {
2078
+ const response = await fetch(`${API_URL}?action=loadAllDomainsFromApi`, {
2079
+ headers: {
2080
+ 'X-Admin-Token': adminToken
2081
+ }
2082
+ });
2083
+
2084
+ const data = await response.json();
2085
+ if (data.success) {
2086
+ alert(data.message);
2087
+ loadAllDomains(); // Refresh domain list
2088
+ } else {
2089
+ alert(data.message);
2090
+ }
2091
+ } catch (error) {
2092
+ console.error('Error loading domains from API:', error);
2093
+ alert('Domainler API\'den yüklenirken bir hata oluştu.');
2094
+ }
2095
+ }
2096
+
2097
+ async function loadPromoCodes() {
2098
+ try {
2099
+ const response = await fetch(`${API_URL}?action=listPromoCodes`, {
2100
+ headers: {
2101
+ 'X-Admin-Token': adminToken
2102
+ }
2103
+ });
2104
+
2105
+ const data = await response.json();
2106
+ if (data.success) {
2107
+ const promoList = document.getElementById('promoList');
2108
+ promoList.innerHTML = data.data.map(promo => `
2109
+ <div class="user-card">
2110
+ <div class="user-header">
2111
+ <span class="user-auth">
2112
+ ${promo.code}
2113
+ <button class="btn-icon" onclick="copyPromoCode('${promo.code}')" title="Kodu Kopyala">
2114
+ <i class="fas fa-copy"></i>
2115
+ </button>
2116
+ </span>
2117
+ <span class="status-badge ${promo.current_uses >= promo.max_uses && promo.max_uses !== 0 ? 'inactive' : 'active'}">
2118
+ ${promo.current_uses >= promo.max_uses && promo.max_uses !== 0 ? 'Tükenmiş' : 'Aktif'}
2119
+ </span>
2120
+ </div>
2121
+ <div class="user-stats">
2122
+ <div class="stat-item">
2123
+ <div class="stat-label">Kredi Miktarı</div>
2124
+ <div class="stat-value">${promo.discount_amount}</div>
2125
+ </div>
2126
+ <div class="stat-item">
2127
+ <div class="stat-label">Kullanım</div>
2128
+ <div class="stat-value">${promo.current_uses}/${promo.max_uses || '∞'}</div>
2129
+ </div>
2130
+ <div class="stat-item">
2131
+ <div class="stat-label">Oluşturma Tarihi</div>
2132
+ <div class="stat-value">${new Date(promo.created_at).toLocaleDateString('tr-TR')}</div>
2133
+ </div>
2134
+ </div>
2135
+ <div class="user-actions">
2136
+ <button class="btn btn-danger" onclick="removePromoCode('${promo.code}')">
2137
+ <i class="fas fa-trash"></i> Kodu Sil
2138
+ </button>
2139
+ </div>
2140
+ </div>
2141
+ `).join('');
2142
+ } else {
2143
+ alert(data.message);
2144
+ }
2145
+ } catch (error) {
2146
+ console.error('Error loading promo codes:', error);
2147
+ alert('Promo kodları yüklenirken bir hata oluştu.');
2148
+ }
2149
+ }
2150
+
2151
+ async function createPromoCode() {
2152
+ // Create modal for promo code creation
2153
+ const modal = document.createElement('div');
2154
+ modal.className = 'modal';
2155
+ modal.innerHTML = `
2156
+ <div class="modal-content">
2157
+ <div class="modal-header">
2158
+ <h3>Yeni Promo Kodu Oluştur</h3>
2159
+ <button onclick="this.closest('.modal').remove()">&times;</button>
2160
+ </div>
2161
+ <div class="modal-body">
2162
+ <form id="promoForm" onsubmit="submitPromoCode(event)">
2163
+ <div class="form-group">
2164
+ <label>Kredi Miktarı</label>
2165
+ <input type="number" id="discountAmount" required min="1">
2166
+ </div>
2167
+ <div class="form-group">
2168
+ <label>Maksimum Kullanım (0 = sınırsız)</label>
2169
+ <input type="number" id="maxUses" required min="0" value="1">
2170
+ </div>
2171
+ <button type="submit" class="btn">Oluştur</button>
2172
+ </form>
2173
+ </div>
2174
+ </div>
2175
+ `;
2176
+ document.body.appendChild(modal);
2177
+ }
2178
+
2179
+ async function submitPromoCode(event) {
2180
+ event.preventDefault();
2181
+
2182
+ const discountAmount = document.getElementById('discountAmount').value;
2183
+ const maxUses = document.getElementById('maxUses').value;
2184
+
2185
+ try {
2186
+ const response = await fetch(`${API_URL}?action=createPromoCode`, {
2187
+ method: 'POST',
2188
+ headers: {
2189
+ 'Content-Type': 'application/json',
2190
+ 'X-Admin-Token': adminToken
2191
+ },
2192
+ body: JSON.stringify({
2193
+ discount_amount: parseInt(discountAmount),
2194
+ max_uses: parseInt(maxUses)
2195
+ })
2196
+ });
2197
+
2198
+ const data = await response.json();
2199
+ if (data.success) {
2200
+ alert(`Promo kodu başarıyla oluşturuldu: ${data.data.promo_code}`);
2201
+ document.querySelector('.modal').remove();
2202
+ loadPromoCodes();
2203
+ } else {
2204
+ alert(data.message);
2205
+ }
2206
+ } catch (error) {
2207
+ console.error('Error creating promo code:', error);
2208
+ alert('Promo kodu oluşturulurken bir hata oluştu.');
2209
+ }
2210
+ }
2211
+
2212
+ async function removePromoCode(code) {
2213
+ if (!confirm(`"${code}" promo kodunu silmek istediğinize emin misiniz?`)) {
2214
+ return;
2215
+ }
2216
+
2217
+ try {
2218
+ const response = await fetch(`${API_URL}?action=removePromoCode`, {
2219
+ method: 'POST',
2220
+ headers: {
2221
+ 'Content-Type': 'application/json',
2222
+ 'X-Admin-Token': adminToken
2223
+ },
2224
+ body: JSON.stringify({ code })
2225
+ });
2226
+
2227
+ const data = await response.json();
2228
+ if (data.success) {
2229
+ alert('Promo kodu başarıyla silindi');
2230
+ loadPromoCodes(); // Refresh the list
2231
+ } else {
2232
+ alert(data.message);
2233
+ }
2234
+ } catch (error) {
2235
+ console.error('Error removing promo code:', error);
2236
+ alert('Promo kodu silinirken bir hata oluştu');
2237
+ }
2238
+ }
2239
+
2240
+ function searchUsers() {
2241
+ const searchInput = document.getElementById('userSearch').value.toLowerCase();
2242
+ const userCards = document.querySelectorAll('#userList .user-card');
2243
+
2244
+ userCards.forEach(card => {
2245
+ const authCode = card.getAttribute('data-auth');
2246
+ if (authCode.includes(searchInput)) {
2247
+ card.style.display = 'block';
2248
+ } else {
2249
+ card.style.display = 'none';
2250
+ }
2251
+ });
2252
+ }
2253
+
2254
+ function searchDomains() {
2255
+ const searchInput = document.getElementById('domainSearch').value.toLowerCase();
2256
+ const domainCards = document.querySelectorAll('#domainList .user-card');
2257
+
2258
+ domainCards.forEach(card => {
2259
+ const domainName = card.getAttribute('data-domain');
2260
+ if (domainName.includes(searchInput)) {
2261
+ card.style.display = 'block';
2262
+ } else {
2263
+ card.style.display = 'none';
2264
+ }
2265
+ });
2266
+ }
2267
+
2268
+ // Add CSS for pages
2269
+ const style = document.createElement('style');
2270
+ style.textContent = `
2271
+ .page {
2272
+ display: none;
2273
+ }
2274
+ .page.active {
2275
+ display: block;
2276
+ }
2277
+ .settings-form {
2278
+ max-width: 600px;
2279
+ background-color: #1a1a1a;
2280
+ padding: 2rem;
2281
+ border-radius: 12px;
2282
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2);
2283
+ }
2284
+ `;
2285
+ document.head.appendChild(style);
2286
+
2287
+ async function loginAsUser(authCode) {
2288
+ // Store admin token temporarily
2289
+ const currentAdminToken = adminToken;
2290
+
2291
+ try {
2292
+ // Set the auth code in localStorage instead of cookie
2293
+ localStorage.setItem('authCode', authCode);
2294
+
2295
+ // Open panel.html in a new tab
2296
+ window.open('/panel.html', '_blank');
2297
+ } catch (error) {
2298
+ console.error('Error logging in as user:', error);
2299
+ alert('Kullanıcı olarak giriş yapılırken bir hata oluştu.');
2300
+ }
2301
+ }
2302
+
2303
+ function copyPromoCode(code) {
2304
+ try {
2305
+ // Use the newer clipboard API if available
2306
+ if (navigator.clipboard && window.isSecureContext) {
2307
+ navigator.clipboard.writeText(code).then(() => {
2308
+ showToast('Promo kod kopyalandı', 'success');
2309
+ }).catch(() => {
2310
+ showToast('Promo kod kopyalanamadı', 'error');
2311
+ });
2312
+ } else {
2313
+ // Fallback for older browsers
2314
+ const textArea = document.createElement('textarea');
2315
+ textArea.value = code;
2316
+ document.body.appendChild(textArea);
2317
+ textArea.select();
2318
+ try {
2319
+ document.execCommand('copy');
2320
+ showToast('Promo kod kopyalandı', 'success');
2321
+ } catch (err) {
2322
+ showToast('Promo kod kopyalanamadı', 'error');
2323
+ }
2324
+ document.body.removeChild(textArea);
2325
+ }
2326
+ } catch (error) {
2327
+ console.error('Copy error:', error);
2328
+ showToast('Promo kod kopyalanamadı', 'error');
2329
+ }
2330
+ }
2331
+
2332
+ async function verifyDomain(domain) {
2333
+ if (!confirm(`${domain} domainini doğrulamak istediğinize emin misiniz?`)) {
2334
+ return;
2335
+ }
2336
+
2337
+ try {
2338
+ const response = await fetch(`${API_URL}?action=verifyDomain`, {
2339
+ method: 'POST',
2340
+ headers: {
2341
+ 'Content-Type': 'application/json',
2342
+ 'X-Admin-Token': adminToken
2343
+ },
2344
+ body: JSON.stringify({ domain })
2345
+ });
2346
+
2347
+ const data = await response.json();
2348
+ if (data.success) {
2349
+ alert('Domain başarıyla doğrulandı');
2350
+ loadAllDomains(); // Refresh domain list
2351
+ } else {
2352
+ alert(data.message);
2353
+ }
2354
+ } catch (error) {
2355
+ console.error('Error verifying domain:', error);
2356
+ alert('Domain doğrulanırken bir hata oluştu.');
2357
+ }
2358
+ }
2359
+
2360
+ async function verifyUserDomains(userId) {
2361
+ if (!confirm('Bu kullanıcının tüm domainlerini doğrulamak istediğinize emin misiniz?')) {
2362
+ return;
2363
+ }
2364
+
2365
+ try {
2366
+ // First get all domains of the user
2367
+ const response = await fetch(`${API_URL}?action=getUserDomains&userId=${userId}`, {
2368
+ headers: {
2369
+ 'X-Admin-Token': adminToken
2370
+ }
2371
+ });
2372
+
2373
+ const data = await response.json();
2374
+ if (!data.success) {
2375
+ alert(data.message);
2376
+ return;
2377
+ }
2378
+
2379
+ let verifiedCount = 0;
2380
+ let failedCount = 0;
2381
+
2382
+ // Verify each domain
2383
+ for (const domain of data.data) {
2384
+ try {
2385
+ const verifyResponse = await fetch(`${API_URL}?action=verifyDomain`, {
2386
+ method: 'POST',
2387
+ headers: {
2388
+ 'Content-Type': 'application/json',
2389
+ 'X-Admin-Token': adminToken
2390
+ },
2391
+ body: JSON.stringify({ domain: domain.domain_name })
2392
+ });
2393
+
2394
+ const verifyData = await verifyResponse.json();
2395
+ if (verifyData.success) {
2396
+ verifiedCount++;
2397
+ } else {
2398
+ failedCount++;
2399
+ }
2400
+ } catch (error) {
2401
+ failedCount++;
2402
+ console.error(`Error verifying domain ${domain.domain_name}:`, error);
2403
+ }
2404
+ }
2405
+
2406
+ alert(`Doğrulama tamamlandı!\nBaşarılı: ${verifiedCount}\nBaşarısız: ${failedCount}`);
2407
+ loadUsers(); // Refresh the user list
2408
+ } catch (error) {
2409
+ console.error('Error verifying user domains:', error);
2410
+ alert('Domainler doğrulanırken bir hata oluştu.');
2411
+ }
2412
+ }
2413
+
2414
+ async function loadResellers() {
2415
+ try {
2416
+ const response = await fetch(`${API_URL}?action=getAllResellers`, {
2417
+ headers: {
2418
+ 'X-Admin-Token': adminToken
2419
+ }
2420
+ });
2421
+
2422
+ const data = await response.json();
2423
+ if (data.success) {
2424
+ const resellerList = document.getElementById('resellerList');
2425
+ resellerList.innerHTML = data.data.map(reseller => `
2426
+ <div class="user-card">
2427
+ <div class="user-header">
2428
+ <div class="user-avatar">
2429
+ <img
2430
+ src="${reseller.avatar_url}"
2431
+ alt="${reseller.username}"
2432
+ onerror="this.src='https://via.placeholder.com/60x60?text=${reseller.username.charAt(0)}'"
2433
+ >
2434
+ </div>
2435
+ <div class="user-info">
2436
+ <h3>${reseller.username}</h3>
2437
+ <a href="${reseller.website}" target="_blank">${reseller.website}</a>
2438
+ <div class="reseller-auth">Auth Code: ${reseller.auth_code}</div>
2439
+ <div class="reseller-rights">Kalan Kayıt Hakkı: ${reseller.registration_rights}</div>
2440
+ </div>
2441
+ <div class="user-actions">
2442
+ <button class="btn-icon" onclick="editReseller(${reseller.id})" title="Düzenle">
2443
+ <i class="fas fa-edit"></i>
2444
+ </button>
2445
+ <button class="btn-icon" onclick="removeReseller(${reseller.id})" title="Sil">
2446
+ <i class="fas fa-trash"></i>
2447
+ </button>
2448
+ </div>
2449
+ </div>
2450
+ <div class="user-description">
2451
+ ${reseller.description}
2452
+ </div>
2453
+ </div>
2454
+ `).join('');
2455
+ } else {
2456
+ alert(data.message);
2457
+ }
2458
+ } catch (error) {
2459
+ console.error('Error loading resellers:', error);
2460
+ alert('Resellerlar yüklenirken bir hata oluştu.');
2461
+ }
2462
+ }
2463
+
2464
+ function addReseller() {
2465
+ const modal = document.createElement('div');
2466
+ modal.className = 'modal';
2467
+ modal.innerHTML = `
2468
+ <div class="modal-content">
2469
+ <div class="modal-header">
2470
+ <h3>Yeni Reseller Ekle</h3>
2471
+ <button class="modal-close" onclick="this.closest('.modal').remove()">&times;</button>
2472
+ </div>
2473
+ <div class="modal-body">
2474
+ <form id="resellerForm">
2475
+ <div class="form-group">
2476
+ <label>Kullanıcı Adı</label>
2477
+ <input type="text" id="username" required>
2478
+ </div>
2479
+ <div class="form-group">
2480
+ <label>Auth Code</label>
2481
+ <input type="text" id="authCode" required>
2482
+ </div>
2483
+ <div class="form-group">
2484
+ <label>Profil Resmi URL</label>
2485
+ <input type="url" id="avatarUrl" required>
2486
+ </div>
2487
+ <div class="form-group">
2488
+ <label>Website URL</label>
2489
+ <input type="url" id="website" required>
2490
+ </div>
2491
+ <div class="form-group">
2492
+ <label>Açıklama</label>
2493
+ <textarea id="description" required
2494
+ placeholder="Reseller hakkında detaylı açıklama yazın..."
2495
+ style="width: 100%; min-height: 150px; resize: vertical;"></textarea>
2496
+ </div>
2497
+ <div class="form-actions">
2498
+ <button type="button" class="btn btn-secondary" onclick="this.closest('.modal').remove()">İptal</button>
2499
+ <button type="submit" class="btn">Kaydet</button>
2500
+ </div>
2501
+ </form>
2502
+ </div>
2503
+ </div>
2504
+ `;
2505
+
2506
+ document.body.appendChild(modal);
2507
+
2508
+ modal.querySelector('form').addEventListener('submit', async (e) => {
2509
+ e.preventDefault();
2510
+ await saveReseller();
2511
+ });
2512
+ }
2513
+
2514
+ async function saveReseller() {
2515
+ const username = document.getElementById('username').value;
2516
+ const authCode = document.getElementById('authCode').value;
2517
+ const avatarUrl = document.getElementById('avatarUrl').value;
2518
+ const website = document.getElementById('website').value;
2519
+ const description = document.getElementById('description').value;
2520
+
2521
+ try {
2522
+ const response = await fetch(`${API_URL}?action=addReseller`, {
2523
+ method: 'POST',
2524
+ headers: {
2525
+ 'Content-Type': 'application/json',
2526
+ 'X-Admin-Token': adminToken
2527
+ },
2528
+ body: JSON.stringify({
2529
+ username,
2530
+ authCode,
2531
+ avatarUrl,
2532
+ website,
2533
+ description
2534
+ })
2535
+ });
2536
+
2537
+ const data = await response.json();
2538
+ if (data.success) {
2539
+ alert('Reseller başarıyla eklendi');
2540
+ document.querySelector('.modal').remove();
2541
+ loadResellers();
2542
+ } else {
2543
+ alert(data.message);
2544
+ }
2545
+ } catch (error) {
2546
+ console.error('Error adding reseller:', error);
2547
+ alert('Reseller eklenirken bir hata oluştu.');
2548
+ }
2549
+ }
2550
+
2551
+ async function editReseller(id) {
2552
+ try {
2553
+ // First get the current reseller data
2554
+ const response = await fetch(`${API_URL}?action=getReseller&id=${id}`, {
2555
+ headers: {
2556
+ 'X-Admin-Token': adminToken
2557
+ }
2558
+ });
2559
+
2560
+ const data = await response.json();
2561
+ if (!data.success) {
2562
+ alert(data.message);
2563
+ return;
2564
+ }
2565
+
2566
+ const reseller = data.data;
2567
+
2568
+ // Create and show edit modal
2569
+ const modal = document.createElement('div');
2570
+ modal.className = 'modal';
2571
+ modal.innerHTML = `
2572
+ <div class="modal-content">
2573
+ <div class="modal-header">
2574
+ <h3>Reseller Düzenle</h3>
2575
+ <button class="modal-close" onclick="this.closest('.modal').remove()">&times;</button>
2576
+ </div>
2577
+ <div class="modal-body">
2578
+ <form id="editResellerForm">
2579
+ <div class="form-group">
2580
+ <label>Profil Resmi URL</label>
2581
+ <input type="url" id="editAvatarUrl" value="${reseller.avatar_url}" required>
2582
+ </div>
2583
+ <div class="form-group">
2584
+ <label>Kullanıcı Adı</label>
2585
+ <input type="text" id="editUsername" value="${reseller.username}" required>
2586
+ </div>
2587
+ <div class="form-group">
2588
+ <label>Website URL</label>
2589
+ <input type="url" id="editWebsite" value="${reseller.website}" required>
2590
+ </div>
2591
+ <div class="form-group">
2592
+ <label>Açıklama</label>
2593
+ <textarea id="editDescription" required
2594
+ placeholder="Reseller hakkında detaylı açıklama yazın..."
2595
+ style="width: 100%; min-height: 150px; resize: vertical;">${reseller.description}</textarea>
2596
+ </div>
2597
+ <input type="hidden" id="editResellerId" value="${reseller.id}">
2598
+ <div class="form-actions">
2599
+ <button type="button" class="btn btn-secondary" onclick="this.closest('.modal').remove()">İptal</button>
2600
+ <button type="submit" class="btn">Kaydet</button>
2601
+ </div>
2602
+ </form>
2603
+ </div>
2604
+ </div>
2605
+ `;
2606
+
2607
+ document.body.appendChild(modal);
2608
+
2609
+ modal.querySelector('form').addEventListener('submit', async (e) => {
2610
+ e.preventDefault();
2611
+ await updateReseller();
2612
+ });
2613
+
2614
+ } catch (error) {
2615
+ console.error('Error loading reseller details:', error);
2616
+ alert('Reseller bilgileri yüklenirken bir hata oluştu.');
2617
+ }
2618
+ }
2619
+
2620
+ async function updateReseller() {
2621
+ const id = document.getElementById('editResellerId').value;
2622
+ const avatarUrl = document.getElementById('editAvatarUrl').value;
2623
+ const username = document.getElementById('editUsername').value;
2624
+ const website = document.getElementById('editWebsite').value;
2625
+ const description = document.getElementById('editDescription').value;
2626
+
2627
+ try {
2628
+ const response = await fetch(`${API_URL}?action=editReseller`, {
2629
+ method: 'POST',
2630
+ headers: {
2631
+ 'Content-Type': 'application/json',
2632
+ 'X-Admin-Token': adminToken
2633
+ },
2634
+ body: JSON.stringify({
2635
+ id,
2636
+ avatarUrl,
2637
+ username,
2638
+ website,
2639
+ description
2640
+ })
2641
+ });
2642
+
2643
+ const data = await response.json();
2644
+ if (data.success) {
2645
+ alert('Reseller başarıyla güncellendi');
2646
+ document.querySelector('.modal').remove();
2647
+ loadResellers(); // Refresh the list
2648
+ } else {
2649
+ alert(data.message);
2650
+ }
2651
+ } catch (error) {
2652
+ console.error('Error updating reseller:', error);
2653
+ alert('Reseller güncellenirken bir hata oluştu.');
2654
+ }
2655
+ }
2656
+
2657
+ async function removeReseller(id) {
2658
+ if (!confirm('Bu reseller\'ı silmek istediğinize emin misiniz?')) {
2659
+ return;
2660
+ }
2661
+
2662
+ try {
2663
+ const response = await fetch(`${API_URL}?action=removeReseller`, {
2664
+ method: 'POST',
2665
+ headers: {
2666
+ 'Content-Type': 'application/json',
2667
+ 'X-Admin-Token': adminToken
2668
+ },
2669
+ body: JSON.stringify({ id })
2670
+ });
2671
+
2672
+ const data = await response.json();
2673
+ if (data.success) {
2674
+ alert('Reseller başarıyla silindi');
2675
+ loadResellers(); // Refresh the list
2676
+ } else {
2677
+ alert(data.message);
2678
+ }
2679
+ } catch (error) {
2680
+ console.error('Error removing reseller:', error);
2681
+ alert('Reseller silinirken bir hata oluştu.');
2682
+ }
2683
+ }
2684
+
2685
+ function showToast(message, type = 'info') {
2686
+ // Create toast container if it doesn't exist
2687
+ let toastContainer = document.getElementById('toastContainer');
2688
+ if (!toastContainer) {
2689
+ toastContainer = document.createElement('div');
2690
+ toastContainer.id = 'toastContainer';
2691
+ document.body.appendChild(toastContainer);
2692
+ }
2693
+
2694
+ // Create toast element
2695
+ const toast = document.createElement('div');
2696
+ toast.className = `toast toast-${type}`;
2697
+ toast.textContent = message;
2698
+
2699
+ // Add toast to container
2700
+ toastContainer.appendChild(toast);
2701
+
2702
+ // Remove toast after animation
2703
+ setTimeout(() => {
2704
+ toast.classList.add('fade-out');
2705
+ setTimeout(() => {
2706
+ toastContainer.removeChild(toast);
2707
+ }, 300);
2708
+ }, 3000);
2709
+ }
2710
+ </script>
2711
+ </body>
2712
+ </html>