185 lines
4.9 KiB
PHP
185 lines
4.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="#">Injury/Ailment</li><li class="active">Injury Part</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_injury">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="injury_id" id="flex_injury_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: 'injury_part_list_script.php',
|
|
dataType: 'json',
|
|
colModel: [
|
|
{display: 'Sr', name: 'count', width: w*.04, sortable: false, align: 'left'},
|
|
|
|
{display: 'Injury Part', name: 'inj_name', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Injury Part Desc', name: 'inj_desc', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Injury Part Code', name: 'inj_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: 'Injury Part', name: 'inj_name', isdefault: true},
|
|
{display: 'Injury Description', name: 'inj_desc'}
|
|
|
|
],
|
|
sortname: "inj_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();
|
|
$("#injury_id").val("");
|
|
$("#injury_name").val("");
|
|
$("#injury_code").val("");
|
|
$("#injury_desc").val("");
|
|
$('#modal-add-injury').modal("show");
|
|
}
|
|
function pdf(){
|
|
window.open('injury_part_pdf.php');
|
|
}
|
|
function excel(){
|
|
window.location = 'injury_part_excel.php';
|
|
}
|
|
|
|
function delete_injury(injuryId){
|
|
$("#flex_injury_id").val(injuryId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the injury?', function(result){
|
|
if(result) {
|
|
$.ajax({
|
|
url : 'delete_injury_part.php',
|
|
type : "POST",
|
|
data : $("#flex_form_injury").serialize(),
|
|
success : function(data) {
|
|
if(data.indexOf("SUCCESS")!=-1){
|
|
BootstrapDialog.alert('injury Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
}else{
|
|
BootstrapDialog.alert('Error Deleting Injury');
|
|
}
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Deleting Injury');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_injury(){
|
|
$.ajax({
|
|
url : 'save_injury_part.php?injury_id='+injury_id+' ',
|
|
type : "POST",
|
|
data : $("#injury_form").serialize(),
|
|
success : function(data) {
|
|
BootstrapDialog.alert('injury Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Role');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
var injury_id = "";
|
|
function open_injury(injuryId, action) {
|
|
|
|
if(action=="V"){
|
|
$(".save_button").hide();
|
|
|
|
}else{
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url : 'select_injury_part.php?injuryId='+injuryId+' ',
|
|
type : 'POST',
|
|
success : function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
$("#injury_id").val(data.inj_id);
|
|
$("#injury_name").val(data.inj_name);
|
|
$("#injury_desc").val(data.inj_desc);
|
|
$("#injury_code").val(data.inj_code);
|
|
$('#modal-add-injury').modal("show");
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Role');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_injury_part.php');?>
|