kopia lustrzana https://github.com/magicbug/Cloudlog
[Hamsat] when checking grid only use first 4 characters.
rodzic
3ad075d3d6
commit
1e21493c93
|
@ -2057,6 +2057,37 @@ class Logbook_model extends CI_Model
|
|||
return $query->num_rows();
|
||||
}
|
||||
|
||||
function check_if_grid_4char_worked_in_logbook($grid, $StationLocationsArray = null, $band = null)
|
||||
{
|
||||
if ($StationLocationsArray == null) {
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
$this->db->select('COL_GRIDSQUARE');
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->group_start();
|
||||
$this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4));
|
||||
$this->db->group_end();
|
||||
|
||||
if ($band != null && $band != 'SAT') {
|
||||
$this->db->where('COL_BAND', $band);
|
||||
} else if ($band == 'SAT') {
|
||||
// Where col_sat_name is not empty
|
||||
$this->db->where('COL_SAT_NAME !=', '');
|
||||
}
|
||||
$this->db->limit('2');
|
||||
|
||||
$query = $this->db->get($this->config->item('table_name'));
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
|
||||
/* Get all QSOs with a valid grid for use in the KML export */
|
||||
function kml_get_all_qsos($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate)
|
||||
{
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<?php
|
||||
// Load the logbook model and call check_if_grid_worked_in_logbook
|
||||
foreach ($rove['grids'] as $grid) {
|
||||
$worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT");
|
||||
$worked = $CI->logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT");
|
||||
if ($worked != 0) {
|
||||
echo " <span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">" . $grid . "</span>";
|
||||
} else {
|
||||
|
|
Ładowanie…
Reference in New Issue