diff --git a/application/models/Gridsquares_model.php b/application/models/Gridsquares_model.php index 149bd365..0fb5705a 100644 --- a/application/models/Gridsquares_model.php +++ b/application/models/Gridsquares_model.php @@ -82,7 +82,7 @@ class Gridsquares_model extends CI_Model { $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.'" + $result = $this->db->query('SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_GRIDSQUARE 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" @@ -99,7 +99,7 @@ class Gridsquares_model extends CI_Model { $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"'); + $result = $this->db->query('SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_SAT_NAME, COL_GRIDSQUARE 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()); diff --git a/application/views/gridsquares/index.php b/application/views/gridsquares/index.php index 6c46884b..38890527 100644 --- a/application/views/gridsquares/index.php +++ b/application/views/gridsquares/index.php @@ -41,7 +41,7 @@ - \ No newline at end of file + diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index e0474c5b..d873a394 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -906,6 +906,7 @@ $(document).ready(function(){ var lng = LatLng.lng; var locator = LatLng2Loc(lat,lng, 10); var loc_4char = locator.substring(0, 4); + var count = 0; console.log(loc_4char); console.log(map.getZoom()); @@ -921,16 +922,24 @@ $(document).ready(function(){ } $.getJSON( "" + search_tags, function( data ) { + count = Object.keys(data).length; + console.log("Count: " + count); var items = []; $.each( data, function( i, item ) { console.log(item.COL_CALL + item.COL_SAT_NAME); if(item.COL_SAT_NAME != undefined) { - items.push( "" + item.COL_TIME_ON + "" + item.COL_CALL + "" + item.COL_MODE + "" + item.COL_SAT_NAME + "" ); + items.push( "" + item.COL_TIME_ON + "" + item.COL_CALL + "" + item.COL_MODE + "" + item.COL_SAT_NAME + "" + item.COL_GRIDSQUARE + "" ); } else { - items.push( "" + item.COL_TIME_ON + "" + item.COL_CALL + "" + item.COL_MODE + "" + item.COL_BAND + "" ); + items.push( "" + item.COL_TIME_ON + "" + item.COL_CALL + "" + item.COL_MODE + "" + item.COL_BAND + "" + item.COL_GRIDSQUARE + "" ); } }); + $('#qso_count').text(count); + if (count > 1) { + $('#gt1_qso').text("s"); + } else { + $('#gt1_qso').text(""); + } $("#grid_results tbody").empty(); $("#grid_results tbody").append(items.join( "" ));