Basic tracking for wacral members WACRAL:# and awards/wacral for acceessing information for awards

pull/106/merge
Peter Goodhall 2012-11-01 16:39:00 +00:00
rodzic 3f2e327c71
commit 328f572596
3 zmienionych plików z 85 dodań i 0 usunięć

Wyświetl plik

@ -47,4 +47,21 @@ class Awards extends CI_Controller {
$this->load->view('layout/footer');
}
/*
Handles showing worked WACRAL members (wacral.org)
Comment field - WACRAL:#
*/
public function wacral() {
// Grab all worked wacral members
$this->load->model('wacral');
$data['wacral_all'] = $this->wacral->get_all();
// Render page
$data['page_title'] = "Awards - WACRAL Members";
$this->load->view('layout/header', $data);
$this->load->view('awards/wacral/index');
$this->load->view('layout/footer');
}
}

Wyświetl plik

@ -0,0 +1,23 @@
<?php
/*
Handles retrieving QSOs that have a Wacral (www.wacral.org) membership number stored in the comment field
eg WACRAL:1245
*/
class Wacral extends CI_Model {
function __construct()
{
parent::__construct();
}
function get_all() {
$this->db->order_by("COL_COMMENT", "ASC");
$this->db->like('COL_COMMENT', 'WACRAL:');
return $this->db->get($this->config->item('table_name'));
}
}
?>

Wyświetl plik

@ -0,0 +1,45 @@
<div id="container">
<h1><?php echo $page_title; ?></h1>
<?php if ($wacral_all->num_rows() > 0) { ?>
<table width="100%" class="zebra-striped">
<tr>
<td>Membership #</td>
<td>Date/Time</td>
<td>Callsign</td>
<td>Band</td>
<td>RST Sent</td>
<td>RST Recvd</td>
</tr>
<?php
foreach ($wacral_all->result() as $row) {
?>
<tr>
<td>
<?php
$pieces = explode(" ", $row->COL_COMMENT);
foreach($pieces as $val) {
if (strpos($val,'WACRAL:') !== false) {
//echo $val;
echo $rest = substr($val,7); // returns "cde"
}
}
?>
</td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?> - <?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<td><?php echo $row->COL_CALL; ?></td>
<td><?php echo $row->COL_BAND; ?></td>
<td><?php echo $row->COL_RST_SENT; ?></td>
<td><?php echo $row->COL_RST_RCVD; ?></td>
</tr>
<?php } ?>
</table>
<?php } else { ?>
<p>You have lot logged any <a href="http://www.wacral.org" target="_blank">WACRAL</a></p>
<?php } ?>
</div>