Fetches state from previous QSO. Fixes #854

pull/871/head
Andreas 2021-02-08 13:40:07 +01:00
rodzic 0d2fe0a43b
commit c35d0d257e
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -130,6 +130,7 @@ class Logbook extends CI_Controller {
$return['callsign_qth'] = $this->logbook_model->call_qth($callsign);
$return['callsign_iota'] = $this->logbook_model->call_iota($callsign);
$return['qsl_manager'] = $this->logbook_model->call_qslvia($callsign);
$return['callsign_state'] = $this->logbook_model->call_state($callsign);
$return['bearing'] = $this->bearing($return['callsign_qra'], $measurement_base);
$return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode);

Wyświetl plik

@ -661,6 +661,26 @@ class Logbook_model extends CI_Model {
return $qsl_via;
}
function call_state($callsign) {
$this->db->select('COL_CALL, COL_STATE');
$this->db->where('COL_CALL', $callsign);
$where = "COL_NAME != \"\"";
$this->db->where($where);
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(1);
$query = $this->db->get($this->config->item('table_name'));
$name = "";
if ($query->num_rows() > 0)
{
$data = $query->row();
$qsl_state = $data->COL_STATE;
}
return $qsl_state;
}
function call_qth($callsign) {
$this->db->select('COL_CALL, COL_QTH, COL_TIME_ON');
$this->db->where('COL_CALL', $callsign);