181 lines
5.3 KiB
PHP
181 lines
5.3 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="#">Injury/Ailment</li><li class="active">Check-up Result</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_checkup">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="checkup_id" id="flex_checkup_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_result_categories_script.php',
|
|
dataType: 'json',
|
|
colModel: [
|
|
{display: 'Sr', name: 'count', width: w*.04, sortable: false, align: 'left'},
|
|
|
|
{display: 'Checkup Categories Result Name', name: 'chk_result_cat_name', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Checkup Categories Result Desc', name: 'chk_result_cat_desc', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Checkup Categories Result Code', name: 'chk_result_cat_code', width: w*.2, sortable: true, align: 'left'},
|
|
{display: '', name: '', width: w*.23, sortable: false, align: 'left'},
|
|
|
|
],
|
|
buttons: [
|
|
|
|
{name: 'Add', bclass: 'add', onpress : add},
|
|
{separator: true},
|
|
{name: 'PDF', bclass: 'print', onpress : pdf},
|
|
{separator: true},
|
|
{name: 'Excel', bclass: 'print_excel', onpress : excel},
|
|
{separator: true}
|
|
],
|
|
searchitems: [
|
|
|
|
{display: 'Checkup Cat Name', name: 'chk_result_cat_name', isdefault: true},
|
|
{display: 'Cheakup Cat Desc', name: 'chk_result_cat_desc'}
|
|
],
|
|
sortname: "chk_result_cat_name",
|
|
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 pdf(){
|
|
window.open('pdf_checkup_result.php');
|
|
}
|
|
function excel(){
|
|
window.location = 'excel_checkup_result.php';
|
|
}
|
|
|
|
function add(){
|
|
$(".save_button").show();
|
|
$("#checkup_id").val("");
|
|
$("#checkup_name").val("");
|
|
$("#checkup_code").val("");
|
|
$("#checkup_description").val("");
|
|
$('#modal-add-checkup').modal("show");
|
|
}
|
|
|
|
function delete_checkup(checkupId){
|
|
$("#flex_checkup_id").val(checkupId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the checkup result category ?', function(result){
|
|
if(result) {
|
|
$.ajax({
|
|
url : 'delete_checkup_result_categories.php',
|
|
type : "POST",
|
|
data : $("#flex_form_checkup").serialize(),
|
|
success : function(data) {
|
|
if(data.indexOf("SUCCESS")!=-1){
|
|
BootstrapDialog.alert('Checkup Result Category Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
}else{
|
|
BootstrapDialog.alert('Error Deleting Checkup Category');
|
|
}
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Deleting Checkup Category');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_checkup(){
|
|
$.ajax({
|
|
url : 'save_checkup_result_categories.php? ',
|
|
type : "POST",
|
|
data : $("#checkup_form").serialize(),
|
|
success : function(data) {
|
|
BootstrapDialog.alert('Checkup Result Category Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Checkup Result Category');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
var checkup_id = "";
|
|
function open_checkup(checkupId, action) {
|
|
if(action=="V"){
|
|
$(".save_button").hide();
|
|
|
|
}else{
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url : 'select_checkup_result_categories.php?checkupId='+checkupId+' ',
|
|
type : 'POST',
|
|
success : function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
role_id = data.role_id;
|
|
$("#checkup_id").val(data.chk_result_cat_id);
|
|
$("#checkup_name").val(data.chk_result_cat_name);
|
|
$("#checkup_description").val(data.chk_result_cat_desc);
|
|
$("#checkup_code").val(data.chk_result_cat_code);
|
|
$('#modal-add-checkup').modal("show");
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Checkup Category');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_checkup_result_categories.php');?>
|