Add QSO count and Locator to details table

这个提交包含在:
phl0 2020-04-20 21:05:00 +02:00
父节点 92ba091872
当前提交 3b01617768
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 3 个文件被更改,包括 10 次插入5 次删除

查看文件

@ -82,7 +82,7 @@ class Gridsquares_model extends CI_Model {
$CI->load->model('Stations'); $CI->load->model('Stations');
$station_id = $CI->Stations->find_active(); $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 != "SAT"
AND COL_PROP_MODE != "INTERNET" AND COL_PROP_MODE != "INTERNET"
AND COL_PROP_MODE != "ECH" AND COL_PROP_MODE != "ECH"
@ -99,7 +99,7 @@ class Gridsquares_model extends CI_Model {
$CI->load->model('Stations'); $CI->load->model('Stations');
$station_id = $CI->Stations->find_active(); $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); //print_r($result);
return json_encode($result->result()); return json_encode($result->result());

查看文件

@ -41,7 +41,7 @@
<div class="modal-dialog modal-xl" role="document"> <div class="modal-dialog modal-xl" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">QSOs in Square: <span id="square_number"></span></h5> <h5 class="modal-title" id="exampleModalLabel"><span id="qso_count"></span> QSOs in Square: <span id="square_number"></span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
@ -54,6 +54,7 @@
<th scope="col">Callsign</th> <th scope="col">Callsign</th>
<th scope="col">Mode</th> <th scope="col">Mode</th>
<th scope="col">Band</th> <th scope="col">Band</th>
<th scope="col">Locator</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

查看文件

@ -906,6 +906,7 @@ $(document).ready(function(){
var lng = LatLng.lng; var lng = LatLng.lng;
var locator = LatLng2Loc(lat,lng, 10); var locator = LatLng2Loc(lat,lng, 10);
var loc_4char = locator.substring(0, 4); var loc_4char = locator.substring(0, 4);
var count = 0;
console.log(loc_4char); console.log(loc_4char);
console.log(map.getZoom()); console.log(map.getZoom());
@ -921,16 +922,19 @@ $(document).ready(function(){
} }
$.getJSON( "<?php echo site_url('gridsquares/');?>" + search_tags, function( data ) { $.getJSON( "<?php echo site_url('gridsquares/');?>" + search_tags, function( data ) {
count = Object.keys(data).length;
console.log("Count: " + count);
var items = []; var items = [];
$.each( data, function( i, item ) { $.each( data, function( i, item ) {
console.log(item.COL_CALL + item.COL_SAT_NAME); console.log(item.COL_CALL + item.COL_SAT_NAME);
if(item.COL_SAT_NAME != undefined) { if(item.COL_SAT_NAME != undefined) {
items.push( "<tr><td>" + item.COL_TIME_ON + "</td><td>" + item.COL_CALL + "</td><td>" + item.COL_MODE + "</td><td>" + item.COL_SAT_NAME + "</td></tr>" ); items.push( "<tr><td>" + item.COL_TIME_ON + "</td><td>" + item.COL_CALL + "</td><td>" + item.COL_MODE + "</td><td>" + item.COL_SAT_NAME + "</td><td>" + item.COL_GRIDSQUARE + "</td></tr>" );
} else { } else {
items.push( "<tr><td>" + item.COL_TIME_ON + "</td><td>" + item.COL_CALL + "</td><td>" + item.COL_MODE + "</td><td>" + item.COL_BAND + "</td></tr>" ); items.push( "<tr><td>" + item.COL_TIME_ON + "</td><td>" + item.COL_CALL + "</td><td>" + item.COL_MODE + "</td><td>" + item.COL_BAND + "</td><td>" + item.COL_GRIDSQUARE + "</td></tr>" );
} }
}); });
$('#qso_count').text(count);
$("#grid_results tbody").empty(); $("#grid_results tbody").empty();
$("#grid_results tbody").append(items.join( "" )); $("#grid_results tbody").append(items.join( "" ));