Started awards - if you log WAB:# in the comments field then visit awards/wab it shows worked WAB squares

pull/106/merge
Peter Goodhall 2012-10-31 20:34:57 +00:00
rodzic ff06d03105
commit 6a4a8991c6
3 zmienionych plików z 88 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,27 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Handles Displaying of information for awards.
*/
class Awards extends CI_Controller {
public function index()
{
echo "This is the index page";
}
/*
Handles Displaying of WAB Squares worked.
*/
public function wab() {
$this->load->model('wab');
$data['wab_all'] = $this->wab->get_all();
$data['page_title'] = "Awards - WAB";
$this->load->view('layout/header', $data);
$this->load->view('awards/wab/index');
$this->load->view('layout/footer');
}
}

Wyświetl plik

@ -0,0 +1,17 @@
<?php
class Wab extends CI_Model {
function __construct()
{
parent::__construct();
}
function get_all() {
$this->db->like('COL_COMMENT', 'WAB:');
return $this->db->get($this->config->item('table_name'));
}
}
?>

Wyświetl plik

@ -0,0 +1,44 @@
<div id="container">
<h1><?php echo $page_title; ?></h1>
<table width="100%" class="zebra-striped">
<tr>
<td>Square</td>
<td>Date/Time</td>
<td>Callsign</td>
<td>Band</td>
<td>RST Sent</td>
<td>RST Recvd</td>
</tr>
<?php
if ($wab_all->num_rows() > 0) {
foreach ($wab_all->result() as $row) {
?>
<tr>
<td>
<?php
$pieces = explode(" ", $row->COL_COMMENT);
foreach($pieces as $val) {
if (strpos($val,'WAB:') !== false) {
//echo $val;
echo $rest = substr($val, 4); // 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>
</div>