diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 2d868c50..f539f572 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -44,6 +44,12 @@ class Dashboard extends CI_Controller { $this->load->view('setup/check_list'); $this->load->view('interface_assets/footer'); } else { + + // + $this->load->model('cat'); + + $data['radio_status'] = $this->cat->recent_status(); + // Store info $data['todays_qsos'] = $this->logbook_model->todays_qsos(); $data['total_qsos'] = $this->logbook_model->total_qsos(); diff --git a/application/models/Cat.php b/application/models/Cat.php index 399cb57d..6057b8b7 100644 --- a/application/models/Cat.php +++ b/application/models/Cat.php @@ -82,6 +82,13 @@ return $query; } + function recent_status() { + $this->db->where("timestamp > date_sub(now(), interval 15 minute)", NULL, FALSE); + + $query = $this->db->get('cat'); + return $query; + } + /* Return list of radios */ function radios() { $this->db->select('id, radio'); diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index b8a0dcd7..9a691545 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -89,6 +89,39 @@
+ + num_rows()) { ?> + + + + + + + result_array() as $row) { ?> + + + + + + +
Radio Status
+ + + + () + +
+ + + + +
lang->line('dashboard_qso_breakdown'); ?>