184 lines
5.2 KiB
PHP
184 lines
5.2 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">Ailment System</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_ailment">
|
||
|
<div id="flex1" style="width:100%">
|
||
|
</div>
|
||
|
<input type="hidden" name="ailment_sys_id" id="flex_ailment_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: 'ailment_system_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [
|
||
|
{display: 'Sr', name: 'count', width: w*.04, sortable: false, align: 'left'},
|
||
|
|
||
|
{display: 'Ailment System Name', name: 'ailment_sys_name', width: w*.2, sortable: true, align: 'left'},
|
||
|
{display: 'Ailment System Desc', name: 'ailment_sys_desc', width: w*.2, sortable: true, align: 'left'},
|
||
|
{display: 'Ailment System Code', name: 'ailment_sys_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: 'Ailment System Name', name: 'ailment_sys_name', isdefault: true},
|
||
|
{display: 'Ailment System Desc', name: 'ailment_sys_desc'}
|
||
|
],
|
||
|
sortname: "ailment_sys_name",
|
||
|
sortorder: "asc",
|
||
|
usepager: true, //pagination
|
||
|
|
||
|
useRp: true,
|
||
|
rp: 50, //records per page
|
||
|
showTableToggleBtn: false, //toggle button for the whole table
|
||
|
resizable: true,
|
||
|
//width: w,
|
||
|
height: h,
|
||
|
singleSelect: true
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
function add(){
|
||
|
$(".save_button").show();
|
||
|
$("ailment_system_id").val("");
|
||
|
$("#ailment_system_description").val("");
|
||
|
$("#ailment_system_code").val("");
|
||
|
$("#ailment_system_name").val("");
|
||
|
|
||
|
$('#modal-add-ailment-system').modal("show");
|
||
|
}
|
||
|
function pdf(){
|
||
|
window.open('pdf_ailment_system.php');
|
||
|
}
|
||
|
function excel(){
|
||
|
window.location = 'excel_ailment_system.php';
|
||
|
}
|
||
|
|
||
|
function delete_ailment(ailmentId){
|
||
|
$("#flex_ailment_system_id").val(ailmentId);
|
||
|
console.log(ailmentId);
|
||
|
BootstrapDialog.confirm('Are you sure to delete the Ailment?', function(result){
|
||
|
if(result) {
|
||
|
$.ajax({
|
||
|
url : 'delete_ailment_system.php?ailmentId='+ailmentId+' ',
|
||
|
type : "POST",
|
||
|
data : $("#flex_form_ailment").serialize(),
|
||
|
success : function(data) {
|
||
|
if(data.indexOf("SUCCESS")!=-1){
|
||
|
BootstrapDialog.alert('Ailment Deleted Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
|
||
|
}else{
|
||
|
BootstrapDialog.alert('Error Deleting Ailment');
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting Ailment');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function ailment_system_save(){
|
||
|
|
||
|
$.ajax({
|
||
|
url : 'save_ailment_system.php? ',
|
||
|
type : "POST",
|
||
|
data : $("#ailment_system_form").serialize(),
|
||
|
success : function(data) {
|
||
|
BootstrapDialog.alert('Ailment System Saved Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Ailment System');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function open_ailment(ailmentId, action) {
|
||
|
if(action=="V"){
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
}else{
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url : 'select_ailment_system.php?ailmentId='+ailmentId+' ',
|
||
|
type : 'POST',
|
||
|
success : function(data) {
|
||
|
//alert(data);
|
||
|
var data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
|
||
|
$("#ailment_system_id").val(data.ailment_sys_id);
|
||
|
$("#ailment_system_name").val(data.ailment_sys_name);
|
||
|
$("#ailment_system_description").val(data.ailment_sys_desc);
|
||
|
$("#ailment_system_code").val(data.ailment_sys_code);
|
||
|
$('#modal-add-ailment-system').modal("show");
|
||
|
},
|
||
|
error : function(data) {
|
||
|
BootstrapDialog.alert('Error Populating ailment system');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
<?php include('form/add_ailment_system.php');?>
|