diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index b9182213..f20a2874 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -188,6 +188,23 @@ class Dashboard extends CI_Controller } } + public function todays_qso_component() { + $this->load->model('user_model'); + + if ($this->user_model->validate_session() == 0) { + // User is not logged in + } else { + $this->load->model('logbook_model'); + $this->load->model('logbooks_model'); + } + + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array); + $this->load->view('components/dashboard_todays_qsos', $data); + + } + public function logbook_display_component() { $this->load->model('user_model'); diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 7da3a444..9440fc19 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -64,7 +64,7 @@ class Debug extends CI_Controller { return false; } - + public function flags() { // load library called DxccFlag diff --git a/application/views/components/dashboard_todays_qsos.php b/application/views/components/dashboard_todays_qsos.php new file mode 100644 index 00000000..2dfac0db --- /dev/null +++ b/application/views/components/dashboard_todays_qsos.php @@ -0,0 +1,11 @@ +
+ = 1) { ?> + + + + +
\ No newline at end of file diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index fb4311ad..3687406c 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -156,7 +156,7 @@
- @@ -175,6 +175,363 @@
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ + + +
diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index f7163725..997e3e73 100644 --- a/assets/js/sections/station_locations.js +++ b/assets/js/sections/station_locations.js @@ -9,23 +9,43 @@ $(document).ready( function () { } }); - $("#canada_state").hide(); + var stateMap = { + '1': 'canada_state', + '5': 'aland_state', + '15': 'asiatic_russia_state', + '27': 'belarus_state', + '50': 'mexico_state', + '54': 'eu_russia_state', + '100': 'argentina_state', + '108': 'brazil_state', + '112': 'chile_state', + '132': 'paraguay_state', + '137': 'korea_state', + '144': 'uruguay_state' + }; + + // Hide all states initially + $("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state").hide(); var selectedDXCCID = $('#dxcc_select').find(":selected").val(); + var stateToShow = stateMap[selectedDXCCID]; - if(selectedDXCCID == '1'){ - $("#canada_state").show(); - $("#us_state").hide(); + if (stateToShow) { + // Show the selected state + $("#" + stateToShow).show(); + } else { + // If no state matches the selected value, show 'us_state' by default + $("#us_state").show(); } $('#dxcc_select').change(function(){ - if($(this).val() == '1'){ // or this.value == 'volvo' - console.log("CANADA!"); - $("#canada_state").show(); - $("#us_state").hide(); - } else { - $("#canada_state").hide(); - $("#us_state").show(); - } + var selectedValue = $(this).val(); + var stateToShow = stateMap[selectedValue] || stateMap['default']; + + // Hide all states + $("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state").hide(); + + // Show the selected state + $("#" + stateToShow).show(); }); } );