PoC for subdivision naming

pull/2771/head
phl0 2023-12-04 14:43:07 +01:00
rodzic 48ddcf0ada
commit 5b577a432a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
3 zmienionych plików z 25 dodań i 1 usunięć

Wyświetl plik

@ -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');

Wyświetl plik

@ -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';
}
}

Wyświetl plik

@ -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 } ?>