diff --git a/application/models/Qsl_model.php b/application/models/Qsl_model.php index 1fdc317b..89012444 100644 --- a/application/models/Qsl_model.php +++ b/application/models/Qsl_model.php @@ -5,13 +5,17 @@ class Qsl_model extends CI_Model { $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->select('*'); - $this->db->from($this->config->item('table_name')); - $this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key'); - $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->order_by("id", "desc"); - - return $this->db->get(); + if (is_array($logbooks_locations_array) && !empty($logbooks_locations_array)) { + $this->db->select('*'); + $this->db->from($this->config->item('table_name')); + $this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key'); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->order_by("id", "desc"); + + return $this->db->get(); + } else { + return false; + } } function getQslForQsoId($id) { diff --git a/application/views/qslcard/index.php b/application/views/qslcard/index.php index 38cb3f05..1c9933cc 100644 --- a/application/views/qslcard/index.php +++ b/application/views/qslcard/index.php @@ -18,7 +18,7 @@ $custom_date_format = $this->config->item('qso_date_format'); } - if (is_array($qslarray->result())) { + if ($qslarray !== FALSE && is_array($qslarray->result())) { echo ' @@ -57,6 +57,8 @@ } echo '
'; + } else { + echo ''; } ?>