From d11ff35bfb2b111c2a5508398b0abb0f1445805a Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 12 Oct 2024 16:56:04 +0200 Subject: [PATCH] Custom maps: set dates to full log range + submodes filter fix + some wording fixes --- application/controllers/Map.php | 13 +++++++-- .../language/bulgarian/general_words_lang.php | 2 ++ .../chinese_simplified/general_words_lang.php | 2 ++ .../language/czech/general_words_lang.php | 2 ++ .../language/dutch/general_words_lang.php | 2 ++ .../language/english/general_words_lang.php | 2 ++ .../language/finnish/general_words_lang.php | 2 ++ .../language/french/general_words_lang.php | 2 ++ .../language/german/general_words_lang.php | 2 ++ .../language/greek/general_words_lang.php | 2 ++ .../language/italian/general_words_lang.php | 2 ++ .../language/polish/general_words_lang.php | 2 ++ .../language/russian/general_words_lang.php | 2 ++ .../language/spanish/general_words_lang.php | 2 ++ .../language/swedish/general_words_lang.php | 2 ++ .../language/turkish/general_words_lang.php | 2 ++ application/models/Logbook_model.php | 9 ++++++ application/views/interface_assets/footer.php | 15 ++++++++-- application/views/map/custom_date.php | 28 +++++++++---------- 19 files changed, 75 insertions(+), 20 deletions(-) diff --git a/application/controllers/Map.php b/application/controllers/Map.php index d26fe437..f634d0dd 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -10,10 +10,10 @@ class Map extends CI_Controller { function custom() { $this->load->model('bands'); - $this->load->model('modes'); + $this->load->model('gridmap_model'); - $data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select - $data['modes'] = $this->modes->active(); // Used in the view for mode select + $data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select + $data['modes'] = $this->gridmap_model->get_worked_modes(); // Used in the view for mode select if ($this->input->post('band') != NULL) { // Band is not set when page first loads. if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands @@ -99,4 +99,11 @@ class Map extends CI_Controller { } } + + // Function to fetch the date of the oldest QSO in the log + public function get_oldest_qso_date() { + $this->load->model('logbook_model'); + $oldestQSOdate = $this->logbook_model->get_oldest_qso_date(); + echo $oldestQSOdate; + } } \ No newline at end of file diff --git a/application/language/bulgarian/general_words_lang.php b/application/language/bulgarian/general_words_lang.php index 1b5a159a..b45ca622 100644 --- a/application/language/bulgarian/general_words_lang.php +++ b/application/language/bulgarian/general_words_lang.php @@ -230,3 +230,5 @@ $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go db->query('SELECT DATE(min(col_time_on)) as oldest_qso_date FROM TABLE_HRD_CONTACTS_V01'); + $row = $query->row(); + if (isset($row)) { + return $row->oldest_qso_date; + } + } } function validateADIFDate($date, $format = 'Ymd') diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index e355472b..a66d3b7a 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -797,9 +797,20 @@ if ($this->session->userdata('user_id') != null) { }; initplot(qso_loc, customdata); }) - - }); + + function get_oldest_qso_date() { + $.ajax({ + url: base_url + 'index.php/map/get_oldest_qso_date', + type: 'post', + success: function(data) { + document.getElementById('from').value = data; + document.getElementById('to').value = new Date().toISOString().split('T')[0]; + }, + error: function() { + }, + }); + } diff --git a/application/views/map/custom_date.php b/application/views/map/custom_date.php index 365fe1f2..94dd06db 100644 --- a/application/views/map/custom_date.php +++ b/application/views/map/custom_date.php @@ -1,6 +1,6 @@

-

logbook QSOs (Custom Date)

+

QSOs (Custom Dates)

session->flashdata('notice')) { ?> + +
+ +
@@ -34,21 +38,14 @@
-
- + + @@ -82,7 +80,7 @@
-
+
@@ -96,4 +94,4 @@
- \ No newline at end of file + \ No newline at end of file