2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< ? php  if  ( ! defined ( 'BASEPATH' ))  exit ( 'No direct script access allowed' );  
						 
					
						
							
								
									
										
										
										
											2012-11-01 04:34:57 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Handles  Displaying  of  information  for  awards . 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									These  are  taken  from  comments  fields  or  ADIF  fields 
							 
						 
					
						
							
								
									
										
										
										
											2012-11-01 04:34:57 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  Awards  extends  CI_Controller  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    function  __construct () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        parent :: __construct (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'user_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( ! $this -> user_model -> authorize ( 2 ))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $this -> session -> set_flashdata ( 'notice' ,  'You\'re not allowed to do that!' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            redirect ( 'dashboard' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> lang -> load ( array ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'lotw' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'eqsl' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  index () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  dok () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI  =  & get_instance (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI -> load -> model ( 'logbooks_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $logbooks_locations_array  =  $CI -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'dok' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'doks' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'doks' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'doks' ]  =  'both' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $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  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 [ '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' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'qsl' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'lotw' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'eqsl' ]  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - DOK " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/dok/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  dxcc () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'dxcc' ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-12 06:45:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-13 22:55:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-12 06:45:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-06 02:26:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'dxcc' );  // Used in the view for band select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-12 06:45:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> modes -> active ();  // Used in the view for mode select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +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' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ;  // Used for displaying selected band(s) in the table in the view
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08: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' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $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' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  {  // Setting default values at first load of page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'qsl' ]  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-18 20:51:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'lotw' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'eqsl' ]  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'worked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'confirmed' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'notworked' ]  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-14 19:58:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'includedeleted' ]  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08: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' ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-12 06:45:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $dxcclist  =  $this -> dxcc -> fetchdxcc ( $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 19:39:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'dxcc_array' ]  =  $this -> dxcc -> get_dxcc_array ( $dxcclist ,  $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-31 21:05:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'dxcc_summary' ]  =  $this -> dxcc -> get_dxcc_summary ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-13 00:31:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - DXCC " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/dxcc/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-16 01:46:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  waja () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData  =  []; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData [ 'scripts' ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/sections/wajamap.js?'  .  filemtime ( realpath ( __DIR__  .  " /../../assets/js/sections/wajamap.js " )) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ]; 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'waja' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'waja' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> modes -> active (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> post ( 'band' )  !=  NULL )  {                // Band is not set when page first loads.
 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( $this -> input -> post ( 'band' )  ==  'All' )  {          // Did the user specify a band? If not, use all bands
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ;  // Used for displaying selected band(s) in the table in the view
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08: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' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $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' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  {  // Setting default values at first load of page
 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'qsl' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'lotw' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'eqsl' ]  =  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 [ 'waja_array' ]  =  $this -> waja -> get_waja_array ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'waja_summary' ]  =  $this -> waja -> get_waja_summary ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - WAJA " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/waja/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ,  $footerData ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-30 03:16:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  vucc () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-15 21:18:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'vucc' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-13 22:55:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-06 02:26:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'vucc' ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-15 21:18:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'vucc_array' ]  =  $this -> vucc -> get_vucc_array ( $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - VUCC " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/vucc/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  vucc_band () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-15 21:18:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'vucc' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $band  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> get ( " Band " ))); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $type  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> get ( " Type " ))); 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-25 21:59:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'vucc_array' ]  =  $this -> vucc -> vucc_details ( $band ,  $type ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'type' ]  =  $type ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-15 21:18:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " VUCC -  "  .  $band  .  "  Band " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  " band  "  .  $band ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-15 21:18:49 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'band' ]  =  $band ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/vucc/band' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  vucc_details_ajax () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-20 20:09:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'logbook_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $gridsquare  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> post ( " Gridsquare " ))); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $band  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> post ( " Band " ))); 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-20 20:09:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'results' ]  =  $this -> logbook_model -> vucc_qso_details ( $gridsquare ,  $band ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Log View - VUCC " ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  " vucc  "  .  $gridsquare  .  "  and band  "  .  $band ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-20 01:24:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/details' ,  $data ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-20 20:09:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-24 20:31:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 *  Used  to  fetch  QSOs  from  the  logbook  in  the  awards 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  qso_details_ajax () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'logbook_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $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 " ))); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $type  =  $this -> security -> xss_clean ( $this -> input -> post ( 'Type' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $qsl  =  $this -> input -> post ( 'QSL' )  ==  null  ?  ''  :  $this -> security -> xss_clean ( $this -> input -> post ( 'QSL' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $searchmode  =  $this -> input -> post ( 'searchmode' )  ==  null  ?  ''  :  $this -> security -> xss_clean ( $this -> input -> post ( 'searchmode' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'results' ]  =  $this -> logbook_model -> qso_details ( $searchphrase ,  $band ,  $mode ,  $type ,  $qsl ,  $searchmode ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // 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' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $qsltype  =  []; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( strpos ( $qsl ,  " Q " )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $qsltype []  =  " QSL " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( strpos ( $qsl ,  " L " )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $qsltype []  =  " LoTW " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( strpos ( $qsl ,  " E " )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $qsltype []  =  " eQSL " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Log View -  "  .  $type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  $type  .  "   "  .  $searchphrase  .  "  and band  "  .  $band  .  "  and mode  "  .  $mode ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( ! empty ( $qsltype ))  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $data [ 'filter' ]  .=  "  and  "  .  implode ( '/' ,  $qsltype ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/details' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2012-11-01 09:50:11 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Handles  showing  worked  SOTAs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Comment  field  -  SOTA : #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  sota () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Grab all worked sota stations
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'sota' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'sota_all' ]  =  $this -> sota -> get_all (); 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - SOTA " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/sota/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-10 21:04:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Handles  showing  worked  WWFFs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Comment  field  -  WWFF : #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  wwff () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-10 21:04:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Grab all worked wwff stations
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'wwff' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'wwff_all' ]  =  $this -> wwff -> get_all (); 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-10 21:04:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - WWFF " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/wwff/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-10 21:04:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-06 04:13:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Handles  showing  worked  POTAs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Comment  field  -  POTA : #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  pota () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-06 04:13:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Grab all worked pota stations
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'pota' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'pota_all' ]  =  $this -> pota -> get_all (); 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-06 04:13:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - POTA " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/pota/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-06 04:13:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  cq () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI  =  & get_instance (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI -> load -> model ( 'logbooks_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $logbooks_locations_array  =  $CI -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' )); 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 04:07:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-13 23:16:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'cq' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-13 22:55:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-04-13 23:16:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-06 02:26:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'cq' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> modes -> active ();  // Used in the view for mode select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +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' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $bands []  =  $this -> input -> post ( 'band' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ;  // Used for displaying selected band(s) in the table in the view
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08: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' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $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' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  {  // Setting default values at first load of page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'qsl' ]  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-18 20:35:58 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'lotw' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'eqsl' ]  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'worked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'confirmed' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'notworked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'band' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-15 00:11:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $logbooks_locations_array )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $location_list  =  " ' "  .  implode ( " ',' " ,  $logbooks_locations_array )  .  " ' " ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-15 00:11:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $data [ 'cq_array' ]  =  $this -> cq -> get_cq_array ( $bands ,  $postdata ,  $location_list ); 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-07 02:35:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $data [ 'cq_summary' ]  =  $this -> cq -> get_cq_summary ( $bands ,  $postdata ,  $location_list ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-15 00:11:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $location_list  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $data [ 'cq_array' ]  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $data [ 'cq_summary' ]  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-31 03:03:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-13 23:16:07 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-21 15:35:09 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - CQ Magazine WAZ " ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/cq/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  was () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData  =  []; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData [ 'scripts' ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/sections/wasmap.js?'  .  filemtime ( realpath ( __DIR__  .  " /../../assets/js/sections/wasmap.js " )) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ]; 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'was' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-13 22:55:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-27 18:11:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-06 02:26:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'was' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> modes -> active ();  // Used in the view for mode select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +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' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ;  // Used for displaying selected band(s) in the table in the view
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08: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' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $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' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  {  // Setting default values at first load of page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'qsl' ]  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-18 21:08:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'lotw' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'eqsl' ]  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'worked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'confirmed' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'notworked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'band' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'was_array' ]  =  $this -> was -> get_was_array ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-05 02:13:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'was_summary' ]  =  $this -> was -> get_was_summary ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-29 07:36:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 10:04:33 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - WAS (Worked All States) " ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/was/index' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ,  $footerData ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-09 20:20:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  wab () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // get worked squares from Worked_all_britain_model
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'worked_all_britain_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'worked_squares' ]  =  array_filter ( $this -> worked_all_britain_model -> get_worked_squares ()); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'confirmed_squares' ]  =  array_filter ( $this -> worked_all_britain_model -> get_confirmed_squares ()); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - Worked All Britain " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/wab/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-09 22:55:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  gmdxsummer () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Load the GMDX Summer Challenge model
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'gmdxsummer_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Get Week 1
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_6m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-05-26 18:00:00' ,  '6m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_6m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-05-26 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_6m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-05-26 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_6m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-05-26 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_4m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-05-26 18:00:00' ,  '4m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_4m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-05-26 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_4m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-05-26 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week1_4m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-05-26 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Get Week 2
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_6m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-06-09 18:00:00' ,  '6m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_6m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-06-09 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_6m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-06-09 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_6m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-06-09 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_4m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-06-09 18:00:00' ,  '4m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_4m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-06-09 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_4m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-06-09 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week2_4m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-06-09 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Get Week 3
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_6m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-06-23 18:00:00' ,  '6m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_6m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-06-23 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_6m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-06-23 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_6m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-06-23 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_4m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-06-23 18:00:00' ,  '4m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_4m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-06-23 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_4m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-06-23 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week3_4m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-06-23 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Get Week 4
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_6m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-07-01 18:00:00' ,  '6m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_6m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-07-01 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_6m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-07-01 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_6m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-07-01 18:00:00' ,  '6m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_4m_cw' ]  =  $this -> gmdxsummer_model -> get_week ( '2024-07-01 18:00:00' ,  '4m' ,  'CW' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_4m_ssb' ]  =  $this -> gmdxsummer_model -> get_week_voice ( '2024-07-01 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_4m_digital' ]  =  $this -> gmdxsummer_model -> get_week_digital ( '2024-07-01 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'week4_4m_combined' ]  =  $this -> gmdxsummer_model -> get_week_combined ( '2024-07-01 18:00:00' ,  '4m' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - GMDX Summer Challenge " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/gmdxsummer/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  wab_details_ajax () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'logbook_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $wab  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> post ( " Wab " ))); 
							 
						 
					
						
							
								
									
										
										
										
											2024-05-09 22:55:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-21 01:09:10 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $wab  =  str_replace ([ " Small Square  " ,  "  Boundry Box " ],  " " ,  $wab ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'results' ]  =  $this -> logbook_model -> wab_qso_details ( $wab ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Log View - WAB " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  " WAB  "  .  $wab ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/wab/details' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  iota () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'iota' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'modes' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-13 22:55:17 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-26 19:13:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-06 02:26:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'worked_bands' ]  =  $this -> bands -> get_worked_bands ( 'iota' );  // Used in the view for band select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +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' ]; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $bands  =  $data [ 'worked_bands' ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $bands ;  // Used for displaying selected band(s) in the table in the view
 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> modes -> active ();  // Used in the view for mode select
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( $this -> input -> method ()  ===  'post' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08: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 [ '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' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  {  // Setting default values at first load of page
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'worked' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'confirmed' ]  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $postdata [ 'notworked' ]  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-14 19:58:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'includedeleted' ]  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08: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' ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $postdata [ 'mode' ]  =  'All' ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $iotalist  =  $this -> iota -> fetchIota ( $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'iota_array' ]  =  $this -> iota -> get_iota_array ( $iotalist ,  $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-07 03:02:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'iota_summary' ]  =  $this -> iota -> get_iota_summary ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-07 18:39:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - IOTA (Islands On The Air) " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/iota/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  counties () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 07:03:05 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'counties' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'counties_array' ]  =  $this -> counties -> get_counties_array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - US Counties " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/counties/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  counties_details () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'counties' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $state  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> get ( " State " ))); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $type  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> get ( " Type " ))); 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'counties_array' ]  =  $this -> counties -> counties_details ( $state ,  $type ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'type' ]  =  $type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " US Counties " ; 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  $type  .  "  counties in state  "  .  $state ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/counties/details' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  counties_details_ajax () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-07 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'logbook_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08: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 22:22:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'results' ]  =  $this -> logbook_model -> county_qso_details ( $state ,  $county ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render Page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Log View - Counties " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'filter' ]  =  " county  "  .  $state ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/details' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  gridmaster ( $dxcc ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $dxcc  =  $this -> security -> xss_clean ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards -  "  .  strtoupper ( $dxcc )  .  "  Gridmaster " ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'gridmap_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'stations' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'homegrid' ]  =  explode ( ',' ,  $this -> stations -> find_gridsquare ()); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'modes' ]  =  $this -> gridmap_model -> get_worked_modes (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'bands' ]  =  $this -> bands -> get_worked_bands (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'sats_available' ]  =  $this -> bands -> get_worked_sats (); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'layer' ]  =  $this -> optionslib -> get_option ( 'option_map_tile_server' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'attribution' ]  =  $this -> optionslib -> get_option ( 'option_map_tile_server_copyright' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares' ]  =  lang ( 'gridsquares_gridsquares' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_worked' ]  =  lang ( 'gridsquares_gridsquares_worked' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_lotw' ]  =  lang ( 'gridsquares_gridsquares_lotw' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_paper' ]  =  lang ( 'gridsquares_gridsquares_paper' ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $indexData [ 'dxcc' ]  =  $dxcc ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 02:15:56 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $footerData  =  []; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData [ 'scripts' ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/leaflet/geocoding.js' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/sections/gridmaster.js' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ]; 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/gridmaster/index' ,  $indexData ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ,  $footerData ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 20:00:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  ffma () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - Fred Fish Memorial Award (FFMA) " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'ffma_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'stations' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $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' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares' ]  =  lang ( 'gridsquares_gridsquares' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_worked' ]  =  lang ( 'gridsquares_gridsquares_worked' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_lotw' ]  =  lang ( 'gridsquares_gridsquares_lotw' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'gridsquares_gridsquares_paper' ]  =  lang ( 'gridsquares_gridsquares_paper' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'grid_count' ]  =  $this -> ffma_model -> get_grid_count (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'grids' ]  =  $this -> ffma_model -> get_grids (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData  =  []; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $footerData [ 'scripts' ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/leaflet/geocoding.js' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            'assets/js/sections/ffma.js' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ]; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/ffma/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ,  $footerData ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  getFfmaGridsjs () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'ffma_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char_lotw  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char_paper  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $grid_4char  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $grid_4char_lotw  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> ffma_model -> get_lotw (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> ffma_model -> get_paper (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> ffma_model -> get_worked (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> ffma_model -> get_vucc_lotw (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> ffma_model -> get_vucc_paper (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> ffma_model -> get_vucc_worked (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'grid_count' ]  =  $this -> ffma_model -> get_grid_count (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'grids' ]  =  $this -> ffma_model -> get_grids (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  function  getGridmasterGridsjs ( $dxcc ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'gridmaster_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $dxcc  =  $this -> security -> xss_clean ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char_lotw  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $array_grid_4char_paper  =  array (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $grid_4char  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $grid_4char_lotw  =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> gridmaster_model -> get_lotw ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> gridmaster_model -> get_paper ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $query  =  $this -> gridmaster_model -> get_worked ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> gridmaster_model -> get_vucc_lotw ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> gridmaster_model -> get_vucc_paper ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $vucc_grids  =  $this -> gridmaster_model -> get_vucc_worked ( $dxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $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 ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Handles  showing  worked  Sigs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Adif  fields :  my_sig 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  sig () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Grab all worked sig stations
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'sig' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $data [ 'sig_types' ]  =  $this -> sig -> get_all_sig_types (); 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - SIG " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/sig/index' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Handles  showing  worked  Sigs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  sig_details () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Grab all worked sig stations
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'sig' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $type  =  str_replace ( '"' ,  " " ,  $this -> security -> xss_clean ( $this -> input -> get ( " type " ))); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'sig_all' ]  =  $this -> sig -> get_all ( $type ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'type' ]  =  $type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Render page
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'page_title' ]  =  " Awards - SIG -  "  .  $type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/header' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'awards/sig/qso_list' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> view ( 'interface_assets/footer' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Handles  exporting  SIGS  to  ADIF 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  sigexportadif () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Set memory limit to unlimited to allow heavy usage
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ini_set ( 'memory_limit' ,  '-1' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'adif_data' ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-10 04:29:59 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $type  =  $this -> security -> xss_clean ( $this -> uri -> segment ( 3 )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $data [ 'qsos' ]  =  $this -> adif_data -> sig_all ( $type ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-20 18:24:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> view ( 'adif/data/exportall' ,  $data ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 23:25:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        function  was_map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-27 18:11:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        This  displays  the  WAS  map  and  requires  the  $band_type  and  $mode_type 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 23:25:38 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08: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-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'was' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08: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 [ '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-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $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-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $states  =  array (); 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $wasArray  as  $state )  {                        // Generating array for use in the table
 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $states [ $state ]  =  '-' ;                    // Inits each state's count
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $was_array  as  $was  =>  $value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            foreach  ( $value   as  $key )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( $key  !=  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    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 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-01 13:57:08 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-13 04:35:03 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $states ); 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 05:38:55 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        function  cq_map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        This  displays  the  CQ  Zone  map  and  requires  the  $band_type  and  $mode_type 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  cq_map () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI  =  & get_instance (); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $CI -> load -> model ( 'logbooks_model' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $logbooks_locations_array  =  $CI -> logbooks_model -> list_logbook_relationships ( $this -> session -> userdata ( 'active_station_logbook' )); 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'cq' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $bands []  =  $this -> input -> post ( 'band' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08: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 [ '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 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'band' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( $logbooks_locations_array )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $location_list  =  " ' "  .  implode ( " ',' " ,  $logbooks_locations_array )  .  " ' " ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $cq_array  =  $this -> cq -> get_cq_array ( $bands ,  $postdata ,  $location_list ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $location_list  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $cq_array  =  null ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $zones  =  array (); 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $cq_array  as  $cq  =>  $value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            foreach  ( $value   as  $key )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( $key  !=  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-12 15:44:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '>W<' )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        $zones []  =  'W' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '>C<' )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        $zones []  =  'C' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '-' )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        $zones []  =  '-' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $zones ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        function  waja_map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  waja_map () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $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-04 18:00:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'waja' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08: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 [ '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-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'band' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $waja_array  =  $this -> waja -> get_waja_array ( $bands ,  $postdata ); 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $prefectures  =  array (); 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $wajaArray  as  $state )  {                        // Generating array for use in the table
 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-04 18:00:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $prefectures [ $state ]  =  '-' ;                    // Inits each state's count
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $waja_array  as  $waja  =>  $value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            foreach  ( $value   as  $key )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( $key  !=  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '>W<' )  !==  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-04 18:00:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        $prefectures [ $waja ]  =  'W' ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '>C<' )  !==  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-04 18:00:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        $prefectures [ $waja ]  =  'C' ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( strpos ( $key ,  '-' )  !==  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-04 18:00:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        $prefectures [ $waja ]  =  '-' ; 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-03 22:57:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $prefectures ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        function  dxcc_map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        This  displays  the  DXCC  map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  dxcc_map () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'dxcc' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08: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 [ '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 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'band' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'mode' ]  =  $this -> security -> xss_clean ( $this -> input -> post ( 'mode' )); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'includedeleted' ]  =  $this -> input -> post ( 'includedeleted' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Africa' ]  =  $this -> input -> post ( 'Africa' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Asia' ]  =  $this -> input -> post ( 'Asia' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Europe' ]  =  $this -> input -> post ( 'Europe' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'NorthAmerica' ]  =  $this -> input -> post ( 'NorthAmerica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'SouthAmerica' ]  =  $this -> input -> post ( 'SouthAmerica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Oceania' ]  =  $this -> input -> post ( 'Oceania' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Antarctica' ]  =  $this -> input -> post ( 'Antarctica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $dxcclist  =  $this -> dxcc -> fetchdxcc ( $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $dxcc_array  =  $this -> dxcc -> get_dxcc_array ( $dxcclist ,  $bands ,  $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $i  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        foreach  ( $dxcclist  as  $dxcc )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $newdxcc [ $i ][ 'adif' ]  =  $dxcc -> adif ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $newdxcc [ $i ][ 'prefix' ]  =  $dxcc -> prefix ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 17:50:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $newdxcc [ $i ][ 'name' ]  =  ucwords ( strtolower ( $dxcc -> name ),  " - (/ " ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( $dxcc -> Enddate  !=  null )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 17:50:46 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                $newdxcc [ $i ][ 'name' ]  .=  ' (deleted)' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $newdxcc [ $i ][ 'lat' ]  =  $dxcc -> lat ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $newdxcc [ $i ][ 'long' ]  =  $dxcc -> long ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-23 00:51:31 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $newdxcc [ $i ++ ][ 'status' ]  =  isset ( $dxcc_array [ $dxcc -> adif ])  ?  $this -> returnStatus ( $dxcc_array [ $dxcc -> adif ])  :  'x' ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-12 02:23:41 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $newdxcc ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /* 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        function  iota 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        This  displays  the  IOTA  map 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    */ 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  function  iota_map () 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $this -> load -> model ( 'iota' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $this -> load -> model ( 'bands' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-01 20:20:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $bands []  =  $this -> security -> xss_clean ( $this -> input -> post ( 'band' )); 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'lotw' ]  =  $this -> input -> post ( 'lotw' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'qsl' ]  =  $this -> input -> post ( 'qsl' )  ==  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 ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'band' ]  =  $this -> input -> post ( 'band' ); 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $postdata [ 'mode' ]  =  $this -> input -> post ( 'mode' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'includedeleted' ]  =  $this -> input -> post ( 'includedeleted' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Africa' ]  =  $this -> input -> post ( 'Africa' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Asia' ]  =  $this -> input -> post ( 'Asia' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Europe' ]  =  $this -> input -> post ( 'Europe' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'NorthAmerica' ]  =  $this -> input -> post ( 'NorthAmerica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'SouthAmerica' ]  =  $this -> input -> post ( 'SouthAmerica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Oceania' ]  =  $this -> input -> post ( 'Oceania' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $postdata [ 'Antarctica' ]  =  $this -> input -> post ( 'Antarctica' )  ==  0  ?  NULL  :  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $iotalist  =  $this -> iota -> fetchIota ( $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $iota_array  =  $this -> iota -> get_iota_array ( $iotalist ,  $bands ,  $postdata ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $i  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        header ( 'Content-Type: application/json' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        echo  json_encode ( $newiota ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    function  returnStatus ( $string ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        foreach  ( $string   as  $key )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-20 23:01:50 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( $key  !=  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-12 00:47:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( strpos ( $key ,  '>W<' )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  'W' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( strpos ( $key ,  '>C<' )  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  'C' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( $key  ==  '-' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  '-' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-17 00:08:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}