From be13a4d26aab71c19f676e939505135a90f823f4 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 26 May 2025 16:23:17 +0200 Subject: [PATCH] Added resultview and more logic --- application/controllers/Statistics.php | 16 +++++++++- application/models/Stats.php | 4 +++ .../views/statistics/initialresult.php | 32 +++++++++++++++++++ application/views/statistics/initials.php | 3 +- assets/js/sections/initials.js | 32 +++++++++++++++++++ 5 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 application/views/statistics/initialresult.php create mode 100644 assets/js/sections/initials.js diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index e44d38b7a..e333599dc 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -319,9 +319,23 @@ class Statistics extends CI_Controller { // Set Page Title $data['page_title'] = __("EME Initials"); + $footerData = []; + $footerData['scripts'] = [ + 'assets/js/sections/initials.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/initials.js")), + ]; + // Load Views $this->load->view('interface_assets/header', $data); $this->load->view('statistics/initials'); - $this->load->view('interface_assets/footer'); + $this->load->view('interface_assets/footer', $footerData); + } + + public function getInitials() { + $band = xss_clean($this->input->post('band')); + $mode = xss_clean($this->input->post('mode')); + + $this->load->model('stats'); + $data['intials_array'] = $this->stats->getInitialsFromDb($band, $mode); + $this->load->view('statistics/initialresult', $data); } } diff --git a/application/models/Stats.php b/application/models/Stats.php index 81b79db58..0af15f624 100644 --- a/application/models/Stats.php +++ b/application/models/Stats.php @@ -918,6 +918,10 @@ return $this->db->get($this->config->item('table_name')); } + + public function getInitialsFromDb($band, $mode) { + + } } ?> diff --git a/application/views/statistics/initialresult.php b/application/views/statistics/initialresult.php new file mode 100644 index 000000000..bf92b325d --- /dev/null +++ b/application/views/statistics/initialresult.php @@ -0,0 +1,32 @@ + +
| '; + foreach($bands as $band) { + echo ' | ' . $band . ' | '; + } + echo ''.__("Total").' | '; + echo '
|---|---|---|
| '. $mode .' | '; + foreach ($value as $key => $val) { + echo '' . $val . ' | '; + } + echo '' . $modetotal[$mode] . ' | '; + echo '
| '.__("Total").' | '; + + $grandtotal = 0; + foreach ($bandtotal as $band => $value) { + echo '' . $value . ' | '; + $grandtotal += $value; + } + echo '' . $grandtotal . ' | '; + echo '