diff --git a/application/controllers/Gridsquares.php b/application/controllers/Gridsquares.php index 1e0d2755..bda7950a 100644 --- a/application/controllers/Gridsquares.php +++ b/application/controllers/Gridsquares.php @@ -17,7 +17,15 @@ class Gridsquares extends CI_Controller { public function index() { - $data['page_title'] = "Satellite Gridsquare Map"; + // if there are no satelite QSOs redirect to band selection directly + $this->load->model('logbook_model'); + $total_sat = $this->logbook_model->total_sat(); + if ($total_sat->num_rows() == 0) { + redirect('gridsquares/band/2m'); + return; + } + + $data['page_title'] = "Gridsquare Map"; $this->load->view('interface_assets/header', $data); $this->load->view('gridsquares/main.php'); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 3879173e..0b9b85b6 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1279,7 +1279,8 @@ class Logbook_model extends CI_Model { $this->db->select('COL_SAT_NAME, COUNT( * ) as count', FALSE); $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->where('COL_SAT_NAME !=', 'null'); + $this->db->where('COL_SAT_NAME is not null'); + $this->db->where('COL_SAT_NAME !=', ''); $this->db->group_by('COL_SAT_NAME'); $query = $this->db->get($this->config->item('table_name')); diff --git a/application/views/distances/index.php b/application/views/distances/index.php index ddfc40ea..916ddee2 100644 --- a/application/views/distances/index.php +++ b/application/views/distances/index.php @@ -8,18 +8,24 @@
- - + + + + + +
diff --git a/application/views/statistics/index.php b/application/views/statistics/index.php index 4a5c51c8..a01c4481 100644 --- a/application/views/statistics/index.php +++ b/application/views/statistics/index.php @@ -13,7 +13,7 @@ google.setOnLoadCallback(drawBandChart); - + num_rows() != 0) { ?> google.setOnLoadCallback(drawSatChart); @@ -208,14 +208,16 @@
- + num_rows() != 0) { ?> + +