diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 798bfd66..24b62b89 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -165,10 +165,15 @@ class Logbook extends CI_Controller { $this->db->where('COL_PROP_MODE !=','SAT'); } - $this->db->where('station_id', $station_id); $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4)); - $query = $this->db->get($this->config->item('table_name'), 1, 0); + $this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc"); + $this->db->limit(1); + + + $query = $this->db->get($this->config->item('table_name')); + + foreach ($query->result() as $workedBeforeRow) { return true; @@ -278,16 +283,25 @@ class Logbook extends CI_Controller { $this->load->view('view_log/qso'); $this->load->view('interface_assets/footer'); } - + function partial($id) { $this->load->model('user_model'); if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } - $html = ""; - $this->db->like('COL_CALL', $id); - $this->db->order_by("COL_TIME_ON", "desc"); + $html = ""; + + + $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_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->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', "desc"); + + $this->db->like($this->config->item('table_name').'.COL_CALL', $id); + $this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc"); $this->db->limit(5); - $query = $this->db->get($this->config->item('table_name')); + + $query = $this->db->get(); if ($query->num_rows() > 0) { @@ -296,10 +310,11 @@ class Logbook extends CI_Controller { $html .= "