Also calculate distance for VUCC_GRIDS

pull/2278/head
phl0 2023-07-12 18:02:12 +02:00
rodzic fb7c448b58
commit 2a91352b91
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -2674,8 +2674,6 @@ class Logbook_model extends CI_Model {
$data = array(
'COL_DISTANCE' => 0
);
if ($qsl_gridsquare != "") {
$data['COL_GRIDSQUARE'] = $qsl_gridsquare;
$this->db->select('station_profile.station_gridsquare as station_gridsquare');
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');
$this->db->where('COL_CALL', $callsign);
@ -2684,14 +2682,17 @@ class Logbook_model extends CI_Model {
$this->db->limit(1);
$query = $this->db->get($this->config->item('table_name'));
$row = $query->row();
$station_gridsquare = '';
if (isset($row)) {
$station_gridsquare = $row->station_gridsquare;
$this->load->library('Qra');
$data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K');
}
} elseif ($qsl_vucc_grids != "") {
$data['COL_VUCC_GRIDS'] = $qsl_vucc_grids;
$this->load->library('Qra');
if ($qsl_gridsquare != "") {
$data['COL_GRIDSQUARE'] = $qsl_gridsquare;
$data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K');
} elseif ($qsl_vucc_grids != "") {
$data['COL_VUCC_GRIDS'] = $qsl_vucc_grids;
$data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_vucc_grids, 'K');
}
$this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"');