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 @@ +
| Reference | +Date/Time | +Callsign | +Band | +RST Sent | +RST 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; ?> | +