From 571491f3085959f1ccf30b318335eaf488035a1f Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 2 Feb 2024 06:54:16 +0000 Subject: [PATCH 1/6] To be conform with MIT-Lic --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 083ff38b2..4ed2bb8ea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ MIT License +Copyright (c) 2019 Peter Goodhall Copyright (c) 2024 by DF2ET, DJ7NT, HB9HIL, LA8AJA Permission is hereby granted, free of charge, to any person obtaining a copy From ba762a98a879b7ccb844811e7737dbde7e346251 Mon Sep 17 00:00:00 2001 From: HB9HIL <80885850+HB9HIL@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:42:14 +0100 Subject: [PATCH 2/6] Adding "Hotfixes" (#76) * Re-added forum link * remove 'v' in Version Dialog * Update README.md added Link to demo instance * Update index.php * We should be MIT Conform --------- Co-authored-by: Andreas <6977712+AndreasK79@users.noreply.github.com> Co-authored-by: Joerg (DJ7NT) Co-authored-by: int2001 --- README.md | 8 ++++++++ application/views/interface_assets/header.php | 1 + application/views/version_dialog/index.php | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e44a3343e..2a21e8700 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ The Core-Dev-Team for Wavelog are (in Alphabetic order of the Call): * HB9HIL ([@HB9HIL](https://github.com/HB9HIL)) * LA8AJA ([@AndreasK79](https://github.com/AndreasK79)) +## Demo +Test Wavelog and it's features! +https://demo.wavelog.org + + Username: demo + Password: demo + + ## Requirements * Linux based Operating System (Windows stack may also work) * Apache (Nginx should work) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 590936b65..e4d141f4c 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -388,6 +388,7 @@ + diff --git a/application/views/version_dialog/index.php b/application/views/version_dialog/index.php index b91a31ed0..5d0582363 100644 --- a/application/views/version_dialog/index.php +++ b/application/views/version_dialog/index.php @@ -53,13 +53,13 @@ $htmlReleaseBodyWithLinks = preg_replace('/(https?:\/\/[^\s<]+)/', '$1', $htmlReleaseBody); $releaseName = isset($firstRelease['name']) ? $firstRelease['name'] : 'No version name information available'; - echo "

v".$releaseName."

"; + echo "

".$releaseName."

"; echo nl2br($htmlReleaseBodyWithLinks); } else { - echo 'Fehler beim Decodieren der JSON-Daten oder leere Antwort erhalten.'; + echo 'Error at parsing JSON-Data or got empty result from github.'; } } else { - echo 'Fehler beim Abrufen der Daten von der GitHub API.'; + echo 'Error at getting the data from GitHub.'; } ?> From d6e3cf48798a84101946bb74dc278d15ee8b7b97 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Fri, 9 Feb 2024 15:40:40 +0100 Subject: [PATCH 3/6] Cfd export (#117) * Added CFD Export for toplist.darc.de to Wavelog --------- Co-authored-by: phl0 --- application/controllers/Cfdexport.php | 85 ++++++++++++ .../language/bulgarian/export_lang.php | 1 + .../chinese_simplified/export_lang.php | 1 + application/language/czech/export_lang.php | 1 + application/language/dutch/export_lang.php | 1 + application/language/english/export_lang.php | 1 + application/language/finnish/export_lang.php | 1 + application/language/french/export_lang.php | 1 + application/language/german/export_lang.php | 1 + application/language/greek/export_lang.php | 1 + application/language/italian/export_lang.php | 1 + application/language/polish/export_lang.php | 1 + application/language/russian/export_lang.php | 1 + application/language/spanish/export_lang.php | 1 + application/language/swedish/export_lang.php | 1 + application/language/turkish/export_lang.php | 1 + application/libraries/Frequency.php | 63 ++++++--- application/models/Dxcc.php | 127 ++++++++---------- application/models/Logbook_model.php | 51 +++++++ application/views/cfd/index.php | 29 ++++ application/views/interface_assets/header.php | 4 +- 21 files changed, 280 insertions(+), 94 deletions(-) create mode 100644 application/controllers/Cfdexport.php create mode 100644 application/views/cfd/index.php diff --git a/application/controllers/Cfdexport.php b/application/controllers/Cfdexport.php new file mode 100644 index 000000000..4de7039a9 --- /dev/null +++ b/application/controllers/Cfdexport.php @@ -0,0 +1,85 @@ +load->model('user_model'); + $this->load->model('modes'); + $this->load->model('logbook_model'); + $this->load->model('bands'); + + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + + $data['page_title'] = "CFD Export"; + + $this->load->view('interface_assets/header', $data); + $this->load->view('cfd/index'); + $this->load->view('interface_assets/footer'); + } + + public function export() { + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + $this->load->model('logbook_model'); + $this->load->model('dxcc'); + + // Parameters + $fromdate = xss_clean($this->input->post('from')); + $todate = xss_clean($this->input->post('to')); + + $this->load->library('frequency'); + // Get QSOs with Valid QRAs + $qsos = $this->logbook_model->cfd_get_all_qsos($fromdate, $todate); + $output=strtoupper($this->session->userdata('user_callsign'))."\n"; + $output.='-------------------------------------------------------------- +MostWanted 1.42 - Overview Confirmed Entities + (M=Mixed C=CW F=Fone R=Rest) +============================================================== + +Entity \ MHz: ALL 1.8 3.5 7 10 14 18 21 24 28 50 +-------------------------------------------------------------------------------------------------------'."\n"; + + $dxcc_list=[]; // Prepare Array + foreach ($qsos->result() as $row) { // Loop through entities which are cnfmd + $nominal=$this->frequency->defaultFrequencies[$row->band]['NOMINAL']; + $dxcc_list[$row->prefix]['name']=$row->name; + if ($row->cnfmd >=1) { $dxcc_list[$row->prefix][$nominal][$row->mode]=$row->mode; } + } + $dxccs=$this->dxcc->list_current('prefix'); + foreach ($dxccs->result() as $dxcc) { // Loop through ALL active entities + $vals=$dxcc_list[$dxcc->prefix] ?? []; // Set current Entity + $output .= str_pad($dxcc->prefix,6," ")." ".str_pad(substr($dxcc->name,0,30),30,".")." "; + $allm=0; + $allc=0; + $allf=0; + $allr=0; + $bandachievements=''; + foreach ($this->frequency->defaultFrequencies as $band => $attribs) { // Loop through Bands + if (($attribs['NOMINAL'] <= 50) && ($attribs['NOMINAL'] != 5)) { // Check Every Band for cnfm state + if ($vals[$attribs['NOMINAL']] ?? '' != '') { $bandachievements .= 'M'; $allm++; } else { $bandachievements .= '-'; } + if ($vals[$attribs['NOMINAL']]['C'] ?? '' == 'C') { $bandachievements .= 'C'; $allc++; } else { $bandachievements .= '-'; } + if ($vals[$attribs['NOMINAL']]['F'] ?? '' == 'F') { $bandachievements .= 'F'; $allf++; } else { $bandachievements .= '-'; } + if ($vals[$attribs['NOMINAL']]['R'] ?? '' == 'R') { $bandachievements .= 'R'; $allr++; } else { $bandachievements .= '-'; } + $bandachievements .= ' '; + } + } + // Prepeare ALL Column + if ($allm >0) { $output.='M'; } else { $output.='-'; } + if ($allc >0) { $output.='C'; } else { $output.='-'; } + if ($allf >0) { $output.='F'; } else { $output.='-'; } + if ($allr >0) { $output.='R'; } else { $output.='-'; } + $output .= ' '.$bandachievements."\n"; + } + + header("Content-Disposition: attachment; filename=\"".strtoupper($this->session->userdata('user_callsign')).".CFD\""); + echo $output; + + } +} diff --git a/application/language/bulgarian/export_lang.php b/application/language/bulgarian/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/bulgarian/export_lang.php +++ b/application/language/bulgarian/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/chinese_simplified/export_lang.php b/application/language/chinese_simplified/export_lang.php index e8623a120..235970df4 100644 --- a/application/language/chinese_simplified/export_lang.php +++ b/application/language/chinese_simplified/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "国家"; $lang['export_cabrillo_no_contests_in_log'] = "在日志中未发现任何竞赛"; $lang['export_cabrillo_no_contests_for_stationlocation'] = "没有找到该台站位置的竞赛"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/czech/export_lang.php b/application/language/czech/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/czech/export_lang.php +++ b/application/language/czech/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/dutch/export_lang.php b/application/language/dutch/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/dutch/export_lang.php +++ b/application/language/dutch/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/english/export_lang.php b/application/language/english/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/english/export_lang.php +++ b/application/language/english/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/finnish/export_lang.php b/application/language/finnish/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/finnish/export_lang.php +++ b/application/language/finnish/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/french/export_lang.php b/application/language/french/export_lang.php index cfe770f71..3540134dd 100644 --- a/application/language/french/export_lang.php +++ b/application/language/french/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Adresse - Pays"; $lang['export_cabrillo_no_contests_in_log'] = "Aucun concours trouvé dans votre journal de trafic"; $lang['export_cabrillo_no_contests_for_stationlocation'] = "Aucun concours trouvé pour cet emplacement de station!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/german/export_lang.php b/application/language/german/export_lang.php index ebf38343c..ad466594c 100644 --- a/application/language/german/export_lang.php +++ b/application/language/german/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Addresse Land"; $lang['export_cabrillo_no_contests_in_log'] = "Es wurden keine Contests in deinem Log gefunden."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "Für diesen Stationsstandort wurden keine vorhandenen Contests gefunden!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/greek/export_lang.php b/application/language/greek/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/greek/export_lang.php +++ b/application/language/greek/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/italian/export_lang.php b/application/language/italian/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/italian/export_lang.php +++ b/application/language/italian/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/polish/export_lang.php b/application/language/polish/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/polish/export_lang.php +++ b/application/language/polish/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/russian/export_lang.php b/application/language/russian/export_lang.php index 2c8b9273c..67536b05f 100644 --- a/application/language/russian/export_lang.php +++ b/application/language/russian/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Адрес (страна)"; $lang['export_cabrillo_no_contests_in_log'] = "В вашем логе конест-сессий не найдено."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "Для этого расположения станции контест-сессии не найдены!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/spanish/export_lang.php b/application/language/spanish/export_lang.php index 7b8d0cea0..4693046e9 100644 --- a/application/language/spanish/export_lang.php +++ b/application/language/spanish/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Dirección - País"; $lang['export_cabrillo_no_contests_in_log'] = "No se encontraron concursos en tu registro."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "¡No se encontraron concursos para esta localización de estación!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/swedish/export_lang.php b/application/language/swedish/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/swedish/export_lang.php +++ b/application/language/swedish/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/language/turkish/export_lang.php b/application/language/turkish/export_lang.php index dd3d81f86..e6493ad5a 100644 --- a/application/language/turkish/export_lang.php +++ b/application/language/turkish/export_lang.php @@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country"; $lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log."; $lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!"; +$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See https://toplist.darc.de)"; diff --git a/application/libraries/Frequency.php b/application/libraries/Frequency.php index 7a30ae8c8..5578f50af 100644 --- a/application/libraries/Frequency.php +++ b/application/libraries/Frequency.php @@ -5,87 +5,108 @@ class Frequency { '160m'=>array( 'SSB'=>"1900000", 'DATA'=>"1838000", - 'CW'=>"1830000"), + 'CW'=>"1830000", + 'NOMINAL'=>"1.8"), '80m'=>array( 'SSB'=>"3700000", 'DATA'=>"3583000", - "CW"=>"3550000"), + "CW"=>"3550000", + "NOMINAL"=>"3.5"), '60m'=>array( 'SSB'=>"5330000", 'DATA'=>"5330000", - "CW"=>"5260000"), + "CW"=>"5260000", + "NOMINAL"=>"5"), '40m'=>array( 'SSB'=>"7100000", 'DATA'=>"7040000", - 'CW'=>"7020000"), + 'CW'=>"7020000", + 'NOMINAL'=>"7"), '30m'=>array( 'SSB'=>"10120000", 'DATA'=>"10145000", - 'CW'=>"10120000"), + 'CW'=>"10120000", + 'NOMINAL'=>"10"), '20m'=>array( 'SSB'=>"14200000", 'DATA'=>"14080000", - 'CW'=>"14020000"), + 'CW'=>"14020000", + 'NOMINAL'=>"14"), '17m'=>array( 'SSB'=>"18130000", 'DATA'=>"18105000", - 'CW'=>"18080000"), + 'CW'=>"18080000", + 'NOMINAL'=>"18"), '15m'=>array( 'SSB'=>"21300000", 'DATA'=>"21080000", - 'CW'=>"21020000"), + 'CW'=>"21020000", + 'NOMINAL'=>"21"), '12m'=>array( 'SSB'=>"24950000", 'DATA'=>"24925000", - 'CW'=>"24900000"), + 'CW'=>"24900000", + 'NOMINAL'=>"24"), '10m'=>array( 'SSB'=>"28300000", 'DATA'=>"28120000", - 'CW'=>"28050000"), + 'CW'=>"28050000", + 'NOMINAL'=>"28"), '6m'=>array( 'SSB'=>"50150000", 'DATA'=>"50230000", - 'CW'=>"50090000"), + 'CW'=>"50090000", + 'NOMINAL'=>"50"), '4m'=>array( 'SSB'=>"70200000", 'DATA'=>"70200000", - 'CW'=>"70200000"), + 'CW'=>"70200000", + 'NOMINAL'=>"70"), '2m'=>array( 'SSB'=>"144300000", 'DATA'=>"144370000", - 'CW'=>"144050000"), + 'CW'=>"144050000", + 'NOMINAL'=>"144"), '1.25m'=>array( 'SSB'=>"222100000", 'DATA'=>"222100000", - 'CW'=>"222100000"), + 'CW'=>"222100000", + 'NOMINAL'=>"222"), '70cm'=>array( 'SSB'=>"432200000", 'DATA'=>"432088000", - 'CW'=>"432050000"), + 'CW'=>"432050000", + 'NOMINAL'=>"433"), '33cm'=>array( 'SSB'=>"902100000", 'DATA'=>"902100000", - 'CW'=>"902100000"), + 'CW'=>"902100000", + 'NOMINAL'=>"902"), '23cm'=>array( 'SSB'=>"1296000000", 'DATA'=>"1296138000", - 'CW'=>"129600000"), + 'CW'=>"129600000", + 'NOMINAL'=>"1296"), '13cm'=>array( 'SSB'=>"2320800000", 'DATA'=>"2320800000", - 'CW'=>"2320800000"), + 'CW'=>"2320800000", + 'NOMINAL'=>"2400"), '9cm'=>array( 'SSB'=>"3410000000", 'DATA'=>"3410000000", - 'CW'=>"3400000000"), + 'CW'=>"3400000000", + 'NOMINAL'=>"3400"), '6cm'=>array( 'SSB'=>"5670000000", 'DATA'=>"5670000000", - 'CW'=>"5670000000"), + 'CW'=>"5670000000", + 'NOMINAL'=>"5670"), '3cm'=>array( 'SSB'=>"10225000000", 'DATA'=>"10225000000", - 'CW'=>"10225000000") + 'CW'=>"10225000000", + 'NOMINAL'=>"10225") ); /* Class to convert band and mode into a frequency in a format based on the specifications of the database table */ diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 297803734..ada40f4df 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -3,11 +3,10 @@ class DXCC extends CI_Model { /** - * Function: mostactive - * Information: Returns the most active band - **/ - function info($callsign) - { + * Function: mostactive + * Information: Returns the most active band + **/ + function info($callsign) { $exceptions = $this->db->query(' SELECT * FROM `dxcc_exceptions` @@ -15,11 +14,9 @@ class DXCC extends CI_Model { LIMIT 1 '); - if ($exceptions->num_rows() > 0) - { + if ($exceptions->num_rows() > 0) { return $exceptions; } else { - $query = $this->db->query(' SELECT * FROM dxcc_entities @@ -32,10 +29,10 @@ class DXCC extends CI_Model { } } - function search(){ - print_r($this->input->get()); - return; - } + function search(){ + print_r($this->input->get()); + return; + } function empty_table($table) { $this->db->empty_table($table); @@ -52,9 +49,14 @@ class DXCC extends CI_Model { /* * Fetches a list of all current dxcc's (non-deleted) */ - function list_current() { + function list_current($orderer = 'name') { $this->db->where('end', null); - $this->db->order_by('name', 'ASC'); + + if ($orderer == 'name') { + $this->db->order_by('name', 'ASC'); + } elseif ($orderer == 'prefix') { + $this->db->order_by('prefix', 'ASC'); + } return $this->db->get('dxcc_entities'); } @@ -132,8 +134,7 @@ class DXCC extends CI_Model { if (isset($dxccMatrix)) { return $dxccMatrix; - } - else { + } else { return 0; } } @@ -173,39 +174,32 @@ class DXCC extends CI_Model { select col_dxcc from ".$this->config->item('table_name')." thcv where station_id in (" . $location_list . ") and col_dxcc > 0"; - $sql .= $this->addBandToQuery($band); - if ($postdata['mode'] != 'All') { $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; } - $sql .= " group by col_dxcc ) x on dxcc_entities.adif = x.col_dxcc";; - if ($postdata['includedeleted'] == NULL) { $sql .= " and dxcc_entities.end is null"; } - $sql .= $this->addContinentsToQuery($postdata); - $query = $this->db->query($sql); - return $query->result(); } function addBandToQuery($band) { - $sql = ''; - if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - } else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } - return $sql; - } + $sql = ''; + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + } else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + return $sql; + } function fetchDxcc($postdata) { $CI =& get_instance(); @@ -219,7 +213,7 @@ class DXCC extends CI_Model { $location_list = "'".implode("','",$logbooks_locations_array)."'"; $sql = "select adif, prefix, name, date(end) Enddate, date(start) Startdate, lat, `long` - from dxcc_entities"; + from dxcc_entities"; if ($postdata['notworked'] == NULL) { $sql .= " join (select col_dxcc from " . $this->config->item('table_name') . " where station_id in (" . $location_list . ") and col_dxcc > 0"; @@ -227,8 +221,7 @@ class DXCC extends CI_Model { if ($postdata['band'] != 'All') { if ($postdata['band'] == 'SAT') { $sql .= " and col_prop_mode ='" . $postdata['band'] . "'"; - } - else { + } else { $sql .= " and col_prop_mode !='SAT'"; $sql .= " and col_band ='" . $postdata['band'] . "'"; } @@ -257,12 +250,11 @@ class DXCC extends CI_Model { function getDxccWorked($location_list, $postdata) { $sql = "SELECT adif as dxcc FROM dxcc_entities - join ( - select col_dxcc - from ".$this->config->item('table_name')." thcv - where station_id in (" . $location_list . - ") and col_dxcc > 0"; - + join ( + select col_dxcc + from ".$this->config->item('table_name')." thcv + where station_id in (" . $location_list . + ") and col_dxcc > 0"; $sql .= $this->addBandToQuery($postdata['band']); if ($postdata['mode'] != 'All') { @@ -270,7 +262,6 @@ class DXCC extends CI_Model { } $sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0"; - $sql .= $this->addBandToQuery($postdata['band']); if ($postdata['mode'] != 'All') { @@ -278,31 +269,27 @@ class DXCC extends CI_Model { } $sql .= $this->addQslToQuery($postdata); - $sql .= ')'; - $sql .= " group by col_dxcc - ) ll on dxcc_entities.adif = ll.col_dxcc - where 1=1"; + ) ll on dxcc_entities.adif = ll.col_dxcc + where 1=1"; if ($postdata['includedeleted'] == NULL) { $sql .= " and dxcc_entities.end is null"; } $sql .= $this->addContinentsToQuery($postdata); - $query = $this->db->query($sql); - return $query->result(); } function getDxccConfirmed($location_list, $postdata) { $sql = "SELECT adif as dxcc FROM dxcc_entities - join ( - select col_dxcc - from ".$this->config->item('table_name')." thcv - where station_id in (". $location_list . - ") and col_dxcc > 0"; + join ( + select col_dxcc + from ".$this->config->item('table_name')." thcv + where station_id in (". $location_list . + ") and col_dxcc > 0"; $sql .= $this->addBandToQuery($postdata['band']); @@ -313,8 +300,8 @@ class DXCC extends CI_Model { $sql .= $this->addQslToQuery($postdata); $sql .= " group by col_dxcc - ) ll on dxcc_entities.adif = ll.col_dxcc - where 1=1"; + ) ll on dxcc_entities.adif = ll.col_dxcc + where 1=1"; if ($postdata['includedeleted'] == NULL) { $sql .= " and dxcc_entities.end is null"; @@ -394,8 +381,7 @@ class DXCC extends CI_Model { /* * Function gets worked and confirmed summary on each band on the active stationprofile */ - function get_dxcc_summary($bands, $postdata) - { + function get_dxcc_summary($bands, $postdata) { $CI =& get_instance(); $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -422,8 +408,7 @@ class DXCC extends CI_Model { return $dxccSummary; } - function getSummaryByBand($band, $postdata, $location_list) - { + function getSummaryByBand($band, $postdata, $location_list) { $sql = "SELECT count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv"; $sql .= " join dxcc_entities d on thcv.col_dxcc = d.adif"; @@ -435,11 +420,11 @@ class DXCC extends CI_Model { $this->load->model('bands'); $bandslots = $this->bands->get_worked_bands('dxcc'); - + $bandslots_list = "'".implode("','",$bandslots)."'"; - + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . - " and thcv.col_prop_mode !='SAT'"; + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -460,8 +445,7 @@ class DXCC extends CI_Model { return $query->result(); } - function getSummaryByBandConfirmed($band, $postdata, $location_list) - { + function getSummaryByBandConfirmed($band, $postdata, $location_list) { $sql = "SELECT count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv"; $sql .= " join dxcc_entities d on thcv.col_dxcc = d.adif"; @@ -473,11 +457,11 @@ class DXCC extends CI_Model { $this->load->model('bands'); $bandslots = $this->bands->get_worked_bands('dxcc'); - + $bandslots_list = "'".implode("','",$bandslots)."'"; - + $sql .= " and thcv.col_band in (" . $bandslots_list . ")" . - " and thcv.col_prop_mode !='SAT'"; + " and thcv.col_prop_mode !='SAT'"; } else { $sql .= " and thcv.col_prop_mode !='SAT'"; $sql .= " and thcv.col_band ='" . $band . "'"; @@ -489,7 +473,7 @@ class DXCC extends CI_Model { $sql .= $this->addQslToQuery($postdata); - + if ($postdata['includedeleted'] == NULL) { $sql .= " and d.end is null"; } @@ -501,8 +485,7 @@ class DXCC extends CI_Model { return $query->result(); } - function lookup_country($country) - { + function lookup_country($country) { $query = $this->db->query(' SELECT * FROM dxcc_entities diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 34724e284..324530e8f 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2121,6 +2121,57 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = return $query; } + function cfd_get_all_qsos($fromdate, $todate) { + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + // If date is set, we add it to the where-statement + if ($fromdate ?? ''!= "") { + $from=" AND date(q.COL_TIME_ON) >= '".$fromdate."'"; + } else { + $from=""; + } + if ($todate ?? '' != "") { + $till=" AND date(q.COL_TIME_ON) <= '".$todate."'"; + } else { + $till=''; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql="SELECT + dx.prefix,dx.name, + CASE + WHEN q.col_mode = 'CW' THEN 'C' + WHEN mo.qrgmode = 'DATA' THEN 'R' + WHEN mo.qrgmode = 'SSB' THEN 'F' + ELSE mo.qrgmode + END AS mode,q.col_band as band, + COUNT(1) as cnfmd + FROM ".$this->config->item('table_name')." q + INNER JOIN + dxcc_entities dx ON (dx.adif = q.COL_DXCC) + INNER JOIN + adif_modes mo ON (mo.mode = q.COL_MODE) + inner join bands b on (b.band=q.COL_BAND) + WHERE + (q.COL_QSL_RCVD = 'Y' + OR q.COL_LOTW_QSL_RCVD = 'Y' + OR q.COL_EQSL_QSL_RCVD = 'Y') + AND q.station_id in (".$location_list.") + AND (b.bandgroup='hf' or b.band = '6m') ".($from ?? '')." ".($till ?? '')." + GROUP BY dx.prefix,dx.name , CASE + WHEN q.col_mode = 'CW' THEN 'C' + WHEN mo.qrgmode = 'DATA' THEN 'R' + WHEN mo.qrgmode = 'SSB' THEN 'F' + ELSE mo.qrgmode + END,q.COL_BAND order by dx.prefix asc, q.col_band desc"; + + $query = $this->db->query($sql); + return $query; + + } + function totals_year() { $this->load->model('logbooks_model'); diff --git a/application/views/cfd/index.php b/application/views/cfd/index.php new file mode 100644 index 000000000..597611d9e --- /dev/null +++ b/application/views/cfd/index.php @@ -0,0 +1,29 @@ +
+
+

CFD

+ +
+
+ +
+ +
+ +
+
+
+ + +
+ +
+ + +
+
+
+ +
+
+
+
diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 5bb282630..668721d3b 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -313,6 +313,8 @@
  • + +
  • CFD Export
  • @@ -409,4 +411,4 @@ } }); }); - \ No newline at end of file + From 6fd999369b377fc366a6bd56258d293203ea88cc Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 9 Feb 2024 17:48:16 +0100 Subject: [PATCH 4/6] special thx to contributors --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 92fcaf980..7403b21b7 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ Wavelog-support can be reached by creating an issue here at github. If you've an ## Contributing +Special thanks to our contributors, who are part of Wavelog by improving code! +@abarrau, @dg0tm + If you would like to contribute in any way to Wavelog, it is most appreciated. This has been developed in free time, help coding new features or writing documentation is always useful. Please note that Wavelog was built using [Codeigniter](https://www.codeigniter.com/docs) version 3 and uses Bootstrap 5 for the user CSS framework documentation is available for this when building components. From 4c01cdc83cc9f603208101772fd5d39959e66468 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 9 Feb 2024 17:48:36 +0100 Subject: [PATCH 5/6] tag 1.1 --- application/config/migration.php | 2 +- application/migrations/180_tag_1_1.php | 36 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 application/migrations/180_tag_1_1.php diff --git a/application/config/migration.php b/application/config/migration.php index 652244a91..cba5ee184 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 179; +$config['migration_version'] = 180; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/180_tag_1_1.php b/application/migrations/180_tag_1_1.php new file mode 100644 index 000000000..a0de3e699 --- /dev/null +++ b/application/migrations/180_tag_1_1.php @@ -0,0 +1,36 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.1')); + + // Trigger Version Info Dialog + $this->db->where('option_type', 'version_dialog'); + $this->db->where('option_name', 'confirmed'); + $this->db->update('user_options', array('option_value' => 'false')); + + // Also set Version Dialog to "both" if only custom text is applied + $this->db->where('option_name', 'version_dialog'); + $this->db->where('option_value', 'custom_text'); + $this->db->update('options', array('option_value' => 'both')); + + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.0')); + } +} \ No newline at end of file From 9a92c7b18f9b9960f4211142dc8df94a8140eed8 Mon Sep 17 00:00:00 2001 From: HB9HIL <80885850+HB9HIL@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:54:22 +0100 Subject: [PATCH 6/6] typo --- application/views/interface_assets/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 5c0ae2b52..668721d3b 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -354,7 +354,7 @@
  • -
  • ^ +