From 89b81b4c85822dd0480a9530f7c03d2af125a840 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 12 Feb 2022 11:45:06 +0100 Subject: [PATCH] [QRB Calculator] Added model, view, controller and javascript to spawn dialog. --- application/controllers/Qrbcalc.php | 25 +++++++++++++++++ application/models/Qrbcalc_model | 7 +++++ application/views/interface_assets/footer.php | 28 +++++++++++++++++++ application/views/qrbcalc/index.php | 25 +++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 application/controllers/Qrbcalc.php create mode 100644 application/models/Qrbcalc_model create mode 100644 application/views/qrbcalc/index.php diff --git a/application/controllers/Qrbcalc.php b/application/controllers/Qrbcalc.php new file mode 100644 index 00000000..99668860 --- /dev/null +++ b/application/controllers/Qrbcalc.php @@ -0,0 +1,25 @@ +load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + public function index() + { + $data['page_title'] = "QRB Calculaltor"; + $this->load->view('qrbcalc/index', $data); + } +} diff --git a/application/models/Qrbcalc_model b/application/models/Qrbcalc_model new file mode 100644 index 00000000..ade46a6d --- /dev/null +++ b/application/models/Qrbcalc_model @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index c4a35e26..439dbefa 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -421,8 +421,36 @@ document.onkeyup = function(e) { if (e.altKey && e.which == 76) { spawnLookupModal(); } + if (e.altKey && e.which == 81) { + spawnQrbCalculator(); + } }; +function spawnQrbCalculator() { + $.ajax({ + url: base_url + 'index.php/qrbcalc', + type: 'post', + success: function (html) { + BootstrapDialog.show({ + title: 'Compute QRB and QTF', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'lookup-dialog', + nl2br: false, + message: html, + onshown: function(dialog) { + + }, + buttons: [{ + label: 'Close', + action: function (dialogItself) { + dialogItself.close(); + } + }] + }); + } + }); +} + // This displays the dialog with the form and it's where the resulttable is displayed function spawnLookupModal() { $.ajax({ diff --git a/application/views/qrbcalc/index.php b/application/views/qrbcalc/index.php new file mode 100644 index 00000000..24f83d76 --- /dev/null +++ b/application/views/qrbcalc/index.php @@ -0,0 +1,25 @@ +
+
+ +
Locator 1
+
+ +
+
+ +
+ +
Locator 2
+
+ +
+
+ +
+ +
+ + +
+
+
\ No newline at end of file