diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 53c9dcc0..dabdced0 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -257,6 +257,23 @@ class Awards extends CI_Controller { $this->load->view('interface_assets/footer'); } + /* + Handles showing worked POTAs + Comment field - POTA:# + */ + public function pota() { + + // Grab all worked pota stations + $this->load->model('pota'); + $data['pota_all'] = $this->pota->get_all(); + + // Render page + $data['page_title'] = "Awards - POTA"; + $this->load->view('interface_assets/header', $data); + $this->load->view('awards/pota/index'); + $this->load->view('interface_assets/footer'); + } + public function cq() { $CI =& get_instance(); $CI->load->model('logbooks_model'); diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 9301bedc..227e5c2c 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -369,6 +369,35 @@ class QSO extends CI_Controller { echo json_encode($json); } + public function get_pota() { + $json = []; + + if(!empty($this->input->get("query"))) { + $query = isset($_GET['query']) ? $_GET['query'] : FALSE; + $pota = strtoupper($query); + + $file = 'assets/json/pota.txt'; + + if (is_readable($file)) { + $lines = file($file, FILE_IGNORE_NEW_LINES); + $input = preg_quote($pota, '~'); + $reg = '~^'. $input .'(.*)$~'; + $result = preg_grep($reg, $lines); + $json = []; + $i = 0; + foreach ($result as &$value) { + // Limit to 100 as to not slowdown browser too much + if (count($json) <= 100) { + $json[] = ["name"=>$value]; + } + } + } + } + + header('Content-Type: application/json'); + echo json_encode($json); + } + /* * Function is used for autocompletion of DOK in the QSO entry form */ diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 0133ba4c..243ff104 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -417,6 +417,43 @@ class Update extends CI_Controller { } } + public function update_pota() { + $csvfile = 'https://pota.app/all_parks.csv'; + + $potafile = './assets/json/pota.txt'; + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $csvfile); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_USERAGENT, 'Cloudlog Updater'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $csv = curl_exec($ch); + curl_close($ch); + + $potafilehandle = fopen($potafile, 'w'); + $data = str_getcsv($csv,"\n"); + foreach ($data as $idx => $row) { + if ($idx == 0) continue; // Skip line we are not interested in + $row = str_getcsv($row, ','); + if ($row[0]) { + fwrite($potafilehandle, $row[0].PHP_EOL); + } + } + + fclose($potafilehandle); + if (file_exists($potafile)) + { + $nCount = count(file($potafile)); + if ($nCount > 0) + { + echo "DONE: " . number_format($nCount) . " POTA's saved"; + } else { + echo"FAILED: Empty file"; + } + } else { + echo"FAILED: Could not create pota.txt file locally"; + } + } } ?> diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index c709c76c..7af103f8 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Посочете стойността н $lang['qso_sota_ref_helptext'] = 'Например: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Например: WWFF или POTA'; -$lang['qso_sig_info_helptext'] = 'Например: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Например: GMA'; +$lang['qso_sig_info_helptext'] = 'Например: DA/NW-357'; $lang['qso_dok_helptext'] = 'Например: Q03'; diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index f9f793d6..eb225d19 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = '以瓦特为单位设置功率值。在 $lang['qso_sota_ref_helptext'] = '例如: GM/NS-001.'; -$lang['qso_sig_helptext'] = '例如: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = '例如: DLFF-0029'; +$lang['qso_sig_helptext'] = '例如: GMA'; +$lang['qso_sig_info_helptext'] = '例如: DA/NW-357'; $lang['qso_dok_helptext'] = '例如: Q03'; diff --git a/application/language/czech/qso_lang.php b/application/language/czech/qso_lang.php index 059657bb..375e5233 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Zadej výkon ve Wattech. Jsou povolen po $lang['qso_sota_ref_helptext'] = 'Příklad: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Příklad: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = 'Příklad: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Příklad: GMA'; +$lang['qso_sig_info_helptext'] = 'Příklad: DA/NW-357'; $lang['qso_dok_helptext'] = 'Příklad: Q03'; diff --git a/application/language/dutch/qso_lang.php b/application/language/dutch/qso_lang.php index 55916e5e..65b25f5f 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Geef vermogen in Watt. Vermeld alleen ci $lang['qso_sota_ref_helptext'] = 'Bijvoorbeeld: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Bijvoorbeeld: WWFF of POTA'; -$lang['qso_sig_info_helptext'] = 'Bijvoorbeeld: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Bijvoorbeeld: GMA'; +$lang['qso_sig_info_helptext'] = 'Bijvoorbeeld: DA/NW-357'; $lang['qso_dok_helptext'] = 'Bijvoorbeeld: Q03'; diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 3a221be3..e5dc1512 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -99,11 +99,13 @@ $lang['gen_hamradio_county_reference'] = 'USA County'; $lang['gen_hamradio_iota_reference'] = 'IOTA Reference'; $lang['gen_hamradio_sota_reference'] = 'SOTA Reference'; $lang['gen_hamradio_wwff_reference'] = 'WWFF Reference'; +$lang['gen_hamradio_pota_reference'] = 'POTA Reference'; $lang['gen_hamradio_dok'] = 'DOK'; $lang['gen_hamradio_state'] = 'State'; $lang['gen_hamradio_iota'] = 'IOTA'; $lang['gen_hamradio_sota'] = 'SOTA'; $lang['gen_hamradio_wwff'] = 'WWFF'; +$lang['gen_hamradio_pota'] = 'POTA'; $lang['gen_hamradio_gridsquare'] = 'Gridsquare'; $lang['gen_hamradio_operator'] = 'Operator'; diff --git a/application/language/english/qso_lang.php b/application/language/english/qso_lang.php index dad4ee33..3b27929f 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -13,9 +13,10 @@ $lang['qso_transmit_power_helptext'] = 'Give power value in Watts. Include only $lang['qso_sota_ref_helptext'] = 'For example: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'For example: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'For example: PA-0150.'; -$lang['qso_sig_helptext'] = 'For example: POTA'; -$lang['qso_sig_info_helptext'] = 'For example: PA-0150'; +$lang['qso_sig_helptext'] = 'For example: GMA'; +$lang['qso_sig_info_helptext'] = 'For example: DA/NW-357'; $lang['qso_dok_helptext'] = 'For example: Q03'; diff --git a/application/language/finnish/qso_lang.php b/application/language/finnish/qso_lang.php index e7fa05de..72e2ec81 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Anna teholukema Watteina käyttäen vain $lang['qso_sota_ref_helptext'] = 'Esimerkiksi: OH/JS-004.'; -$lang['qso_sig_helptext'] = 'Esimerkiksi: WWFF tai POTA'; -$lang['qso_sig_info_helptext'] = 'Esimerkiksi: OHFF-0029'; +$lang['qso_sig_helptext'] = 'Esimerkiksi: GMA'; +$lang['qso_sig_info_helptext'] = 'Esimerkiksi: DA/NW-357'; $lang['qso_dok_helptext'] = 'Esimerkiksi: Q03'; diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index aab4e008..bbed0738 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Saisissez la ouissance en Watts en utili $lang['qso_sota_ref_helptext'] = 'Par exemple: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Par exemple: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = 'Par exemple: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Par exemple: GMA'; +$lang['qso_sig_info_helptext'] = 'Par exemple: DA/NW-357'; $lang['qso_dok_helptext'] = 'Par exemple: Q03'; diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index 5e76a4c8..caf948f7 100644 --- a/application/language/german/general_words_lang.php +++ b/application/language/german/general_words_lang.php @@ -99,10 +99,13 @@ $lang['gen_hamradio_county_reference'] = 'USA County'; $lang['gen_hamradio_iota_reference'] = 'IOTA Referenznummer'; $lang['gen_hamradio_sota_reference'] = 'SOTA Referenznummer'; $lang['gen_hamradio_wwff_reference'] = 'WWFF Referenznummer'; +$lang['gen_hamradio_pota_reference'] = 'POTA Referenznummer'; $lang['gen_hamradio_dok'] = 'DOK'; $lang['gen_hamradio_state'] = 'Staat'; $lang['gen_hamradio_iota'] = 'IOTA'; $lang['gen_hamradio_sota'] = 'SOTA'; +$lang['gen_hamradio_wwff'] = 'WWFF'; +$lang['gen_hamradio_pota'] = 'POTA'; $lang['gen_hamradio_gridsquare'] = 'Planquadrat'; $lang['gen_hamradio_operator'] = 'Operator'; diff --git a/application/language/german/qso_lang.php b/application/language/german/qso_lang.php index b6227d09..0f1b0949 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -13,9 +13,10 @@ $lang['qso_transmit_power_helptext'] = 'Gib die Ausgangsleistung in Watt an. Erf $lang['qso_sota_ref_helptext'] = 'Zum Beispiel: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Zum Beispiel: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'Zum Beispiel: PA-0150.'; -$lang['qso_sig_helptext'] = 'Zum Beispiel: POTA'; -$lang['qso_sig_info_helptext'] = 'Zum Beispiel: PA-0150'; +$lang['qso_sig_helptext'] = 'Zum Beispiel: GMA'; +$lang['qso_sig_info_helptext'] = 'Zum Beispiel: DA/NW-357'; $lang['qso_dok_helptext'] = 'Zum Beispiel: Q03'; diff --git a/application/language/italian/qso_lang.php b/application/language/italian/qso_lang.php index 375951cf..8aebb73d 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -13,9 +13,10 @@ $lang['qso_transmit_power_helptext'] = 'Dare valore di potenza in Watt. Includer $lang['qso_sota_ref_helptext'] = 'Per esempio: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Per esempio: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'Per esempio: PA-0150.'; -$lang['qso_sig_helptext'] = 'Per esempio: POTA'; -$lang['qso_sig_info_helptext'] = 'Per esempio: PA-0150'; +$lang['qso_sig_helptext'] = 'Per esempio: GMA'; +$lang['qso_sig_info_helptext'] = 'Per esempio: DA/NW-357'; $lang['qso_dok_helptext'] = 'Per esempio: Q03'; diff --git a/application/language/polish/qso_lang.php b/application/language/polish/qso_lang.php index 9c34a6fe..03a8cf35 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Wpisz wartość mocy w watach. W polu po $lang['qso_sota_ref_helptext'] = 'Na przykład: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Na przykład: WWFF lub POTA'; -$lang['qso_sig_info_helptext'] = 'Na przykład: SPFF-0029'; +$lang['qso_sig_helptext'] = 'Na przykład: GMA'; +$lang['qso_sig_info_helptext'] = 'Na przykład: DA/NW-357'; $lang['qso_dok_helptext'] = 'Na przykład: Q03'; diff --git a/application/language/russian/qso_lang.php b/application/language/russian/qso_lang.php index 26d64f3b..5e3f1963 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -13,9 +13,10 @@ $lang['qso_transmit_power_helptext'] = 'Укажите мощность в Ва $lang['qso_sota_ref_helptext'] = 'Например: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Например: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'Например: PA-0150.'; -$lang['qso_sig_helptext'] = 'Например: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = 'Например: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Например: GMA'; +$lang['qso_sig_info_helptext'] = 'Например: DA/NW-357'; $lang['qso_dok_helptext'] = 'Например: Q03'; diff --git a/application/language/spanish/qso_lang.php b/application/language/spanish/qso_lang.php index 027f71d9..e8acab39 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -12,8 +12,8 @@ $lang['qso_transmit_power_helptext'] = 'Especifique el valor de potencia en Wati $lang['qso_sota_ref_helptext'] = 'Por ejemplo: GM/NS-001.'; -$lang['qso_sig_helptext'] = 'Por ejemplo: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = 'Por ejemplo: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Por ejemplo: GMA'; +$lang['qso_sig_info_helptext'] = 'Por ejemplo: DA/NW-357'; $lang['qso_dok_helptext'] = 'Por ejemplo: Q03'; diff --git a/application/language/swedish/qso_lang.php b/application/language/swedish/qso_lang.php index bac7b921..c3a63d4b 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -13,9 +13,10 @@ $lang['qso_transmit_power_helptext'] = 'Ange effekt i watt, enbart med siffror.' $lang['qso_sota_ref_helptext'] = 'Exempel: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Exempel: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'Exempel: PA-0150.'; -$lang['qso_sig_helptext'] = 'Exempel: POTA'; -$lang['qso_sig_info_helptext'] = 'Exempel: PA-0150'; +$lang['qso_sig_helptext'] = 'Exempel: GMA'; +$lang['qso_sig_info_helptext'] = 'Exempel: DA/NW-357'; $lang['qso_dok_helptext'] = 'Exempel: Q03'; diff --git a/application/language/turkish/qso_lang.php b/application/language/turkish/qso_lang.php index fee94083..fad4a8cb 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -14,9 +14,10 @@ $lang['qso_transmit_power_helptext'] = 'Gücü Watt olarak veriniz. Sadece rakam $lang['qso_sota_ref_helptext'] = 'Örnek: GM/NS-001.'; $lang['qso_wwff_ref_helptext'] = 'Örnek: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = 'Örnek: PA-0150.'; -$lang['qso_sig_helptext'] = 'Örnek: WWFF or POTA'; -$lang['qso_sig_info_helptext'] = 'Örnek: DLFF-0029'; +$lang['qso_sig_helptext'] = 'Örnek: GMA'; +$lang['qso_sig_info_helptext'] = 'Örnek: DA/NW-357'; $lang['qso_dok_helptext'] = 'Örnek: Q03'; diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 926f7ee4..cc936f08 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -88,6 +88,7 @@ class AdifHelper { 'SKCC', 'SOTA_REF', 'WWFF_REF', + 'POTA_REF', 'SRX', 'SRX_STRING', 'STATE', @@ -191,6 +192,8 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_WWFF_REF", $qso->station_wwff); + $line .= $this->getAdifFieldLine("MY_POTA_REF", $qso->station_pota); + $line .= $this->getAdifFieldLine("MY_CQ_ZONE", $qso->station_cq); $line .= $this->getAdifFieldLine("MY_ITU_ZONE", $qso->station_itu); diff --git a/application/migrations/108_add_pota_columns.php b/application/migrations/108_add_pota_columns.php new file mode 100644 index 00000000..2242fc7a --- /dev/null +++ b/application/migrations/108_add_pota_columns.php @@ -0,0 +1,68 @@ +db->field_exists('COL_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) { + $fields = array( + 'COL_POTA_REF VARCHAR(30) DEFAULT NULL', + 'COL_MY_POTA_REF VARCHAR(50) DEFAULT NULL', + ); + $this->dbforge->add_column('TABLE_HRD_CONTACTS_V01', $fields, 'COL_VUCC_GRIDS'); + + // Now copy over data from SIG_INFO fields and remove COL_SIG and COL_SIG_INFO only if COL_SIG is POTA + // This cannot be reverted on downgrade to prevent overwriting of other COL_SIG information + $this->db->set('COL_POTA_REF', 'COL_SIG_INFO', FALSE); + $this->db->set('COL_SIG_INFO', ''); + $this->db->set('COL_SIG', ''); + $this->db->where('COL_SIG', 'POTA'); + $this->db->update('TABLE_HRD_CONTACTS_V01'); + + } + if (!$this->db->field_exists('station_pota', 'station_profile')) { + // Add MY_POTA_REF to station profile + $fields = array( + 'station_pota varchar(50) DEFAULT NULL', + ); + $this->dbforge->add_column('station_profile', $fields); + } + if (!$this->db->field_exists('pota', 'bandxuser')) { + $fields = array( + 'pota' => array( + 'type' => 'INT', + 'constraint' => 20, + 'unsigned' => TRUE, + ), + ); + $this->dbforge->add_column('bandxuser', $fields); + $this->db->query("update bandxuser set pota = 1"); + } + } + + public function down() + { + if ($this->db->field_exists('COL_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) { + $this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_POTA_REF'); + } + if ($this->db->field_exists('COL_MY_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) { + $this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_MY_POTA_REF'); + } + if ($this->db->field_exists('station_pota', 'station_profile')) { + $this->dbforge->drop_column('station_profile', 'station_pota'); + } + if ($this->db->field_exists('pota', 'bandxuser')) { + $this->dbforge->drop_column('bandxuser', 'pota'); + } + } +} diff --git a/application/models/Bands.php b/application/models/Bands.php index f8eee324..574620bb 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -247,6 +247,7 @@ class Bands extends CI_Model { 'dok' => $band['dok'] == "true" ? '1' : '0', 'dxcc' => $band['dxcc'] == "true" ? '1' : '0', 'iota' => $band['iota'] == "true" ? '1' : '0', + 'pota' => $band['pota'] == "true" ? '1' : '0', 'sig' => $band['sig'] == "true" ? '1' : '0', 'sota' => $band['sota'] == "true" ? '1' : '0', 'uscounties' => $band['uscounties'] == "true" ? '1' : '0', @@ -291,8 +292,8 @@ class Bands extends CI_Model { $this->db->insert('bands', $data); } - $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, wwff, vucc) - select bands.id, " . $this->session->userdata('user_id') . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands where band ='".$data['band']."' and not exists (select 1 from bandxuser where userid = " . $this->session->userdata('user_id') . " and bandid = bands.id);"); + $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, pota, sig, sota, uscounties, was, wwff, vucc) + select bands.id, " . $this->session->userdata('user_id') . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands where band ='".$data['band']."' and not exists (select 1 from bandxuser where userid = " . $this->session->userdata('user_id') . " and bandid = bands.id);"); } function getband($id) { @@ -317,4 +318,4 @@ class Bands extends CI_Model { } } -?> \ No newline at end of file +?> diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5a618c31..a8ba548b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -178,6 +178,7 @@ class Logbook_model extends CI_Model { 'COL_CNTY' => $clean_county_input, 'COL_SOTA_REF' => trim($this->input->post('sota_ref')), 'COL_WWFF_REF' => trim($this->input->post('wwff_ref')), + 'COL_POTA_REF' => trim($this->input->post('pota_ref')), 'COL_SIG' => trim($this->input->post('sig')), 'COL_SIG_INFO' => trim($this->input->post('sig_info')), 'COL_DARC_DOK' => strtoupper(trim($darc_dok)), @@ -211,6 +212,7 @@ class Logbook_model extends CI_Model { $data['COL_MY_IOTA'] = strtoupper(trim($station['station_iota'])); $data['COL_MY_SOTA_REF'] = strtoupper(trim($station['station_sota'])); $data['COL_MY_WWFF_REF'] = strtoupper(trim($station['station_wwff'])); + $data['COL_MY_POTA_REF'] = strtoupper(trim($station['station_pota'])); $data['COL_STATION_CALLSIGN'] = strtoupper(trim($station['station_callsign'])); $data['COL_MY_DXCC'] = strtoupper(trim($station['station_dxcc'])); @@ -287,6 +289,9 @@ class Logbook_model extends CI_Model { case 'WWFF': $this->db->where('COL_WWFF_REF', $searchphrase); break; + case 'POTA': + $this->db->where('COL_POTA_REF', $searchphrase); + break; } $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); @@ -723,6 +728,7 @@ class Logbook_model extends CI_Model { 'COL_IOTA' => $this->input->post('iota_ref'), 'COL_SOTA_REF' => $this->input->post('sota_ref'), 'COL_WWFF_REF' => $this->input->post('wwff_ref'), + 'COL_POTA_REF' => $this->input->post('pota_ref'), 'COL_TX_PWR' => $txpower, 'COL_SIG' => $this->input->post('sig'), 'COL_SIG_INFO' => $this->input->post('sig_info'), @@ -2680,6 +2686,7 @@ class Logbook_model extends CI_Model { 'COL_MY_SIG_INTL' => (!empty($record['my_sig_intl'])) ? $record['my_sig_intl'] : '', 'COL_MY_SOTA_REF' => (!empty($record['my_sota_ref'])) ? $record['my_sota_ref'] : '', 'COL_MY_WWFF_REF' => (!empty($record['my_wwff_ref'])) ? $record['my_wwff_ref'] : '', + 'COL_MY_POTA_REF' => (!empty($record['my_pota_ref'])) ? $record['my_pota_ref'] : '', 'COL_MY_STATE' => (!empty($record['my_state'])) ? $record['my_state'] : '', 'COL_MY_STREET' => (!empty($record['my_street'])) ? $record['my_street'] : '', 'COL_MY_STREET_INTL' => (!empty($record['my_street_intl'])) ? $record['my_street_intl'] : '', @@ -2729,12 +2736,13 @@ class Logbook_model extends CI_Model { 'COL_SKCC' => (!empty($record['skcc'])) ? $record['skcc'] : '', 'COL_SOTA_REF' => (!empty($record['sota_ref'])) ? $record['sota_ref'] : '', 'COL_WWFF_REF' => (!empty($record['wwff_ref'])) ? $record['wwff_ref'] : '', + 'COL_POTA_REF' => (!empty($record['pota_ref'])) ? $record['pota_ref'] : '', 'COL_SRX' => (!empty($record['srx'])) ? (int)$record['srx'] : null, - //convert to integer to make sure no invalid entries are imported - 'COL_SRX_STRING' => (!empty($record['srx_string'])) ? $record['srx_string'] : '', + //convert to integer to make sure no invalid entries are imported + 'COL_SRX_STRING' => (!empty($record['srx_string'])) ? $record['srx_string'] : '', 'COL_STATE' => (!empty($record['state'])) ? strtoupper($record['state']) : '', 'COL_STATION_CALLSIGN' => (!empty($record['station_callsign'])) ? $record['station_callsign'] : '', - //convert to integer to make sure no invalid entries are imported + //convert to integer to make sure no invalid entries are imported 'COL_STX' => (!empty($record['stx'])) ? (int)$record['stx'] : null, 'COL_STX_STRING' => (!empty($record['stx_string'])) ? $record['stx_string'] : '', 'COL_SUBMODE' => $input_submode, @@ -2769,6 +2777,7 @@ class Logbook_model extends CI_Model { $data['COL_MY_IOTA'] = strtoupper(trim($row['station_iota'])); $data['COL_MY_SOTA_REF'] = strtoupper(trim($row['station_sota'])); $data['COL_MY_WWFF_REF'] = strtoupper(trim($row['station_wwff'])); + $data['COL_MY_POTA_REF'] = strtoupper(trim($row['station_pota'])); $data['COL_STATION_CALLSIGN'] = strtoupper(trim($row['station_callsign'])); $data['COL_MY_DXCC'] = strtoupper(trim($row['station_dxcc'])); diff --git a/application/models/Pota.php b/application/models/Pota.php new file mode 100644 index 00000000..117a8c42 --- /dev/null +++ b/application/models/Pota.php @@ -0,0 +1,27 @@ +load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('pota'); + + $this->db->where_in("station_id", $logbooks_locations_array); + $this->db->where_in("col_band", $bandslots); + $this->db->order_by("COL_POTA_REF", "ASC"); + $this->db->where('COL_POTA_REF !=', ''); + + return $this->db->get($this->config->item('table_name')); + } +} + +?> diff --git a/application/models/Stations.php b/application/models/Stations.php index 53d1ab0c..23100f39 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -65,6 +65,7 @@ class Stations extends CI_Model { 'station_iota' => xss_clean(strtoupper($this->input->post('iota', true))), 'station_sota' => xss_clean(strtoupper($this->input->post('sota', true))), 'station_wwff' => xss_clean(strtoupper($this->input->post('wwff', true))), + 'station_pota' => xss_clean(strtoupper($this->input->post('pota', true))), 'station_sig' => xss_clean(strtoupper($this->input->post('sig', true))), 'station_sig_info' => xss_clean(strtoupper($this->input->post('sig_info', true))), 'station_callsign' => xss_clean($this->input->post('station_callsign', true)), @@ -91,6 +92,7 @@ class Stations extends CI_Model { 'station_iota' => xss_clean($this->input->post('iota', true)), 'station_sota' => xss_clean($this->input->post('sota', true)), 'station_wwff' => xss_clean($this->input->post('wwff', true)), + 'station_pota' => xss_clean($this->input->post('pota', true)), 'station_sig' => xss_clean($this->input->post('sig', true)), 'station_sig_info' => xss_clean($this->input->post('sig_info', true)), 'station_callsign' => xss_clean($this->input->post('station_callsign', true)), @@ -267,6 +269,10 @@ class Stations extends CI_Model { $this->db->where('COL_MY_WWFF_REF', $row->station_wwff); } + if($row->station_pota != "") { + $this->db->where('COL_MY_POTA_REF', $row->station_pota); + } + if($row->station_sig != "") { $this->db->where('COL_MY_SIG', $row->station_sig); } diff --git a/application/models/User_model.php b/application/models/User_model.php index 384a42b0..278eb53e 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -156,7 +156,7 @@ class User_Model extends CI_Model { // Add user and insert bandsettings for user $this->db->insert($this->config->item('auth_table'), $data); $insert_id = $this->db->insert_id(); - $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, sig, sota, uscounties, was, wwff, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;"); + $this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, pota, sig, sota, uscounties, was, wwff, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;"); return OK; } else { return EUSERNAMEEXISTS; diff --git a/application/views/awards/pota/index.php b/application/views/awards/pota/index.php new file mode 100644 index 00000000..a5f2b942 --- /dev/null +++ b/application/views/awards/pota/index.php @@ -0,0 +1,55 @@ +
| lang->line('gen_hamradio_pota_reference') ?> | +lang->line('general_word_date') ?> | +lang->line('general_word_time') ?> | +lang->line('gen_hamradio_callsign') ?> | +lang->line('gen_hamradio_band') ?> | +lang->line('gen_hamradio_rsts') ?> | +lang->line('gen_hamradio_rstr') ?> | +
|---|---|---|---|---|---|---|
| COL_POTA_REF; ?> | +COL_TIME_ON); echo date($custom_date_format, $timestamp); ?> | +COL_TIME_ON); echo date('H:i', $timestamp); ?> | +COL_CALL; ?> | +COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo $row->COL_BAND; } ?> | +COL_RST_SENT; ?> | +COL_RST_RCVD; ?> | +