From e50d24369ad92f20465a8f12e46106b651ae525e Mon Sep 17 00:00:00 2001 From: abarrau Date: Thu, 7 Mar 2024 09:28:41 +0100 Subject: [PATCH 01/44] remove map/custom reference --- application/controllers/Map.php | 15 ++---- application/views/interface_assets/footer.php | 50 ------------------- 2 files changed, 3 insertions(+), 62 deletions(-) diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 4e27c60ac..a906a9ca8 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -12,18 +12,9 @@ class Map extends CI_Controller { $this->load->model('logbook_model'); // set informations // - if ($this->input->post('isCustom') == true) { - $date_from = xss_clean($this->input->post('date_from')); - $date_to = xss_clean($this->input->post('date_to')); - $band = xss_clean($this->input->post('band')); - $mode = xss_clean($this->input->post('mode')); - $prop_mode = xss_clean($this->input->post('prop_mode')); - $qsos = $this->logbook_model->map_custom_qsos($date_from, $date_to, $band, $mode, $prop_mode); - } else { - $nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18; - $offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null; - $qsos = $this->logbook_model->get_qsos($nb_qso, $offset); - } + $nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18; + $offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null; + $qsos = $this->logbook_model->get_qsos($nb_qso, $offset); // [PLOT] ADD plot // $plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result()); // [MAP Custom] ADD Station // diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index d23fee3fb..04d634614 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -732,56 +732,6 @@ function showActivatorsMap(call, count, grids) { -uri->segment(1) == "map" && $this->uri->segment(2) == "custom") { ?> - - - - - uri->segment(1) == "" || $this->uri->segment(1) == "dashboard" ) { ?> From e6492c5d8dbd786ca423cb4630e0850413df897a Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 7 Mar 2024 09:47:03 +0100 Subject: [PATCH 02/44] sort states list alpabetical --- application/models/Logbook_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5de66c6b0..c625b7bb0 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4766,6 +4766,7 @@ function lotw_last_qsl_date($user_id) { public function get_states_by_dxcc($dxcc) { $this->db->where('adif', $dxcc); + $this->db->order_by('subdivision', 'ASC'); return $this->db->get('primary_subdivisions'); } From fa3fbeebdad39cd1bed8a6227cd49bb8623a9751 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 7 Mar 2024 09:47:49 +0100 Subject: [PATCH 03/44] move get_county function to lookup --- application/controllers/Lookup.php | 40 ++++++++++++++++++++++++++--- application/controllers/Qso.php | 35 ------------------------- application/controllers/Station.php | 34 ------------------------ 3 files changed, 36 insertions(+), 73 deletions(-) diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index 60079ac02..86e953614 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -131,24 +131,56 @@ class Lookup extends CI_Controller { public function get_state_list() { $this->load->library('subdivisions'); - + $dxcc = xss_clean($this->input->post('dxcc')); $states_result = $this->subdivisions->get_state_list($dxcc); $subdivision_name = $this->subdivisions->get_primary_subdivision_name($dxcc); - + if ($states_result->num_rows() > 0) { $states_array = $states_result->result_array(); - $result = array( + $result = array( 'status' => 'ok', 'subdivision_name' => $subdivision_name, 'data' => $states_array ); header('Content-Type: application/json'); - echo json_encode($result); + echo json_encode($result); } else { header('Content-Type: application/json'); echo json_encode(array('status' => 'No States for this DXCC in Database')); } } + + + public function get_county() { + $json = []; + + if(!empty($this->input->get("query"))) { + $county = $this->input->get("state"); + $cleanedcounty = explode('(', $county); + $cleanedcounty = trim($cleanedcounty[0]); + + $file = 'assets/json/US_counties.csv'; + + if (is_readable($file)) { + $lines = file($file, FILE_IGNORE_NEW_LINES); + $input = preg_quote($cleanedcounty, '~'); + $reg = '~^'. $input .'(.*)$~'; + $result = preg_grep($reg, $lines); + $json = []; + $i = 0; + foreach ($result as &$value) { + $county = explode(',', $value); + // Limit to 100 as to not slowdown browser too much + if (count($json) <= 100) { + $json[] = ["name"=>$county[1]]; + } + } + } + } + + header('Content-Type: application/json'); + echo json_encode($json); + } } diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index b197537bb..580e05223 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -500,41 +500,6 @@ class QSO extends CI_Controller { echo json_encode($json); } - /* - * Function is used for autocompletion of Counties in the station profile form - */ - public function get_county() { - $json = []; - - if(!empty($this->input->get("query"))) { - //$query = isset($_GET['query']) ? $_GET['query'] : FALSE; - $county = $this->input->get("state"); - $cleanedcounty = explode('(', $county); - $cleanedcounty = trim($cleanedcounty[0]); - - $file = 'assets/json/US_counties.csv'; - - if (is_readable($file)) { - $lines = file($file, FILE_IGNORE_NEW_LINES); - $input = preg_quote($cleanedcounty, '~'); - $reg = '~^'. $input .'(.*)$~'; - $result = preg_grep($reg, $lines); - $json = []; - $i = 0; - foreach ($result as &$value) { - $county = explode(',', $value); - // Limit to 100 as to not slowdown browser too much - if (count($json) <= 300) { - $json[] = ["name"=>$county[1]]; - } - } - } - } - - header('Content-Type: application/json'); - echo json_encode($json); - } - public function get_sota_info() { $this->load->library('sota'); diff --git a/application/controllers/Station.php b/application/controllers/Station.php index fd82eb55a..ef5ffcc1e 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -182,38 +182,4 @@ class Station extends CI_Controller redirect('stationsetup'); } - /* - * Function is used for autocompletion of Counties in the station profile form - */ - public function get_county() - { - $json = []; - - if (!empty($this->input->get("query"))) { - $query = isset($_GET['query']) ? $_GET['query'] : FALSE; - $county = $this->input->get("state"); - - $file = 'assets/json/US_counties.csv'; - - if (is_readable($file)) { - $lines = file($file, FILE_IGNORE_NEW_LINES); - $input = preg_quote($county, '~'); - $reg = '~^' . $input . '(.*)$~'; - $result = preg_grep($reg, $lines); - $json = []; - $i = 0; - foreach ($result as &$value) { - $county = explode(',', $value); - // Limit to 300 as to not slowdown browser too much - if (count($json) <= 300) { - $json[] = ["name" => $county[1]]; - } - } - } - } - - header('Content-Type: application/json'); - echo json_encode($json); - } - } From 9ee6ec398a6c59c5db5510502174f66a2c4f67dd Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 7 Mar 2024 10:02:58 +0100 Subject: [PATCH 04/44] removed selectize stuff from footer --- application/views/interface_assets/footer.php | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index d23fee3fb..c5c8f1ffb 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2559,64 +2559,6 @@ function viewEqsl(picture, callsign) { -uri->segment(1) == "station") { ?> - - - - uri->segment(2) == "counties" || $this->uri->segment(2) == "counties_details") { ?>