diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index 5082220f6..9beae0b32 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -57,6 +57,7 @@ class Gridmap extends CI_Controller { } public function getGridsjs() { + $call = $this->input->post('call', TRUE); $band = $this->input->post('band', TRUE); $mode = $this->input->post('mode', TRUE); $qsl = $this->input->post('qsl', TRUE); @@ -93,7 +94,7 @@ class Gridmap extends CI_Controller { $grid_4char_confirmed = ""; $grid_6char_confirmed = ""; - $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto); + $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto, null, $call); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -120,7 +121,7 @@ class Gridmap extends CI_Controller { } } - $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto); + $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto, null, $call); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -147,7 +148,7 @@ class Gridmap extends CI_Controller { } } } - $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto); + $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, null, $call); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { @@ -193,7 +194,7 @@ class Gridmap extends CI_Controller { } // // Confirmed Squares - $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto); + $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, null, $call); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { diff --git a/application/models/Gridmap_model.php b/application/models/Gridmap_model.php index 014b86d61..746595a06 100644 --- a/application/models/Gridmap_model.php +++ b/application/models/Gridmap_model.php @@ -2,7 +2,7 @@ class Gridmap_model extends CI_Model { - function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL) { + function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') { if ($logbooks_locations_array == NULL) { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -21,6 +21,11 @@ class Gridmap_model extends CI_Model { .' WHERE station_id in (' .$location_list.') AND COL_GRIDSQUARE != ""'; + if ($call != '' && $call != '*') { + $sql .= " and col_call = ?"; + $binding[] = $call; + } + if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode = ? "; @@ -84,7 +89,7 @@ class Gridmap_model extends CI_Model { return $this->db->query($sql, $binding); } - function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL) { + function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') { if ($logbooks_locations_array == NULL) { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -103,6 +108,11 @@ class Gridmap_model extends CI_Model { .' WHERE station_id in (' .$location_list.') AND COL_GRIDSQUARE != ""'; + if ($call != '' && $call != '*') { + $sql .= " and col_call = ?"; + $binding[] = $call; + } + if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode = ?"; @@ -164,7 +174,7 @@ class Gridmap_model extends CI_Model { return $this->db->query($sql, $binding); } - function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL) { + function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -181,6 +191,11 @@ class Gridmap_model extends CI_Model { .' WHERE station_id in (' .$location_list.') AND COL_VUCC_GRIDS != ""'; + if ($call != '' && $call != '*') { + $sql .= " and col_call = ?"; + $binding[] = $call; + } + if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode = ?"; @@ -236,7 +251,7 @@ class Gridmap_model extends CI_Model { return $this->db->query($sql, $binding); } - function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL) { + function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -253,6 +268,11 @@ class Gridmap_model extends CI_Model { .' WHERE station_id in (' .$location_list.') AND COL_VUCC_GRIDS != ""'; + if ($call != '' && $call != '*') { + $sql .= " and col_call = ?"; + $binding[] = $call; + } + if ($band != 'All') { if ($band == 'SAT') { $sql .= " and col_prop_mode = ?"; diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index 2728de6b8..55ad324b7 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -52,6 +52,13 @@ +