[Contesting] Fixed so that correct gridsquare was shown in the view. Also removed some unused code in the controller.
这个提交包含在:
		
							父节点
							
								
									cfecaa1ce3
								
							
						
					
					
						当前提交
						e0e80fb680
					
				
					共有  2 个文件被更改,包括 12 次插入 和 36 次删除
				
			
		|  | @ -1,16 +1,13 @@ | ||||||
| <?php | <?php | ||||||
| 
 |  | ||||||
| if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| /* | /* | ||||||
| 	This controller will contain features for contesting | 	This controller contains features for contesting | ||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| class Contesting extends CI_Controller { | class Contesting extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 	function __construct() | 	function __construct() { | ||||||
| 	{ |  | ||||||
| 		parent::__construct(); | 		parent::__construct(); | ||||||
| 		$this->lang->load('contesting'); | 		$this->lang->load('contesting'); | ||||||
| 
 | 
 | ||||||
|  | @ -18,24 +15,17 @@ class Contesting extends CI_Controller { | ||||||
| 		if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } | 		if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|     public function index() |     public function index() { | ||||||
|     { |  | ||||||
| 
 |  | ||||||
|         $this->load->model('cat'); |         $this->load->model('cat'); | ||||||
|         $this->load->model('stations'); |         $this->load->model('stations'); | ||||||
|         $this->load->model('logbook_model'); |  | ||||||
|         $this->load->model('user_model'); |  | ||||||
|         $this->load->model('modes'); |         $this->load->model('modes'); | ||||||
| 		$this->load->model('contesting_model'); | 		$this->load->model('contesting_model'); | ||||||
| 
 | 
 | ||||||
|         $data['active_station_profile'] = $this->stations->find_active(); | 		$data['my_gridsquare'] = $this->stations->find_gridsquare(); | ||||||
|         $data['notice'] = false; |  | ||||||
|         $data['stations'] = $this->stations->all(); |  | ||||||
|         $data['radios'] = $this->cat->radios(); |         $data['radios'] = $this->cat->radios(); | ||||||
|         $data['modes'] = $this->modes->active(); |         $data['modes'] = $this->modes->active(); | ||||||
| 		$data['contestnames'] = $this->contesting_model->getActivecontests(); | 		$data['contestnames'] = $this->contesting_model->getActivecontests(); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 		$this->load->library('form_validation'); | 		$this->load->library('form_validation'); | ||||||
| 
 | 
 | ||||||
|         $this->form_validation->set_rules('start_date', 'Date', 'required'); |         $this->form_validation->set_rules('start_date', 'Date', 'required'); | ||||||
|  | @ -47,18 +37,6 @@ class Contesting extends CI_Controller { | ||||||
| 		$this->load->view('interface_assets/header', $data); | 		$this->load->view('interface_assets/header', $data); | ||||||
| 		$this->load->view('contesting/index'); | 		$this->load->view('contesting/index'); | ||||||
| 		$this->load->view('interface_assets/footer'); | 		$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'); |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function getSessionQsos() { |     public function getSessionQsos() { | ||||||
|  | @ -73,8 +51,7 @@ class Contesting extends CI_Controller { | ||||||
|         return json_encode($data); |         return json_encode($data); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 	public function create() | 	public function create() { | ||||||
| 	{ |  | ||||||
| 		$this->load->model('Contesting_model'); | 		$this->load->model('Contesting_model'); | ||||||
| 		$this->load->library('form_validation'); | 		$this->load->library('form_validation'); | ||||||
| 
 | 
 | ||||||
|  | @ -104,8 +81,7 @@ class Contesting extends CI_Controller { | ||||||
| 		$this->load->view('interface_assets/footer'); | 		$this->load->view('interface_assets/footer'); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public function edit($id) | 	public function edit($id) { | ||||||
| 	{ |  | ||||||
| 		$this->load->library('form_validation'); | 		$this->load->library('form_validation'); | ||||||
| 
 | 
 | ||||||
| 		$this->load->model('Contesting_model'); | 		$this->load->model('Contesting_model'); | ||||||
|  |  | ||||||
|  | @ -132,7 +132,7 @@ | ||||||
| 
 | 
 | ||||||
| 							<div style="display:none" class="form-group col-md-2 gridsquares"> | 							<div style="display:none" class="form-group col-md-2 gridsquares"> | ||||||
| 								<label for="exch_gridsquare_s">Gridsquare (S)</label> | 								<label for="exch_gridsquare_s">Gridsquare (S)</label> | ||||||
| 								<input disabled type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="<?php echo strtoupper($_SESSION['user_locator']) ?>"> | 								<input disabled type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="<?php echo $my_gridsquare;?>"> | ||||||
| 							</div> | 							</div> | ||||||
| 
 | 
 | ||||||
|                             <div class="form-group col-md-1"> |                             <div class="form-group col-md-1"> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用