Only Export Cabrillo for stations belonging to the User
这个提交包含在:
		
							父节点
							
								
									e957402b37
								
							
						
					
					
						当前提交
						feb81eecde
					
				
					共有  1 个文件被更改,包括 82 次插入 和 68 次删除
				
			
		|  | @ -42,11 +42,16 @@ class Cabrillo extends CI_Controller { | ||||||
| 		$this->load->model('Contesting_model'); | 		$this->load->model('Contesting_model'); | ||||||
| 
 | 
 | ||||||
| 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | ||||||
|  | 		$this->load->model('stations'); | ||||||
|  | 		if ($this->stations->check_station_is_accessible($station_id)) { | ||||||
| 			$year = $this->security->xss_clean($this->input->post('year')); | 			$year = $this->security->xss_clean($this->input->post('year')); | ||||||
| 			$result = $this->Contesting_model->get_logged_contests($station_id, $year); | 			$result = $this->Contesting_model->get_logged_contests($station_id, $year); | ||||||
| 
 | 
 | ||||||
| 			header('Content-Type: application/json'); | 			header('Content-Type: application/json'); | ||||||
| 			echo json_encode($result); | 			echo json_encode($result); | ||||||
|  | 		} else { | ||||||
|  | 			$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public function getYears() { | 	public function getYears() { | ||||||
|  | @ -62,6 +67,8 @@ class Cabrillo extends CI_Controller { | ||||||
| 	public function getContestDates() { | 	public function getContestDates() { | ||||||
| 		$this->load->model('Contesting_model'); | 		$this->load->model('Contesting_model'); | ||||||
| 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | ||||||
|  | 		$this->load->model('stations'); | ||||||
|  | 		if ($this->stations->check_station_is_accessible($station_id)) { | ||||||
| 			$year = $this->security->xss_clean($this->input->post('year')); | 			$year = $this->security->xss_clean($this->input->post('year')); | ||||||
| 			$contestid = $this->security->xss_clean($this->input->post('contestid')); | 			$contestid = $this->security->xss_clean($this->input->post('contestid')); | ||||||
| 
 | 
 | ||||||
|  | @ -69,6 +76,9 @@ class Cabrillo extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 			header('Content-Type: application/json'); | 			header('Content-Type: application/json'); | ||||||
| 			echo json_encode($result); | 			echo json_encode($result); | ||||||
|  | 		} else { | ||||||
|  | 			$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public function export() { | 	public function export() { | ||||||
|  | @ -81,6 +91,7 @@ class Cabrillo extends CI_Controller { | ||||||
| 		$this->load->model('user_model'); | 		$this->load->model('user_model'); | ||||||
| 
 | 
 | ||||||
| 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | 		$station_id = $this->security->xss_clean($this->input->post('station_id')); | ||||||
|  | 		if ($this->stations->check_station_is_accessible($station_id)) { | ||||||
| 			$contest_id = $this->security->xss_clean($this->input->post('contestid')); | 			$contest_id = $this->security->xss_clean($this->input->post('contestid')); | ||||||
| 
 | 
 | ||||||
| 			$from = $this->security->xss_clean($this->input->post('contestdatesfrom')); | 			$from = $this->security->xss_clean($this->input->post('contestdatesfrom')); | ||||||
|  | @ -120,5 +131,8 @@ class Cabrillo extends CI_Controller { | ||||||
| 			$data['gridlocator'] = $station->station_gridsquare; | 			$data['gridlocator'] = $station->station_gridsquare; | ||||||
| 
 | 
 | ||||||
| 			$this->load->view('cabrillo/export', $data); | 			$this->load->view('cabrillo/export', $data); | ||||||
|  | 		}else { | ||||||
|  | 			$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
		正在加载…
	
		在新工单中引用