[QRB Calculator] Added model, view, controller and javascript to spawn dialog.

这个提交包含在:
Andreas 2022-02-12 11:45:06 +01:00
父节点 6b0e9b5eeb
当前提交 89b81b4c85
共有 4 个文件被更改,包括 85 次插入0 次删除

查看文件

@ -0,0 +1,25 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Data lookup functions used within Cloudlog
*/
class Qrbcalc extends CI_Controller {
function __construct()
{
parent::__construct();
$this->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);
}
}

查看文件

@ -0,0 +1,7 @@
<?php
class Qrbcalc_model extends CI_Model {
}
?>

查看文件

@ -421,8 +421,36 @@ document.onkeyup = function(e) {
if (e.altKey && e.which == 76) { if (e.altKey && e.which == 76) {
spawnLookupModal(); 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 // This displays the dialog with the form and it's where the resulttable is displayed
function spawnLookupModal() { function spawnLookupModal() {
$.ajax({ $.ajax({

查看文件

@ -0,0 +1,25 @@
<form class="form col-md-12" enctype="multipart/form-data">
<div class="form-group row">
<div class="col-md-2 control-label" for="input">Locator 1</div>
<div class="col-md-3">
<input class="form-control input-group-sm" id="locator1" type="text" name="locator1" placeholder="" aria-label="locator1">
</div>
</div>
<div class="form-group row">
<div class="col-md-2 control-label" for="input">Locator 2</div>
<div class="col-md-3">
<input class="form-control input-group-sm" id="locator2" type="text" name="locator2" placeholder="" aria-label="locator2">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="button1id"></label>
<div class="col-md-9">
<button id="button2id" type="reset" name="button2id" class="btn-sm btn-warning">Reset</button>
<button id="button1id" type="submit" name="button1id" class="btn-sm btn-primary">Calculate</button>
</div>
</div>
</form>