diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 224fa8d0..d00bebfe 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -50,6 +50,10 @@ class Logbook extends CI_Controller { //load the model and get results $data['results'] = $this->logbook_model->get_qsos($config['per_page'],$this->uri->segment(3)); + if(!$data['results']) { + $this->session->set_flashdata('notice', $this->lang->line('error_no_logbook_found') . ' Station Logbooks'); + } + // Calculate Lat/Lng from Locator to use on Maps if($this->session->userdata('user_locator')) { $this->load->library('qra'); diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index a3dc864d..90fbf0b1 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -118,3 +118,5 @@ $lang['dashboard_countries_breakdown'] = 'Countries Breakdown'; $lang['gen_from_date'] = 'From date'; $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on'; + +$lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:'; \ No newline at end of file diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ef107a06..d0408d85 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1018,7 +1018,10 @@ class Logbook_model extends CI_Model { $logbooks_locations_array = $StationLocationsArray; } - //$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_SUBMODE, '.$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.*'); + if (empty($logbooks_locations_array)) { + return array(); + } + $this->db->from($this->config->item('table_name')); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); diff --git a/application/models/Logbooks_model.php b/application/models/Logbooks_model.php index 05a8b98b..aede928f 100644 --- a/application/models/Logbooks_model.php +++ b/application/models/Logbooks_model.php @@ -207,7 +207,7 @@ class Logbooks_model extends CI_Model { return $relationships_array; } else{ - return false; + return array(); } } diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index b983842e..df31fcce 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -1,7 +1,10 @@

lang->line('gen_hamradio_logbook'); ?>

-
lang->line('gen_hamradio_logbook').": ".$this->logbooks_model->find_name($this->session->userdata('active_station_logbook')); ?> lang->line('general_word_location').": ".$this->stations->find_name(); ?>
+ +
lang->line('gen_hamradio_logbook').": ".$this->logbooks_model->find_name($this->session->userdata('active_station_logbook')); ?> lang->line('general_word_location').": ".$this->stations->find_name(); ?>
+ + session->flashdata('notice')) { ?>