From 2a03c6af15e026a3fa02c39b6a4fe4ddb9fb8e9b Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 1 Nov 2012 01:50:11 +0000 Subject: [PATCH] Started SOTA tracking comments field - SOTA:# then awards/sota --- application/controllers/awards.php | 23 +++++++++++++ application/models/sota.php | 18 ++++++++++ application/views/awards/sota/index.php | 44 +++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 application/models/sota.php create mode 100644 application/views/awards/sota/index.php diff --git a/application/controllers/awards.php b/application/controllers/awards.php index a38e159b..265cd9bb 100644 --- a/application/controllers/awards.php +++ b/application/controllers/awards.php @@ -2,6 +2,8 @@ /* Handles Displaying of information for awards. + + These are taken from comments fields or ADIF fields */ class Awards extends CI_Controller { @@ -13,15 +15,36 @@ class Awards extends CI_Controller { /* Handles Displaying of WAB Squares worked. + Comment field - WAB:# */ public function wab() { + // Grab all worked WABs $this->load->model('wab'); $data['wab_all'] = $this->wab->get_all(); + // Render Page $data['page_title'] = "Awards - WAB"; $this->load->view('layout/header', $data); $this->load->view('awards/wab/index'); $this->load->view('layout/footer'); } + + /* + Handles showing worked SOTAs + Comment field - SOTA:# + */ + public function sota() { + + // Grab all worked sota stations + $this->load->model('sota'); + $data['sota_all'] = $this->sota->get_all(); + + // Render page + $data['page_title'] = "Awards - SOTA"; + $this->load->view('layout/header', $data); + $this->load->view('awards/sota/index'); + $this->load->view('layout/footer'); + } + } \ No newline at end of file diff --git a/application/models/sota.php b/application/models/sota.php new file mode 100644 index 00000000..a08d9fd9 --- /dev/null +++ b/application/models/sota.php @@ -0,0 +1,18 @@ +db->order_by("COL_COMMENT", "ASC"); + $this->db->like('COL_COMMENT', 'SOTA:'); + + return $this->db->get($this->config->item('table_name')); + } +} + +?> \ No newline at end of file diff --git a/application/views/awards/sota/index.php b/application/views/awards/sota/index.php new file mode 100644 index 00000000..da18a64c --- /dev/null +++ b/application/views/awards/sota/index.php @@ -0,0 +1,44 @@ +
+

+ + + + + + + + + + + + + num_rows() > 0) { + foreach ($sota_all->result() as $row) { + ?> + + + + + + + + + + + +
ReferenceDate/TimeCallsignBandRST SentRST Recvd
+ COL_COMMENT); + foreach($pieces as $val) { + if (strpos($val,'SOTA:') !== false) { + //echo $val; + echo $rest = substr($val, 5); // returns "cde" + } + } + ?> + COL_TIME_ON); echo date('d/m/y', $timestamp); ?> - COL_TIME_ON); echo date('H:i', $timestamp); ?>COL_CALL; ?>COL_BAND; ?>COL_RST_SENT; ?>COL_RST_RCVD; ?>
+
\ No newline at end of file