diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 356f4c74a..42b6bd946 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -72,7 +72,7 @@ class Map extends CI_Controller { $station_id = ($station_id === 'all') ? null : $station_id; try { - $qsos = $this->Map_model->get_qsos_by_country($country, $station_id, $limit); + $qsos = $this->Map_model->get_qsos_by_country($country, $station_id); if (empty($qsos)) { while (ob_get_level()) ob_end_clean(); diff --git a/application/models/Map_model.php b/application/models/Map_model.php index b20b29d0e..410ac75ad 100644 --- a/application/models/Map_model.php +++ b/application/models/Map_model.php @@ -6,13 +6,12 @@ class Map_model extends CI_Model { * Get available countries from the logbook with QSOs */ public function get_available_countries() { - $this->db->select('DISTINCT COL_COUNTRY, COL_DXCC, COUNT(*) as qso_count', FALSE); + $this->db->select('DISTINCT dxcc_entities.name AS COL_COUNTRY, COL_DXCC, COUNT(*) as qso_count', FALSE); $this->db->from($this->config->item('table_name')); - $this->db->join('station_profile', 'station_profile.station_id = ' . $this->config->item('table_name') . '.station_id'); - $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); - $this->db->where('COL_COUNTRY IS NOT NULL'); - $this->db->where('COL_COUNTRY !=', ''); - $this->db->where("LENGTH(COL_GRIDSQUARE) >=", 6); // At least 6 chars + $this->db->join('station_profile', 'station_profile.station_id = ' . $this->config->item('table_name') . '.station_id'); + $this->db->join('dxcc_entities', 'dxcc_entities.adif = ' . $this->config->item('table_name') . '.COL_DXCC'); + $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); + $this->db->where("LENGTH(COL_GRIDSQUARE) >=", 6); // At least 6 chars $this->db->group_by('COL_COUNTRY, COL_DXCC'); $this->db->order_by('COL_COUNTRY'); diff --git a/application/views/map/qso_map.php b/application/views/map/qso_map.php index 0b7ee0160..658109ce5 100644 --- a/application/views/map/qso_map.php +++ b/application/views/map/qso_map.php @@ -7,9 +7,9 @@ @@ -284,9 +284,9 @@ function initMap() { if (dxcc && supportedDxccs.includes(parseInt(dxcc))) { // Single country GeoJSON $.ajax({ - url: base_url + "map/get_country_geojson/", + url: base_url + "index.php/map/get_country_geojson/", type: 'post', - data: { dxcc: dxcc }, + data: { dxcc: dxcc }, success: function(geojson) { if (geojson && !geojson.error) { const layer = L.geoJSON(geojson, {