From e8c62a26cf99e737463e7f35498f175d3085526c Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:02:15 +0100 Subject: [PATCH] [Dashboard] Update radio frequency display every 5 seconds --- application/controllers/Dashboard.php | 7 ++++++ .../views/components/radio_display_table.php | 23 +++++++++++++++++++ application/views/dashboard/index.php | 23 +------------------ 3 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 application/views/components/radio_display_table.php diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 8a497343..afc0132d 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -114,6 +114,13 @@ class Dashboard extends CI_Controller { } + function radio_display_component() { + $this->load->model('cat'); + + $data['radio_status'] = $this->cat->recent_status(); + $this->load->view('components/radio_display_table', $data); + } + function map() { $this->load->model('logbook_model'); diff --git a/application/views/components/radio_display_table.php b/application/views/components/radio_display_table.php new file mode 100644 index 00000000..e27c5154 --- /dev/null +++ b/application/views/components/radio_display_table.php @@ -0,0 +1,23 @@ +num_rows()) { ?> + + + + + + + result_array() as $row) { ?> + + + + + + +
Radio Status
+ + + + frequency->hz_to_mhz($row['frequency']); ?> () + +
+ + \ No newline at end of file diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 1f2cc0ef..432431fd 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -160,29 +160,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
- num_rows()) { ?> - - - - - - result_array() as $row) { ?> - - - - - - -
Radio Status
- - - - frequency->hz_to_mhz($row['frequency']); ?> () - -
- - +