ESH/form/add_hygiene.php
2024-10-23 18:28:06 +05:30

149 lines
4.5 KiB
PHP

<script>
function validate_hygiene(){
var hygieneParameter = $('#hygieneParameter').val();
if(hygieneParameter == ''){
BootstrapDialog.alert('Please Enter Hygiene Parameter.!!!');
return false;
}
var workAreaMinRange = $('#workAreaMinRange').val();
if(workAreaMinRange == ''){
BootstrapDialog.alert('Please Enter Work Area Min Range.!!!');
return false;
}
var workAreaMaxRange = $('#workAreaMaxRange').val();
if(workAreaMaxRange == ''){
BootstrapDialog.alert('Please Enter Work Area Max Range.!!!');
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;
}
$("#hygiene_form").submit();
//save_employee();
}
</script>
<script>
$(document).ready(function(e){
$("#hygiene_form").on('submit', function(e){
e.preventDefault();
$.ajax({
type: 'POST',
url: 'save_hygiene.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('Hygiene Saved Successfully.');
$("#flex1").flexReload();
$('.close').click();
return;
},
error : function(data) {
BootstrapDialog.alert('Error Saving Hygiene');
$('.close').click();
return;
}
});
});
});
</script>
<style>
#modal-add-hygiene{
overflow-y:scroll;
}
</style>
<div class="modal fade" id="modal-add-hygiene" name="modal-add-hygiene" role="dialog" aria-hidden="true">
<form role="form" id="hygiene_form" name="hygiene_form" action="#" method="post">
<div class="modal-dialog">
<div class="modal-content">
<div class="widget-header">
<h5 class="widget-title">Add Hygiene</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">Hygiene Parameter</label>
<input style=" height:30px" type="text" class="form-control" name="hygieneParameter"
id="hygieneParameter" placeholder="Enter Hygiene Parameter" autofocus="autofocus" required/>
<input type="hidden" class="form-control" name="hygiene_id"
id="hygiene_id" required/>
</div>
<div class="form-group col-sm-6">
<label for="workAreaMinRange">Work Area Min Range</label>
<input style=" height:30px" type="text" class="form-control" name="workAreaMinRange"
id="workAreaMinRange" placeholder="Enter Work Area Min Range" required/>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label for="workAreaMinRange">Work Area Max Range</label>
<input style=" height:30px" type="text" class="form-control" name="workAreaMaxRange"
id="workAreaMaxRange" placeholder="Enter Work Area Min Range" required/>
</div>
<div class="form-group col-sm-6">
<label for="humanMinRange">Human Min Range</label>
<input style=" height:30px" type="text" class="form-control" name="humanMinRange"
id="humanMinRange" placeholder="Human Min Range" required/>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label for="humanMaxRange">Human Max Range</label>
<input style=" height:30px" type="text" class="form-control" name="humanMaxRange"
id="humanMaxRange" placeholder="Human Max Range" required/>
</div>
</div>
<div class="widget-toolbox padding-8 clearfix" >
<button type="button" class="btn btn-info btn-sm save_button" onclick="validate_hygiene();"><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>