| 
									
										
										
										
											2019-09-12 00:38:09 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | 	This controller will contain features for contesting | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Contesting extends CI_Controller { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-08 17:46:08 +08:00
										 |  |  |     public function index() | 
					
						
							| 
									
										
										
										
											2019-09-12 00:38:09 +08:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2020-11-08 17:46:08 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $this->load->model('cat'); | 
					
						
							|  |  |  |         $this->load->model('stations'); | 
					
						
							|  |  |  |         $this->load->model('logbook_model'); | 
					
						
							|  |  |  |         $this->load->model('user_model'); | 
					
						
							|  |  |  |         $this->load->model('modes'); | 
					
						
							|  |  |  |         if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $data['active_station_profile'] = $this->stations->find_active(); | 
					
						
							|  |  |  |         $data['notice'] = false; | 
					
						
							|  |  |  |         $data['stations'] = $this->stations->all(); | 
					
						
							|  |  |  |         $data['radios'] = $this->cat->radios(); | 
					
						
							|  |  |  |         $data['dxcc'] = $this->logbook_model->fetchDxcc(); | 
					
						
							|  |  |  |         $data['modes'] = $this->modes->active(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->load->library('form_validation'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->form_validation->set_rules('start_date', 'Date', 'required'); | 
					
						
							|  |  |  |         $this->form_validation->set_rules('start_time', 'Time', 'required'); | 
					
						
							|  |  |  |         $this->form_validation->set_rules('callsign', 'Callsign', 'required'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             $data['page_title'] = "Contest logging"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             $this->load->view('interface_assets/header', $data); | 
					
						
							|  |  |  |             $this->load->view('contesting/index'); | 
					
						
							|  |  |  |             $this->load->view('interface_assets/footer'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             //setcookie("radio", $qso_data['radio'], time()+3600*24*99);
 | 
					
						
							|  |  |  |             //setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             //$this->session->set_userdata($qso_data);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             // If SAT name is set make it session set to sat
 | 
					
						
							|  |  |  |             if($this->input->post('sat_name')) { | 
					
						
							|  |  |  |                 $this->session->set_userdata('prop_mode', 'SAT'); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-09-12 00:38:09 +08:00
										 |  |  | } |