[Custom map] Added mode and propagation selection
这个提交包含在:
		
							父节点
							
								
									cf7d471df7
								
							
						
					
					
						当前提交
						f9045d0427
					
				
					共有  4 个文件被更改,包括 66 次插入 和 8 次删除
				
			
		|  | @ -33,12 +33,11 @@ class Map extends CI_Controller { | ||||||
| 
 | 
 | ||||||
|     function custom() |     function custom() | ||||||
| 	{ | 	{ | ||||||
| 
 |  | ||||||
| 		$this->load->model('bands'); | 		$this->load->model('bands'); | ||||||
|         //$this->load->model('modes');
 |         $this->load->model('modes'); | ||||||
| 
 | 
 | ||||||
|         $data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
 |         $data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
 | ||||||
|         //$data['modes'] = $this->modes->active(); // Used in the view for mode select
 | 		$data['modes'] = $this->modes->active(); 					// Used in the view for mode select
 | ||||||
| 
 | 
 | ||||||
|         if ($this->input->post('band') != NULL) {   			// Band is not set when page first loads.
 |         if ($this->input->post('band') != NULL) {   			// Band is not set when page first loads.
 | ||||||
|             if ($this->input->post('band') == 'All') {          // Did the user specify a band? If not, use all bands
 |             if ($this->input->post('band') == 'All') {          // Did the user specify a band? If not, use all bands
 | ||||||
|  | @ -108,11 +107,13 @@ class Map extends CI_Controller { | ||||||
|         $start_date = $this->uri->segment(3); |         $start_date = $this->uri->segment(3); | ||||||
|         $end_date = $this->uri->segment(4); |         $end_date = $this->uri->segment(4); | ||||||
| 		$band = $this->uri->segment(5); | 		$band = $this->uri->segment(5); | ||||||
|  | 		$mode = $this->uri->segment(6); | ||||||
|  | 		$propagation = $this->uri->segment(7); | ||||||
| 		$this->load->model('logbook_model'); | 		$this->load->model('logbook_model'); | ||||||
| 
 | 
 | ||||||
| 		$this->load->library('qra'); | 		$this->load->library('qra'); | ||||||
| 
 | 
 | ||||||
| 		$qsos = $this->logbook_model->map_custom_qsos(rawurldecode($start_date), rawurldecode($end_date), $band); | 		$qsos = $this->logbook_model->map_custom_qsos(rawurldecode($start_date), rawurldecode($end_date), $band, rawurldecode($mode), rawurldecode($propagation)); | ||||||
| 		header('Content-Type: application/json; charset=utf-8'); | 		header('Content-Type: application/json; charset=utf-8'); | ||||||
| 		echo "{\"markers\": ["; | 		echo "{\"markers\": ["; | ||||||
| 		$count = 1; | 		$count = 1; | ||||||
|  |  | ||||||
|  | @ -1284,7 +1284,7 @@ class Logbook_model extends CI_Model { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /* used to return custom qsos requires start, end date plus a band */ |     /* used to return custom qsos requires start, end date plus a band */ | ||||||
|     function map_custom_qsos($start, $end, $band) { |     function map_custom_qsos($start, $end, $band, $mode, $propagation) { | ||||||
| 		$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')); | ||||||
|  | @ -1305,6 +1305,15 @@ class Logbook_model extends CI_Model { | ||||||
|         $this->db->where("COL_PROP_MODE", "SAT"); |         $this->db->where("COL_PROP_MODE", "SAT"); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|  |       if ($mode != 'All') { | ||||||
|  |         $this->db->where("COL_MODE", $mode); | ||||||
|  |         $this->db->or_where("COL_SUBMODE", $mode); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if ($propagation != 'All') { | ||||||
|  |         $this->db->where("COL_PROP_MODE", $propagation); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|       $this->db->order_by("COL_TIME_ON", "ASC"); |       $this->db->order_by("COL_TIME_ON", "ASC"); | ||||||
|       $query = $this->db->get($this->config->item('table_name')); |       $query = $this->db->get($this->config->item('table_name')); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -721,7 +721,7 @@ function getLookupResult() { | ||||||
|         var q_lng = -32.695312; |         var q_lng = -32.695312; | ||||||
|         <?php } ?>
 |         <?php } ?>
 | ||||||
| 
 | 
 | ||||||
|         var qso_loc = '<?php echo site_url('map/map_data_custom/');?><?php echo rawurlencode($date_from); ?>/<?php echo rawurlencode($date_to); ?>/<?php echo rawurlencode($this->input->post('band')); ?>'; |         var qso_loc = '<?php echo site_url('map/map_data_custom/');?><?php echo rawurlencode($date_from); ?>/<?php echo rawurlencode($date_to); ?>/<?php echo rawurlencode($this->input->post('band')); ?>/<?php echo rawurlencode($this->input->post('mode')); ?>/<?php echo rawurlencode($this->input->post('prop_mode')); ?>'; | ||||||
|         var q_zoom = 3; |         var q_zoom = 3; | ||||||
| 
 | 
 | ||||||
|       $(document).ready(function(){ |       $(document).ready(function(){ | ||||||
|  |  | ||||||
|  | @ -31,10 +31,10 @@ | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|     <div class="form-group row"> |     <div class="row"> | ||||||
|         <label class="col-md-2 control-label" for="band">Band</label> |         <label class="col-md-2 control-label" for="band">Band</label> | ||||||
| 
 | 
 | ||||||
|         <div class="col-md-2"> |         <div class="col-md-3"> | ||||||
|             <select id="band2" name="band" class="form-control custom-select-sm"> |             <select id="band2" name="band" class="form-control custom-select-sm"> | ||||||
|                 <option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> >Every band</option>
 |                 <option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> >Every band</option>
 | ||||||
|                 <?php foreach($worked_bands as $band) { |                 <?php foreach($worked_bands as $band) { | ||||||
|  | @ -46,6 +46,54 @@ | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|  |     <div class="row"> | ||||||
|  |         <label class="col-md-2 control-label" for="mode">Mode</label> | ||||||
|  |         <div class="col-md-3"> | ||||||
|  |         <select id="mode" name="mode" class="form-control custom-select-sm"> | ||||||
|  |         <option value="All" <?php if ($this->input->post('mode') == "All" || $this->input->method() !== 'post') echo ' selected'; ?>>All</option>
 | ||||||
|  |             <?php | ||||||
|  |             foreach($modes->result() as $mode){ | ||||||
|  |                 if ($mode->submode == null) { | ||||||
|  |                     echo '<option value="' . $mode->mode . '"'; | ||||||
|  |                     if ($this->input->post('mode') == $mode->mode) echo ' selected'; | ||||||
|  |                     echo '>'. $mode->mode . '</option>'."\n"; | ||||||
|  |                 } else { | ||||||
|  |                     echo '<option value="' . $mode->submode . '"'; | ||||||
|  |                     if ($this->input->post('mode') == $mode->submode) echo ' selected'; | ||||||
|  |                     echo '>' . $mode->submode . '</option>'."\n"; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             ?>
 | ||||||
|  |         </select> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  |     <div class="row"> | ||||||
|  |         <label class="col-md-2 control-label"for="selectPropagation">Propagation Mode</label> | ||||||
|  |         <div class="col-md-3"> | ||||||
|  |             <select class="form-control custom-select-sm" id="selectPropagation" name="prop_mode"> | ||||||
|  |                 <option value="All" <?php if ($this->input->post('prop_mode') == "All" || $this->input->method() !== 'post') echo ' selected'; ?>>All</option>
 | ||||||
|  |                 <option value="AS" <?php if ($this->input->post('prop_mode') == "AS") echo ' selected';?>>Aircraft Scatter</option>
 | ||||||
|  |                 <option value="AUR" <?php if ($this->input->post('prop_mode') == "AUR") echo ' selected';?>>Aurora</option>
 | ||||||
|  |                 <option value="AUE" <?php if ($this->input->post('prop_mode') == "AUE") echo ' selected';?>>Aurora-E</option>
 | ||||||
|  |                 <option value="BS" <?php if ($this->input->post('prop_mode') == "BS") echo ' selected';?>>Back scatter</option>
 | ||||||
|  |                 <option value="ECH" <?php if ($this->input->post('prop_mode') == "ECH") echo ' selected';?>>EchoLink</option>
 | ||||||
|  |                 <option value="EME" <?php if ($this->input->post('prop_mode') == "EME") echo ' selected';?>>Earth-Moon-Earth</option>
 | ||||||
|  |                 <option value="ES" <?php if ($this->input->post('prop_mode') == "ES") echo ' selected';?>>Sporadic E</option>
 | ||||||
|  |                 <option value="FAI" <?php if ($this->input->post('prop_mode') == "FAI") echo ' selected';?>>Field Aligned Irregularities</option>
 | ||||||
|  |                 <option value="F2" <?php if ($this->input->post('prop_mode') == "F2") echo ' selected';?>>F2 Reflection</option>
 | ||||||
|  |                 <option value="INTERNET" <?php if ($this->input->post('prop_mode') == "INTERNET") echo ' selected';?>>Internet-assisted</option>
 | ||||||
|  |                 <option value="ION" <?php if ($this->input->post('prop_mode') == "ION") echo ' selected';?>>Ionoscatter</option>
 | ||||||
|  |                 <option value="IRL" <?php if ($this->input->post('prop_mode') == "IRL") echo ' selected';?>>IRLP</option>
 | ||||||
|  |                 <option value="MS" <?php if ($this->input->post('prop_mode') == "MS") echo ' selected';?>>Meteor scatter</option>
 | ||||||
|  |                 <option value="RPT" <?php if ($this->input->post('prop_mode') == "RPT") echo ' selected';?>>Terrestrial or atmospheric repeater or transponder</option>
 | ||||||
|  |                 <option value="RS" <?php if ($this->input->post('prop_mode') == "RS") echo ' selected';?>>Rain scatter</option>
 | ||||||
|  |                 <option value="SAT" <?php if ($this->input->post('prop_mode') == "SAT") echo ' selected';?>>Satellite</option>
 | ||||||
|  |                 <option value="TEP" <?php if ($this->input->post('prop_mode') == "TEP") echo ' selected';?>>Trans-equatorial</option>
 | ||||||
|  |                 <option value="TR" <?php if ($this->input->post('prop_mode') == "TR") echo ' selected';?>>Tropospheric ducting</option>
 | ||||||
|  |             </select> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | 
 | ||||||
|     <input type="submit" value="Load Map"> |     <input type="submit" value="Load Map"> | ||||||
|     <br><br> |     <br><br> | ||||||
| </form> | </form> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用