Added QRZ-Logic to activated gridsquare map
这个提交包含在:
		
							父节点
							
								
									0ca4320264
								
							
						
					
					
						当前提交
						609527b22d
					
				
					共有  2 个文件被更改,包括 31 次插入 和 42 次删除
				
			
		|  | @ -50,6 +50,7 @@ class Activated_gridmap extends CI_Controller { | ||||||
|         $qsl = $this->security->xss_clean($this->input->post('qsl')); |         $qsl = $this->security->xss_clean($this->input->post('qsl')); | ||||||
|         $lotw = $this->security->xss_clean($this->input->post('lotw')); |         $lotw = $this->security->xss_clean($this->input->post('lotw')); | ||||||
|         $eqsl = $this->security->xss_clean($this->input->post('eqsl')); |         $eqsl = $this->security->xss_clean($this->input->post('eqsl')); | ||||||
|  |         $qrz = $this->security->xss_clean($this->input->post('qrz')); | ||||||
| 		$sat = $this->security->xss_clean($this->input->post('sat')); | 		$sat = $this->security->xss_clean($this->input->post('sat')); | ||||||
| 		$this->load->model('activated_gridmap_model'); | 		$this->load->model('activated_gridmap_model'); | ||||||
| 
 | 
 | ||||||
|  | @ -69,7 +70,7 @@ class Activated_gridmap extends CI_Controller { | ||||||
| 		$grid_4char_confirmed = ""; | 		$grid_4char_confirmed = ""; | ||||||
| 		$grid_6char_confirmed = ""; | 		$grid_6char_confirmed = ""; | ||||||
| 
 | 
 | ||||||
| 		$query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat); | 		$query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); | ||||||
| 
 | 
 | ||||||
| 		if ($query && $query->num_rows() > 0) { | 		if ($query && $query->num_rows() > 0) { | ||||||
| 			foreach ($query->result() as $row) 	{ | 			foreach ($query->result() as $row) 	{ | ||||||
|  | @ -99,7 +100,7 @@ class Activated_gridmap extends CI_Controller { | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		$query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $sat); | 		$query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); | ||||||
| 
 | 
 | ||||||
| 		if ($query && $query->num_rows() > 0) { | 		if ($query && $query->num_rows() > 0) { | ||||||
| 			foreach ($query->result() as $row) { | 			foreach ($query->result() as $row) { | ||||||
|  | @ -129,7 +130,7 @@ class Activated_gridmap extends CI_Controller { | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		$query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat); | 		$query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); | ||||||
| 
 | 
 | ||||||
| 		if ($query_vucc && $query_vucc->num_rows() > 0) { | 		if ($query_vucc && $query_vucc->num_rows() > 0) { | ||||||
| 			foreach ($query_vucc->result() as $row) { | 			foreach ($query_vucc->result() as $row) { | ||||||
|  | @ -154,7 +155,7 @@ class Activated_gridmap extends CI_Controller { | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		// // Confirmed Squares
 | 		// // Confirmed Squares
 | ||||||
| 		$query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat); | 		$query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); | ||||||
| 
 | 
 | ||||||
| 		if ($query_vucc && $query_vucc->num_rows() > 0) { | 		if ($query_vucc && $query_vucc->num_rows() > 0) { | ||||||
| 			foreach ($query_vucc->result() as $row) 			{ | 			foreach ($query_vucc->result() as $row) 			{ | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| class Activated_gridmap_model extends CI_Model { | class Activated_gridmap_model extends CI_Model { | ||||||
| 
 | 
 | ||||||
|     function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat) { |     function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) { | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|         $CI->load->model('logbooks_model'); |         $CI->load->model('logbooks_model'); | ||||||
|         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | @ -35,11 +35,11 @@ class Activated_gridmap_model extends CI_Model { | ||||||
| 			$sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; | 			$sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl); |         $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); | ||||||
| 		return $this->db->query($sql); | 		return $this->db->query($sql); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|     function get_band($band, $mode, $qsl, $lotw, $eqsl, $sat) { |     function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) { | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|         $CI->load->model('logbooks_model'); |         $CI->load->model('logbooks_model'); | ||||||
|         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | @ -75,7 +75,7 @@ class Activated_gridmap_model extends CI_Model { | ||||||
|         return $this->db->query($sql); |         return $this->db->query($sql); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) { |     function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) { | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|         $CI->load->model('logbooks_model'); |         $CI->load->model('logbooks_model'); | ||||||
|         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | @ -112,7 +112,7 @@ class Activated_gridmap_model extends CI_Model { | ||||||
|         return $this->db->query($sql); |         return $this->db->query($sql); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) { |     function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) { | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|         $CI->load->model('logbooks_model'); |         $CI->load->model('logbooks_model'); | ||||||
|         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | @ -145,48 +145,36 @@ class Activated_gridmap_model extends CI_Model { | ||||||
| 			$sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; | 			$sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 		$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl); | 		$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); | ||||||
| 
 | 
 | ||||||
|         return null; |         return null; | ||||||
| 		return $this->db->query($sql); | 		return $this->db->query($sql); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|     	// Adds confirmation to query
 | // Adds confirmation to query
 | ||||||
| 	function addQslToQuery($qsl, $lotw, $eqsl) { |     function addQslToQuery($qsl, $lotw, $eqsl, $qrz) { | ||||||
| 		$sql = ''; | 	    $sql = ''; | ||||||
| 		if ($lotw == "true" && $qsl == "false" && $eqsl == "false") { | 	    if ($lotw == "true") { | ||||||
| 			$sql .= " and col_lotw_qsl_sent = 'Y'"; | 		    $sql .= " or col_lotw_qsl_sent = 'Y'"; | ||||||
| 		} | 	    } | ||||||
| 
 | 
 | ||||||
| 		if ($qsl == "true" && $lotw == "false" && $eqsl == "false") { | 	    if ($qsl == "true") { | ||||||
| 			$sql .= " and col_qsl_true = 'Y'"; | 		    $sql .= " or col_qsl_sent = 'Y'"; | ||||||
| 		} | 	    } | ||||||
| 
 | 
 | ||||||
|         if ($eqsl == "true" && $lotw == "false" && $qsl == "false") { | 	    if ($eqsl == "true") { | ||||||
| 			$sql .= " and col_eqsl_qsl_sent = 'Y'"; | 		    $sql .= " or col_eqsl_qsl_sent = 'Y'"; | ||||||
| 		} | 	    } | ||||||
| 
 | 
 | ||||||
|         if ($lotw == "true" && $qsl == "true" && $eqsl == "false") { | 	    if ($qrz == "true") { | ||||||
| 			$sql .= " and (col_lotw_qsl_sent = 'Y' or col_qsl_sent = 'Y')"; | 		    $sql .= " or col_qrzcom_qso_upload_status = 'Y'"; | ||||||
| 		} | 	    } | ||||||
|  | 	    if ($sql != '') { | ||||||
|  | 		    $sql='and (1=0 '.$sql.')'; | ||||||
|  | 	    } | ||||||
|  | 	    return $sql; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
| 		if ($qsl == "true" && $lotw == "false" && $eqsl == "true") { |  | ||||||
| 			$sql .= " and (col_qsl_sent = 'Y' or col_eqsl_qsl_sent = 'Y')"; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
|         if ($eqsl == "true" && $lotw == "true" && $qsl == "false") { |  | ||||||
| 			$sql .= " and (col_eqsl_qsl_sent = 'Y' or col_lotw_qsl_sent = 'Y')"; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		if ($qsl == "true" && $lotw == "true" && $eqsl == "true") { |  | ||||||
| 			$sql .= " and (col_qsl_sent = 'Y' or col_lotw_qsl_sent = 'Y' or col_eqsl_qsl_sent = 'Y')"; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
|         if ($qsl == "false" && $lotw == "false" && $eqsl == "false") { |  | ||||||
| 			$sql .= " and (col_qsl_sent != 'Y' and col_lotw_qsl_sent != 'Y' and col_eqsl_qsl_sent != 'Y')"; |  | ||||||
| 		} |  | ||||||
| 		return $sql; |  | ||||||
| 	} |  | ||||||
| 
 | 
 | ||||||
|     /* |     /* | ||||||
| 	 * Get's the worked modes from the log | 	 * Get's the worked modes from the log | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用