added eQSL and LotW to the dashboard
这个提交包含在:
		
							父节点
							
								
									e044da8df0
								
							
						
					
					
						当前提交
						602a63d8c1
					
				
					共有  4 个文件被更改,包括 150 次插入 和 6 次删除
				
			
		|  | @ -76,7 +76,13 @@ class Dashboard extends CI_Controller { | ||||||
| 			$data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv(); | 			$data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv(); | ||||||
| 			$data['total_qsl_requested'] = $this->logbook_model->total_qsl_requested(); | 			$data['total_qsl_requested'] = $this->logbook_model->total_qsl_requested(); | ||||||
| 
 | 
 | ||||||
| 			$data['last_five_qsos'] = $this->logbook_model->get_last_qsos('11'); | 			$data['total_eqsl_sent'] = $this->logbook_model->total_eqsl_sent(); | ||||||
|  | 			$data['total_eqsl_recv'] = $this->logbook_model->total_eqsl_recv(); | ||||||
|  | 
 | ||||||
|  | 			$data['total_lotw_sent'] = $this->logbook_model->total_lotw_sent(); | ||||||
|  | 			$data['total_lotw_recv'] = $this->logbook_model->total_lotw_recv(); | ||||||
|  | 
 | ||||||
|  | 			$data['last_five_qsos'] = $this->logbook_model->get_last_qsos('18'); | ||||||
| 
 | 
 | ||||||
| 			$data['page_title'] = "Dashboard"; | 			$data['page_title'] = "Dashboard"; | ||||||
| 
 | 
 | ||||||
|  | @ -99,7 +105,7 @@ class Dashboard extends CI_Controller { | ||||||
| 		 | 		 | ||||||
| 		$this->load->library('qra'); | 		$this->load->library('qra'); | ||||||
| 
 | 
 | ||||||
| 		$qsos = $this->logbook_model->get_last_qsos('11'); | 		$qsos = $this->logbook_model->get_last_qsos('18'); | ||||||
| 
 | 
 | ||||||
| 		echo "{\"markers\": ["; | 		echo "{\"markers\": ["; | ||||||
| 		$count = 1; | 		$count = 1; | ||||||
|  |  | ||||||
|  | @ -44,6 +44,8 @@ $lang['general_word_qslcards'] = 'QSL Cards'; | ||||||
| $lang['general_word_qslcard_direct'] = 'Direct'; | $lang['general_word_qslcard_direct'] = 'Direct'; | ||||||
| $lang['general_word_qslcard_bureau'] = 'Bureau'; | $lang['general_word_qslcard_bureau'] = 'Bureau'; | ||||||
| $lang['general_word_qslcard_via'] = 'Via'; | $lang['general_word_qslcard_via'] = 'Via'; | ||||||
|  | $lang['general_word_eqslcards'] = 'eQSL Cards'; | ||||||
|  | $lang['general_word_lotw'] = 'Logbook of the World'; | ||||||
| 
 | 
 | ||||||
| $lang['general_edit_qso'] = 'Edit QSO'; | $lang['general_edit_qso'] = 'Edit QSO'; | ||||||
| $lang['general_mark_qsl_rx_bureau'] = 'Mark QSL Received (Bureau)'; | $lang['general_mark_qsl_rx_bureau'] = 'Mark QSL Received (Bureau)'; | ||||||
|  |  | ||||||
|  | @ -1468,6 +1468,106 @@ class Logbook_model extends CI_Model { | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /* Return total number of eQSL Cards sent */ | ||||||
|  |     function total_eqsl_sent() { | ||||||
|  |         $CI =& get_instance(); | ||||||
|  |         $CI->load->model('logbooks_model'); | ||||||
|  |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | 
 | ||||||
|  |         if(!empty($logbooks_locations_array)) { | ||||||
|  |             $this->db->select('count(COL_EQSL_QSL_SENT) AS count'); | ||||||
|  |             $this->db->where_in('station_id', $logbooks_locations_array); | ||||||
|  |             $this->db->where('COL_EQSL_QSL_SENT =', 'Y'); | ||||||
|  | 
 | ||||||
|  |             $query = $this->db->get($this->config->item('table_name')); | ||||||
|  | 
 | ||||||
|  |             $row = $query->row(); | ||||||
|  | 
 | ||||||
|  |             if($row == null) { | ||||||
|  |                 return 0; | ||||||
|  |             } else { | ||||||
|  |                 return $row->count; | ||||||
|  |             } | ||||||
|  |         } else { | ||||||
|  |             return 0; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /* Return total number of eQSL Cards received */ | ||||||
|  |     function total_eqsl_recv() { | ||||||
|  |         $CI =& get_instance(); | ||||||
|  |         $CI->load->model('logbooks_model'); | ||||||
|  |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | 
 | ||||||
|  |         if(!empty($logbooks_locations_array)) { | ||||||
|  |             $this->db->select('count(COL_EQSL_QSL_RCVD) AS count'); | ||||||
|  |             $this->db->where_in('station_id', $logbooks_locations_array); | ||||||
|  |             $this->db->where('COL_EQSL_QSL_RCVD =', 'Y'); | ||||||
|  | 
 | ||||||
|  |             $query = $this->db->get($this->config->item('table_name')); | ||||||
|  | 
 | ||||||
|  |             $row = $query->row(); | ||||||
|  | 
 | ||||||
|  |             if($row == null) { | ||||||
|  |                 return 0; | ||||||
|  |             } else { | ||||||
|  |                 return $row->count; | ||||||
|  |             } | ||||||
|  |         } else { | ||||||
|  |             return 0; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /* Return total number of LotW sent */ | ||||||
|  |     function total_lotw_sent() { | ||||||
|  |         $CI =& get_instance(); | ||||||
|  |         $CI->load->model('logbooks_model'); | ||||||
|  |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | 
 | ||||||
|  |         if(!empty($logbooks_locations_array)) { | ||||||
|  |             $this->db->select('count(COL_LOTW_QSL_SENT) AS count'); | ||||||
|  |             $this->db->where_in('station_id', $logbooks_locations_array); | ||||||
|  |             $this->db->where('COL_LOTW_QSL_SENT =', 'Y'); | ||||||
|  | 
 | ||||||
|  |             $query = $this->db->get($this->config->item('table_name')); | ||||||
|  | 
 | ||||||
|  |             $row = $query->row(); | ||||||
|  | 
 | ||||||
|  |             if($row == null) { | ||||||
|  |                 return 0; | ||||||
|  |             } else { | ||||||
|  |                 return $row->count; | ||||||
|  |             } | ||||||
|  |         } else { | ||||||
|  |             return 0; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /* Return total number of LotW received */ | ||||||
|  |     function total_lotw_recv() { | ||||||
|  |         $CI =& get_instance(); | ||||||
|  |         $CI->load->model('logbooks_model'); | ||||||
|  |         $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); | ||||||
|  | 
 | ||||||
|  |         if(!empty($logbooks_locations_array)) { | ||||||
|  |             $this->db->select('count(COL_LOTW_QSL_RCVD) AS count'); | ||||||
|  |             $this->db->where_in('station_id', $logbooks_locations_array); | ||||||
|  |             $this->db->where('COL_LOTW_QSL_RCVD =', 'Y'); | ||||||
|  | 
 | ||||||
|  |             $query = $this->db->get($this->config->item('table_name')); | ||||||
|  | 
 | ||||||
|  |             $row = $query->row(); | ||||||
|  | 
 | ||||||
|  |             if($row == null) { | ||||||
|  |                 return 0; | ||||||
|  |             } else { | ||||||
|  |                 return $row->count; | ||||||
|  |             } | ||||||
|  |         } else { | ||||||
|  |             return 0; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /* Return total number of countries worked */ |     /* Return total number of countries worked */ | ||||||
|     function total_countries() { |     function total_countries() { | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|  |  | ||||||
|  | @ -193,7 +193,7 @@ function echo_table_col($row, $name) { | ||||||
| 			</tr> | 			</tr> | ||||||
| 		</table> | 		</table> | ||||||
| 
 | 
 | ||||||
| 		<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
 | 		<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_recv != 0 || $total_qsl_requested != 0)) { ?>
 | ||||||
| 		<table class="table table-striped"> | 		<table class="table table-striped"> | ||||||
| 			<tr class="titles"> | 			<tr class="titles"> | ||||||
| 				<td colspan="2"><i class="fas fa-envelope"></i> <?php echo $this->lang->line('general_word_qslcards'); ?></td>
 | 				<td colspan="2"><i class="fas fa-envelope"></i> <?php echo $this->lang->line('general_word_qslcards'); ?></td>
 | ||||||
|  | @ -215,6 +215,42 @@ function echo_table_col($row, $name) { | ||||||
| 			</tr> | 			</tr> | ||||||
| 		</table> | 		</table> | ||||||
| 		<?php } ?>
 | 		<?php } ?>
 | ||||||
|  | 
 | ||||||
|  | 		<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_recv != 0)) { ?>
 | ||||||
|  | 		<table class="table table-striped"> | ||||||
|  | 			<tr class="titles"> | ||||||
|  | 				<td colspan="2"><i class="fas fa-address-card"></i> <?php echo $this->lang->line('general_word_eqslcards'); ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 
 | ||||||
|  | 			<tr> | ||||||
|  | 				<td><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||||
|  | 				<td><?php echo $total_eqsl_sent; ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 
 | ||||||
|  | 			<tr> | ||||||
|  | 				<td><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||||
|  | 				<td><?php echo $total_eqsl_recv; ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 		</table> | ||||||
|  | 		<?php } ?>
 | ||||||
|  | 
 | ||||||
|  | 		<?php if((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_lotw_sent != 0 || $total_lotw_recv != 0)) { ?>
 | ||||||
|  | 		<table class="table table-striped"> | ||||||
|  | 			<tr class="titles"> | ||||||
|  | 				<td colspan="2"><i class="fas fa-list"></i> <?php echo $this->lang->line('general_word_lotw'); ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 
 | ||||||
|  | 			<tr> | ||||||
|  | 				<td><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||||
|  | 				<td><?php echo $total_lotw_sent; ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 
 | ||||||
|  | 			<tr> | ||||||
|  | 				<td><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||||
|  | 				<td><?php echo $total_lotw_recv; ?></td>
 | ||||||
|  | 			</tr> | ||||||
|  | 		</table> | ||||||
|  | 		<?php } ?>
 | ||||||
| 	</div> | 	</div> | ||||||
|   </div> |   </div> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用