PoC for subdivision naming

这个提交包含在:
phl0 2023-12-04 14:43:07 +01:00
父节点 48ddcf0ada
当前提交 5b577a432a
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 3 个文件被更改,包括 25 次插入1 次删除

查看文件

@ -670,6 +670,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
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);
@ -683,6 +684,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
$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['max_upload'] = ini_get('upload_max_filesize');
$this->load->view('interface_assets/mini_header', $data);
$this->load->view('view_log/qso');

查看文件

@ -0,0 +1,22 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Lookup functions for subdivisions
*/
class Subdivisions {
public function get_primary_subdivision_name($dxcc) {
switch($dxcc) {
case '1':
return 'Province';
case '291':
return 'US State';
case '339':
return 'Prefecture';
}
return 'State';
}
}

查看文件

@ -161,7 +161,7 @@
<?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 } ?>