[Dashboard] Adds Radio Status showing radios active in the last 15mins
这个提交包含在:
		
							父节点
							
								
									31b5439bc1
								
							
						
					
					
						当前提交
						bbdd0eadde
					
				
					共有  3 个文件被更改,包括 46 次插入 和 0 次删除
				
			
		|  | @ -44,6 +44,12 @@ class Dashboard extends CI_Controller { | ||||||
| 			$this->load->view('setup/check_list'); | 			$this->load->view('setup/check_list'); | ||||||
| 			$this->load->view('interface_assets/footer'); | 			$this->load->view('interface_assets/footer'); | ||||||
| 		} else { | 		} else { | ||||||
|  | 
 | ||||||
|  | 			// 
 | ||||||
|  | 			$this->load->model('cat'); | ||||||
|  | 
 | ||||||
|  | 			$data['radio_status'] = $this->cat->recent_status(); | ||||||
|  | 
 | ||||||
| 			// Store info
 | 			// Store info
 | ||||||
| 			$data['todays_qsos'] = $this->logbook_model->todays_qsos(); | 			$data['todays_qsos'] = $this->logbook_model->todays_qsos(); | ||||||
| 			$data['total_qsos'] = $this->logbook_model->total_qsos(); | 			$data['total_qsos'] = $this->logbook_model->total_qsos(); | ||||||
|  |  | ||||||
|  | @ -82,6 +82,13 @@ | ||||||
| 			return $query; | 			return $query; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		function recent_status() { | ||||||
|  | 			$this->db->where("timestamp > date_sub(now(), interval 15 minute)", NULL, FALSE); | ||||||
|  | 
 | ||||||
|  | 			$query = $this->db->get('cat'); | ||||||
|  | 			return $query; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		/* Return list of radios */ | 		/* Return list of radios */ | ||||||
| 		function radios() { | 		function radios() { | ||||||
| 			$this->db->select('id, radio'); | 			$this->db->select('id, radio'); | ||||||
|  |  | ||||||
|  | @ -89,6 +89,39 @@ | ||||||
| 
 | 
 | ||||||
|   <div class="col-sm-4"> |   <div class="col-sm-4"> | ||||||
|   	<div class="table-responsive"> |   	<div class="table-responsive"> | ||||||
|  | 
 | ||||||
|  | 		<?php if($radio_status->num_rows()) { ?>
 | ||||||
|  | 
 | ||||||
|  | 			<table class="table table-striped"> | ||||||
|  | 					<tr class="titles"> | ||||||
|  | 						<td colspan="2"><i class="fas fa-broadcast-tower"></i> Radio Status</td> | ||||||
|  | 					</tr> | ||||||
|  | 					 | ||||||
|  | 					<?php foreach ($radio_status->result_array() as $row) { ?>
 | ||||||
|  | 					<tr> | ||||||
|  | 						<td><?php echo $row['radio']; ?></td>
 | ||||||
|  | 						<td> | ||||||
|  | 							<?php if($row['radio'] == "SatPC32") { ?>
 | ||||||
|  | 								<?php echo $row['sat_name']; ?>
 | ||||||
|  | 							<?php } else { ?>
 | ||||||
|  | 								<?php echo frequency_display_string($row['frequency']); ?> (<?php echo $row['mode']; ?>)
 | ||||||
|  | 							<?php } ?>
 | ||||||
|  | 						</td> | ||||||
|  | 					</tr> | ||||||
|  | 					<?php } ?>
 | ||||||
|  | 
 | ||||||
|  | 				</table> | ||||||
|  | 
 | ||||||
|  | 		<?php } ?>
 | ||||||
|  | 
 | ||||||
|  | 		<?php  | ||||||
|  | 		// converts a frequency in Hz (e.g. 3650) to 3.650 MHz 
 | ||||||
|  | 		function frequency_display_string($frequency) | ||||||
|  | 		{ | ||||||
|  | 			return number_format (($frequency / 1000 / 1000), 3) . " MHz"; | ||||||
|  | 		} | ||||||
|  | 		?>
 | ||||||
|  | 
 | ||||||
|     	<table class="table table-striped"> |     	<table class="table table-striped"> | ||||||
| 			<tr class="titles"> | 			<tr class="titles"> | ||||||
| 				<td colspan="2"><i class="fas fa-chart-bar"></i> <?php echo $this->lang->line('dashboard_qso_breakdown'); ?></td>
 | 				<td colspan="2"><i class="fas fa-chart-bar"></i> <?php echo $this->lang->line('dashboard_qso_breakdown'); ?></td>
 | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用