mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
PoC for subdivision naming
This commit is contained in:
@@ -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');
|
||||
|
||||
22
application/libraries/Subdivisions.php
Normal file
22
application/libraries/Subdivisions.php
Normal file
@@ -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 } ?>
|
||||
|
||||
Reference in New Issue
Block a user