diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index d4ad916a..b1bf28c0 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -260,8 +260,8 @@ class Logbook extends CI_Controller { $this->load->library('qra'); - $this->db->where('COL_PRIMARY_KEY', $id); - $data['query'] = $this->db->get($this->config->item('table_name')); + $this->load->model('logbook_model'); + $data['query'] = $this->logbook_model->get_qso($id); $this->load->view('interface_assets/mini_header', $data); $this->load->view('view_log/qso'); @@ -340,11 +340,17 @@ class Logbook extends CI_Controller { if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } - $this->db->like('COL_CALL', $id); - $this->db->or_like('COL_GRIDSQUARE', $id); - $this->db->or_like('COL_VUCC_GRIDS', $id); - $this->db->order_by("COL_TIME_ON", "desc"); - $query = $this->db->get($this->config->item('table_name')); + $this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_NAME, '.$this->config->item('table_name').'.COL_COUNTRY, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*'); + + $this->db->from($this->config->item('table_name')); + + $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); + + $this->db->like(''.$this->config->item('table_name').'.COL_CALL', $id); + $this->db->or_like(''.$this->config->item('table_name').'.COL_GRIDSQUARE', $id); + $this->db->or_like(''.$this->config->item('table_name').'.COL_VUCC_GRIDS', $id); + $this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', 'desc'); + $query = $this->db->get(); if ($query->num_rows() > 0) { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index cb8d4a2c..4057de3f 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -425,7 +425,7 @@ class Logbook_model extends CI_Model { $this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_NAME, '.$this->config->item('table_name').'.COL_COUNTRY, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*'); $this->db->from($this->config->item('table_name')); - $this->db->join('station_profile', 'station_profile.station_id = TABLE_HRD_CONTACTS_V01.station_id'); + $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', "desc"); $this->db->limit($num); @@ -434,6 +434,16 @@ class Logbook_model extends CI_Model { return $this->db->get(); } + function get_qso($id) { + $this->db->select(''.$this->config->item('table_name').'.*, station_profile.*'); + $this->db->from($this->config->item('table_name')); + + $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); + $this->db->where('COL_PRIMARY_KEY', $id); + + return $this->db->get(); + } + function get_clublog_qsos(){ $this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null); $this->db->or_where("COL_CLUBLOG_QSO_UPLOAD_STATUS", ""); diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 32b4f79a..3c957c57 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -156,16 +156,33 @@
| Station Callsign | -COL_STATION_CALLSIGN; ?> | +station_callsign; ?> |
| Station Gridsquare | -COL_MY_GRIDSQUARE; ?> | +station_gridsquare; ?> |
| Station City: | +station_city; ?> | +|
| Station Country: | +station_country; ?> | +|
| Station Operator | COL_OPERATOR; ?> |