当前提交
						11df165103
					
				
					共有  6 个文件被更改,包括 64 次插入 和 4 次删除
				
			
		| 
						 | 
				
			
			@ -9,10 +9,16 @@ class Dashboard extends CI_Controller {
 | 
			
		|||
            $this->output->enable_profiler(TRUE);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		// Load language files
 | 
			
		||||
		$this->lang->load('lotw');
 | 
			
		||||
 | 
			
		||||
		// Database connections
 | 
			
		||||
		$this->load->model('logbook_model');
 | 
			
		||||
		$this->load->model('user_model');
 | 
			
		||||
 | 
			
		||||
		// LotW infos
 | 
			
		||||
		$this->load->model('LotwCert');
 | 
			
		||||
 | 
			
		||||
		if($this->optionslib->get_option('version2_trigger') == "false") {
 | 
			
		||||
			redirect('welcome');
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,7 @@ $lang['lotw_status'] = 'Status';
 | 
			
		|||
$lang['lotw_options'] = 'Options';
 | 
			
		||||
$lang['lotw_valid'] = 'Valid';
 | 
			
		||||
$lang['lotw_expired'] = 'Expired';
 | 
			
		||||
$lang['lotw_expiring'] = 'Expiring';
 | 
			
		||||
$lang['lotw_not_synced'] = 'Not Synced';
 | 
			
		||||
 | 
			
		||||
$lang['lotw_certificate_dxcc'] = 'Certificate DXCC';
 | 
			
		||||
| 
						 | 
				
			
			@ -52,3 +53,7 @@ $lang['lotw_p12_export_step_three'] = 'Click "Save Callsign Certificate File" an
 | 
			
		|||
$lang['lotw_p12_export_step_four'] = 'Upload File below.';
 | 
			
		||||
 | 
			
		||||
$lang['lotw_confirmed'] = 'This QSO is confirmed on LoTW';
 | 
			
		||||
 | 
			
		||||
// LotW Expiry
 | 
			
		||||
$lang['lotw_cert_expiring'] = 'At least one of your LotW certificates is about to expire!';
 | 
			
		||||
$lang['lotw_cert_expired'] = 'At least one of your LotW certificates is expired!';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,7 @@ $lang['lotw_status'] = 'Status';
 | 
			
		|||
$lang['lotw_options'] = 'Optionen';
 | 
			
		||||
$lang['lotw_valid'] = 'Gültig';
 | 
			
		||||
$lang['lotw_expired'] = 'Abgelaufen';
 | 
			
		||||
$lang['lotw_expiring'] = 'Läuft ab';
 | 
			
		||||
$lang['lotw_not_synced'] = 'Nicht synchronisiert';
 | 
			
		||||
 | 
			
		||||
$lang['lotw_certificate_dxcc'] = 'Zertifikats-DXCC';
 | 
			
		||||
| 
						 | 
				
			
			@ -52,3 +53,7 @@ $lang['lotw_p12_export_step_three'] = 'Klick "Save Callsign Certificate File" un
 | 
			
		|||
$lang['lotw_p12_export_step_four'] = 'Lade untenstehende Datei hoch.';
 | 
			
		||||
 | 
			
		||||
$lang['lotw_confirmed'] = 'Dieses QSO wurde via LotW bestätigt am';
 | 
			
		||||
 | 
			
		||||
// LotW Expiry
 | 
			
		||||
$lang['lotw_cert_expiring'] = 'Mindestens eines deiner LotW Zertifikate läuft bald ab!';
 | 
			
		||||
$lang['lotw_cert_expired'] = 'Mindestens eines deiner LotW Zertifikate ist abgelaufen!';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -90,5 +90,30 @@ class LotwCert extends CI_Model {
 | 
			
		|||
	function empty_table($table) {
 | 
			
		||||
		$this->db->empty_table($table); 
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
   function lotw_cert_expired($user_id, $date) {
 | 
			
		||||
      $array = array('user_id' => $user_id, 'date_expires <' => $date);
 | 
			
		||||
      $this->db->where($array);
 | 
			
		||||
      $query = $this->db->get('lotw_certs');
 | 
			
		||||
 | 
			
		||||
      if ($query->num_rows() > 0) {
 | 
			
		||||
         return true;
 | 
			
		||||
      } else {
 | 
			
		||||
         return false;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   function lotw_cert_expiring($user_id, $date) {
 | 
			
		||||
      $array = array('user_id' => $user_id, 'DATE_SUB(date_expires, INTERVAL 30 DAY) <' => $date, 'date_expires >' => $date);
 | 
			
		||||
      $this->db->where($array);
 | 
			
		||||
      $query = $this->db->get('lotw_certs');
 | 
			
		||||
 | 
			
		||||
      if ($query->num_rows() > 0) {
 | 
			
		||||
         return true;
 | 
			
		||||
      } else {
 | 
			
		||||
         return false;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,6 +63,22 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
 | 
			
		|||
		</div>
 | 
			
		||||
	<?php } ?>
 | 
			
		||||
 | 
			
		||||
	<?php if ($this->session->userdata('user_id')) { ?>
 | 
			
		||||
		<?php
 | 
			
		||||
			$current_date = date('Y-m-d H:i:s');
 | 
			
		||||
			if($this->LotwCert->lotw_cert_expired($this->session->userdata('user_id'), $current_date) == true) { ?>
 | 
			
		||||
			<div class="alert alert-danger" role="alert">
 | 
			
		||||
				<span class="badge badge-info"><?php echo $this->lang->line('general_word_important'); ?></span> <i class="fas fa-hourglass-end"></i> <?php echo $this->lang->line('lotw_cert_expired'); ?>
 | 
			
		||||
			</div>
 | 
			
		||||
		<?php } ?>
 | 
			
		||||
 | 
			
		||||
		<?php if($this->LotwCert->lotw_cert_expiring($this->session->userdata('user_id'), $current_date) == true) { ?>
 | 
			
		||||
			<div class="alert alert-warning" role="alert">
 | 
			
		||||
				<span class="badge badge-info"><?php echo $this->lang->line('general_word_important'); ?></span> <i class="fas fa-hourglass-half"></i> <?php echo $this->lang->line('lotw_cert_expiring'); ?>
 | 
			
		||||
			</div>
 | 
			
		||||
		<?php } ?>
 | 
			
		||||
	<?php } ?>
 | 
			
		||||
 | 
			
		||||
<?php } ?>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,11 +76,14 @@
 | 
			
		|||
								</td>
 | 
			
		||||
								<td>
 | 
			
		||||
									<?php $current_date = date('Y-m-d H:i:s'); ?>
 | 
			
		||||
									<?php $warning_date = date('Y-m-d H:i:s', strtotime($row->date_expires.'-30 days')); ?>
 | 
			
		||||
 | 
			
		||||
									<?php if ($current_date <= $row->date_expires) { ?>
 | 
			
		||||
										<span class="badge badge-success"><?php echo $this->lang->line('lotw_valid'); ?></span>
 | 
			
		||||
									<?php } else { ?>
 | 
			
		||||
									<?php if ($current_date > $row->date_expires) { ?>
 | 
			
		||||
										<span class="badge badge-danger"><?php echo $this->lang->line('lotw_expired'); ?></span>
 | 
			
		||||
									<?php } else if ($current_date <= $row->date_expires && $current_date > $warning_date) { ?>
 | 
			
		||||
										<span class="badge badge-warning"><?php echo $this->lang->line('lotw_expiring'); ?></span>
 | 
			
		||||
									<?php } else { ?>
 | 
			
		||||
										<span class="badge badge-success"><?php echo $this->lang->line('lotw_valid'); ?></span>
 | 
			
		||||
									<?php } ?>
 | 
			
		||||
 | 
			
		||||
									<?php if ($row->last_upload) { ?>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		正在加载…
	
		在新工单中引用