diff --git a/application/controllers/radio.php b/application/controllers/radio.php
index 42a17c8e..36ec380d 100644
--- a/application/controllers/radio.php
+++ b/application/controllers/radio.php
@@ -4,12 +4,40 @@
public function index()
{
-
+ // load the view
+ $data['page_title'] = "Radio Status";
+
+ $this->load->view('layout/header', $data);
+ $this->load->view('radio/index');
+ $this->load->view('layout/footer');
}
function status() {
$this->load->model('cat');
- print_r($this->cat->status());
+ $query = $this->cat->status();
+ if ($query->num_rows() > 0)
+ {
+ echo "
";
+ echo "| Radio | ";
+ echo "Frequency | ";
+ echo "Mode | ";
+ echo "Timestamp | " ;
+ echo "
";
+ foreach ($query->result() as $row)
+ {
+ echo "";
+ echo "| ".$row->radio." | ";
+ echo "".$row->frequency." | ";
+ echo "".$row->mode." | ";
+ echo "".$row->timestamp." | " ;
+ echo "
";
+ }
+ } else {
+ echo "";
+ echo "| No CAT Interfaced radios found. | ";
+ echo "
";
+ }
+
}
function frequency($id) {
diff --git a/application/models/cat.php b/application/models/cat.php
index d2fbbb11..bcb00920 100644
--- a/application/models/cat.php
+++ b/application/models/cat.php
@@ -44,22 +44,9 @@
function status() {
//$this->db->where('radio', $result['radio']);
- $this->db->limit(1);
$query = $this->db->get('cat');
- if ($query->num_rows() > 0)
- {
- foreach ($query->result() as $row)
- {
- $data = array(
- 'radio' => $row->radio,
- 'frequency' => $row->frequency,
- 'mode' => $row->mode
- );
- }
- }
-
- return $data;
+ return $query;
}
/* Return list of radios */
diff --git a/application/views/layout/header.php b/application/views/layout/header.php
index 0e74da5d..e4eaaad7 100644
--- a/application/views/layout/header.php
+++ b/application/views/layout/header.php
@@ -7,8 +7,6 @@
-
-
@@ -54,6 +52,7 @@
Admin