@@ -31,17 +31,63 @@ public function index()
31
31
32
32
public function dok ()
33
33
{
34
+
35
+ $ CI =& get_instance ();
36
+ $ CI ->load ->model ('logbooks_model ' );
37
+ $ logbooks_locations_array = $ CI ->logbooks_model ->list_logbook_relationships ($ this ->session ->userdata ('active_station_logbook ' ));
38
+
34
39
$ this ->load ->model ('dok ' );
35
40
$ this ->load ->model ('bands ' );
41
+ $ this ->load ->model ('modes ' );
36
42
37
43
if ($ this ->input ->method () === 'post ' ) {
38
44
$ postdata ['doks ' ] = $ this ->input ->post ('doks ' );
39
45
} else {
40
46
$ postdata ['doks ' ] = 'both ' ;
41
47
}
42
- $ data ['doks ' ] = $ this ->dok ->show_stats ($ postdata );
43
48
44
- $ data ['worked_bands ' ] = $ this ->bands ->get_worked_bands_dok (); // Used in the view for band select
49
+ $ data ['worked_bands ' ] = $ this ->bands ->get_worked_bands ('dok ' );
50
+ $ data ['modes ' ] = $ this ->modes ->active ();
51
+
52
+ if ($ this ->input ->post ('band ' ) != NULL ) {
53
+ if ($ this ->input ->post ('band ' ) == 'All ' ) {
54
+ $ bands = $ data ['worked_bands ' ];
55
+ } else {
56
+ $ bands [] = $ this ->input ->post ('band ' );
57
+ }
58
+ } else {
59
+ $ bands = $ data ['worked_bands ' ];
60
+ }
61
+
62
+ $ data ['bands ' ] = $ bands ;
63
+
64
+ if ($ this ->input ->method () === 'post ' ) {
65
+ $ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' );
66
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
67
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' );
68
+ $ postdata ['worked ' ] = $ this ->input ->post ('worked ' );
69
+ $ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' );
70
+ $ postdata ['band ' ] = $ this ->input ->post ('band ' );
71
+ $ postdata ['mode ' ] = $ this ->input ->post ('mode ' );
72
+ } else {
73
+ $ postdata ['qsl ' ] = 1 ;
74
+ $ postdata ['lotw ' ] = 1 ;
75
+ $ postdata ['eqsl ' ] = 0 ;
76
+ $ postdata ['worked ' ] = 1 ;
77
+ $ postdata ['confirmed ' ] = 1 ;
78
+ $ postdata ['band ' ] = 'All ' ;
79
+ $ postdata ['mode ' ] = 'All ' ;
80
+ }
81
+
82
+ if ($ logbooks_locations_array ) {
83
+ $ location_list = "' " .implode ("',' " ,$ logbooks_locations_array )."' " ;
84
+ $ data ['dok_array ' ] = $ this ->dok ->get_dok_array ($ bands , $ postdata , $ location_list );
85
+ $ data ['dok_summary ' ] = $ this ->dok ->get_dok_summary ($ bands , $ postdata , $ location_list );
86
+ } else {
87
+ $ location_list = null ;
88
+ $ data ['dok_array ' ] = null ;
89
+ $ data ['dok_summary ' ] = null ;
90
+ }
45
91
46
92
// Render Page
47
93
$ data ['page_title ' ] = "Awards - DOK " ;
@@ -66,9 +112,6 @@ public function dok_details_ajax(){
66
112
$ arguments ["order " ] = '' ;
67
113
$ arguments ["join_station_profile " ] = true ;
68
114
69
- // print_r($arguments);
70
- // return;
71
-
72
115
// Load the API and Logbook models
73
116
$ this ->load ->model ('api_model ' );
74
117
$ this ->load ->model ('logbook_model ' );
@@ -81,7 +124,7 @@ public function dok_details_ajax(){
81
124
82
125
// Render Page
83
126
$ data ['page_title ' ] = "Log View - DOK " ;
84
- $ data ['filter ' ] = str_replace ("(and) " , ", " , $ q );//implode(", ", array_keys($a));
127
+ $ data ['filter ' ] = str_replace ("(and) " , ", " , $ q );
85
128
$ this ->load ->view ('awards/details ' , $ data );
86
129
}
87
130
@@ -108,8 +151,9 @@ public function dxcc () {
108
151
$ data ['bands ' ] = $ bands ; // Used for displaying selected band(s) in the table in the view
109
152
110
153
if ($ this ->input ->method () === 'post ' ) {
111
- $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
112
154
$ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' );
155
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
156
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' );
113
157
$ postdata ['worked ' ] = $ this ->input ->post ('worked ' );
114
158
$ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' );
115
159
$ postdata ['notworked ' ] = $ this ->input ->post ('notworked ' );
@@ -125,8 +169,9 @@ public function dxcc () {
125
169
$ postdata ['mode ' ] = $ this ->input ->post ('mode ' );
126
170
}
127
171
else { // Setting default values at first load of page
128
- $ postdata ['lotw ' ] = 1 ;
129
172
$ postdata ['qsl ' ] = 1 ;
173
+ $ postdata ['lotw ' ] = 1 ;
174
+ $ postdata ['eqsl ' ] = 0 ;
130
175
$ postdata ['worked ' ] = 1 ;
131
176
$ postdata ['confirmed ' ] = 1 ;
132
177
$ postdata ['notworked ' ] = 1 ;
@@ -206,8 +251,9 @@ public function qso_details_ajax(){
206
251
$ band = str_replace ('" ' , "" , $ this ->input ->post ("Band " ));
207
252
$ mode = str_replace ('" ' , "" , $ this ->input ->post ("Mode " ));
208
253
$ type = $ this ->input ->post ('Type ' );
254
+ $ qsl = $ this ->input ->post ('QSL ' ) == null ? '' : $ this ->input ->post ('QSL ' );
209
255
210
- $ data ['results ' ] = $ this ->logbook_model ->qso_details ($ searchphrase , $ band , $ mode , $ type );
256
+ $ data ['results ' ] = $ this ->logbook_model ->qso_details ($ searchphrase , $ band , $ mode , $ type, $ qsl );
211
257
212
258
// This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC.
213
259
// We replace the values to make it look a bit nicer
@@ -217,9 +263,23 @@ public function qso_details_ajax(){
217
263
$ searchphrase = $ dxccname ['name ' ];
218
264
}
219
265
266
+ $ qsltype = [];
267
+ if (strpos ($ qsl , "Q " ) !== false ) {
268
+ $ qsltype [] = "QSL " ;
269
+ }
270
+ if (strpos ($ qsl , "L " ) !== false ) {
271
+ $ qsltype [] = "LotW " ;
272
+ }
273
+ if (strpos ($ qsl , "E " ) !== false ) {
274
+ $ qsltype [] = "eQSL " ;
275
+ }
276
+
220
277
// Render Page
221
278
$ data ['page_title ' ] = "Log View - " . $ type ;
222
279
$ data ['filter ' ] = $ type . " " . $ searchphrase . " and band " .$ band . " and mode " .$ mode ;
280
+ if (!empty ($ qsltype )) {
281
+ $ data ['filter ' ] .= " and " .implode ('/ ' , $ qsltype );
282
+ }
223
283
$ this ->load ->view ('awards/details ' , $ data );
224
284
}
225
285
@@ -301,17 +361,19 @@ public function cq() {
301
361
$ data ['bands ' ] = $ bands ; // Used for displaying selected band(s) in the table in the view
302
362
303
363
if ($ this ->input ->method () === 'post ' ) {
304
- $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
305
364
$ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' );
365
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
366
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' );
306
367
$ postdata ['worked ' ] = $ this ->input ->post ('worked ' );
307
368
$ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' );
308
369
$ postdata ['notworked ' ] = $ this ->input ->post ('notworked ' );
309
370
$ postdata ['band ' ] = $ this ->input ->post ('band ' );
310
371
$ postdata ['mode ' ] = $ this ->input ->post ('mode ' );
311
372
}
312
373
else { // Setting default values at first load of page
313
- $ postdata ['lotw ' ] = 1 ;
314
374
$ postdata ['qsl ' ] = 1 ;
375
+ $ postdata ['lotw ' ] = 1 ;
376
+ $ postdata ['eqsl ' ] = 0 ;
315
377
$ postdata ['worked ' ] = 1 ;
316
378
$ postdata ['confirmed ' ] = 1 ;
317
379
$ postdata ['notworked ' ] = 1 ;
@@ -359,17 +421,19 @@ public function was() {
359
421
$ data ['bands ' ] = $ bands ; // Used for displaying selected band(s) in the table in the view
360
422
361
423
if ($ this ->input ->method () === 'post ' ) {
362
- $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
363
424
$ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' );
425
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' );
426
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' );
364
427
$ postdata ['worked ' ] = $ this ->input ->post ('worked ' );
365
428
$ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' );
366
429
$ postdata ['notworked ' ] = $ this ->input ->post ('notworked ' );
367
430
$ postdata ['band ' ] = $ this ->input ->post ('band ' );
368
431
$ postdata ['mode ' ] = $ this ->input ->post ('mode ' );
369
432
}
370
433
else { // Setting default values at first load of page
371
- $ postdata ['lotw ' ] = 1 ;
372
434
$ postdata ['qsl ' ] = 1 ;
435
+ $ postdata ['lotw ' ] = 1 ;
436
+ $ postdata ['eqsl ' ] = 0 ;
373
437
$ postdata ['worked ' ] = 1 ;
374
438
$ postdata ['confirmed ' ] = 1 ;
375
439
$ postdata ['notworked ' ] = 1 ;
@@ -553,8 +617,9 @@ public function was_map($band_type, $mode_type) {
553
617
554
618
$ bands [] = $ band_type ;
555
619
556
- $ postdata ['lotw ' ] = 1 ;
557
620
$ postdata ['qsl ' ] = 1 ;
621
+ $ postdata ['lotw ' ] = 1 ;
622
+ $ postdata ['eqsl ' ] = 0 ;
558
623
$ postdata ['worked ' ] = 1 ;
559
624
$ postdata ['confirmed ' ] = 1 ;
560
625
$ postdata ['notworked ' ] = 1 ;
@@ -581,8 +646,9 @@ public function cq_map() {
581
646
582
647
$ bands [] = $ this ->input ->post ('band ' );
583
648
584
- $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' ) == 0 ? NULL : 1 ;
585
649
$ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' ) == 0 ? NULL : 1 ;
650
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' ) == 0 ? NULL : 1 ;
651
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' ) == 0 ? NULL : 1 ;
586
652
$ postdata ['worked ' ] = $ this ->input ->post ('worked ' ) == 0 ? NULL : 1 ;
587
653
$ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' ) == 0 ? NULL : 1 ;
588
654
$ postdata ['notworked ' ] = $ this ->input ->post ('notworked ' ) == 0 ? NULL : 1 ;
@@ -630,8 +696,9 @@ public function dxcc_map() {
630
696
631
697
$ bands [] = $ this ->input ->post ('band ' );
632
698
633
- $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' ) == 0 ? NULL : 1 ;
634
699
$ postdata ['qsl ' ] = $ this ->input ->post ('qsl ' ) == 0 ? NULL : 1 ;
700
+ $ postdata ['lotw ' ] = $ this ->input ->post ('lotw ' ) == 0 ? NULL : 1 ;
701
+ $ postdata ['eqsl ' ] = $ this ->input ->post ('eqsl ' ) == 0 ? NULL : 1 ;
635
702
$ postdata ['worked ' ] = $ this ->input ->post ('worked ' ) == 0 ? NULL : 1 ;
636
703
$ postdata ['confirmed ' ] = $ this ->input ->post ('confirmed ' ) == 0 ? NULL : 1 ;
637
704
$ postdata ['notworked ' ] = $ this ->input ->post ('notworked ' ) == 0 ? NULL : 1 ;
@@ -733,4 +800,4 @@ function returnStatus($string) {
733
800
}
734
801
}
735
802
}
736
- }
803
+ }
0 commit comments