266 lines
6.9 KiB
PHP
266 lines
6.9 KiB
PHP
|
<?php include('techsyn_header.php'); ?>
|
||
|
<!-- Main Content Container for side bar and body-->
|
||
|
<div class="main-container ace-save-state" id="main-container">
|
||
|
<script type="text/javascript">
|
||
|
try {
|
||
|
ace.settings.loadState('main-container')
|
||
|
} catch (e) {}
|
||
|
</script>
|
||
|
<?php include('techsyn_sidebar.php'); ?>
|
||
|
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
||
|
<ul class="breadcrumb">
|
||
|
|
||
|
<li class="#">Data Setup</li>
|
||
|
<li class="#">Masters</li>
|
||
|
<li class="active">Checkup Parameter Group</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
|
||
|
<div class="page-content">
|
||
|
<div id="flexigridDiv" class="table-responsive">
|
||
|
|
||
|
<form name="f1" method="post" action="" id="flex_form_unit">
|
||
|
<div id="flex1" style="width:100%">
|
||
|
</div>
|
||
|
<input type="hidden" name="flex_unit_id" id="flex_unit_id" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div><!-- /.page-content -->
|
||
|
</div>
|
||
|
</div><!-- /.main-content -->
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
var w = screen.width * .90;
|
||
|
var h = 0;
|
||
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'checkup_parameter_group_list_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [{
|
||
|
display: 'Sr',
|
||
|
name: 'count',
|
||
|
width: w * .04,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
display: 'Group Id',
|
||
|
name: 'group_id',
|
||
|
width: w * .15,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Group No.',
|
||
|
name: 'group_no',
|
||
|
width: w * .1,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Group Section',
|
||
|
name: 'group_section',
|
||
|
width: w * .1,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Group Tital',
|
||
|
name: 'group_tital',
|
||
|
width: w * .1,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: '',
|
||
|
name: '',
|
||
|
width: w * .08,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
],
|
||
|
buttons: [
|
||
|
|
||
|
{
|
||
|
name: 'Add',
|
||
|
bclass: 'add',
|
||
|
onpress: add
|
||
|
},
|
||
|
|
||
|
|
||
|
{
|
||
|
separator: true
|
||
|
}
|
||
|
],
|
||
|
searchitems: [
|
||
|
|
||
|
{
|
||
|
display: 'Group Tital',
|
||
|
name: 'group_tital',
|
||
|
isdefault: true
|
||
|
},
|
||
|
{
|
||
|
display: 'Group Section',
|
||
|
name: 'group_section'
|
||
|
}
|
||
|
],
|
||
|
sortname: "group_id",
|
||
|
sortorder: "asc",
|
||
|
usepager: true, //pagination
|
||
|
|
||
|
useRp: true,
|
||
|
rp: 20, //records per page
|
||
|
showTableToggleBtn: false, //toggle button for the whole table
|
||
|
resizable: true,
|
||
|
//width: w,
|
||
|
height: h,
|
||
|
singleSelect: true
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
function add() {
|
||
|
|
||
|
$("#group_no").val("");
|
||
|
$("#group_id").val("");
|
||
|
|
||
|
|
||
|
$('#group_section').trigger('chosen:updated');
|
||
|
|
||
|
|
||
|
$("#group_tital").val("");
|
||
|
$('#model-checkup-parameter').modal("show");
|
||
|
}
|
||
|
|
||
|
function open_checkup_parameter_form(checkup_parameter_group_id, access_level) {
|
||
|
if (access_level == 'V') {
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
} else {
|
||
|
$(".save_button").show();
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_checkup_parameter_group.php?checkup_parameter_group_id=' + checkup_parameter_group_id +
|
||
|
' ',
|
||
|
data: {
|
||
|
id: checkup_parameter_group_id
|
||
|
},
|
||
|
success: function(data) {
|
||
|
|
||
|
data = $.parseJSON(data);
|
||
|
|
||
|
$("#group_id").val(data.group_id);
|
||
|
$("#group_no").val(data.group_no);
|
||
|
$("#group_section").val(data.group_section);
|
||
|
$('#group_section').trigger('chosen:updated');
|
||
|
$("#group_tital").val(data.group_tital);
|
||
|
|
||
|
|
||
|
|
||
|
$('#model-checkup-parameter').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating injury');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function delete_checkup_parameter_form(checkup_parameterId) {
|
||
|
|
||
|
$("#flex_unit_id").val(checkup_parameterId);
|
||
|
|
||
|
BootstrapDialog.confirm('Are you sure to delete the checkup parameter group?', function(result) {
|
||
|
if (result) {
|
||
|
$.ajax({
|
||
|
url: 'checkup_parameter_group_delete.php',
|
||
|
type: "POST",
|
||
|
data: $("#flex_form_unit").serialize(),
|
||
|
success: function(data) {
|
||
|
if (data.indexOf("SUCCESS") != -1) {
|
||
|
BootstrapDialog.alert('Checkup Parameter group Deleted Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
|
||
|
} else {
|
||
|
BootstrapDialog.alert('Error Deleting Checkup Parameter group');
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting Checkup Parameter group');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function validate_checkup_parameter() {
|
||
|
|
||
|
let cpname = $("#group_section").val();
|
||
|
if (cpname == '' || cpname == null) {
|
||
|
BootstrapDialog.alert("Please fill parameter Group Section.Don't repeat the same name");
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
|
||
|
save_checkup_parameter();
|
||
|
}
|
||
|
|
||
|
$(document).on("keypress", "#c_name", function(event) {
|
||
|
var character = String.fromCharCode(event.keyCode);
|
||
|
// alert(character); // alert(isValid(character));
|
||
|
return isValid(character);
|
||
|
});
|
||
|
|
||
|
function isValid(str) {
|
||
|
return !/[~`!@#$%\^&*()+=\-\\ \[\]\\';,/{}|\\":<>\?]/g.test(str);
|
||
|
}
|
||
|
|
||
|
function save_checkup_parameter() {
|
||
|
$.ajax({
|
||
|
url: 'save_checkup_parameters_group.php',
|
||
|
type: "POST",
|
||
|
data: $("#checkup_parameter_form").serialize(),
|
||
|
success: function(data) {
|
||
|
BootstrapDialog.alert('Checkup Parameter Group Saved Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Unit');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
<?php include('form/checkup_parameter_group_form.php'); ?>
|