DXCC awards has links to show stations worked on that band and country
这个提交包含在:
		
							父节点
							
								
									98a17832c9
								
							
						
					
					
						当前提交
						34212d2976
					
				
					共有  6 个文件被更改,包括 120 次插入 和 35 次删除
				
			
		|  | @ -151,6 +151,8 @@ class API extends CI_Controller { | ||||||
| 		$this->load->model('user_model'); | 		$this->load->model('user_model'); | ||||||
| 
 | 
 | ||||||
| 		$arguments = $this->_retrieve(); | 		$arguments = $this->_retrieve(); | ||||||
|  | 		print_r($arguments); | ||||||
|  | 		return; | ||||||
| 
 | 
 | ||||||
| 		if((!$this->user_model->authorize(3)) && ($this->api_model->authorize($arguments['key']) == 0)) { | 		if((!$this->user_model->authorize(3)) && ($this->api_model->authorize($arguments['key']) == 0)) { | ||||||
|             $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); |             $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); | ||||||
|  | @ -166,6 +168,18 @@ class API extends CI_Controller { | ||||||
| 		$s = $this->logbook_model->api_search_query($query); | 		$s = $this->logbook_model->api_search_query($query); | ||||||
| 		$a = 0; | 		$a = 0; | ||||||
| 
 | 
 | ||||||
|  |         // Print query results using original column names and exit
 | ||||||
|  |         if ($arguments['format'] == 'original'){ | ||||||
|  |             $results = array(); | ||||||
|  |             foreach($s['results']->result() as $row){ | ||||||
|  |                 //print_r($row);
 | ||||||
|  |                 array_push($results,  $row); | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             print json_encode($results); | ||||||
|  |             return; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|         if(isset($s['results'])) { |         if(isset($s['results'])) { | ||||||
|             $results = $s['results']; |             $results = $s['results']; | ||||||
| 
 | 
 | ||||||
|  | @ -204,6 +218,31 @@ class API extends CI_Controller { | ||||||
| 		$this->load->view('api/index', $data); | 		$this->load->view('api/index', $data); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	/* | ||||||
|  | 	 * version of search that is callable internally | ||||||
|  | 	 * $arguments is an array of columns to query | ||||||
|  | 	 */ | ||||||
|  | 	function api_search($arguments){ | ||||||
|  | 		// Load the API and Logbook models
 | ||||||
|  | 		$this->load->model('api_model'); | ||||||
|  | 		$this->load->model('logbook_model'); | ||||||
|  | 		$this->load->model('user_model'); | ||||||
|  | 
 | ||||||
|  | 		if((!$this->user_model->authorize(3)) && ($this->api_model->authorize($arguments['key']) == 0)) { | ||||||
|  |             $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 		// Retrieve the arguments from the query string
 | ||||||
|  |         $data['data']['format'] = $arguments['format']; | ||||||
|  | 	 | ||||||
|  | 		// Call the parser within the API model to build the query
 | ||||||
|  | 		$query = $this->api_model->select_parse($arguments); | ||||||
|  | 
 | ||||||
|  | 		// Execute the query, and retrieve the results
 | ||||||
|  | 		$s = $this->logbook_model->api_search_query($query); | ||||||
|  | 		return $s; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|   function validate() |   function validate() | ||||||
|   { |   { | ||||||
| 		// Load the API and Logbook models
 | 		// Load the API and Logbook models
 | ||||||
|  |  | ||||||
|  | @ -31,6 +31,41 @@ class Awards extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	public function dxcc_details(){ | ||||||
|  |         $a = $this->input->get(); | ||||||
|  |         $q = ""; | ||||||
|  |         foreach ($a as $key => $value) { | ||||||
|  |         	$q .= $key."=".$value.("(and)"); | ||||||
|  |         } | ||||||
|  |         $q = substr($q, 0, strlen($q)-13); | ||||||
|  | 
 | ||||||
|  |         $arguments["query"] = $q; | ||||||
|  |         $arguments["fields"] = ''; | ||||||
|  |         $arguments["format"] = "json"; | ||||||
|  |         $arguments["limit"] = ''; | ||||||
|  |         $arguments["order"] = ''; | ||||||
|  | 
 | ||||||
|  |         // print_r($arguments);
 | ||||||
|  |         // return;
 | ||||||
|  | 
 | ||||||
|  | 		// Load the API and Logbook models
 | ||||||
|  | 		$this->load->model('api_model'); | ||||||
|  | 		$this->load->model('logbook_model'); | ||||||
|  | 
 | ||||||
|  | 		// Call the parser within the API model to build the query
 | ||||||
|  | 		$query = $this->api_model->select_parse($arguments); | ||||||
|  | 
 | ||||||
|  | 		// Execute the query, and retrieve the results
 | ||||||
|  | 		$data = $this->logbook_model->api_search_query($query); | ||||||
|  | 
 | ||||||
|  | 		// Render Page
 | ||||||
|  | 		$data['page_title'] = "Log View - DXCC"; | ||||||
|  | 		$data['filter'] = $a["Country"] . " and " . $a["Band"]; | ||||||
|  | 		$this->load->view('layout/header', $data); | ||||||
|  | 		$this->load->view('awards/dxcc/details'); | ||||||
|  | 		$this->load->view('layout/footer'); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
| 	/* | 	/* | ||||||
| 		Handles Displaying of WAB Squares worked. | 		Handles Displaying of WAB Squares worked. | ||||||
| 		Comment field - WAB:#
 | 		Comment field - WAB:#
 | ||||||
|  |  | ||||||
|  | @ -291,7 +291,7 @@ class Logbook extends CI_Controller { | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   function search_result($id) { |   function search_result($id="") { | ||||||
|     $this->load->model('user_model'); |     $this->load->model('user_model'); | ||||||
| 
 | 
 | ||||||
|     if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } |     if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } | ||||||
|  | @ -304,7 +304,7 @@ class Logbook extends CI_Controller { | ||||||
|     if ($query->num_rows() > 0) |     if ($query->num_rows() > 0) | ||||||
|     { |     { | ||||||
|       $data['results'] = $query; |       $data['results'] = $query; | ||||||
|       $this->load->view('search/result_search.php', $data); |       $this->load->view('view_log/partial/log.php', $data); | ||||||
|     } else { |     } else { | ||||||
|       $this->load->model('search'); |       $this->load->model('search'); | ||||||
| 
 | 
 | ||||||
|  | @ -313,7 +313,7 @@ class Logbook extends CI_Controller { | ||||||
|       if ($iota_search->num_rows() > 0) |       if ($iota_search->num_rows() > 0) | ||||||
|       { |       { | ||||||
|         $data['results'] = $iota_search; |         $data['results'] = $iota_search; | ||||||
|         $this->load->view('search/result_search.php', $data); |         $this->load->view('view_log/partial/log.php', $data); | ||||||
|       } else { |       } else { | ||||||
|         if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { |         if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { | ||||||
|           // Lookup using QRZ
 |           // Lookup using QRZ
 | ||||||
|  |  | ||||||
|  | @ -41,6 +41,7 @@ class DXCC extends CI_Model { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // print_r($results);
 |         // print_r($results);
 | ||||||
|  |         // return;
 | ||||||
| 
 | 
 | ||||||
|         return $results; |         return $results; | ||||||
| 	} | 	} | ||||||
|  | @ -75,6 +76,11 @@ class DXCC extends CI_Model { | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |     function search(){ | ||||||
|  |         print_r($this->input->get()); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
| 	function empty_table($table) { | 	function empty_table($table) { | ||||||
| 		$this->db->empty_table($table); | 		$this->db->empty_table($table); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -35,8 +35,11 @@ | ||||||
|         foreach($dxcc as $country=>$val){ |         foreach($dxcc as $country=>$val){ | ||||||
|             print("<tr><td>$country</td>"); |             print("<tr><td>$country</td>"); | ||||||
|             foreach($val as $band=>$count){ |             foreach($val as $band=>$count){ | ||||||
|                 $count = ($count == 0)?" ":$count; |                 if ($count == 0){ | ||||||
|                 print("<td>$count</td>"); |                     print("<td> </td>"); | ||||||
|  |                 }else{ | ||||||
|  |                     printf("<td><a href='dxcc_details?Country=\"%s\"&Band=\"%s\"'>%d</a></td>", $country, $band, $count); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|             print("</tr>"); |             print("</tr>"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -88,9 +88,11 @@ | ||||||
| 		 | 		 | ||||||
| 	</table> | 	</table> | ||||||
| 
 | 
 | ||||||
|  |     <?php if (isset($this->pagination)){ ?>
 | ||||||
| 	<div class="pagination"> | 	<div class="pagination"> | ||||||
| 		<?php echo $this->pagination->create_links(); ?>
 | 		<?php echo $this->pagination->create_links(); ?>
 | ||||||
| 	</div> | 	</div> | ||||||
|  | 	<?php } ?>
 | ||||||
| 
 | 
 | ||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用