kopia lustrzana https://github.com/magicbug/Cloudlog
PoC for subdivision naming
rodzic
48ddcf0ada
commit
5b577a432a
|
@ -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 } ?>
|
||||
|
|
Ładowanie…
Reference in New Issue