diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 81e048a8..bbb09ada 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -40,7 +40,7 @@ class Logbook extends CI_Controller { $config['cur_tag_close'] = ''; $this->pagination->initialize($config); - + //load the model and get results $data['results'] = $this->logbook_model->get_qsos($config['per_page'],$this->uri->segment(3)); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 24075d9f..debeeca1 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -916,10 +916,14 @@ class Logbook_model extends CI_Model { return $query; } - function get_qsos($num, $offset) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function get_qsos($num, $offset, $StationLocationsArray) { + if($StationLocationsArray == null) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } else { + $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.*'); $this->db->from($this->config->item('table_name')); @@ -1507,10 +1511,26 @@ class Logbook_model extends CI_Model { } else { - return false; + $QSLBreakdown['QSL_Sent'] = 0; + $QSLBreakdown['QSL_Received'] = 0; + $QSLBreakdown['QSL_Requested'] = 0; + $QSLBreakdown['eQSL_Sent'] = 0; + $QSLBreakdown['eQSL_Received'] = 0; + $QSLBreakdown['LoTW_Sent'] = 0; + $QSLBreakdown['LoTW_Received'] = 0; + + return $QSLBreakdown; } } else { - return false; + $QSLBreakdown['QSL_Sent'] = 0; + $QSLBreakdown['QSL_Received'] = 0; + $QSLBreakdown['QSL_Requested'] = 0; + $QSLBreakdown['eQSL_Sent'] = 0; + $QSLBreakdown['eQSL_Received'] = 0; + $QSLBreakdown['LoTW_Sent'] = 0; + $QSLBreakdown['LoTW_Received'] = 0; + + return $QSLBreakdown; } } @@ -1766,10 +1786,18 @@ class Logbook_model extends CI_Model { } else { - return false; + $CountriesBreakdown['Countries_Worked'] = 0; + $CountriesBreakdown['Countries_Worked_QSL'] = 0; + $CountriesBreakdown['Countries_Worked_EQSL'] = 0; + $CountriesBreakdown['Countries_Worked_LOTW'] = 0; + return $CountriesBreakdown; } } else { - return false; + $CountriesBreakdown['Countries_Worked'] = 0; + $CountriesBreakdown['Countries_Worked_QSL'] = 0; + $CountriesBreakdown['Countries_Worked_EQSL'] = 0; + $CountriesBreakdown['Countries_Worked_LOTW'] = 0; + return $CountriesBreakdown; } }