diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index ba399b851..124aeebf1 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -1917,7 +1917,7 @@ class Awards extends CI_Controller { $this->load->view('interface_assets/footer'); } - public function wae () { + public function wae () { $this->load->model('wae'); $this->load->model('modes'); $this->load->model('bands'); @@ -1995,4 +1995,15 @@ class Awards extends CI_Controller { $this->load->view('interface_assets/footer'); } + public function seven3on73 () { + + // Grab all worked stations on AO-73 + $this->load->model('Seven3on73'); + $data['seven3on73_array'] = $this->Seven3on73->get_all(); + + $data['page_title'] = sprintf(__("Awards - %s"), __("73 on 73")); + $this->load->view('interface_assets/header', $data); + $this->load->view('awards/73on73/index'); + $this->load->view('interface_assets/footer'); + } } diff --git a/application/models/Seven3on73.php b/application/models/Seven3on73.php new file mode 100644 index 000000000..e16600945 --- /dev/null +++ b/application/models/Seven3on73.php @@ -0,0 +1,38 @@ +load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $sql = "SELECT MIN(COL_TIME_ON) as time, COL_CALL as callsign FROM ".$this->config->item('table_name')." WHERE station_id IN (".implode(', ', $logbooks_locations_array).") AND COL_SAT_NAME = 'AO-73' AND COL_TIME_ON > '2014-09-01 00:00:00' GROUP BY callsign ORDER BY time DESC;"; + $query = $this->db->query($sql); + + $result = array(); + + foreach($query->result() as $row) { + $bindings=[]; + $subsql = "SELECT COL_PRIMARY_KEY AS pkey, COL_MODE AS mode, COL_RST_RCVD AS rst_r, COL_RST_SENT AS rst_s + FROM ".$this->config->item('table_name')." + WHERE ".$this->config->item('table_name').".station_id IN (".implode(', ', $logbooks_locations_array).") + AND COL_CALL = ? + AND COL_TIME_ON = ? + ORDER BY COL_TIME_ON ASC LIMIT 1;"; + $bindings[] = $row->callsign; + $bindings[] = $row->time; + $subquery = $this->db->query($subsql, $bindings); + $subrow = $subquery->row(); + array_push($result, (object) ["time" => $row->time, "callsign" => $row->callsign, "pkey" => $subrow->pkey, "mode" => $subrow->mode, "rst_r" => $subrow->rst_r, "rst_s" => $subrow->rst_s]); + } + + return $result; + + } +} + +?> diff --git a/application/views/awards/73on73/index.php b/application/views/awards/73on73/index.php new file mode 100644 index 000000000..e0b03fb7b --- /dev/null +++ b/application/views/awards/73on73/index.php @@ -0,0 +1,67 @@ +
| = __("Number") ?> | += __("Date") ?> | += __("Time") ?> | += __("Callsign") ?> | += __("Mode") ?> | += __("RST (R)") ?> | += __("RST (S)") ?> | +
|---|---|---|---|---|---|---|
| + | time); echo date($custom_date_format, $timestamp); ?> | +time); echo date('H:i', $timestamp); ?> | +callsign; ?> | +mode; ?> | +rst_r; ?> | +rst_s; ?> | +