diff --git a/application/models/Timeline_model.php b/application/models/Timeline_model.php index ed0df9ef9..e5b4738d8 100644 --- a/application/models/Timeline_model.php +++ b/application/models/Timeline_model.php @@ -369,7 +369,8 @@ class Timeline_model extends CI_Model { foreach ($col_gridsquare as $grid) { $timeline[] = array( 'gridsquare' => $grid->gridsquare, - 'date' => $grid->date); + 'date' => $grid->date, + 'sat_name' => $grid->sat_name ?? ''); } $col_vucc_grids = $this->get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); @@ -383,7 +384,8 @@ class Timeline_model extends CI_Model { // Doesn't exist, add new entry $timeline[] = array( 'gridsquare' => $grid_four, - 'date' => $gridSplit->date + 'date' => $gridSplit->date, + 'sat_name' => $gridSplit->sat_name ?? '' ); } else { // Exists, check the date @@ -403,8 +405,11 @@ class Timeline_model extends CI_Model { public function get_gridsquare($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) { $binding = []; - $sql = "select min(COL_TIME_ON) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from " - .$this->config->item('table_name'). " thcv + $sql = "select min(COL_TIME_ON) date, upper(substring(col_gridsquare, 1, 4)) gridsquare "; + if ($propmode == 'SAT') { + $sql .= ", COL_SAT_NAME as sat_name "; + } + $sql .= "from ".$this->config->item('table_name'). " thcv where station_id in (" . $location_list . ")"; if ($band == 'SAT') { // Left for compatibility reasons @@ -440,8 +445,11 @@ class Timeline_model extends CI_Model { $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz); - $sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4)) - order by date desc"; + $sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4)) "; + if ($propmode == 'SAT') { + $sql .= ", sat_name "; + } + $sql .= "order by date desc"; $query = $this->db->query($sql, $binding); @@ -450,8 +458,11 @@ class Timeline_model extends CI_Model { public function get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) { $binding = []; - $sql = "select COL_TIME_ON as date, upper(col_vucc_grids) gridsquare from " - .$this->config->item('table_name'). " thcv + $sql = "select COL_TIME_ON as date, upper(col_vucc_grids) gridsquare "; + if ($propmode == 'SAT') { + $sql .= ", COL_SAT_NAME as sat_name "; + } + $sql .= "from ".$this->config->item('table_name'). " thcv where station_id in (" . $location_list . ")"; if ($band == 'SAT') { // Left for compatibility reasons diff --git a/application/views/timeline/index.php b/application/views/timeline/index.php index 2484a10c3..a85d03bca 100644 --- a/application/views/timeline/index.php +++ b/application/views/timeline/index.php @@ -343,7 +343,7 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $ echo ''; } -function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode,$award, $selectedyear, $onlynew) { +function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) { // Apply filtering to the timeline array $filtered_timeline = filter_timeline_array_vucc($timeline_array, $selectedyear, $onlynew); $i = count($filtered_timeline); // General counter for all entries @@ -353,8 +353,11 @@ function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, # '.__("Date").' '.__("Time").' - '.__("Gridsquare").' - '.__("Show QSOs").' + '.__("Gridsquare").''; + if ($propmode == 'SAT') { + echo ' '.__("Satellite").''; + } + echo ' '.__("Show QSOs").' '; @@ -366,8 +369,11 @@ function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, ' . $i-- . ' ' . date($custom_date_format, $date_as_timestamp) . ' ' . date('H:i', $date_as_timestamp) . ' - ' . $line['gridsquare'] . ' - '.__("Show").' + ' . $line['gridsquare'] . ''; + if ($propmode == 'SAT') { + echo ''.$line['sat_name'].''; + } + echo ' '.__("Show").' '; } echo '';