当前提交
fa49d31b79
共有 3 个文件被更改,包括 104 次插入 和 5 次删除
|
|
@ -702,6 +702,7 @@ class Logbook extends CI_Controller {
|
|||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
||||
|
||||
$this->load->library('qra');
|
||||
$this->load->library('subdivisions');
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$data['query'] = $this->logbook_model->get_qso($id);
|
||||
|
|
@ -715,6 +716,8 @@ class Logbook extends CI_Controller {
|
|||
|
||||
$this->load->model('Qsl_model');
|
||||
$data['qslimages'] = $this->Qsl_model->getQslForQsoId($id);
|
||||
$data['primary_subdivision'] = $this->subdivisions->get_primary_subdivision_name($data['query']->result()[0]->COL_DXCC);
|
||||
$data['secondary_subdivision'] = $this->subdivisions->get_secondary_subdivision_name($data['query']->result()[0]->COL_DXCC);
|
||||
$data['max_upload'] = ini_get('upload_max_filesize');
|
||||
$this->load->view('interface_assets/mini_header', $data);
|
||||
$this->load->view('view_log/qso');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
Lookup functions for subdivisions
|
||||
*/
|
||||
|
||||
|
||||
class Subdivisions {
|
||||
|
||||
public function get_primary_subdivision_name($dxcc) {
|
||||
// ref. http://adif.org.uk/314/ADIF_314_annotated.htm#Primary_Administrative_Subdivision
|
||||
switch($dxcc) {
|
||||
case '1':
|
||||
case '29':
|
||||
case '32':
|
||||
case '100':
|
||||
case '137':
|
||||
case '163':
|
||||
case '206':
|
||||
case '209':
|
||||
case '212':
|
||||
case '225':
|
||||
case '248':
|
||||
case '263':
|
||||
case '269':
|
||||
case '281':
|
||||
case '284':
|
||||
case '318':
|
||||
case '375':
|
||||
case '386':
|
||||
return 'Province';
|
||||
case '27':
|
||||
case '15':
|
||||
case '54':
|
||||
case '61':
|
||||
case '126':
|
||||
case '151':
|
||||
case '288':
|
||||
return 'Oblast';
|
||||
case '112':
|
||||
return 'Region';
|
||||
case '132':
|
||||
case '144':
|
||||
case '227':
|
||||
return 'Department';
|
||||
case '170':
|
||||
return 'Region';
|
||||
case '224':
|
||||
return 'Municipality';
|
||||
case '230':
|
||||
return 'Federal State';
|
||||
case '239':
|
||||
case '245':
|
||||
case '275':
|
||||
case '497':
|
||||
return 'County';
|
||||
case '272':
|
||||
case '503':
|
||||
case '504':
|
||||
return 'District';
|
||||
case '287':
|
||||
return 'Canton';
|
||||
case '291':
|
||||
return 'US State';
|
||||
case '318':
|
||||
case '339':
|
||||
return 'Prefecture';
|
||||
}
|
||||
return 'State';
|
||||
}
|
||||
|
||||
public function get_secondary_subdivision_name($dxcc) {
|
||||
// ref. http://adif.org.uk/314/ADIF_314_annotated.htm#Secondary_Administrative_Subdivision
|
||||
switch($dxcc) {
|
||||
case '6':
|
||||
case '110':
|
||||
case '291':
|
||||
return 'US County';
|
||||
case '15':
|
||||
case '54':
|
||||
case '61':
|
||||
case '126':
|
||||
case '151':
|
||||
case '288':
|
||||
return 'District';
|
||||
case '21':
|
||||
case '29':
|
||||
case '32':
|
||||
case '281':
|
||||
return 'DME';
|
||||
case '339':
|
||||
return 'City / Ku / Gun';
|
||||
}
|
||||
return 'County';
|
||||
}
|
||||
}
|
||||
|
|
@ -161,16 +161,16 @@
|
|||
|
||||
<?php if($row->COL_STATE != null) { ?>
|
||||
<tr>
|
||||
<td>USA State:</td>
|
||||
<td><?php echo $primary_subdivision ?>:</td>
|
||||
<td><?php echo $row->COL_STATE; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($row->COL_CNTY != null && $row->COL_CNTY != ",") { ?>
|
||||
<tr>
|
||||
<td>USA County:</td>
|
||||
<td><?php echo $row->COL_CNTY; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $secondary_subdivision ?>:</td>
|
||||
<td><?php echo $row->COL_CNTY; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($row->COL_NAME != null) { ?>
|
||||
|
|
|
|||
正在加载…
在新工单中引用