Merge pull request #1312 from Werzi2001/eqsl_lotw_on_dashboard
added eQSL and LotW to the dashboard
这个提交包含在:
		
						当前提交
						2b1f3b5461
					
				
					共有  4 个文件被更改,包括 168 次插入 和 24 次删除
				
			
		|  | @ -76,7 +76,13 @@ class Dashboard extends CI_Controller { | |||
| 			$data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv(); | ||||
| 			$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"; | ||||
| 
 | ||||
|  | @ -99,7 +105,7 @@ class Dashboard extends CI_Controller { | |||
| 		 | ||||
| 		$this->load->library('qra'); | ||||
| 
 | ||||
| 		$qsos = $this->logbook_model->get_last_qsos('11'); | ||||
| 		$qsos = $this->logbook_model->get_last_qsos('18'); | ||||
| 
 | ||||
| 		echo "{\"markers\": ["; | ||||
| 		$count = 1; | ||||
|  |  | |||
|  | @ -44,6 +44,8 @@ $lang['general_word_qslcards'] = 'QSL Cards'; | |||
| $lang['general_word_qslcard_direct'] = 'Direct'; | ||||
| $lang['general_word_qslcard_bureau'] = 'Bureau'; | ||||
| $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_mark_qsl_rx_bureau'] = 'Mark QSL Received (Bureau)'; | ||||
|  |  | |||
|  | @ -1472,6 +1472,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 */ | ||||
|     function total_countries() { | ||||
|         $CI =& get_instance(); | ||||
|  |  | |||
|  | @ -152,18 +152,18 @@ function echo_table_col($row, $name) { | |||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_total'); ?></td>
 | ||||
| 				<td><?php echo $total_qsos; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_total'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_qsos; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_year'); ?></td>
 | ||||
| 				<td><?php echo $year_qsos; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_year'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $year_qsos; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_month'); ?></td>
 | ||||
| 				<td><?php echo $month_qsos; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_month'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $month_qsos; ?></td>
 | ||||
| 			</tr> | ||||
| 		</table> | ||||
| 
 | ||||
|  | @ -175,12 +175,12 @@ function echo_table_col($row, $name) { | |||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_worked'); ?></td>
 | ||||
| 				<td><?php echo $total_countries; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_worked'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_countries; ?></td>
 | ||||
| 			</tr> | ||||
| 			<tr> | ||||
| 				<td><a href="#" onclick="return false" data-original-title="QSL Cards / eQSL / LoTW" data-toggle="tooltip"><?php echo $this->lang->line('general_word_confirmed'); ?></a></td>
 | ||||
| 				<td> | ||||
| 				<td width="50%"><a href="#" onclick="return false" data-original-title="QSL Cards / eQSL / LoTW" data-toggle="tooltip"><?php echo $this->lang->line('general_word_confirmed'); ?></a></td>
 | ||||
| 				<td width="50%"> | ||||
| 					<?php echo $total_countries_confirmed_paper; ?> /
 | ||||
| 					<?php echo $total_countries_confirmed_eqsl; ?> /
 | ||||
| 					<?php echo $total_countries_confirmed_lotw; ?>
 | ||||
|  | @ -188,30 +188,66 @@ function echo_table_col($row, $name) { | |||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_needed'); ?></td>
 | ||||
| 				<td><?php echo $total_countries_needed; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_needed'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_countries_needed; ?></td>
 | ||||
| 			</tr> | ||||
| 		</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"> | ||||
| 			<tr class="titles"> | ||||
| 				<td colspan="2"><i class="fas fa-envelope"></i> <?php echo $this->lang->line('general_word_qslcards'); ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||
| 				<td><?php echo $total_qsl_sent; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_qsl_sent; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||
| 				<td><?php echo $total_qsl_recv; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_qsl_recv; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td><?php echo $this->lang->line('general_word_requested'); ?></td>
 | ||||
| 				<td><?php echo $total_qsl_requested; ?></td>
 | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_requested'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_qsl_requested; ?></td>
 | ||||
| 			</tr> | ||||
| 		</table> | ||||
| 		<?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 width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_eqsl_sent; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||
| 				<td width="50%"><?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 width="50%"><?php echo $this->lang->line('general_word_sent'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_lotw_sent; ?></td>
 | ||||
| 			</tr> | ||||
| 
 | ||||
| 			<tr> | ||||
| 				<td width="50%"><?php echo $this->lang->line('general_word_received'); ?></td>
 | ||||
| 				<td width="50%"><?php echo $total_lotw_recv; ?></td>
 | ||||
| 			</tr> | ||||
| 		</table> | ||||
| 		<?php } ?>
 | ||||
|  |  | |||
		正在加载…
	
		在新工单中引用