diff --git a/application/controllers/Gridsquares.php b/application/controllers/Gridsquares.php index f1b94ec3..f1596c96 100644 --- a/application/controllers/Gridsquares.php +++ b/application/controllers/Gridsquares.php @@ -261,5 +261,21 @@ class Gridsquares extends CI_Controller { $this->load->view('gridsquares/index.php'); $this->load->view('interface_assets/footer'); } + + function search_band($band, $gridsquare){ + $this->load->model('gridsquares_model'); + header('Content-Type: application/json'); + $result = $this->gridsquares_model->search_band($band, $gridsquare); + + echo $result; + } + + function search_sat($gridsquare){ + $this->load->model('gridsquares_model'); + header('Content-Type: application/json'); + $result = $this->gridsquares_model->search_sat($gridsquare); + + echo $result; + } } \ No newline at end of file diff --git a/application/models/Gridsquares_model.php b/application/models/Gridsquares_model.php index d845a4b9..4a63e5de 100644 --- a/application/models/Gridsquares_model.php +++ b/application/models/Gridsquares_model.php @@ -76,4 +76,34 @@ class Gridsquares_model extends CI_Model { AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y") '); } + + function search_band($band, $gridsquare) { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $result = $this->db->query('SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" AND COL_BAND = "'.$band.'" + AND COL_PROP_MODE != "SAT" + AND COL_PROP_MODE != "INTERNET" + AND COL_PROP_MODE != "ECH" + AND COL_PROP_MODE != "RPT" + AND COL_SAT_NAME = "" + '); + + //print_r($result); + return json_encode($result->result()); + } + + function search_sat($gridsquare) { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $result = $this->db->query('SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_SAT_NAME FROM '.$this->config->item('table_name').' WHERE station_id = "'.$station_id.'" AND COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" + AND COL_PROP_MODE = "SAT" + '); + + //print_r($result); + return json_encode($result->result()); + } } \ No newline at end of file diff --git a/application/views/gridsquares/index.php b/application/views/gridsquares/index.php index 8c1a0094..6c46884b 100644 --- a/application/views/gridsquares/index.php +++ b/application/views/gridsquares/index.php @@ -47,23 +47,16 @@
| Date/Time | Callsign | Mode | Band | -Confirmation |
|---|---|---|---|---|
| - | - | - | - |