| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Sig extends CI_Model { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  | 	function __construct() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		parent::__construct(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | 	function get_all($type) { | 
					
						
							|  |  |  | 		$CI =& get_instance(); | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  |       	$CI->load->model('Stations'); | 
					
						
							|  |  |  |       	$station_id = $CI->Stations->find_active(); | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  | 		$this->db->where("station_id", $station_id); | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | 		$this->db->order_by("COL_SIG_INFO", "ASC"); | 
					
						
							|  |  |  | 		$this->db->where('COL_SIG =', $type); | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | 		return $this->db->get($this->config->item('table_name')); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function get_all_sig_types() { | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  |         $CI =& get_instance(); | 
					
						
							|  |  |  |         $CI->load->model('Stations'); | 
					
						
							|  |  |  |         $station_id = $CI->Stations->find_active(); | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $sql = "select col_sig, count(*) qsos, count(distinct col_sig_info) refs from " . $this->config->item('table_name') . | 
					
						
							|  |  |  |                 " where col_sig <> ''" . | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  |                 " and station_id = " . $station_id . | 
					
						
							| 
									
										
										
										
											2021-03-20 18:24:13 +08:00
										 |  |  |                 " group by col_sig"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $query = $this->db->query($sql); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $query->result(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  | ?>
 |