| 
									
										
										
										
											2020-10-18 06:00:01 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | defined('BASEPATH') OR exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Timeplotter 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'); } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function index() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // Render Page
 | 
					
						
							|  |  |  |         $data['page_title'] = "Timeplotter"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-13 22:55:17 +08:00
										 |  |  |         $this->load->model('bands'); | 
					
						
							| 
									
										
										
										
											2020-10-18 06:00:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-13 22:55:17 +08:00
										 |  |  |         $data['worked_bands'] = $this->bands->get_worked_bands(); | 
					
						
							| 
									
										
										
										
											2020-10-18 06:00:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $this->load->model('dxcc'); | 
					
						
							|  |  |  |         $data['dxcc_list'] = $this->dxcc->list(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->load->model('modes'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $data['modes'] = $this->modes->active(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->load->view('interface_assets/header', $data); | 
					
						
							|  |  |  |         $this->load->view('timeplotter/index'); | 
					
						
							|  |  |  |         $this->load->view('interface_assets/footer'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function getTimes() { | 
					
						
							|  |  |  |         // POST data
 | 
					
						
							|  |  |  |         $postData = $this->input->post(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //load model
 | 
					
						
							|  |  |  |         $this->load->model('Timeplotter_model'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // get data
 | 
					
						
							|  |  |  |         $data = $this->Timeplotter_model->getTimes($postData); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return json_encode($data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |