made one from two

This commit is contained in:
HB9HIL
2024-06-28 23:02:01 +02:00
parent 1d970cc9a3
commit cdd61846b4
2 changed files with 8 additions and 19 deletions

View File

@@ -156,7 +156,7 @@ class Logbookadvanced extends CI_Controller {
$this->load->model('logbookadvanced_model');
$qsoID = xss_clean($this->input->post('qsoID'));
$qso = $this->qso_info($qsoID)->row_array();
$qso = $this->logbook_model->qso_info($qsoID)->row_array();
if ($qso === null) {
header("Content-Type: application/json");
echo json_encode([]);
@@ -167,7 +167,7 @@ class Logbookadvanced extends CI_Controller {
if ($callbook['callsign'] ?? "" !== "") {
$this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook);
$qso = $this->qso_info($qsoID)->row_array();
$qso = $this->logbook_model->qso_info($qsoID)->row_array();
}
$qsoObj = new QSO($qso);
@@ -176,21 +176,6 @@ class Logbookadvanced extends CI_Controller {
echo json_encode($qsoObj->toArray());
}
/* Return QSO Info */
function qso_info($id) {
$this->load->model('logbook_model');
if ($this->logbook_model->check_qso_is_accessible($id)) {
$this->db->where('COL_PRIMARY_KEY', $id);
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
return $this->db->get($this->config->item('table_name'));
} else {
return;
}
}
function export_to_adif() {
ini_set('memory_limit', '-1');
set_time_limit(0);

View File

@@ -1621,11 +1621,15 @@ class Logbook_model extends CI_Model {
return $name;
}
/* Return QSO Info */
function qso_info($id) {
if ($this->logbook_model->check_qso_is_accessible($id)) {
if ($this->check_qso_is_accessible($id)) {
$this->db->where('COL_PRIMARY_KEY', $id);
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
return $this->db->get($this->config->item('table_name'));
} else {
return;