@@ -2209,4 +2209,113 @@ public function seven3on73 () {
22092209 $ this ->load ->view ('awards/73on73/index ' );
22102210 $ this ->load ->view ('interface_assets/footer ' );
22112211 }
2212+
2213+ public function wpx () {
2214+ $ footerData = [];
2215+ $ footerData ['scripts ' ] = [
2216+ 'assets/js/sections/wpx.js? ' . filemtime (realpath (__DIR__ . "/../../assets/js/sections/wpx.js " )),
2217+ ];
2218+
2219+ $ this ->load ->model ('wpx ' );
2220+ $ this ->load ->model ('modes ' );
2221+ $ this ->load ->model ('bands ' );
2222+
2223+ $ data ['orbits ' ] = $ this ->bands ->get_worked_orbits ();
2224+ $ data ['sats_available ' ] = $ this ->bands ->get_worked_sats ();
2225+ $ data ['user_default_band ' ] = $ this ->session ->userdata ('user_default_band ' );
2226+
2227+ $ data ['worked_bands ' ] = $ this ->bands ->get_worked_bands ('dxcc ' ); // Used in the view for band select
2228+ $ data ['modes ' ] = $ this ->modes ->active (); // Used in the view for mode select
2229+
2230+ if ($ this ->input ->post ('band ' ) != NULL ) { // Band is not set when page first loads.
2231+ if ($ this ->input ->post ('band ' ) == 'All ' ) { // Did the user specify a band? If not, use all bands
2232+ $ bands = $ data ['worked_bands ' ];
2233+ } else {
2234+ $ bands [] = $ this ->security ->xss_clean ($ this ->input ->post ('band ' ));
2235+ }
2236+ } else {
2237+ $ bands = $ data ['worked_bands ' ];
2238+ }
2239+
2240+ $ data ['bands ' ] = $ bands ; // Used for displaying selected band(s) in the table in the view
2241+
2242+ if ($ this ->input ->method () === 'post ' ) {
2243+ $ postdata ['qsl ' ] = ($ this ->input ->post ('qsl ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2244+ $ postdata ['lotw ' ] = ($ this ->input ->post ('lotw ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2245+ $ postdata ['eqsl ' ] = ($ this ->input ->post ('eqsl ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2246+ $ postdata ['qrz ' ] = ($ this ->input ->post ('qrz ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2247+ $ postdata ['clublog ' ] = ($ this ->input ->post ('clublog ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2248+ $ postdata ['Africa ' ] = ($ this ->input ->post ('Africa ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2249+ $ postdata ['Asia ' ] = ($ this ->input ->post ('Asia ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2250+ $ postdata ['Europe ' ] = ($ this ->input ->post ('Europe ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2251+ $ postdata ['NorthAmerica ' ] = ($ this ->input ->post ('NorthAmerica ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2252+ $ postdata ['SouthAmerica ' ] = ($ this ->input ->post ('SouthAmerica ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2253+ $ postdata ['Oceania ' ] = ($ this ->input ->post ('Oceania ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2254+ $ postdata ['Antarctica ' ] = ($ this ->input ->post ('Antarctica ' ,true ) ?? 0 ) == 0 ? NULL : 1 ;
2255+ $ postdata ['band ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('band ' ));
2256+ $ postdata ['mode ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('mode ' ));
2257+ $ postdata ['sat ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('sats ' ));
2258+ $ postdata ['orbit ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('orbits ' ));
2259+ } else { // Setting default values at first load of page
2260+ $ postdata ['qsl ' ] = 1 ;
2261+ $ postdata ['lotw ' ] = 1 ;
2262+ $ postdata ['eqsl ' ] = NULL ;
2263+ $ postdata ['qrz ' ] = NULL ;
2264+ $ postdata ['clublog ' ] = NULL ;
2265+ $ postdata ['Africa ' ] = 1 ;
2266+ $ postdata ['Asia ' ] = 1 ;
2267+ $ postdata ['Europe ' ] = 1 ;
2268+ $ postdata ['NorthAmerica ' ] = 1 ;
2269+ $ postdata ['SouthAmerica ' ] = 1 ;
2270+ $ postdata ['Oceania ' ] = 1 ;
2271+ $ postdata ['Antarctica ' ] = 1 ;
2272+ $ postdata ['band ' ] = 'All ' ;
2273+ $ postdata ['mode ' ] = 'All ' ;
2274+ $ postdata ['sat ' ] = 'All ' ;
2275+ $ postdata ['orbit ' ] = 'All ' ;
2276+ }
2277+
2278+ $ data ['wpx_array ' ] = $ this ->wpx ->get_wpx_array ($ bands , $ postdata );
2279+
2280+ // Render Page
2281+ $ data ['page_title ' ] = sprintf (__ ("Awards - %s " ), __ ("WPX " ));
2282+ $ data ['posted_band ' ]=$ postdata ['band ' ];
2283+ $ this ->load ->view ('interface_assets/header ' , $ data );
2284+ $ this ->load ->view ('awards/wpx/index ' );
2285+ $ this ->load ->view ('interface_assets/footer ' , $ footerData );
2286+ }
2287+
2288+ public function wpx_details () {
2289+ $ postdata ['band ' ] = $ this ->input ->post ('band ' , true );
2290+ $ postdata ['status ' ] = $ this ->input ->post ('status ' , true );
2291+ $ postdata ['sat ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('sats ' ));
2292+ $ postdata ['orbit ' ] = $ this ->security ->xss_clean ($ this ->input ->post ('orbits ' ));
2293+ $ postdata ['mode ' ] = $ this ->input ->post ('mode ' );
2294+ $ postdata ['qsl ' ] = ($ this ->input ->post ('qsl ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2295+ $ postdata ['lotw ' ] = ($ this ->input ->post ('lotw ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2296+ $ postdata ['eqsl ' ] = ($ this ->input ->post ('eqsl ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2297+ $ postdata ['qrz ' ] = ($ this ->input ->post ('qrz ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2298+ $ postdata ['clublog ' ] = ($ this ->input ->post ('clublog ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2299+ $ postdata ['Africa ' ] = ($ this ->input ->post ('Africa ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2300+ $ postdata ['Asia ' ] = ($ this ->input ->post ('Asia ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2301+ $ postdata ['Europe ' ] = ($ this ->input ->post ('Europe ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2302+ $ postdata ['NorthAmerica ' ] = ($ this ->input ->post ('NorthAmerica ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2303+ $ postdata ['SouthAmerica ' ] = ($ this ->input ->post ('SouthAmerica ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2304+ $ postdata ['Oceania ' ] = ($ this ->input ->post ('Oceania ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2305+ $ postdata ['Antarctica ' ] = ($ this ->input ->post ('Antarctica ' , true ) ?? 0 ) == 0 ? NULL : 1 ;
2306+ $ postdata ['summaryband ' ] = $ this ->input ->post ('summaryband ' , true );
2307+
2308+ $ this ->load ->model ('wpx ' );
2309+ $ this ->load ->model ('modes ' );
2310+ $ this ->load ->model ('bands ' );
2311+
2312+ $ results = $ this ->wpx ->getWpxBandDetails ($ postdata );
2313+
2314+ $ data ['band ' ] = $ postdata ['band ' ];
2315+ $ data ['status ' ] = $ postdata ['status ' ];
2316+ $ data ['results ' ] = $ results ;
2317+
2318+ $ this ->load ->view ('awards/wpx/wpx_details ' , $ data );
2319+ }
2320+
22122321}
0 commit comments