[QRB Calculator] Added model, view, controller and javascript to spawn dialog.
这个提交包含在:
		
							父节点
							
								
									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> | ||||||
		正在加载…
	
		在新工单中引用