262 lines
5.8 KiB
PHP
262 lines
5.8 KiB
PHP
|
|
<script>
|
|
|
|
function validate_emp_hyg_checkup(){
|
|
var empName = $('#empName').val();
|
|
if(empName == ''){
|
|
BootstrapDialog.alert('Please Enter Emp Name.!!!');
|
|
return false;
|
|
}
|
|
/*var hygieneParameter = $('#hygieneParameter').val();
|
|
if(hygieneParameter == ''){
|
|
BootstrapDialog.alert('Please Enter Hygiene Parameter.!!!');
|
|
return false;
|
|
}
|
|
*/
|
|
var humanMinRange = $('#humanMinRange').val();
|
|
if(humanMinRange == ''){
|
|
BootstrapDialog.alert('Please Enter Human Min Range.!!!');
|
|
return false;
|
|
}
|
|
var humanMaxRange = $('#humanMaxRange').val();
|
|
if(humanMaxRange == ''){
|
|
BootstrapDialog.alert('Please Enter Human Max Range.!!!');
|
|
return false;
|
|
}
|
|
var currentValue = $('#currentValue').val();
|
|
if(currentValue == ''){
|
|
BootstrapDialog.alert('Please Enter Current Value.!!!');
|
|
return false;
|
|
}
|
|
|
|
|
|
$("#emp_hyg_checkup_form").submit();
|
|
|
|
|
|
//save_employee();
|
|
}
|
|
|
|
function getMinMaxLimit(hygieneId){
|
|
$.ajax({
|
|
url : 'getHygieneParameterLimits.php?hygieneId='+hygieneId+' ',
|
|
type : 'POST',
|
|
|
|
success : function(data) {
|
|
data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
|
|
|
|
|
|
$("#humanMinRange").val(data.human_min_range);
|
|
$("#humanMaxRange").val(data.human_max_range);
|
|
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Hygiene');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<script>
|
|
$(document).ready(function(e){
|
|
$("#emp_hyg_checkup_form").on('submit', function(e){
|
|
e.preventDefault();
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'save_emp_hyg_checkup.php',
|
|
data: new FormData(this),
|
|
contentType: false,
|
|
cache: false,
|
|
processData:false,
|
|
beforeSend: function(){
|
|
// $('.submitBtn').attr("disabled","disabled");
|
|
//$('#fupForm').css("opacity",".5");
|
|
},
|
|
success: function(msg){
|
|
BootstrapDialog.alert('Emp Hygiene Checkup Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
$('.close').click();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Emp Hygiene Checkup');
|
|
$('.close').click();
|
|
return;
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
#modal-add-hygiene {
|
|
overflow-y: scroll;
|
|
}
|
|
.modal-dialog {
|
|
padding: 15px;
|
|
width:50%;
|
|
}
|
|
</style>
|
|
<div class="modal fade" id="modal-add-emp-hygiene"
|
|
name="modal-add-emp-hygiene" role="dialog" aria-hidden="true">
|
|
<form role="form" id="emp_hyg_checkup_form" name="emp_hyg_checkup_form"
|
|
action="#" method="post">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">Employee Hygiene Checkup </h5>
|
|
<div class="widget-toolbar">
|
|
<div class="widget-menu">
|
|
<a href="#" class="close" data-action="close"
|
|
data-dismiss="modal"> <i class="ace-icon fa fa-times"></i>
|
|
</a>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
|
|
|
|
<div class="form-group col-sm-6">
|
|
<label for="hygieneParameter">Employee</label> <select
|
|
style="height: 30px" class="chosen-select form-control"
|
|
name="empName" data-placeholder="Select Employee" id="empName"
|
|
autofocus="autofocus" required>
|
|
|
|
<?php echo generateOption('employee',"CONCAT(fname,' ',lname)",'id'); ?>
|
|
</select> <input type="hidden" class="form-control"
|
|
name="hyg_check_id" id="hyg_check_id" required />
|
|
</div>
|
|
|
|
<div class="form-group col-sm-6">
|
|
<label for="currentValue">Checkup Date</label>
|
|
|
|
<div class="input-group"><input id="CheckupDate" name="CheckupDate" type="text" class="form-control" style="height:30px" />
|
|
|
|
<span class="input-group-addon">
|
|
|
|
<i style="height:5px" class="fa fa-clock-o bigger-110"></i>
|
|
|
|
</span></div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading" style="height:40px">
|
|
Checkup Hygiene Parameter Of Employee
|
|
<div class="btn-group" style="float:right" >
|
|
<button type="button" class="btn btn-default btn-sm" onclick="addRowForHygieneParameter()" id="addButtonForRawMaterial">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
<input type="hidden" name="parameterRow" id="parameterRow" value="0">
|
|
</div>
|
|
<div class="panel-body" style="padding: 0px;">
|
|
<table class="table table-bordered table-hover" id="hygieneParameterTable">
|
|
<tr class="active">
|
|
<th width="10%">Sr</th>
|
|
<th width="40%">Hygiene Parameter</th>
|
|
<th width="40%">Current Value</th>
|
|
|
|
<th width="10%"></th>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="widget-toolbox padding-8 clearfix">
|
|
<button type="button" class="btn btn-info btn-sm save_button"
|
|
onclick="validate_emp_hyg_checkup();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i>Save
|
|
</button>
|
|
<button type="button" class="btn btn-danger btn-sm"
|
|
data-dismiss="modal">
|
|
<i class="ace-icon fa fa-times bigger-110"></i>Cancel
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
jQuery(function($) {
|
|
|
|
|
|
|
|
|
|
if(!ace.vars['old_ie']) $('#CheckupDate').datetimepicker({
|
|
|
|
format: 'DD/MM/YYYY h:mm A',//use this option to display seconds
|
|
|
|
defaultDate: new Date(),
|
|
|
|
maxDate: new Date(),
|
|
|
|
//minDate: new Date()-10,
|
|
|
|
icons: {
|
|
|
|
time: 'fa fa-clock-o',
|
|
|
|
date: 'fa fa-calendar',
|
|
|
|
up: 'fa fa-chevron-up',
|
|
|
|
down: 'fa fa-chevron-down',
|
|
|
|
previous: 'fa fa-chevron-left',
|
|
|
|
next: 'fa fa-chevron-right',
|
|
|
|
today: 'fa fa-arrows ',
|
|
|
|
clear: 'fa fa-trash',
|
|
|
|
close: 'fa fa-times'
|
|
|
|
}
|
|
|
|
}).next().on(ace.click_event, function(){
|
|
|
|
$(this).prev().focus();
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|