2012-10-31 20:34:57 +00:00
< ? php if ( ! defined ( 'BASEPATH' )) exit ( 'No direct script access allowed' );
/*
Handles Displaying of information for awards .
2021-03-20 11:24:13 +01:00
These are taken from comments fields or ADIF fields
2012-10-31 20:34:57 +00:00
*/
class Awards extends CI_Controller {
2021-03-20 11:24:13 +01:00
2025-11-16 13:58:58 +01:00
private $user_map_color_qso ;
private $user_map_color_qsoconfirm ;
private $user_map_color_unworked ;
2019-10-05 19:35:55 +01:00
function __construct ()
{
parent :: __construct ();
2024-08-16 10:08:44 +02:00
if ( ! $this -> user_model -> authorize ( 2 )) { $this -> session -> set_flashdata ( 'error' , __ ( " You're not allowed to do that! " )); redirect ( 'dashboard' ); }
2025-11-16 13:58:58 +01:00
$map_custom = json_decode ( $this -> optionslib -> get_map_custom ());
2025-12-10 12:40:59 +01:00
$this -> user_map_color_qso = $map_custom -> qso -> color ? ? '' ;
2025-12-10 12:26:38 +01:00
$this -> user_map_color_qsoconfirm = $map_custom -> qsoconfirm -> color ? ? '' ;
2025-11-16 13:58:58 +01:00
$this -> user_map_color_unworked = $map_custom -> unworked -> color ? ? '' ;
2019-10-05 19:35:55 +01:00
}
2012-10-31 20:34:57 +00:00
public function index ()
{
2012-11-20 17:24:50 +00:00
// Render Page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Awards " );
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
2012-11-20 17:24:50 +00:00
$this -> load -> view ( 'awards/index' );
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/footer' );
2012-10-31 20:34:57 +00:00
}
2021-03-20 11:24:13 +01:00
2019-06-26 10:17:06 +02:00
public function dok ()
{
2024-01-31 13:57:05 +00:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2023-01-16 17:08:27 +01:00
2019-06-26 10:17:06 +02:00
$this -> load -> model ( 'dok' );
2021-11-13 15:55:17 +01:00
$this -> load -> model ( 'bands' );
2023-01-16 17:08:27 +01:00
$this -> load -> model ( 'modes' );
2021-11-13 15:55:17 +01:00
2022-01-26 09:18:29 +01:00
if ( $this -> input -> method () === 'post' ) {
2023-08-01 14:20:14 +02:00
$postdata [ 'doks' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'doks' ));
2022-01-26 09:18:29 +01:00
} else {
$postdata [ 'doks' ] = 'both' ;
}
2021-11-13 15:55:17 +01:00
2023-01-16 17:08:27 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'dok' );
$data [ 'modes' ] = $this -> modes -> active ();
if ( $this -> input -> post ( 'band' ) != NULL ) {
if ( $this -> input -> post ( 'band' ) == 'All' ) {
$bands = $data [ 'worked_bands' ];
} else {
2023-08-01 14:20:14 +02:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2023-01-16 17:08:27 +01:00
}
} else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ;
if ( $this -> input -> method () === 'post' ) {
2023-08-01 14:20:14 +02:00
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
2024-05-27 08:19:21 +00:00
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
2023-08-01 14:20:14 +02:00
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2023-01-16 17:08:27 +01:00
} else {
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = 0 ;
2024-05-27 08:19:21 +00:00
$postdata [ 'clublog' ] = 0 ;
2023-01-16 17:08:27 +01:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$data [ 'dok_array' ] = $this -> dok -> get_dok_array ( $bands , $postdata , $location_list );
$data [ 'dok_summary' ] = $this -> dok -> get_dok_summary ( $bands , $postdata , $location_list );
} else {
$location_list = null ;
$data [ 'dok_array' ] = null ;
$data [ 'dok_summary' ] = null ;
}
2019-06-26 10:17:06 +02:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " DOK " ));
2019-06-26 10:17:06 +02:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/dok/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2021-03-20 11:24:13 +01:00
2020-02-09 13:20:59 +01:00
public function dxcc () {
2016-02-12 16:31:29 +00:00
$this -> load -> model ( 'dxcc' );
2024-01-31 12:47:40 +00:00
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2026-02-27 10:27:32 +01:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2020-12-11 23:45:06 +01:00
2024-04-12 22:33:11 +02:00
$data [ 'orbits' ] = $this -> bands -> get_worked_orbits ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
$data [ 'user_default_band' ] = $this -> session -> userdata ( 'user_default_band' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-04-12 22:33:11 +02:00
2024-01-31 12:47:40 +00:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'dxcc' ); // Used in the view for band select
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
2026-08-07 18:56:47 +02:00
$data [ 'adif_propmodes' ] = $this -> config -> item ( 'adif_propmodes' );
2020-03-03 12:39:45 +01:00
2024-01-31 12:47:40 +00:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
2024-05-27 09:23:39 +00:00
} else {
2024-01-31 12:47:40 +00:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
2024-05-27 09:23:39 +00:00
} else {
2024-01-31 12:47:40 +00:00
$bands = $data [ 'worked_bands' ];
}
2020-03-03 12:39:45 +01:00
2024-01-31 12:47:40 +00:00
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
2020-03-03 12:39:45 +01:00
2024-01-31 12:47:40 +00:00
if ( $this -> input -> method () === 'post' ) {
2025-03-07 08:19:24 +00:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
2024-01-31 12:47:40 +00:00
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2024-04-12 22:33:11 +02:00
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sats' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbits' ));
2026-08-07 18:56:47 +02:00
$postdata [ 'prop_mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'prop_mode' ));
2025-11-17 12:59:15 +01:00
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2024-05-27 09:23:39 +00:00
} else { // Setting default values at first load of page
2024-01-31 12:47:40 +00:00
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
2025-03-07 08:19:24 +00:00
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
2024-01-31 12:47:40 +00:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
2025-03-07 08:19:24 +00:00
$postdata [ 'includedeleted' ] = NULL ;
2024-01-31 12:47:40 +00:00
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
2024-04-12 22:33:11 +02:00
$postdata [ 'sat' ] = 'All' ;
$postdata [ 'orbit' ] = 'All' ;
2026-08-07 18:56:47 +02:00
$postdata [ 'prop_mode' ] = 'All' ;
2025-11-17 12:59:15 +01:00
$postdata [ 'dateFrom' ] = null ;
$postdata [ 'dateTo' ] = null ;
2024-01-31 12:47:40 +00:00
}
2020-03-03 12:39:45 +01:00
2026-02-27 10:27:32 +01:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$dxcclist = $this -> dxcc -> fetchdxcc ( $postdata , $location_list );
if ( $dxcclist && $dxcclist [ 0 ] -> adif == " 0 " ) {
unset ( $dxcclist [ 0 ]);
}
2026-04-01 10:07:23 +02:00
$dxcc_result = $this -> dxcc -> get_dxcc_array ( $dxcclist , $bands , $postdata , $location_list );
// Extract bands data and summary from the result
$data [ 'dxcc_array' ] = ( $dxcc_result && isset ( $dxcc_result [ 'matrix' ])) ? $dxcc_result [ 'matrix' ] : null ;
$data [ 'dxcc_summary' ] = ( $dxcc_result && isset ( $dxcc_result [ 'summary' ])) ? $dxcc_result [ 'summary' ] : null ;
2026-05-15 11:58:18 +02:00
$data [ 'dxcc_continent_summary' ] = ( $dxcc_result && isset ( $dxcc_result [ 'continent_summary' ])) ? $dxcc_result [ 'continent_summary' ] : null ;
2026-02-27 10:27:32 +01:00
} else {
2026-04-01 10:07:23 +02:00
$location_list = null ;
$data [ 'dxcc_array' ] = null ;
$data [ 'dxcc_summary' ] = null ;
2026-05-15 11:58:18 +02:00
$data [ 'dxcc_continent_summary' ] = null ;
2026-04-01 10:07:23 +02:00
}
2016-02-12 16:31:29 +00:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " DXCC " ));
2026-03-01 08:17:36 +01:00
$data [ 'posted_band' ] = $postdata [ 'band' ];
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
2016-02-12 16:31:29 +00:00
$this -> load -> view ( 'awards/dxcc/index' );
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/footer' );
2012-11-20 17:25:54 +00:00
}
2016-02-15 17:46:33 +00:00
2026-05-22 21:05:59 +02:00
public function dxcc_progress () {
try {
$this -> load -> model ( 'dxcc' );
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
// Get posted data
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2026-05-23 12:54:10 +00:00
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sat' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbit' ));
2026-08-07 18:56:47 +02:00
$postdata [ 'prop_mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'prop_mode' ));
2026-05-22 21:05:59 +02:00
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
} else {
// Default values
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'includedeleted' ] = NULL ;
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
$postdata [ 'sat' ] = 'All' ;
$postdata [ 'orbit' ] = 'All' ;
2026-08-07 18:56:47 +02:00
$postdata [ 'prop_mode' ] = 'All' ;
2026-05-22 21:05:59 +02:00
$postdata [ 'dateFrom' ] = null ;
$postdata [ 'dateTo' ] = null ;
}
// Get bands
if ( $this -> input -> post ( 'band' ) != NULL ) {
if ( $this -> input -> post ( 'band' ) == 'All' ) {
$bands = $this -> bands -> get_worked_bands ( 'dxcc' );
} else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
} else {
$bands = $this -> bands -> get_worked_bands ( 'dxcc' );
}
2026-05-23 13:50:55 +00:00
// Fetch mode progress
$total_dxcc_entities = $this -> dxcc -> countDxccEntities ( $postdata );
2026-05-22 21:05:59 +02:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-05-23 13:50:55 +00:00
$dxcc_mode_summary = $this -> dxcc -> mode_progress ( $total_dxcc_entities , $postdata , $location_list );
2026-05-22 21:05:59 +02:00
} else {
$dxcc_mode_summary = null ;
}
// Generate HTML
$html = '' ;
if ( $dxcc_mode_summary ) {
$data [ 'dxcc_mode_summary' ] = $dxcc_mode_summary ;
$html = $this -> load -> view ( 'awards/dxcc/progress' , $data , true );
$this -> output
-> set_content_type ( 'application/json' )
-> set_output ( json_encode ([ 'success' => true , 'html' => $html ]));
} else {
$this -> output
-> set_content_type ( 'application/json' )
-> set_output ( json_encode ([ 'success' => true , 'html' => '' ]));
}
} catch ( Exception $e ) {
$this -> output
-> set_content_type ( 'application/json' )
-> set_output ( json_encode ([ 'success' => false , 'message' => $e -> getMessage ()]));
}
}
2025-07-23 10:01:17 +08:00
public function wapc () {
$footerData = [];
2026-02-28 14:09:46 +08:00
$footerData [ 'scripts' ] = [
2026-02-28 14:55:42 +08:00
'assets/js/sections/wapcmap.js' ,
2026-02-28 14:09:46 +08:00
'assets/js/leaflet/L.Maidenhead.js' ,
];
2025-07-23 10:01:17 +08:00
$this -> load -> model ( 'wapc' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2025-07-23 13:58:14 +08:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'wapc' );
2025-07-23 10:01:17 +08:00
$data [ 'modes' ] = $this -> modes -> active ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2025-07-23 10:01:17 +08:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'includedeleted' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'includedeleted' ));
$postdata [ 'Africa' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Africa' ));
$postdata [ 'Asia' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Asia' ));
$postdata [ 'Europe' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Europe' ));
$postdata [ 'NorthAmerica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'NorthAmerica' ));
$postdata [ 'SouthAmerica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'SouthAmerica' ));
$postdata [ 'Oceania' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Oceania' ));
$postdata [ 'Antarctica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Antarctica' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'clublog' ] = 0 ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'includedeleted' ] = 0 ;
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
$data [ 'wapc_array' ] = $this -> wapc -> get_wapc_array ( $bands , $postdata );
$data [ 'wapc_summary' ] = $this -> wapc -> get_wapc_summary ( $bands , $postdata );
// Render Page
$data [ 'page_title' ] = __ ( " Awards - WAPC " );
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wapc/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2023-11-29 20:16:53 +01:00
public function waja () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/wajamap.js' ,
2024-01-30 15:28:00 +01:00
'assets/js/leaflet/L.Maidenhead.js' ,
2023-11-29 20:16:53 +01:00
];
$this -> load -> model ( 'waja' );
2024-05-27 09:26:29 +00:00
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2023-11-29 20:16:53 +01:00
2024-05-27 09:26:29 +00:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'waja' );
$data [ 'modes' ] = $this -> modes -> active ();
2023-11-29 20:16:53 +01:00
2024-05-27 09:26:29 +00:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
}
else {
$bands = $data [ 'worked_bands' ];
}
2023-11-29 20:16:53 +01:00
2024-05-27 09:26:29 +00:00
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
2023-11-29 20:16:53 +01:00
2024-05-27 09:26:29 +00:00
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'includedeleted' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'includedeleted' ));
$postdata [ 'Africa' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Africa' ));
$postdata [ 'Asia' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Asia' ));
$postdata [ 'Europe' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Europe' ));
$postdata [ 'NorthAmerica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'NorthAmerica' ));
$postdata [ 'SouthAmerica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'SouthAmerica' ));
$postdata [ 'Oceania' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Oceania' ));
$postdata [ 'Antarctica' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'Antarctica' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'clublog' ] = 0 ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'includedeleted' ] = 0 ;
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
2023-11-29 20:16:53 +01:00
2024-05-27 09:26:29 +00:00
$data [ 'waja_array' ] = $this -> waja -> get_waja_array ( $bands , $postdata );
$data [ 'waja_summary' ] = $this -> waja -> get_waja_summary ( $bands , $postdata );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2023-11-29 20:16:53 +01:00
// Render Page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Awards - WAJA " );
2023-11-29 20:16:53 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/waja/index' );
2023-12-03 15:57:25 +01:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
2023-11-29 20:16:53 +01:00
}
2026-03-28 20:12:35 +08:00
/**
* JCC Award Main Page .
*/
public function jcc () {
2024-02-23 22:38:03 +01:00
$footerData = [];
2024-04-29 14:21:47 +02:00
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/jcc.js' ,
'assets/js/sections/jccmap.js'
2024-04-29 14:21:47 +02:00
];
2024-02-23 22:38:03 +01:00
2026-03-27 22:49:08 +08:00
$this -> load -> helper ( 'awards' );
2024-02-24 16:30:53 +01:00
$this -> load -> model ( 'jcc_model' );
2024-05-27 10:06:36 +00:00
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2024-02-23 22:38:03 +01:00
2024-05-27 10:06:36 +00:00
if ( $this -> input -> method () === 'post' ) {
2026-03-27 22:53:37 +08:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> input -> post ( 'band' , true ) ? ? 'All' ;
$postdata [ 'mode' ] = $this -> input -> post ( 'mode' , true ) ? ? 'All' ;
$postdata [ 'prop_mode' ] = $this -> input -> post ( 'prop_mode' , true ) ? ? 'All' ;
2026-03-28 20:12:35 +08:00
} else {
// Setting default values at first load of page
2024-05-27 10:06:36 +00:00
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
2026-03-27 22:53:37 +08:00
$postdata [ 'eqsl' ] = 1 ;
$postdata [ 'qrz' ] = null ;
$postdata [ 'clublog' ] = null ;
2024-05-27 10:06:36 +00:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
2026-03-27 22:53:37 +08:00
$postdata [ 'notworked' ] = null ;
$postdata [ 'includedeleted' ] = null ;
2024-05-27 10:06:36 +00:00
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
2026-03-25 23:32:25 +08:00
$postdata [ 'prop_mode' ] = 'All' ;
2024-05-27 10:06:36 +00:00
}
2026-03-28 20:12:35 +08:00
$data [ 'postdata' ] = $postdata ;
2024-02-23 22:38:03 +01:00
2026-03-28 20:12:35 +08:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'jcc' );
$data [ 'modes' ] = $this -> modes -> active ();
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
// If "All" is selected, show all bands that have been worked. Otherwise, just the selected band.
if ( $postdata [ 'band' ] == 'All' ) {
$bands = $data [ 'worked_bands' ];
} else {
$bands = [ $postdata [ 'band' ]];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
// Query the database for JCC status
2026-03-27 15:22:25 +08:00
$jcc_entity_status = $this -> jcc_model -> query_entity_status ( $postdata , 'band' );
2026-05-15 11:58:18 +02:00
2026-03-27 15:22:25 +08:00
$data [ 'jcc_array' ] = $this -> jcc_model -> get_jcc_array ( $bands , $postdata , $jcc_entity_status );
$data [ 'jcc_summary' ] = $this -> jcc_model -> get_jcc_summary ( $bands , $postdata , $jcc_entity_status );
2024-02-23 22:38:03 +01:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " JCC " ));
2024-02-23 22:38:03 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/jcc/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2026-03-28 20:12:35 +08:00
/**
* Export JCC QSOs as CSV for Award Application
*/
2024-05-27 10:06:36 +00:00
public function jcc_export () {
$this -> load -> model ( 'Jcc_model' );
2026-03-27 22:53:37 +08:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> input -> post ( 'band' , true ) ? ? 'All' ;
$postdata [ 'mode' ] = $this -> input -> post ( 'mode' , true ) ? ? 'All' ;
$postdata [ 'prop_mode' ] = $this -> input -> post ( 'prop_mode' , true ) ? ? 'All' ;
2024-04-25 00:27:49 +02:00
2026-03-28 19:45:35 +08:00
$qsos = $this -> Jcc_model -> get_jcc_export ( $postdata );
2024-04-24 22:42:11 +02:00
2024-05-27 10:06:36 +00:00
$fp = fopen ( 'php://output' , 'w' );
$i = 1 ;
2026-03-16 19:08:05 +08:00
fputcsv ( $fp , array ( 'No' , 'Callsign' , 'Date' , 'Band' , 'Mode' , 'Remarks' ), escape : '\\' );
2024-05-27 10:06:36 +00:00
foreach ( $qsos as $qso ) {
2026-03-28 19:45:35 +08:00
fputcsv ( $fp , array (
2026-05-15 11:58:18 +02:00
$i ,
$qso [ 'COL_CALL' ],
$qso [ 'COL_TIME_ON' ],
$qso [ 'COL_BAND' ] . ( $qso [ 'COL_PROP_MODE' ] ? ( ' / ' . $qso [ 'COL_PROP_MODE' ]) : '' ),
$qso [ 'COL_MODE' ],
2026-03-28 19:45:35 +08:00
$qso [ 'entity' ] . ' - ' . $qso [ 'entity_name' ]
), escape : '\\' );
2024-05-27 10:06:36 +00:00
$i ++ ;
}
fclose ( $fp );
return ;
}
2024-04-24 09:34:30 +02:00
2024-05-27 10:48:12 +00:00
public function vucc () {
$this -> load -> model ( 'vucc' );
$this -> load -> model ( 'bands' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-05-27 10:48:12 +00:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'vucc' );
2020-03-15 14:18:49 +01:00
2024-05-27 10:48:12 +00:00
$data [ 'vucc_array' ] = $this -> vucc -> get_vucc_array ( $data );
2020-03-15 14:18:49 +01:00
2024-05-27 10:48:12 +00:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " VUCC " ));
2024-05-27 10:48:12 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/vucc/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2020-03-15 14:18:49 +01:00
2024-05-27 10:48:12 +00:00
public function vucc_band (){
$this -> load -> model ( 'vucc' );
$band = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> get ( " Band " )));
$type = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> get ( " Type " )));
$data [ 'vucc_array' ] = $this -> vucc -> vucc_details ( $band , $type );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-05-27 10:48:12 +00:00
$data [ 'type' ] = $type ;
2020-03-15 14:18:49 +01:00
2024-05-27 10:48:12 +00:00
// Render Page
$data [ 'page_title' ] = " VUCC - " . $band . " Band " ;
$data [ 'filter' ] = " band " . $band ;
$data [ 'band' ] = $band ;
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/vucc/band' );
$this -> load -> view ( 'interface_assets/footer' );
}
2020-03-15 14:18:49 +01:00
2024-05-27 10:48:12 +00:00
public function vucc_details_ajax (){
$this -> load -> model ( 'logbook_model' );
2020-09-20 14:09:46 +02:00
2024-05-27 10:48:12 +00:00
$gridsquare = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Gridsquare " )));
$band = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Band " )));
$data [ 'results' ] = $this -> logbook_model -> vucc_qso_details ( $gridsquare , $band );
2020-09-20 14:09:46 +02:00
2024-05-27 10:48:12 +00:00
// Render Page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Log View - VUCC " );
2024-05-27 10:48:12 +00:00
$data [ 'filter' ] = " vucc " . $gridsquare . " and band " . $band ;
$this -> load -> view ( 'awards/details' , $data );
}
2020-09-20 14:09:46 +02:00
2021-07-24 14:31:16 +02:00
/*
* Used to fetch QSOs from the logbook in the awards
*/
2024-05-27 10:48:12 +00:00
public function qso_details_ajax () {
2021-07-24 14:31:16 +02:00
$this -> load -> model ( 'logbook_model' );
2023-08-01 14:20:14 +02:00
$searchphrase = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Searchphrase " )));
$band = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Band " )));
$mode = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Mode " )));
2024-04-05 16:36:44 +02:00
$sat = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Sat " )));
$orbit = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Orbit " )));
2024-05-27 10:48:12 +00:00
$propagation = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Propagation " )) ? ? '' );
2023-08-01 14:20:14 +02:00
$type = $this -> security -> xss_clean ( $this -> input -> post ( 'Type' ));
$qsl = $this -> input -> post ( 'QSL' ) == null ? '' : $this -> security -> xss_clean ( $this -> input -> post ( 'QSL' ));
2023-09-16 00:32:39 +02:00
$searchmode = $this -> input -> post ( 'searchmode' ) == null ? '' : $this -> security -> xss_clean ( $this -> input -> post ( 'searchmode' ));
2025-11-17 13:42:52 +01:00
$dateFrom = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$dateTo = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
$data [ 'results' ] = $this -> logbook_model -> qso_details ( $searchphrase , $band , $mode , $type , $qsl , $sat , $orbit , $searchmode , $propagation , $dateFrom , $dateTo );
2026-05-08 11:24:54 +02:00
$data [ 'adif_propmodes' ] = $this -> config -> item ( 'adif_propmodes' );
2021-07-24 14:31:16 +02:00
2024-01-17 14:20:10 +00:00
// This is done because we have two different ways to get dxcc info in Wavelog. Once is using the name (in awards), and the other one is using the ADIF DXCC.
2021-07-29 10:38:27 +02:00
// We replace the values to make it look a bit nicer
if ( $type == 'DXCC2' ) {
$type = 'DXCC' ;
$dxccname = $this -> logbook_model -> get_entity ( $searchphrase );
$searchphrase = $dxccname [ 'name' ];
}
2023-01-16 17:08:27 +01:00
$qsltype = [];
if ( strpos ( $qsl , " Q " ) !== false ) {
$qsltype [] = " QSL " ;
}
if ( strpos ( $qsl , " L " ) !== false ) {
2023-04-26 05:44:54 +02:00
$qsltype [] = " LoTW " ;
2023-01-16 17:08:27 +01:00
}
if ( strpos ( $qsl , " E " ) !== false ) {
$qsltype [] = " eQSL " ;
}
2024-01-31 12:47:40 +00:00
if ( strpos ( $qsl , " Z " ) !== false ) {
$qsltype [] = " QRZ.com " ;
}
2024-05-27 10:48:12 +00:00
if ( strpos ( $qsl , " C " ) !== false ) {
$qsltype [] = " Clublog " ;
}
2023-01-16 17:08:27 +01:00
2021-07-24 14:31:16 +02:00
// Render Page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Log View " ) . " - " . $type ;
2026-03-03 12:52:41 +01:00
$data [ 'filter' ] = (( $type != $band ) ? $type : '' ) . " " . $searchphrase . " " . __ ( " and " ) . " " ;
2026-03-03 12:56:23 +01:00
$data [ 'filter' ] .= ( $band == 'All' ? lcfirst ( __ ( " Every band (w/o SAT) " )) : __ ( " band " ) . " " . $band );
2024-04-05 16:36:44 +02:00
if ( $band == 'SAT' ) {
2024-04-05 21:12:27 +02:00
if ( $sat != 'All' && $sat != null ) {
2025-07-03 17:22:32 +02:00
$data [ 'filter' ] .= __ ( " and satellite " ) . $sat ;
2024-04-05 16:36:44 +02:00
}
2024-04-05 21:12:27 +02:00
if ( $orbit != 'All' && $orbit != null ) {
2024-06-08 11:01:59 +02:00
$data [ 'filter' ] .= __ ( " and orbit type " ) . $orbit ;
2024-04-05 16:36:44 +02:00
}
}
2024-05-27 10:48:12 +00:00
if ( $propagation != '' && $propagation != null ) {
2024-06-08 11:01:59 +02:00
$data [ 'filter' ] .= __ ( " and propagation " ) . $propagation ;
2024-05-27 10:48:12 +00:00
}
2024-04-05 21:12:27 +02:00
if ( $mode != null && strtolower ( $mode ) != 'all' ) {
2025-07-03 17:22:32 +02:00
$data [ 'filter' ] .= __ ( " and mode " ) . strtoupper ( $mode );
2024-04-05 21:12:27 +02:00
}
2023-01-16 17:08:27 +01:00
if ( ! empty ( $qsltype )) {
2024-06-08 11:01:59 +02:00
$data [ 'filter' ] .= __ ( " and " ) . implode ( '/' , $qsltype );
2023-01-16 17:08:27 +01:00
}
2025-07-01 16:35:49 +02:00
$data [ 'ispopup' ] = true ;
2021-07-24 14:31:16 +02:00
$this -> load -> view ( 'awards/details' , $data );
}
2012-11-01 01:50:11 +00:00
/*
Handles showing worked SOTAs
Comment field - SOTA : #
*/
public function sota () {
2021-03-20 11:24:13 +01:00
2012-11-01 01:50:11 +00:00
// Grab all worked sota stations
$this -> load -> model ( 'sota' );
2026-08-07 14:35:48 +02:00
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'modes' );
2012-11-01 01:50:11 +00:00
$data [ 'sota_all' ] = $this -> sota -> get_all ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2026-08-07 14:35:48 +02:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'sota' );
$data [ 'modes' ] = $this -> modes -> active ();
2021-03-20 11:24:13 +01:00
2012-11-01 01:50:11 +00:00
// Render page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " SOTA " ));
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
2012-11-01 01:50:11 +00:00
$this -> load -> view ( 'awards/sota/index' );
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/footer' );
2012-11-01 01:50:11 +00:00
}
2021-03-20 11:24:13 +01:00
2026-08-07 14:35:48 +02:00
public function sota_map () {
$this -> load -> model ( 'sota' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
$data = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$data = $this -> sota -> get_map_data ( $postdata , $location_list );
}
header ( 'Content-Type: application/json' );
echo json_encode ( $data );
}
public function sota_table () {
$this -> load -> model ( 'sota' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
if ( $this -> session -> userdata ( 'user_date_format' )) {
$date_format = $this -> session -> userdata ( 'user_date_format' );
} else {
$date_format = $this -> config -> item ( 'qso_date_format' );
}
$out = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$rows = $this -> sota -> get_qso_list ( $postdata , $location_list );
foreach ( $rows as $row ) {
$ts = strtotime ( $row -> COL_TIME_ON );
$out [] = [
'<a target="_blank" href="https://www.sotadata.org.uk/en/summit/' . htmlspecialchars (( string ) $row -> COL_SOTA_REF ) . '">' . htmlspecialchars (( string ) $row -> COL_SOTA_REF ) . '</a>' ,
date ( $date_format , $ts ),
date ( 'H:i' , $ts ),
'<a href="javascript:displayQso(' . ( int ) $row -> COL_PRIMARY_KEY . ')">' . htmlspecialchars (( string ) $row -> COL_CALL ) . '</a>' ,
( $row -> COL_SAT_NAME != null ) ? $row -> COL_SAT_NAME : $row -> COL_BAND ,
$row -> COL_RST_SENT ,
$row -> COL_RST_RCVD ,
];
}
}
header ( 'Content-Type: application/json' );
echo json_encode ([ 'data' => $out ]);
}
2022-09-10 15:04:05 +02:00
/*
Handles showing worked WWFFs
Comment field - WWFF : #
*/
public function wwff () {
// Grab all worked wwff stations
$this -> load -> model ( 'wwff' );
2026-08-01 07:17:56 +00:00
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'modes' );
2022-09-10 15:04:05 +02:00
$data [ 'wwff_all' ] = $this -> wwff -> get_all ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2026-08-01 07:17:56 +00:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'wwff' );
$data [ 'modes' ] = $this -> modes -> active ();
2022-09-10 15:04:05 +02:00
// Render page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " WWFF " ));
2022-09-10 15:04:05 +02:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wwff/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2026-08-01 07:17:56 +00:00
public function wwff_map () {
$this -> load -> model ( 'wwff' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
$data = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$data = $this -> wwff -> get_map_data ( $postdata , $location_list );
}
header ( 'Content-Type: application/json' );
echo json_encode ( $data );
}
2026-08-01 07:59:03 +00:00
public function wwff_table () {
$this -> load -> model ( 'wwff' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
if ( $this -> session -> userdata ( 'user_date_format' )) {
$date_format = $this -> session -> userdata ( 'user_date_format' );
} else {
$date_format = $this -> config -> item ( 'qso_date_format' );
}
$out = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$rows = $this -> wwff -> get_qso_list ( $postdata , $location_list );
foreach ( $rows as $row ) {
$ts = strtotime ( $row -> COL_TIME_ON );
$out [] = [
'<a target="_blank" href="https://www.cqgma.org/zinfo.php?ref=' . htmlspecialchars (( string ) $row -> COL_WWFF_REF ) . '">' . htmlspecialchars (( string ) $row -> COL_WWFF_REF ) . '</a>' ,
date ( $date_format , $ts ),
date ( 'H:i' , $ts ),
'<a href="javascript:displayQso(' . ( int ) $row -> COL_PRIMARY_KEY . ')">' . htmlspecialchars (( string ) $row -> COL_CALL ) . '</a>' ,
( $row -> COL_SAT_NAME != null ) ? $row -> COL_SAT_NAME : $row -> COL_BAND ,
$row -> COL_RST_SENT ,
$row -> COL_RST_RCVD ,
];
}
}
header ( 'Content-Type: application/json' );
echo json_encode ([ 'data' => $out ]);
}
2022-10-05 22:13:12 +02:00
/*
Handles showing worked POTAs
Comment field - POTA : #
*/
public function pota () {
// Grab all worked pota stations
$this -> load -> model ( 'pota' );
2026-08-06 08:43:02 +02:00
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'modes' );
2022-10-05 22:13:12 +02:00
$data [ 'pota_all' ] = $this -> pota -> get_all ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2026-08-06 08:43:02 +02:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'pota' );
$data [ 'modes' ] = $this -> modes -> active ();
2026-08-06 20:31:52 +02:00
$data [ 'pota_award_tiers' ] = $this -> pota -> award_tiers ();
$data [ 'pota_hunted_count' ] = $this -> pota -> count_unique_references ( 'COL_POTA_REF' );
2022-10-05 22:13:12 +02:00
// Render page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " POTA " ));
2022-10-05 22:13:12 +02:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/pota/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2026-08-06 08:43:02 +02:00
public function pota_map () {
$this -> load -> model ( 'pota' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
$data = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$data = $this -> pota -> get_map_data ( $postdata , $location_list );
}
header ( 'Content-Type: application/json' );
echo json_encode ( $data );
}
public function pota_table () {
$this -> load -> model ( 'pota' );
$this -> load -> model ( 'logbooks_model' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
if ( $this -> session -> userdata ( 'user_date_format' )) {
$date_format = $this -> session -> userdata ( 'user_date_format' );
} else {
$date_format = $this -> config -> item ( 'qso_date_format' );
}
$out = [];
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
if ( $logbooks_locations_array && $logbooks_locations_array [ 0 ] !== - 1 ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$rows = $this -> pota -> get_qso_list ( $postdata , $location_list );
foreach ( $rows as $row ) {
$ts = strtotime ( $row -> COL_TIME_ON );
$dateCell = date ( $date_format , $ts );
$timeCell = date ( 'H:i' , $ts );
$callCell = '<a href="javascript:displayQso(' . ( int ) $row -> COL_PRIMARY_KEY . ')">' . htmlspecialchars (( string ) $row -> COL_CALL ) . '</a>' ;
$bandCell = ( $row -> COL_SAT_NAME != null ) ? $row -> COL_SAT_NAME : $row -> COL_BAND ;
$rstSent = $row -> COL_RST_SENT ;
$rstRcvd = $row -> COL_RST_RCVD ;
// A QSO can carry several POTA references - emit one row per park
foreach ( explode ( ',' , ( string ) $row -> COL_POTA_REF ) as $reference ) {
$reference = trim ( $reference );
if ( $reference === '' ) continue ;
$refCell = '<a target="_blank" href="https://pota.app/#/park/' . htmlspecialchars ( $reference ) . '">' . htmlspecialchars ( $reference ) . '</a>' ;
$out [] = [
$refCell ,
$dateCell ,
$timeCell ,
$callCell ,
$bandCell ,
$rstSent ,
$rstRcvd ,
];
}
}
}
header ( 'Content-Type: application/json' );
echo json_encode ([ 'data' => $out ]);
}
2021-09-09 18:14:41 +02:00
public function cq () {
2024-01-08 08:13:41 +01:00
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/cqmap_geojson.js' ,
'assets/js/sections/cqmap.js'
2024-01-08 08:13:41 +01:00
];
2024-06-03 16:04:14 +02:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2021-09-08 22:07:00 +02:00
2016-04-13 16:16:07 +01:00
$this -> load -> model ( 'cq' );
2021-07-26 09:00:52 +02:00
$this -> load -> model ( 'modes' );
2021-11-13 15:55:17 +01:00
$this -> load -> model ( 'bands' );
2016-04-13 16:16:07 +01:00
2022-09-05 20:26:08 +02:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'cq' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2021-07-26 09:00:52 +02:00
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
2020-03-30 21:03:38 +02:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
2026-02-23 19:21:02 +01:00
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2023-08-01 14:20:14 +02:00
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2025-11-27 20:40:37 +01:00
$postdata [ 'datefrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateto' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2026-02-23 19:21:02 +01:00
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
2021-07-26 09:00:52 +02:00
$postdata [ 'mode' ] = 'All' ;
2025-11-27 20:40:37 +01:00
$postdata [ 'datefrom' ] = null ;
$postdata [ 'dateto' ] = null ;
2026-02-23 19:21:02 +01:00
}
2020-03-30 21:03:38 +02:00
2026-02-24 22:13:30 +01:00
$data [ 'posted_band' ] = $postdata [ 'band' ];
2020-03-30 21:03:38 +02:00
2021-11-14 17:11:59 +01:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-02-23 19:21:02 +01:00
$cq_result = $this -> cq -> get_cq_array ( $bands , $postdata , $location_list );
// Extract bands data and summary from the result
$data [ 'cq_array' ] = ( $cq_result && isset ( $cq_result [ 'bands' ])) ? $cq_result [ 'bands' ] : null ;
$data [ 'cq_summary' ] = ( $cq_result && isset ( $cq_result [ 'summary' ])) ? $cq_result [ 'summary' ] : null ;
2021-11-14 17:11:59 +01:00
} else {
$location_list = null ;
$data [ 'cq_array' ] = null ;
$data [ 'cq_summary' ] = null ;
}
2020-03-30 21:03:38 +02:00
2016-04-13 16:16:07 +01:00
// Render page
2025-04-09 09:36:53 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " CQ WAZ (Worked All Zones) " ));
2019-02-10 22:47:57 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
2016-04-13 16:16:07 +01:00
$this -> load -> view ( 'awards/cq/index' );
2024-01-08 08:13:41 +01:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
2016-04-13 16:16:07 +01:00
}
2020-02-09 13:20:59 +01:00
public function was () {
2023-12-12 21:35:03 +01:00
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/wasmap.js' ,
2024-01-30 15:28:00 +01:00
'assets/js/leaflet/L.Maidenhead.js' ,
2023-12-12 21:35:03 +01:00
];
2020-02-09 13:20:59 +01:00
$this -> load -> model ( 'was' );
2021-07-27 12:11:41 +02:00
$this -> load -> model ( 'modes' );
2021-11-13 15:55:17 +01:00
$this -> load -> model ( 'bands' );
2021-07-27 12:11:41 +02:00
2022-09-05 20:26:08 +02:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'was' );
2021-07-27 12:11:41 +02:00
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
2020-02-09 13:20:59 +01:00
2020-03-29 00:36:18 +01:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
2023-08-01 14:20:14 +02:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2020-03-29 00:36:18 +01:00
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
2023-08-01 14:20:14 +02:00
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
2023-08-01 14:20:14 +02:00
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2020-03-29 00:36:18 +01:00
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
2023-01-18 14:08:56 +01:00
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = 0 ;
2020-03-29 00:36:18 +01:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
2021-07-27 12:11:41 +02:00
$postdata [ 'mode' ] = 'All' ;
2020-03-29 00:36:18 +01:00
}
$data [ 'was_array' ] = $this -> was -> get_was_array ( $bands , $postdata );
2022-01-04 19:13:41 +01:00
$data [ 'was_summary' ] = $this -> was -> get_was_summary ( $bands , $postdata );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2020-03-29 00:36:18 +01:00
2020-02-09 13:20:59 +01:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " Worked All States (WAS) " ));;
2020-02-09 13:20:59 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/was/index' );
2023-12-12 21:35:03 +01:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
2020-02-09 13:20:59 +01:00
}
2024-01-08 10:17:53 +01:00
public function rac () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/racmap.js' ,
2024-01-31 08:36:18 +01:00
'assets/js/leaflet/L.Maidenhead.js' ,
2024-01-08 10:17:53 +01:00
];
$this -> load -> model ( 'rac' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'rac' );
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-01-08 10:17:53 +01:00
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
2024-01-08 10:17:53 +01:00
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = 0 ;
2024-01-08 10:17:53 +01:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
$data [ 'rac_array' ] = $this -> rac -> get_rac_array ( $bands , $postdata );
$data [ 'rac_summary' ] = $this -> rac -> get_rac_summary ( $bands , $postdata );
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " RAC " ));
2024-01-08 10:17:53 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/rac/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2024-02-17 00:47:00 +01:00
public function helvetia () {
2024-02-16 23:25:07 +01:00
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/helvetiamap.js' ,
2024-02-16 23:25:07 +01:00
'assets/js/leaflet/L.Maidenhead.js' ,
];
2024-02-17 20:49:11 +01:00
$this -> load -> model ( 'helvetia_model' );
2024-02-16 23:25:07 +01:00
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2024-02-17 00:47:00 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'helvetia' );
2024-02-16 23:25:07 +01:00
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
2024-02-17 20:49:11 +01:00
$data [ 'helvetia_array' ] = $this -> helvetia_model -> get_helvetia_array ( $bands , $postdata );
$data [ 'helvetia_summary' ] = $this -> helvetia_model -> get_helvetia_summary ( $bands , $postdata );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-02-16 23:25:07 +01:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " H26 " ));
2024-02-16 23:25:07 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
2024-02-17 00:47:00 +01:00
$this -> load -> view ( 'awards/helvetia/index' );
2024-02-16 23:25:07 +01:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2024-05-27 12:22:21 +00:00
public function iota () {
2024-02-18 16:22:18 +00:00
$this -> load -> model ( 'iota' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
2024-08-15 08:37:48 +02:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2026-03-18 09:00:48 +01:00
if ( $logbooks_locations_array [ 0 ] === - 1 ) {
2024-08-15 08:37:48 +02:00
return null ;
}
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-08-15 08:37:48 +02:00
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2024-02-18 16:22:18 +00:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'iota' ); // Used in the view for band select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
} else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
} else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> method () === 'post' ) {
2025-03-07 09:21:49 +00:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
2024-02-18 16:33:29 +00:00
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' )) ? ? NULL ;
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )) ? ? NULL ;
2024-02-18 16:22:18 +00:00
} else { // Setting default values at first load of page
2024-05-27 12:22:21 +00:00
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
2025-03-07 09:21:49 +00:00
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
2024-02-18 16:22:18 +00:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
2025-03-07 09:21:49 +00:00
$postdata [ 'includedeleted' ] = NULL ;
2024-02-18 16:22:18 +00:00
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
2024-08-15 08:37:48 +02:00
$iotalist = $this -> iota -> fetchIota ( $postdata , $location_list );
$data [ 'iota_array' ] = $this -> iota -> get_iota_array ( $iotalist , $bands , $postdata , $location_list );
$data [ 'iota_summary' ] = $this -> iota -> get_iota_summary ( $bands , $postdata , $location_list );
2025-03-07 17:03:51 +00:00
$data [ 'posted_band' ] = $postdata [ 'band' ];
2024-02-18 16:22:18 +00:00
// Render Page
2024-06-23 01:22:51 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " IOTA (Island On The Air) " ));
2024-02-18 16:22:18 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/iota/index' );
$this -> load -> view ( 'interface_assets/footer' );
2020-03-07 11:39:22 +01:00
}
2021-02-07 00:03:05 +01:00
public function counties () {
$this -> load -> model ( 'counties' );
2026-06-29 13:51:13 +02:00
$data [ 'counties_progress' ] = $this -> counties -> get_counties_progress ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2021-02-07 00:03:05 +01:00
// Render Page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " US Counties " ));
2021-02-07 00:03:05 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/counties/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2021-02-07 15:22:03 +01:00
2026-06-30 14:25:04 +00:00
public function counties_list_ajax () {
2021-02-07 15:22:03 +01:00
$this -> load -> model ( 'counties' );
2026-06-30 14:25:04 +00:00
$state = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " State " )));
$type = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " Type " )));
2021-02-07 15:22:03 +01:00
$data [ 'counties_array' ] = $this -> counties -> counties_details ( $state , $type );
$data [ 'type' ] = $type ;
2026-06-30 14:25:04 +00:00
$this -> load -> view ( 'awards/counties/details_ajax' , $data );
2021-02-07 15:22:03 +01:00
}
2026-06-29 14:37:31 +02:00
public function counties_details_ajax () {
2021-02-07 15:22:03 +01:00
$this -> load -> model ( 'logbook_model' );
2023-08-01 14:20:14 +02:00
$state = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " State " )));
$county = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " County " )));
2021-02-07 15:22:03 +01:00
$data [ 'results' ] = $this -> logbook_model -> county_qso_details ( $state , $county );
2026-06-29 14:37:31 +02:00
$data [ 'adif_propmodes' ] = $this -> config -> item ( 'adif_propmodes' );
2021-02-07 15:22:03 +01:00
// Render Page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Log View - Counties " );
2021-02-07 15:22:03 +01:00
$data [ 'filter' ] = " county " . $state ;
$this -> load -> view ( 'awards/details' , $data );
}
2021-03-20 11:24:13 +01:00
2026-06-30 14:09:51 +00:00
public function counties_state_ajax () {
2026-06-29 13:51:13 +02:00
$this -> load -> model ( 'counties' );
2026-06-30 14:09:51 +00:00
$state = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> post ( " State " )));
2026-06-29 13:51:13 +02:00
$data [ 'counties_array' ] = $this -> counties -> get_county_counts ( $state );
$data [ 'state' ] = $state ;
2026-06-30 14:09:51 +00:00
$this -> load -> view ( 'awards/counties/state_ajax' , $data );
2026-06-29 13:51:13 +02:00
}
2023-12-12 19:15:56 +01:00
public function gridmaster ( $dxcc ) {
$dxcc = $this -> security -> xss_clean ( $dxcc );
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Awards - " ) . strtoupper ( $dxcc ) . " Gridmaster " ;
2023-10-19 14:00:20 +02:00
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'gridmap_model' );
$this -> load -> model ( 'stations' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2023-10-19 14:00:20 +02:00
$data [ 'homegrid' ] = explode ( ',' , $this -> stations -> find_gridsquare ());
$data [ 'modes' ] = $this -> gridmap_model -> get_worked_modes ();
$data [ 'bands' ] = $this -> bands -> get_worked_bands ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
$data [ 'layer' ] = $this -> optionslib -> get_option ( 'option_map_tile_server' );
$data [ 'attribution' ] = $this -> optionslib -> get_option ( 'option_map_tile_server_copyright' );
2024-06-06 21:32:42 +02:00
$data [ 'gridsquares_gridsquares' ] = __ ( " Gridsquares " );
$data [ 'gridsquares_gridsquares_worked' ] = __ ( " Gridsquares worked " );
$data [ 'gridsquares_gridsquares_lotw' ] = __ ( " Gridsquares confirmed on LoTW " );
$data [ 'gridsquares_gridsquares_paper' ] = __ ( " Gridsquares confirmed by paper QSL " );
2025-11-25 14:02:29 +01:00
$data [ 'gridsquares_total_gridsquares_worked' ] = __ ( " Total Gridsquares worked " );
2023-10-19 14:00:20 +02:00
2023-12-12 19:15:56 +01:00
$indexData [ 'dxcc' ] = $dxcc ;
2023-10-19 14:00:20 +02:00
$footerData = [];
$footerData [ 'scripts' ] = [
'assets/js/leaflet/geocoding.js' ,
'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js' ,
2023-12-12 19:15:56 +01:00
'assets/js/sections/gridmaster.js'
2023-10-19 14:00:20 +02:00
];
$this -> load -> view ( 'interface_assets/header' , $data );
2023-12-12 19:15:56 +01:00
$this -> load -> view ( 'awards/gridmaster/index' , $indexData );
2023-10-19 14:00:20 +02:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2023-10-20 13:27:44 +02:00
public function ffma () {
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " Fred Fish Memorial Award (FFMA) " ));
2023-10-20 13:27:44 +02:00
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'ffma_model' );
$this -> load -> model ( 'stations' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2023-10-20 13:27:44 +02:00
$data [ 'homegrid' ] = explode ( ',' , $this -> stations -> find_gridsquare ());
$data [ 'layer' ] = $this -> optionslib -> get_option ( 'option_map_tile_server' );
$data [ 'attribution' ] = $this -> optionslib -> get_option ( 'option_map_tile_server_copyright' );
2024-06-06 21:32:42 +02:00
$data [ 'gridsquares_gridsquares' ] = __ ( " Gridsquares " );
$data [ 'gridsquares_gridsquares_worked' ] = __ ( " Gridsquares worked " );
$data [ 'gridsquares_gridsquares_lotw' ] = __ ( " Gridsquares confirmed on LoTW " );
$data [ 'gridsquares_gridsquares_paper' ] = __ ( " Gridsquares confirmed by paper QSL " );
2025-11-25 14:02:29 +01:00
$data [ 'gridsquares_total_gridsquares_worked' ] = __ ( " Total Gridsquares worked " );
2023-12-12 21:58:34 +01:00
$data [ 'grid_count' ] = $this -> ffma_model -> get_grid_count ();
$data [ 'grids' ] = $this -> ffma_model -> get_grids ();
2023-10-20 13:27:44 +02:00
$footerData = [];
$footerData [ 'scripts' ] = [
2024-08-15 08:37:48 +02:00
'assets/js/leaflet/geocoding.js' ,
2025-11-25 13:02:37 +01:00
'assets/js/sections/ffma.js' ,
'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js'
2023-10-20 13:27:44 +02:00
];
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/ffma/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
2024-08-15 08:37:48 +02:00
}
2023-10-20 13:27:44 +02:00
2023-10-22 21:23:51 +02:00
public function getFfmaGridsjs () {
2024-08-15 08:37:48 +02:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2023-10-20 13:27:44 +02:00
$this -> load -> model ( 'ffma_model' );
$array_grid_4char = array ();
$array_grid_4char_lotw = array ();
$array_grid_4char_paper = array ();
$grid_4char = " " ;
$grid_4char_lotw = " " ;
2024-08-15 08:37:48 +02:00
$query = $this -> ffma_model -> get_lotw ( $location_list );
2023-10-20 13:27:44 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
$grid_4char_lotw = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_4char_lotw , $array_grid_4char_lotw )){
array_push ( $array_grid_4char_lotw , $grid_4char_lotw );
}
}
}
2024-08-15 08:37:48 +02:00
$query = $this -> ffma_model -> get_paper ( $location_list );
2023-10-20 13:27:44 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
$grid_4char_paper = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_4char_paper , $array_grid_4char_paper )){
array_push ( $array_grid_4char_paper , $grid_4char_paper );
}
}
}
2024-08-15 08:37:48 +02:00
$query = $this -> ffma_model -> get_worked ( $location_list );
2023-10-20 13:27:44 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
$grid_four = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_four , $array_grid_4char )){
array_push ( $array_grid_4char , $grid_four );
}
}
}
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> ffma_model -> get_vucc_lotw ( $location_list );
2023-10-20 13:27:44 +02:00
foreach ( $vucc_grids as $key ) {
$grid_four_lotw = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four_lotw , $array_grid_4char_lotw )){
array_push ( $array_grid_4char_lotw , $grid_four_lotw );
}
}
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> ffma_model -> get_vucc_paper ( $location_list );
2023-10-20 13:27:44 +02:00
foreach ( $vucc_grids as $key ) {
$grid_four_paper = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four_paper , $array_grid_4char_paper )){
array_push ( $array_grid_4char_paper , $grid_four_paper );
}
}
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> ffma_model -> get_vucc_worked ( $location_list );
2023-10-20 13:27:44 +02:00
foreach ( $vucc_grids as $key ) {
$grid_four = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four , $array_grid_4char )){
array_push ( $array_grid_4char , $grid_four );
}
}
$data [ 'grid_4char_lotw' ] = ( $array_grid_4char_lotw );
$data [ 'grid_4char_paper' ] = ( $array_grid_4char_paper );
$data [ 'grid_4char' ] = ( $array_grid_4char );
2023-12-12 21:58:34 +01:00
$data [ 'grid_count' ] = $this -> ffma_model -> get_grid_count ();
$data [ 'grids' ] = $this -> ffma_model -> get_grids ();
2023-10-20 13:27:44 +02:00
header ( 'Content-Type: application/json' );
echo json_encode ( $data );
}
2023-12-12 19:15:56 +01:00
public function getGridmasterGridsjs ( $dxcc ) {
2024-08-15 08:37:48 +02:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2023-10-19 14:00:20 +02:00
$this -> load -> model ( 'gridmaster_model' );
2023-12-12 19:15:56 +01:00
$dxcc = $this -> security -> xss_clean ( $dxcc );
2023-10-19 14:00:20 +02:00
$array_grid_4char = array ();
2023-10-19 18:12:52 +02:00
$array_grid_4char_lotw = array ();
$array_grid_4char_paper = array ();
2023-10-19 14:00:20 +02:00
$grid_4char = " " ;
2023-10-19 18:12:52 +02:00
$grid_4char_lotw = " " ;
2023-10-19 14:00:20 +02:00
2024-08-15 08:37:48 +02:00
$query = $this -> gridmaster_model -> get_lotw ( $dxcc , $location_list );
2023-10-19 14:00:20 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
2023-10-19 18:12:52 +02:00
$grid_4char_lotw = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_4char_lotw , $array_grid_4char_lotw )){
array_push ( $array_grid_4char_lotw , $grid_4char_lotw );
2023-10-19 14:00:20 +02:00
}
2023-10-19 18:12:52 +02:00
}
}
2023-10-19 14:00:20 +02:00
2024-08-15 08:37:48 +02:00
$query = $this -> gridmaster_model -> get_paper ( $dxcc , $location_list );
2023-10-19 18:12:52 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
$grid_4char_paper = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_4char_paper , $array_grid_4char_paper )){
array_push ( $array_grid_4char_paper , $grid_4char_paper );
}
2023-10-19 14:00:20 +02:00
}
}
2024-08-15 08:37:48 +02:00
$query = $this -> gridmaster_model -> get_worked ( $dxcc , $location_list );
2023-10-19 14:00:20 +02:00
if ( $query && $query -> num_rows () > 0 ) {
foreach ( $query -> result () as $row ) {
$grid_four = strtoupper ( substr ( $row -> GRID_SQUARES , 0 , 4 ));
if ( ! in_array ( $grid_four , $array_grid_4char )){
2023-10-20 13:27:44 +02:00
array_push ( $array_grid_4char , $grid_four );
2023-10-19 14:00:20 +02:00
}
}
}
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> gridmaster_model -> get_vucc_lotw ( $dxcc , $location_list );
2023-10-19 14:00:20 +02:00
foreach ( $vucc_grids as $key ) {
2023-10-19 18:12:52 +02:00
$grid_four_lotw = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four_lotw , $array_grid_4char_lotw )){
array_push ( $array_grid_4char_lotw , $grid_four_lotw );
}
}
2023-10-19 14:00:20 +02:00
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> gridmaster_model -> get_vucc_paper ( $dxcc , $location_list );
2023-10-19 18:12:52 +02:00
foreach ( $vucc_grids as $key ) {
$grid_four_paper = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four_paper , $array_grid_4char_paper )){
array_push ( $array_grid_4char_paper , $grid_four_paper );
2023-10-19 14:00:20 +02:00
}
}
2024-08-15 08:37:48 +02:00
$vucc_grids = $this -> gridmaster_model -> get_vucc_worked ( $dxcc , $location_list );
2023-10-19 14:00:20 +02:00
foreach ( $vucc_grids as $key ) {
$grid_four = strtoupper ( substr ( $key , 0 , 4 ));
if ( ! in_array ( $grid_four , $array_grid_4char )){
array_push ( $array_grid_4char , $grid_four );
}
}
2023-10-19 18:12:52 +02:00
$data [ 'grid_4char_lotw' ] = ( $array_grid_4char_lotw );
$data [ 'grid_4char_paper' ] = ( $array_grid_4char_paper );
2023-10-19 14:00:20 +02:00
$data [ 'grid_4char' ] = ( $array_grid_4char );
2023-12-12 19:15:56 +01:00
$data [ 'grid_count' ] = $this -> gridmaster_model -> get_grid_count ( $dxcc );
$data [ 'grids' ] = $this -> gridmaster_model -> get_grids ( $dxcc );
$data [ 'lat' ] = $this -> gridmaster_model -> get_lat ( $dxcc );
$data [ 'lon' ] = $this -> gridmaster_model -> get_lon ( $dxcc );
$data [ 'zoom' ] = $this -> gridmaster_model -> get_zoom ( $dxcc );
2023-10-19 14:00:20 +02:00
header ( 'Content-Type: application/json' );
echo json_encode ( $data );
}
2021-03-20 11:24:13 +01:00
/*
Handles showing worked Sigs
Adif fields : my_sig
*/
public function sig () {
// Grab all worked sig stations
$this -> load -> model ( 'sig' );
$data [ 'sig_types' ] = $this -> sig -> get_all_sig_types ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2021-03-20 11:24:13 +01:00
// Render page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " SIG " ));
2021-03-20 11:24:13 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/sig/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
/*
Handles showing worked Sigs
*/
public function sig_details () {
// Grab all worked sig stations
$this -> load -> model ( 'sig' );
2023-08-01 14:20:14 +02:00
$type = str_replace ( '"' , " " , $this -> security -> xss_clean ( $this -> input -> get ( " type " )));
2021-03-20 11:24:13 +01:00
$data [ 'sig_all' ] = $this -> sig -> get_all ( $type );
$data [ 'type' ] = $type ;
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2021-03-20 11:24:13 +01:00
// Render page
2024-06-08 11:01:59 +02:00
$data [ 'page_title' ] = __ ( " Awards - SIG - " ) . $type ;
2021-03-20 11:24:13 +01:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/sig/qso_list' );
$this -> load -> view ( 'interface_assets/footer' );
}
/*
Handles exporting SIGS to ADIF
*/
public function sigexportadif () {
// Set memory limit to unlimited to allow heavy usage
ini_set ( 'memory_limit' , '-1' );
$this -> load -> model ( 'adif_data' );
2021-09-09 22:29:59 +02:00
2023-08-01 14:20:14 +02:00
$type = $this -> security -> xss_clean ( $this -> uri -> segment ( 3 ));
2021-03-20 11:24:13 +01:00
$data [ 'qsos' ] = $this -> adif_data -> sig_all ( $type );
2021-03-20 11:43:32 +01:00
$this -> load -> view ( 'adif/data/exportall' , $data );
2021-03-20 11:24:13 +01:00
}
2021-04-29 22:38:55 +01:00
2021-04-30 16:25:38 +01:00
/*
function was_map
2021-07-27 12:11:41 +02:00
This displays the WAS map and requires the $band_type and $mode_type
2021-04-30 16:25:38 +01:00
*/
2023-12-12 21:35:03 +01:00
public function was_map () {
$stateString = 'AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY' ;
$wasArray = explode ( ',' , $stateString );
2021-04-29 22:38:55 +01:00
$this -> load -> model ( 'was' );
2023-12-12 21:35:03 +01:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
2023-12-12 21:35:03 +01:00
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$was_array = $this -> was -> get_was_array ( $bands , $postdata );
2021-04-29 22:38:55 +01:00
2023-12-12 21:35:03 +01:00
$states = array ();
2021-04-29 22:38:55 +01:00
2023-12-12 21:35:03 +01:00
foreach ( $wasArray as $state ) { // Generating array for use in the table
$states [ $state ] = '-' ; // Inits each state's count
}
2021-04-29 22:38:55 +01:00
2023-12-12 21:35:03 +01:00
foreach ( $was_array as $was => $value ) {
foreach ( $value as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
$states [ $was ] = 'W' ;
break ;
2025-05-21 23:47:57 +02:00
}
if ( strpos ( $key , '>C<' ) !== false ) {
$states [ $was ] = 'C' ;
break ;
}
if ( strpos ( $key , '-' ) !== false ) {
$states [ $was ] = '-' ;
break ;
}
}
}
}
header ( 'Content-Type: application/json' );
echo json_encode ( $states );
}
public function wap () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/wapmap.js' ,
2025-05-21 23:47:57 +02:00
'assets/js/leaflet/L.Maidenhead.js' ,
];
$this -> load -> model ( 'wap' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'wap' );
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
}
$data [ 'wap_array' ] = $this -> wap -> get_wap_array ( $bands , $postdata );
$data [ 'wap_summary' ] = $this -> wap -> get_wap_summary ( $bands , $postdata );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2025-05-21 23:47:57 +02:00
// Render Page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " WAP " ));
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wap/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2026-03-11 18:38:39 +01:00
/*
function WAIP
This displays the WAIP ( Worked All Italian Provinces ) award
*/
public function waip () {
$data [ 'active_station_logbook' ] = $this -> logbooks_model -> find_name ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'waip' );
$this -> load -> model ( 'bands' );
// Get station location
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
// Generate QSL string for displayContacts links (QSL only)
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$data [ 'qsl_string' ] = $this -> genfunctions -> gen_qsl_from_postdata ( $postdata );
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
// All data comes from single efficient query
$data [ 'waip_worked' ] = $this -> waip -> get_waip_worked_by_modes ( $location_list );
$data [ 'waip_array' ] = $this -> waip -> get_waip_simple_by_modes ( $postdata , $location_list );
$data [ 'waip_totals' ] = $this -> waip -> get_waip_totals_by_modes ( $postdata , $location_list );
// Band-based data
2026-03-16 14:53:01 +01:00
$data [ 'waip_worked_bands' ] = $this -> waip -> get_waip_worked_by_bands ( $location_list );
$data [ 'waip_array_bands' ] = $this -> waip -> get_waip_simple_by_bands ( $postdata , $location_list );
$data [ 'waip_totals_bands' ] = $this -> waip -> get_waip_totals_by_bands ( $postdata , $location_list );
2026-03-11 18:38:39 +01:00
} else {
$location_list = null ;
$data [ 'waip_worked' ] = null ;
$data [ 'waip_array' ] = null ;
$data [ 'waip_totals' ] = null ;
$data [ 'waip_worked_bands' ] = null ;
$data [ 'waip_array_bands' ] = null ;
$data [ 'waip_totals_bands' ] = null ;
}
// Pass postdata for use in view
$data [ 'postdata' ] = $postdata ;
// Render page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( 'WAIP' ));
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/waip/index' );
2026-03-16 14:53:01 +01:00
$this -> load -> view ( 'interface_assets/footer' );
2026-03-11 18:38:39 +01:00
}
/*
function waip_map
Returns JSON data for WAIP Award map visualization
*/
public function waip_map () {
$this -> load -> model ( 'waip' );
// Get category (MIXED, PHONE, CW, DIGI, or band like 20M)
$category = $this -> security -> xss_clean ( $this -> input -> post ( 'category' ));
if ( ! $category ) {
$category = 'MIXED' ;
}
// QSL only
$postdata [ 'qsl' ] = 1 ;
// Get location list for active station
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
// Get map status directly from model
$provinces = $this -> waip -> get_waip_map_status ( $category , $postdata , $location_list );
header ( 'Content-Type: application/json' );
echo json_encode ( $provinces );
}
2025-05-21 23:47:57 +02:00
/*
function WAP_map
This displays the WAP Worked All The Netherlands Provinces map and requires the $band_type and $mode_type
*/
public function wap_map () {
$stateString = 'DR,FL,FR,GD,GR,LB,NB,NH,OV,UT,ZH,ZL' ;
$wapArray = explode ( ',' , $stateString );
$this -> load -> model ( 'wap' );
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$wap_array = $this -> wap -> get_wap_array ( $bands , $postdata );
$states = array ();
foreach ( $wapArray as $state ) { // Generating array for use in the table
$states [ $state ] = '-' ; // Inits each state's count
}
foreach ( $wap_array as $was => $value ) {
foreach ( $value as $key ) {
if ( $key != " " ) {
2023-12-12 21:35:03 +01:00
if ( strpos ( $key , '>C<' ) !== false ) {
$states [ $was ] = 'C' ;
break ;
}
2025-11-30 23:46:14 +01:00
if ( strpos ( $key , '>W<' ) !== false ) {
$states [ $was ] = 'W' ;
break ;
}
2023-12-12 21:35:03 +01:00
if ( strpos ( $key , '-' ) !== false ) {
$states [ $was ] = '-' ;
break ;
}
}
}
}
2021-05-01 07:57:08 +02:00
2024-01-08 10:17:53 +01:00
header ( 'Content-Type: application/json' );
echo json_encode ( $states );
}
/*
function RAC_map
This displays the RAC map and requires the $band_type and $mode_type
*/
public function rac_map () {
$stateString = 'AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT' ;
$racArray = explode ( ',' , $stateString );
$this -> load -> model ( 'rac' );
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
2024-01-08 10:17:53 +01:00
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$rac_array = $this -> rac -> get_rac_array ( $bands , $postdata );
$states = array ();
foreach ( $racArray as $state ) { // Generating array for use in the table
$states [ $state ] = '-' ; // Inits each state's count
}
foreach ( $rac_array as $was => $value ) {
foreach ( $value as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
$states [ $was ] = 'W' ;
break ;
}
if ( strpos ( $key , '>C<' ) !== false ) {
$states [ $was ] = 'C' ;
break ;
}
if ( strpos ( $key , '-' ) !== false ) {
$states [ $was ] = '-' ;
break ;
}
}
}
}
2023-12-12 21:35:03 +01:00
header ( 'Content-Type: application/json' );
echo json_encode ( $states );
2021-04-29 22:38:55 +01:00
}
2022-10-12 09:44:13 +02:00
2024-02-16 23:25:07 +01:00
/*
function H26_map
This displays the H26 map and requires the $band_type and $mode_type
*/
2024-02-17 00:47:00 +01:00
public function helvetia_map () {
2024-02-17 00:59:43 +01:00
$stateString = 'AG,AI,AR,BE,BL,BS,FR,GE,GL,GR,JU,LU,NE,NW,OW,SG,SH,SO,SZ,TG,TI,UR,VD,VS,ZG,ZH' ;
2024-02-17 00:47:00 +01:00
$helvetiaArray = explode ( ',' , $stateString );
2024-02-16 23:25:07 +01:00
2024-02-17 20:49:11 +01:00
$this -> load -> model ( 'helvetia_model' );
2024-02-16 23:25:07 +01:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2024-02-17 20:49:11 +01:00
$helvetia_array = $this -> helvetia_model -> get_helvetia_array ( $bands , $postdata );
2024-02-16 23:25:07 +01:00
$states = array ();
2024-02-17 00:47:00 +01:00
foreach ( $helvetiaArray as $state ) { // Generating array for use in the table
2024-02-16 23:25:07 +01:00
$states [ $state ] = '-' ; // Inits each state's count
}
2024-02-17 00:47:00 +01:00
foreach ( $helvetia_array as $was => $value ) {
2024-02-16 23:25:07 +01:00
foreach ( $value as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
$states [ $was ] = 'W' ;
break ;
}
if ( strpos ( $key , '>C<' ) !== false ) {
$states [ $was ] = 'C' ;
break ;
}
if ( strpos ( $key , '-' ) !== false ) {
$states [ $was ] = '-' ;
break ;
}
}
}
}
header ( 'Content-Type: application/json' );
echo json_encode ( $states );
}
2022-10-12 09:44:13 +02:00
/*
function cq_map
This displays the CQ Zone map and requires the $band_type and $mode_type
*/
public function cq_map () {
2024-06-03 16:04:14 +02:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2022-10-12 09:44:13 +02:00
$this -> load -> model ( 'cq' );
2026-02-24 10:05:49 +01:00
$this -> load -> model ( 'bands' );
2022-10-12 09:44:13 +02:00
2026-02-24 09:43:42 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'cq' );
2026-02-24 10:05:49 +01:00
if ( $this -> input -> post ( 'band' ) == 'All' ) {
2026-02-24 09:43:42 +01:00
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
2022-10-12 09:44:13 +02:00
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
2023-01-18 13:35:58 +01:00
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
2024-05-27 09:20:04 +00:00
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
2022-10-12 09:44:13 +02:00
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
2023-08-01 14:20:14 +02:00
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2026-02-24 09:43:42 +01:00
$postdata [ 'datefrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateto' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2022-10-12 09:44:13 +02:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-02-24 09:43:42 +01:00
$zones = $this -> cq -> get_cq_array ( $bands , $postdata , $location_list , true );
2022-10-12 09:44:13 +02:00
} else {
$location_list = null ;
2026-02-24 09:43:42 +01:00
$zones = array ();
2022-10-12 09:44:13 +02:00
}
header ( 'Content-Type: application/json' );
echo json_encode ( $zones );
}
2023-08-01 14:20:14 +02:00
2023-12-03 15:57:25 +01:00
/*
function waja_map
*/
public function waja_map () {
2023-12-04 11:00:01 +01:00
$prefectureString = '01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47' ;
$wajaArray = explode ( ',' , $prefectureString );
2023-12-03 15:57:25 +01:00
$this -> load -> model ( 'waja' );
$this -> load -> model ( 'bands' );
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
2024-01-31 13:03:36 +00:00
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
2023-12-03 15:57:25 +01:00
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
2024-05-27 10:38:17 +00:00
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
2023-12-03 15:57:25 +01:00
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$waja_array = $this -> waja -> get_waja_array ( $bands , $postdata );
$prefectures = array ();
2023-12-04 11:00:01 +01:00
foreach ( $wajaArray as $state ) { // Generating array for use in the table
$prefectures [ $state ] = '-' ; // Inits each state's count
}
2023-12-03 15:57:25 +01:00
foreach ( $waja_array as $waja => $value ) {
foreach ( $value as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
2023-12-04 11:00:01 +01:00
$prefectures [ $waja ] = 'W' ;
2023-12-03 15:57:25 +01:00
break ;
}
if ( strpos ( $key , '>C<' ) !== false ) {
2023-12-04 11:00:01 +01:00
$prefectures [ $waja ] = 'C' ;
2023-12-03 15:57:25 +01:00
break ;
}
if ( strpos ( $key , '-' ) !== false ) {
2023-12-04 11:00:01 +01:00
$prefectures [ $waja ] = '-' ;
2023-12-03 15:57:25 +01:00
break ;
}
}
}
}
header ( 'Content-Type: application/json' );
echo json_encode ( $prefectures );
}
2026-02-28 14:09:46 +08:00
/*
function wapc_map
*/
public function wapc_map () {
$this -> load -> model ( 'wapc' );
$this -> load -> model ( 'bands' );
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
2026-02-28 14:55:42 +08:00
$postdata [ 'band' ] = $this -> input -> post ( 'band' , TRUE );
$postdata [ 'mode' ] = $this -> input -> post ( 'mode' , TRUE );
2026-02-28 14:09:46 +08:00
$wapc_array = $this -> wapc -> get_wapc_array ( $bands , $postdata );
$provinces = array ();
$wapcArray = array_keys ( $this -> wapc -> cnProvinces );
foreach ( $wapcArray as $state ) {
$provinces [ $state ] = '-' ;
}
foreach ( $wapc_array as $wapc => $value ) {
foreach ( $value as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
$provinces [ $wapc ] = 'W' ;
break ;
}
if ( strpos ( $key , '>C<' ) !== false ) {
$provinces [ $wapc ] = 'C' ;
break ;
}
if ( strpos ( $key , '-' ) !== false ) {
$provinces [ $wapc ] = '-' ;
break ;
}
}
}
}
header ( 'Content-Type: application/json' );
echo json_encode ( $provinces );
}
2022-11-11 19:23:41 +01:00
/*
function dxcc_map
This displays the DXCC map
*/
public function dxcc_map () {
2026-02-27 10:27:32 +01:00
$this -> load -> model ( 'dxcc' );
$this -> load -> model ( 'bands' );
2022-11-11 19:23:41 +01:00
2026-02-28 11:32:40 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'dxcc' );
if ( $this -> input -> post ( 'band' ) == 'All' ) {
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
2026-02-27 10:27:32 +01:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2022-11-11 19:23:41 +01:00
2026-02-27 10:27:32 +01:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sat' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbit' ));
2026-08-07 18:56:47 +02:00
$postdata [ 'prop_mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'prop_mode' ));
2025-03-07 09:54:58 +00:00
2025-11-17 12:59:15 +01:00
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2025-03-07 09:54:58 +00:00
2026-02-27 10:27:32 +01:00
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2022-11-11 19:23:41 +01:00
2026-02-27 10:27:32 +01:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-03-02 10:59:18 +01:00
$dxcclist = $this -> dxcc -> fetchdxcc ( $postdata , $location_list );
2026-06-16 08:12:40 +00:00
if ( ! empty ( $dxcclist ) && $dxcclist [ 0 ] -> adif == " 0 " ) {
2026-03-02 10:59:18 +01:00
unset ( $dxcclist [ 0 ]);
}
2026-02-27 10:27:32 +01:00
$dxcc_array = $this -> dxcc -> get_dxcc_array ( $dxcclist , $bands , $postdata , $location_list , true );
} else {
$location_list = null ;
$dxcc_array = array ();
2026-06-16 08:12:40 +00:00
$dxcclist = [];
2026-02-27 10:27:32 +01:00
}
2022-11-11 19:23:41 +01:00
2026-06-16 08:12:40 +00:00
$newdxcc = [];
2026-02-27 10:27:32 +01:00
$i = 0 ;
foreach ( $dxcclist as $dxcc ) {
$newdxcc [ $i ][ 'adif' ] = $dxcc -> adif ;
$newdxcc [ $i ][ 'prefix' ] = $dxcc -> prefix ;
$newdxcc [ $i ][ 'name' ] = ucwords ( strtolower ( $dxcc -> name ), " - (/ " );
if ( $dxcc -> Enddate != null ) {
$newdxcc [ $i ][ 'name' ] .= ' (deleted)' ;
}
$newdxcc [ $i ][ 'lat' ] = $dxcc -> lat ;
$newdxcc [ $i ][ 'long' ] = $dxcc -> long ;
$newdxcc [ $i ++ ][ 'status' ] = isset ( $dxcc_array [ $dxcc -> adif ]) ? $dxcc_array [ $dxcc -> adif ] : 'x' ;
}
header ( 'Content-Type: application/json' );
echo json_encode ( $newdxcc );
2022-11-11 19:23:41 +01:00
}
2022-12-11 17:47:36 +01:00
2026-03-28 20:12:35 +08:00
/**
* Provide data for AJAX to render the JCC map
*/
2024-04-29 14:21:47 +02:00
public function jcc_map () {
2024-05-27 10:06:36 +00:00
$this -> load -> model ( 'jcc_model' );
$this -> load -> model ( 'bands' );
2024-04-29 14:21:47 +02:00
2024-05-27 10:06:36 +00:00
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2026-03-27 22:53:37 +08:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? null : 1 ;
$postdata [ 'band' ] = $this -> input -> post ( 'band' , true ) ? ? 'All' ;
$postdata [ 'mode' ] = $this -> input -> post ( 'mode' , true ) ? ? 'All' ;
$postdata [ 'prop_mode' ] = $this -> input -> post ( 'prop_mode' , true ) ? ? 'All' ;
2024-05-27 10:06:36 +00:00
2026-03-27 15:22:25 +08:00
$jcc_entity_status = $this -> jcc_model -> query_entity_status ( $postdata , 'none' );
$jccs = $this -> jcc_model -> get_jcc_map_array ( $postdata , $jcc_entity_status );
2024-04-29 14:21:47 +02:00
2024-05-27 10:06:36 +00:00
header ( 'Content-Type: application/json' );
echo json_encode ( $jccs );
2024-04-29 14:21:47 +02:00
}
2022-12-11 17:47:36 +01:00
/*
function iota
This displays the IOTA map
*/
public function iota_map () {
2025-03-07 09:21:49 +00:00
$this -> load -> model ( 'iota' );
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
2024-08-15 08:37:48 +02:00
2026-03-18 09:00:48 +01:00
if ( $logbooks_locations_array [ 0 ] === - 1 ) {
2025-03-07 09:21:49 +00:00
return null ;
}
2024-08-15 08:37:48 +02:00
2025-03-07 09:21:49 +00:00
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2022-12-11 17:47:36 +01:00
2025-03-07 09:21:49 +00:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = ( $this -> input -> post ( 'includedeleted' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' )) ? ? NULL ;
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )) ? ? NULL ;
2022-12-11 17:47:36 +01:00
2025-03-07 09:21:49 +00:00
$iotalist = $this -> iota -> fetchIota ( $postdata , $location_list );
2022-12-11 17:47:36 +01:00
2025-03-07 09:21:49 +00:00
$iota_array = $this -> iota -> get_iota_array ( $iotalist , $bands , $postdata , $location_list );
2022-12-11 17:47:36 +01:00
2025-03-07 09:21:49 +00:00
$i = 0 ;
2022-12-11 17:47:36 +01:00
2026-07-11 17:50:04 +02:00
$newiota = [];
2025-03-07 09:21:49 +00:00
foreach ( $iotalist as $iota ) {
$newiota [ $i ][ 'tag' ] = $iota -> tag ;
$newiota [ $i ][ 'prefix' ] = $iota -> prefix ;
$newiota [ $i ][ 'name' ] = ucwords ( strtolower ( $iota -> name ), " - (/ " );
if ( $iota -> status == 'D' ) {
$newiota [ $i ][ 'name' ] .= ' (deleted)' ;
}
$newiota [ $i ][ 'lat1' ] = $iota -> lat1 ;
$newiota [ $i ][ 'lon1' ] = $iota -> lon1 ;
$newiota [ $i ][ 'lat2' ] = $iota -> lat2 ;
$newiota [ $i ][ 'lon2' ] = $iota -> lon2 ;
$newiota [ $i ++ ][ 'status' ] = isset ( $iota_array [ $iota -> tag ]) ? $this -> returnStatus ( $iota_array [ $iota -> tag ]) : 'x' ;
}
2022-12-11 17:47:36 +01:00
2025-03-07 09:21:49 +00:00
header ( 'Content-Type: application/json' );
echo json_encode ( $newiota );
2022-12-11 17:47:36 +01:00
}
function returnStatus ( $string ) {
foreach ( $string as $key ) {
if ( $key != " " ) {
if ( strpos ( $key , '>W<' ) !== false ) {
return 'W' ;
}
if ( strpos ( $key , '>C<' ) !== false ) {
return 'C' ;
}
if ( $key == '-' ) {
return '-' ;
}
}
}
}
2024-04-20 10:05:33 +02:00
2024-05-27 08:19:21 +00:00
public function wab () {
$this -> load -> model ( 'bands' );
$this -> load -> model ( 'gridmap_model' );
$this -> load -> model ( 'stations' );
2024-04-20 10:05:33 +02:00
2024-05-27 08:19:21 +00:00
$data [ 'modes' ] = $this -> gridmap_model -> get_worked_modes ();
$data [ 'bands' ] = $this -> bands -> get_worked_bands ();
$data [ 'orbits' ] = $this -> bands -> get_worked_orbits ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
2024-04-20 10:05:33 +02:00
2024-05-27 08:19:21 +00:00
$data [ 'user_default_band' ] = $this -> session -> userdata ( 'user_default_band' );
$data [ 'user_default_confirmation' ] = $this -> session -> userdata ( 'user_default_confirmation' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-04-20 10:05:33 +02:00
2024-05-27 08:19:21 +00:00
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/wab.js'
2024-05-27 08:19:21 +00:00
];
2024-04-20 10:05:33 +02:00
2024-05-27 08:19:21 +00:00
// Render page
2024-06-08 11:19:51 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), " Worked All Britain " );
2024-05-27 08:19:21 +00:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wab/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2024-04-21 09:02:18 +02:00
2024-05-27 08:19:21 +00:00
public function wab_map () {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sat' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbit' ));
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'wab' );
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$wab_array = $this -> wab -> get_wab_array ( $location_list , $postdata );
} else {
$location_list = null ;
$wab_array = null ;
}
2024-04-21 09:02:18 +02:00
2024-05-27 08:19:21 +00:00
header ( 'Content-Type: application/json' );
echo json_encode ( $wab_array );
}
2024-04-21 09:02:18 +02:00
2024-05-27 08:19:21 +00:00
public function wab_list () {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
$postdata [ 'worked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'worked' ));
$postdata [ 'confirmed' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'confirmed' ));
$postdata [ 'notworked' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'notworked' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sat' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbit' ));
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'wab' );
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$wab_array = $this -> wab -> get_wab_list ( $location_list , $postdata );
} else {
$location_list = null ;
$wab_array = null ;
}
2024-04-21 09:02:18 +02:00
2024-05-27 08:19:21 +00:00
$data [ 'wab_array' ] = $wab_array ;
$data [ 'postdata' ][ 'band' ] = $postdata [ 'band' ];
$data [ 'postdata' ][ 'mode' ] = $postdata [ 'mode' ];
$data [ 'postdata' ][ 'sat' ] = $postdata [ 'sat' ];
$data [ 'postdata' ][ 'orbit' ] = $postdata [ 'orbit' ];
2024-04-21 09:02:18 +02:00
2024-05-27 08:19:21 +00:00
$this -> load -> view ( 'awards/wab/list' , $data );
}
2024-04-21 09:02:18 +02:00
2024-04-27 17:37:43 +02:00
public function itu () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/itumap_geojson.js' ,
'assets/js/sections/itumap.js'
2024-04-27 17:37:43 +02:00
];
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'itu' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'cq' );
2026-02-25 09:54:52 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-04-27 17:37:43 +02:00
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
2026-02-25 09:54:52 +01:00
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'datefrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateto' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
2024-04-27 17:37:43 +02:00
$postdata [ 'mode' ] = 'All' ;
2026-02-25 09:54:52 +01:00
$postdata [ 'datefrom' ] = null ;
$postdata [ 'dateto' ] = null ;
}
$data [ 'posted_band' ] = $postdata [ 'band' ];
2024-04-27 17:37:43 +02:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-02-25 09:54:52 +01:00
$itu_result = $this -> itu -> get_itu_array ( $bands , $postdata , $location_list );
// Extract bands data and summary from the result
$data [ 'itu_array' ] = ( $itu_result && isset ( $itu_result [ 'bands' ])) ? $itu_result [ 'bands' ] : null ;
$data [ 'itu_summary' ] = ( $itu_result && isset ( $itu_result [ 'summary' ])) ? $itu_result [ 'summary' ] : null ;
2024-04-27 17:37:43 +02:00
} else {
$location_list = null ;
$data [ 'itu_array' ] = null ;
$data [ 'itu_summary' ] = null ;
}
// Render page
2024-06-08 11:13:17 +02:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " ITU Zones " ));
2024-04-27 17:37:43 +02:00
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/itu/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
/*
function itu_map
This displays the ITU Zone map and requires the $band_type and $mode_type
*/
public function itu_map () {
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'itu' );
2026-02-25 09:54:52 +01:00
$this -> load -> model ( 'bands' );
2024-04-27 17:37:43 +02:00
2026-02-25 09:54:52 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'cq' );
2024-04-27 17:37:43 +02:00
2026-02-25 09:54:52 +01:00
if ( $this -> input -> post ( 'band' ) == 'All' ) {
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
2024-04-27 17:37:43 +02:00
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
2024-05-27 08:19:21 +00:00
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
2024-04-27 17:37:43 +02:00
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
2026-02-25 09:54:52 +01:00
$postdata [ 'datefrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateto' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2024-04-27 17:37:43 +02:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2026-02-25 09:54:52 +01:00
$zones = $this -> itu -> get_itu_array ( $bands , $postdata , $location_list , true );
2024-04-27 17:37:43 +02:00
} else {
$location_list = null ;
2026-02-25 09:54:52 +01:00
$zones = array ();
2024-04-27 17:37:43 +02:00
}
header ( 'Content-Type: application/json' );
echo json_encode ( $zones );
}
2024-09-06 11:24:03 +02:00
public function wac () {
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$this -> load -> model ( 'wac' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ();
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-09-06 11:24:03 +02:00
$data [ 'orbits' ] = $this -> bands -> get_worked_orbits ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
$data [ 'user_default_band' ] = $this -> session -> userdata ( 'user_default_band' );
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
}
else {
$bands [] = $this -> input -> post ( 'band' );
}
}
else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
2026-03-11 11:22:14 +01:00
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
2024-09-06 11:24:03 +02:00
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sats' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbits' ));
2026-03-11 11:22:14 +01:00
$postdata [ 'worked' ] = ( $this -> input -> post ( 'worked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = ( $this -> input -> post ( 'confirmed' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = ( $this -> input -> post ( 'notworked' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
2024-09-06 11:24:03 +02:00
}
else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
2026-03-11 11:22:14 +01:00
$postdata [ 'eqsl' ] = null ;
$postdata [ 'qrz' ] = null ;
$postdata [ 'clublog' ] = null ;
2024-09-06 11:24:03 +02:00
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
$postdata [ 'sat' ] = 'All' ;
$postdata [ 'orbit' ] = 'All' ;
2026-03-11 11:22:14 +01:00
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
2024-09-06 11:24:03 +02:00
}
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
$data [ 'wac_array' ] = $this -> wac -> get_wac_array ( $bands , $postdata , $location_list );
$data [ 'wac_summary' ] = $this -> wac -> get_wac_summary ( $bands , $postdata , $location_list );
} else {
$location_list = null ;
$data [ 'wac_array' ] = null ;
$data [ 'wac_summary' ] = null ;
}
2026-03-11 11:22:14 +01:00
$data [ 'posted_band' ] = $postdata [ 'band' ];
$footerData = [];
$footerData [ 'scripts' ] = [
'assets/js/sections/wac.js' ,
];
2024-09-06 11:24:03 +02:00
// Render page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " Worked All Continents (WAC) " ));
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wac/index' );
2026-03-11 11:22:14 +01:00
$this -> load -> view ( 'interface_assets/footer' , $footerData );
2024-09-06 11:24:03 +02:00
}
2025-02-27 09:25:58 +01:00
public function wae () {
2024-12-19 14:24:15 +01:00
$this -> load -> model ( 'wae' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'orbits' ] = $this -> bands -> get_worked_orbits ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
$data [ 'user_default_band' ] = $this -> session -> userdata ( 'user_default_band' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2024-12-19 14:24:15 +01:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'dxcc' ); // Used in the view for band select
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
} else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
} else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
$postdata [ 'worked' ] = $this -> input -> post ( 'worked' ) == 0 ? NULL : 1 ;
$postdata [ 'confirmed' ] = $this -> input -> post ( 'confirmed' ) == 0 ? NULL : 1 ;
$postdata [ 'notworked' ] = $this -> input -> post ( 'notworked' ) == 0 ? NULL : 1 ;
$postdata [ 'includedeleted' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'includedeleted' ));
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sats' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbits' ));
2026-03-01 08:17:36 +01:00
$postdata [ 'dateFrom' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateFrom' ));
$postdata [ 'dateTo' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'dateTo' ));
2024-12-19 14:24:15 +01:00
} else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'worked' ] = 1 ;
$postdata [ 'confirmed' ] = 1 ;
$postdata [ 'notworked' ] = 1 ;
$postdata [ 'includedeleted' ] = 0 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
$postdata [ 'sat' ] = 'All' ;
$postdata [ 'orbit' ] = 'All' ;
2026-03-01 08:17:36 +01:00
$postdata [ 'dateFrom' ] = null ;
$postdata [ 'dateTo' ] = null ;
2024-12-19 14:24:15 +01:00
}
2026-03-01 08:17:36 +01:00
$result = $this -> wae -> get_wae_array ( $bands , $postdata );
$data [ 'wae_array' ] = $result [ 'matrix' ] ? ? null ;
$data [ 'wae_summary' ] = $result [ 'summary' ] ? ? null ;
$data [ 'posted_band' ] = $postdata [ 'band' ];
2024-12-19 14:24:15 +01:00
// Render Page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " WAE " ));
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wae/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2025-02-27 09:25:58 +01:00
public function seven3on73 () {
// Grab all worked stations on AO-73
$this -> load -> model ( 'Seven3on73' );
$data [ 'seven3on73_array' ] = $this -> Seven3on73 -> get_all ();
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2025-02-27 09:25:58 +01:00
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " 73 on 73 " ));
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/73on73/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
2025-09-27 12:09:09 +02:00
public function wpx () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/wpx.js' ,
2025-09-27 12:09:09 +02:00
];
$this -> load -> model ( 'wpx' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$data [ 'orbits' ] = $this -> bands -> get_worked_orbits ();
$data [ 'sats_available' ] = $this -> bands -> get_worked_sats ();
$data [ 'user_default_band' ] = $this -> session -> userdata ( 'user_default_band' );
2025-11-16 13:58:58 +01:00
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
2025-09-27 12:09:09 +02:00
$data [ 'worked_bands' ] = $this -> bands -> get_worked_bands ( 'dxcc' ); // Used in the view for band select
$data [ 'modes' ] = $this -> modes -> active (); // Used in the view for mode select
if ( $this -> input -> post ( 'band' ) != NULL ) { // Band is not set when page first loads.
if ( $this -> input -> post ( 'band' ) == 'All' ) { // Did the user specify a band? If not, use all bands
$bands = $data [ 'worked_bands' ];
} else {
$bands [] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
}
} else {
$bands = $data [ 'worked_bands' ];
}
$data [ 'bands' ] = $bands ; // Used for displaying selected band(s) in the table in the view
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'band' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'band' ));
$postdata [ 'mode' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'mode' ));
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sats' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbits' ));
} else { // Setting default values at first load of page
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = NULL ;
$postdata [ 'qrz' ] = NULL ;
$postdata [ 'clublog' ] = NULL ;
$postdata [ 'Africa' ] = 1 ;
$postdata [ 'Asia' ] = 1 ;
$postdata [ 'Europe' ] = 1 ;
$postdata [ 'NorthAmerica' ] = 1 ;
$postdata [ 'SouthAmerica' ] = 1 ;
$postdata [ 'Oceania' ] = 1 ;
$postdata [ 'Antarctica' ] = 1 ;
$postdata [ 'band' ] = 'All' ;
$postdata [ 'mode' ] = 'All' ;
$postdata [ 'sat' ] = 'All' ;
$postdata [ 'orbit' ] = 'All' ;
}
$data [ 'wpx_array' ] = $this -> wpx -> get_wpx_array ( $bands , $postdata );
// Render Page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( " WPX " ));
$data [ 'posted_band' ] = $postdata [ 'band' ];
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/wpx/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
2025-10-14 18:29:01 +02:00
public function wpx_details () {
2025-09-27 12:09:09 +02:00
$postdata [ 'band' ] = $this -> input -> post ( 'band' , true );
$postdata [ 'status' ] = $this -> input -> post ( 'status' , true );
$postdata [ 'sat' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'sats' ));
$postdata [ 'orbit' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'orbits' ));
$postdata [ 'mode' ] = $this -> input -> post ( 'mode' );
$postdata [ 'qsl' ] = ( $this -> input -> post ( 'qsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = ( $this -> input -> post ( 'lotw' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = ( $this -> input -> post ( 'eqsl' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = ( $this -> input -> post ( 'qrz' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = ( $this -> input -> post ( 'clublog' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Africa' ] = ( $this -> input -> post ( 'Africa' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Asia' ] = ( $this -> input -> post ( 'Asia' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Europe' ] = ( $this -> input -> post ( 'Europe' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'NorthAmerica' ] = ( $this -> input -> post ( 'NorthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'SouthAmerica' ] = ( $this -> input -> post ( 'SouthAmerica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Oceania' ] = ( $this -> input -> post ( 'Oceania' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
$postdata [ 'Antarctica' ] = ( $this -> input -> post ( 'Antarctica' , true ) ? ? 0 ) == 0 ? NULL : 1 ;
2025-10-14 18:29:01 +02:00
$postdata [ 'summaryband' ] = $this -> input -> post ( 'summaryband' , true );
2025-09-27 12:09:09 +02:00
$this -> load -> model ( 'wpx' );
$this -> load -> model ( 'modes' );
$this -> load -> model ( 'bands' );
$results = $this -> wpx -> getWpxBandDetails ( $postdata );
$data [ 'band' ] = $postdata [ 'band' ];
$data [ 'status' ] = $postdata [ 'status' ];
$data [ 'results' ] = $results ;
$this -> load -> view ( 'awards/wpx/wpx_details' , $data );
}
2025-11-16 14:15:26 +01:00
/*
Handles displaying the Polska Award ( Polish Award )
Tracks contacts with Polish voivodeships ( provinces ) for the Poland award program
Uses COL_STATE field for voivodeship codes ( 16 Polish voivodeships )
*/
public function pl_polska () {
$footerData = [];
$footerData [ 'scripts' ] = [
2026-02-13 16:58:57 +01:00
'assets/js/sections/award_pl_polska.js' ,
2025-11-16 14:15:26 +01:00
'assets/js/leaflet/L.Maidenhead.js' ,
];
$this -> load -> model ( 'logbooks_model' );
$this -> load -> model ( 'stations' );
2025-12-01 09:46:19 +01:00
$data [ 'active_station_logbook' ] = $this -> logbooks_model -> find_name ( $this -> session -> userdata ( 'active_station_logbook' ));
2025-11-16 14:15:26 +01:00
$this -> load -> model ( 'award_pl_polska' );
$this -> load -> model ( 'bands' );
2025-11-27 23:25:26 +01:00
$this -> load -> library ( 'Genfunctions' );
2025-11-16 14:15:26 +01:00
// Define valid bands for Polska award (per PZK rules)
// https://awards.pzk.org.pl/polish-awards/polska.html
// SAT is explicitly excluded (no satellite/repeater contacts allowed)
$data [ 'worked_bands' ] = array ( '160M' , '80M' , '40M' , '30M' , '20M' , '17M' , '15M' , '12M' , '10M' , '6M' , '2M' );
if ( $this -> input -> method () === 'post' ) {
$postdata [ 'qsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qsl' ));
$postdata [ 'lotw' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'lotw' ));
$postdata [ 'eqsl' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'eqsl' ));
$postdata [ 'qrz' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'qrz' ));
$postdata [ 'clublog' ] = $this -> security -> xss_clean ( $this -> input -> post ( 'clublog' ));
// Always use active logbook (no multiselect)
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
} else {
$postdata [ 'qsl' ] = 1 ;
$postdata [ 'lotw' ] = 1 ;
$postdata [ 'eqsl' ] = 0 ;
$postdata [ 'qrz' ] = 0 ;
$postdata [ 'clublog' ] = 0 ;
// Default to active logbook
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
}
// Add confirmed key for gen_qsl_from_postdata function compatibility
$postdata [ 'confirmed' ] = 1 ;
2025-11-27 23:25:26 +01:00
// Generate QSL string for displayContacts links
$data [ 'qsl_string' ] = $this -> genfunctions -> gen_qsl_from_postdata ( $postdata );
2025-11-16 14:15:26 +01:00
if ( $logbooks_locations_array ) {
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
2025-11-27 23:25:26 +01:00
// Worked data (all QSOs, not just confirmed)
$data [ 'polska_worked' ] = $this -> award_pl_polska -> get_polska_worked_by_modes ( $location_list );
$data [ 'polska_worked_bands' ] = $this -> award_pl_polska -> get_polska_worked_by_bands ( $data [ 'worked_bands' ], $location_list );
// Confirmed data
2025-11-16 14:15:26 +01:00
$data [ 'polska_array' ] = $this -> award_pl_polska -> get_polska_simple_by_modes ( $postdata , $location_list );
$data [ 'polska_totals' ] = $this -> award_pl_polska -> get_polska_totals_by_modes ( $postdata , $location_list );
2025-11-27 23:25:26 +01:00
// Band-based confirmed data
2025-11-16 14:15:26 +01:00
$data [ 'polska_array_bands' ] = $this -> award_pl_polska -> get_polska_simple_by_bands ( $data [ 'worked_bands' ], $postdata , $location_list );
$data [ 'polska_totals_bands' ] = $this -> award_pl_polska -> get_polska_totals_by_bands ( $data [ 'worked_bands' ], $postdata , $location_list );
// Calculate award classes for each mode category
$data [ 'polska_classes' ] = array ();
$mode_categories = array ( 'MIXED' , 'PHONE' , 'CW' , 'DIGI' );
foreach ( $mode_categories as $category ) {
$postdata_temp = $postdata ;
$postdata_temp [ 'mode' ] = $category ;
$postdata_temp [ 'band' ] = 'All' ;
$data [ 'polska_classes' ][ $category ] = $this -> award_pl_polska -> getPolskaClassByCategory ( $location_list , $category , $postdata_temp , true );
}
// Calculate award classes for each band
$data [ 'polska_classes_bands' ] = array ();
$valid_bands = array ( '160M' , '80M' , '40M' , '30M' , '20M' , '17M' , '15M' , '12M' , '10M' , '6M' , '2M' );
foreach ( $valid_bands as $band ) {
$postdata_temp = $postdata ;
$postdata_temp [ 'band' ] = $band ;
$postdata_temp [ 'mode' ] = 'All' ;
$data [ 'polska_classes_bands' ][ $band ] = $this -> award_pl_polska -> getPolskaClassByBand ( $location_list , $band , $postdata_temp , true );
}
} else {
$location_list = null ;
2025-11-27 23:25:26 +01:00
$data [ 'polska_worked' ] = null ;
$data [ 'polska_worked_bands' ] = null ;
2025-11-16 14:15:26 +01:00
$data [ 'polska_array' ] = null ;
$data [ 'polska_totals' ] = null ;
$data [ 'polska_array_bands' ] = null ;
$data [ 'polska_totals_bands' ] = null ;
$data [ 'polska_classes' ] = null ;
$data [ 'polska_classes_bands' ] = null ;
}
2025-11-27 23:25:26 +01:00
// Pass postdata for use in view
$data [ 'postdata' ] = $postdata ;
2025-11-16 14:15:26 +01:00
// Render page
$data [ 'page_title' ] = sprintf ( __ ( " Awards - %s " ), __ ( '"Polska" Award' ));
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/pl_polska/index' );
$this -> load -> view ( 'interface_assets/footer' , $footerData );
}
/*
function polska_map
Returns JSON data for Polska Award map visualization
*/
public function polska_map () {
$this -> load -> model ( 'award_pl_polska' );
// Get category (MIXED, PHONE, CW, DIGI, or band like 20M)
$category = $this -> security -> xss_clean ( $this -> input -> post ( 'category' ));
if ( ! $category ) {
$category = 'MIXED' ;
}
$postdata [ 'qsl' ] = $this -> input -> post ( 'qsl' ) == 0 ? NULL : 1 ;
$postdata [ 'lotw' ] = $this -> input -> post ( 'lotw' ) == 0 ? NULL : 1 ;
$postdata [ 'eqsl' ] = $this -> input -> post ( 'eqsl' ) == 0 ? NULL : 1 ;
$postdata [ 'qrz' ] = $this -> input -> post ( 'qrz' ) == 0 ? NULL : 1 ;
$postdata [ 'clublog' ] = $this -> input -> post ( 'clublog' ) == 0 ? NULL : 1 ;
// Get location list for active station
$this -> load -> model ( 'logbooks_model' );
$logbooks_locations_array = $this -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' ));
$location_list = " ' " . implode ( " ',' " , $logbooks_locations_array ) . " ' " ;
// Get map status directly from model
$voivodeships = $this -> award_pl_polska -> get_polska_map_status ( $category , $postdata , $location_list );
header ( 'Content-Type: application/json' );
echo json_encode ( $voivodeships );
}
2026-05-21 09:40:40 +00:00
/*
* AMSAT Rover Award
*/
public function amsat_rover () {
$this -> load -> model ( 'amsat_rover' );
$data [ 'page_title' ] = __ ( " Awards - AMSAT Rover " );
$data [ 'user_map_custom' ] = $this -> optionslib -> get_map_custom ();
$station_info = $this -> amsat_rover -> get_station_info ();
2026-05-21 13:06:27 +00:00
$data [ 'home_grid' ] = $station_info [ 'home_grid' ];
$data [ 'station_callsign' ] = $station_info [ 'station_callsign' ];
2026-05-21 09:40:40 +00:00
$filters = ( $this -> input -> method () === 'post' )
? $this -> amsat_rover -> get_filters ()
: [ 'confirmations' => [ 'lotw' , 'qsl' ]];
$data [ 'filters' ] = $filters ;
foreach ([ 'bonus_social' , 'bonus_photos' , 'bonus_mm' , 'bonus_journal' ] as $field ) {
$data [ $field ] = ( bool ) $this -> input -> post ( $field );
}
$result = $this -> amsat_rover -> get_activations ( $filters , $station_info );
$data [ 'activations' ] = $result [ 'activations' ];
$data [ 'summary' ] = $result [ 'summary' ];
$this -> load -> view ( 'interface_assets/header' , $data );
$this -> load -> view ( 'awards/amsat_rover/index' );
$this -> load -> view ( 'interface_assets/footer' );
}
/*
* AMSAT Rover Award - Export as plain text for email
*/
public function amsat_rover_export_text () {
$this -> load -> model ( 'amsat_rover' );
$station_info = $this -> amsat_rover -> get_station_info ();
$result = $this -> amsat_rover -> get_activations ( $this -> amsat_rover -> get_filters (), $station_info );
$bonus = $this -> amsat_rover -> get_bonus ();
$total = $result [ 'summary' ][ 'total_points' ] + $bonus [ 'bonus' ];
$out = " AMSAT Rover Award Application \n "
. " ============================ \n \n "
. " Call: { $station_info [ 'station_callsign' ] } \n "
. " Home Grid: { $station_info [ 'home_grid' ] } \n \n "
. " Grid Activations (Confirmed): \n "
. " ---------------------------- \n " ;
if ( empty ( $result [ 'activations' ])) {
$out .= " No confirmed satellite activations found. \n " ;
} else {
foreach ( $result [ 'activations' ] as $a ) {
$out .= sprintf ( " %s | %s | %s | %d pt | %s | %s | %s \n " ,
$a [ 'my_grid' ], $a [ 'call_worked' ], $a [ 'mode_category' ],
$a [ 'points' ], $a [ 'confirmation' ], $a [ 'satellite' ] ? ? 'N/A' ,
date ( 'Y-m-d H:i' , strtotime ( $a [ 'date' ])) . ' UTC' );
}
}
$out .= " \n Summary: \n -------- \n "
. " Base Points: { $result [ 'summary' ][ 'total_points' ] } \n " ;
if ( $bonus [ 'bonus' ] > 0 ) {
$out .= " Bonus Points: { $bonus [ 'bonus' ] } \n "
. implode ( " \n " , $bonus [ 'details' ]) . " \n " ;
}
$out .= " Total Points: { $total } \n Target: 25 \n "
. ( $total >= 25
? " \n Status: APPROVED - Ready to submit! \n "
: " \n Status: " . ( 25 - $total ) . " more points needed \n " )
. " \n Evidence: LoTW screenshots/QSL cards attached \n " ;
2026-05-21 13:56:42 +00:00
if ( $this -> input -> post ( 'bonus_social' )) {
$out .= " Social Media Evidence: [include link to social media post with @amsat tag] \n " ;
}
if ( $this -> input -> post ( 'bonus_photos' )) {
$out .= " Photo Evidence: [include link to photo post with @amsat tag] \n " ;
}
if ( $this -> input -> post ( 'bonus_journal' )) {
$out .= " AMSAT Journal Evidence: [reference to published article] \n " ;
}
2026-05-21 09:40:40 +00:00
header ( 'Content-Type: text/plain; charset=utf-8' );
echo $out ;
}
/*
* AMSAT Rover Award - Export as CSV
*/
public function amsat_rover_export_csv () {
$this -> load -> model ( 'amsat_rover' );
$station_info = $this -> amsat_rover -> get_station_info ();
$result = $this -> amsat_rover -> get_activations ( $this -> amsat_rover -> get_filters (), $station_info );
header ( 'Content-Type: text/csv; charset=utf-8' );
header ( 'Content-Disposition: attachment; filename="amsat_rover_activations.csv"' );
$fp = fopen ( 'php://output' , 'w' );
fputcsv ( $fp , [ 'Grid' , 'Mode' , 'Category' , 'Points' , 'Confirmation' , 'Satellite' , 'Date' , 'Callsign' ], escape : '\\' );
foreach ( $result [ 'activations' ] as $a ) {
fputcsv ( $fp , [
$a [ 'my_grid' ], $a [ 'mode' ], $a [ 'mode_category' ], $a [ 'points' ],
$a [ 'confirmation' ], $a [ 'satellite' ] ? ? 'N/A' ,
date ( 'Y-m-d H:i' , strtotime ( $a [ 'date' ])) . ' UTC' , $a [ 'call_worked' ],
], escape : '\\' );
}
fclose ( $fp );
}
2023-01-16 17:08:27 +01:00
}