| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | 	Handles Displaying of information for awards. | 
					
						
							| 
									
										
										
										
											2012-11-01 09:50:11 +08:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	These are taken from comments fields or ADIF fields  | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Awards extends CI_Controller { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function index() | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2012-11-21 01:24:50 +08:00
										 |  |  | 		// Render Page
 | 
					
						
							|  |  |  | 		$data['page_title'] = "Awards"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-21 01:25:54 +08:00
										 |  |  | 	public function dxcc () | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2016-02-13 00:31:29 +08:00
										 |  |  | 		//echo "Needs Developed";
 | 
					
						
							|  |  |  | 		$this->load->model('dxcc'); | 
					
						
							|  |  |  | 		$data['dxcc'] = $this->dxcc->show_stats(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Render Page
 | 
					
						
							|  |  |  | 		$data['page_title'] = "Awards - DXCC"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/dxcc/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-21 01:25:54 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-02-16 01:46:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	public function dxcc_details(){ | 
					
						
							|  |  |  |         $a = $this->input->get(); | 
					
						
							|  |  |  |         $q = ""; | 
					
						
							|  |  |  |         foreach ($a as $key => $value) { | 
					
						
							|  |  |  |         	$q .= $key."=".$value.("(and)"); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $q = substr($q, 0, strlen($q)-13); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $arguments["query"] = $q; | 
					
						
							|  |  |  |         $arguments["fields"] = ''; | 
					
						
							|  |  |  |         $arguments["format"] = "json"; | 
					
						
							|  |  |  |         $arguments["limit"] = ''; | 
					
						
							|  |  |  |         $arguments["order"] = ''; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // print_r($arguments);
 | 
					
						
							|  |  |  |         // return;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Load the API and Logbook models
 | 
					
						
							|  |  |  | 		$this->load->model('api_model'); | 
					
						
							|  |  |  | 		$this->load->model('logbook_model'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Call the parser within the API model to build the query
 | 
					
						
							|  |  |  | 		$query = $this->api_model->select_parse($arguments); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Execute the query, and retrieve the results
 | 
					
						
							|  |  |  | 		$data = $this->logbook_model->api_search_query($query); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Render Page
 | 
					
						
							|  |  |  | 		$data['page_title'] = "Log View - DXCC"; | 
					
						
							| 
									
										
										
										
											2016-04-17 18:39:56 +08:00
										 |  |  | 		$data['filter'] = str_replace("(and)", ", ", $q);//implode(", ", array_keys($a));
 | 
					
						
							| 
									
										
										
										
											2016-02-16 01:46:33 +08:00
										 |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/dxcc/details'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-11-21 01:25:54 +08:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | 	/* | 
					
						
							|  |  |  | 		Handles Displaying of WAB Squares worked. | 
					
						
							| 
									
										
										
										
											2012-11-01 09:50:11 +08:00
										 |  |  | 		Comment field - WAB:#
 | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | 	*/ | 
					
						
							|  |  |  | 	public function wab() { | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-01 09:50:11 +08:00
										 |  |  | 		// Grab all worked WABs
 | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | 		$this->load->model('wab'); | 
					
						
							|  |  |  | 		$data['wab_all'] = $this->wab->get_all(); | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-01 09:50:11 +08:00
										 |  |  | 		// Render Page
 | 
					
						
							| 
									
										
										
										
											2012-11-01 04:34:57 +08:00
										 |  |  | 		$data['page_title'] = "Awards - WAB"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/wab/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-11-01 09:50:11 +08:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 		Handles showing worked SOTAs | 
					
						
							|  |  |  | 		Comment field - SOTA:#
 | 
					
						
							|  |  |  | 	*/ | 
					
						
							|  |  |  | 	public function sota() { | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		// Grab all worked sota stations
 | 
					
						
							|  |  |  | 		$this->load->model('sota'); | 
					
						
							|  |  |  | 		$data['sota_all'] = $this->sota->get_all(); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		// Render page
 | 
					
						
							|  |  |  | 		$data['page_title'] = "Awards - SOTA"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/sota/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-02 00:39:00 +08:00
										 |  |  | 	/* | 
					
						
							|  |  |  | 		Handles showing worked WACRAL members (wacral.org) | 
					
						
							|  |  |  | 		Comment field - WACRAL:#
 | 
					
						
							|  |  |  | 	*/ | 
					
						
							|  |  |  | 	public function wacral() { | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		// Grab all worked wacral members
 | 
					
						
							|  |  |  | 		$this->load->model('wacral'); | 
					
						
							|  |  |  | 		$data['wacral_all'] = $this->wacral->get_all(); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 		// Render page
 | 
					
						
							|  |  |  | 		$data['page_title'] = "Awards - WACRAL Members"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/wacral/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2016-04-13 23:16:07 +08:00
										 |  |  | 	public function cq(){ | 
					
						
							|  |  |  |         $this->load->model('cq'); | 
					
						
							|  |  |  |         $zones = array(); | 
					
						
							|  |  |  |         foreach($this->cq->get_zones() as $row){ | 
					
						
							|  |  |  |             array_push($zones, intval($row->COL_CQZ)); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         $data['cqz'] = $zones; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // Render page
 | 
					
						
							|  |  |  |         $data['page_title'] = "Awards - CQ Magazine"; | 
					
						
							|  |  |  | 		$this->load->view('layout/header', $data); | 
					
						
							|  |  |  | 		$this->load->view('awards/cq/index'); | 
					
						
							|  |  |  | 		$this->load->view('layout/footer'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-02-13 00:31:29 +08:00
										 |  |  | } |