diff --git a/application/models/Callstats_model.php b/application/models/Callstats_model.php index cde44b4eb..c475d280d 100644 --- a/application/models/Callstats_model.php +++ b/application/models/Callstats_model.php @@ -25,7 +25,9 @@ class Callstats_model extends CI_Model { $sql = "select `col_call` as `call`, - COUNT(*) as `count` + COUNT(*) as `count`, + min(col_time_on) as first_qso, + max(col_time_on) as last_qso from " . $this->config->item('table_name') . " left join satellite on ".$this->config->item('table_name').".COL_SAT_NAME = satellite.name where station_id in (" . $location_list . ")"; diff --git a/application/views/callstats/index.php b/application/views/callstats/index.php index 7d335fe37..24966a9dc 100644 --- a/application/views/callstats/index.php +++ b/application/views/callstats/index.php @@ -120,11 +120,10 @@ } ?> ' . __("Nothing found!") . ''; } @@ -135,7 +134,7 @@ # ' . __("Callsign") . ' ' . __("#QSOs") . ' + ' . __("First QSO") . ' + ' . __("Last QSO") . ' ' . __("Show QSOs") . ' '; $activators = array(); + foreach ($activators_array as $line) { $call = $line->call; $count = $line->count; - array_push($activators, array($count, $call)); + $timestamp = strtotime($line->first_qso); + $first_qso = date($custom_date_format, $timestamp); + $timestamp = strtotime($line->last_qso); + $last_qso = date($custom_date_format, $timestamp); + array_push($activators, array($count, $call, $first_qso, $last_qso)); } arsort($activators); foreach ($activators as $line) { @@ -164,6 +170,8 @@ function write_activators($activators_array, $band, $mode, $sat, $orbit, $propag ' . $i++ . ' ' . $line[1] . ' ' . $line[0] . ' + ' . $line[2] . ' + ' . $line[3] . ' '; }