File: /var/www/html/hrms-production/storage/framework/views/40b25d881ea6a4cbb2c44e58bd2d8128f8ed10a7.php
<div class="modal fade" id="addEmpGeneralDetail">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Employee Name <span id="AddGenerelDetailEmployeeName" class="text-info"></span>
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- Main content -->
<form id="addEmpGeneralDetailform">
<input type="hidden" name="_token" id="AddGenerelDetailToken" value="<?php echo e(csrf_token()); ?>">
<input type="hidden" id="AddGenerelDetailEmployeeId" name="EmployeeId">
<input type="hidden" id="AddGenerelDetailEmployeeCode" name="EmployeeCode">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="FatherName">Fathers's name <span
class="text-danger">*</span></label>
<input type="text" id="FatherName" name="FatherName"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="FatherResidence">Fathers's Residence <span
class="text-danger">*</span></label>
<input type="text" id="FatherResidence" name="FatherResidence"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0">Gender <span class="text-danger">*</span></label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="Gender" id="Gender" data-placeholder="Select Gender">
<option value="" selected disabled>Select Gender</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="MaritalStatus">Marital Status <span
class="text-danger">*</span></label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="MaritalStatus" id="MaritalStatus"
data-placeholder="Select Marital Status">
<option value="" selected disabled>Select Marital Status</option>
</select>
</div>
</div>
<div class="col-md-4" id="husband_field" style="display: none">
<div class="form-group mb-2">
<label class="mb-0" for="HusbandName">Husband's name <span
class="text-danger">*</span></label>
<input type="text" id="HusbandName" name="HusbandName"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4" id="husband_address_field" style="display: none">
<div class="form-group mb-2">
<label class="mb-0" for="HusbandResidence">Husband's Residence <span
class="text-danger">*</span></label>
<input type="text" id="HusbandResidence" name="HusbandResidence"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Personal mark of Identification">Personal mark of
Identification <span class="text-danger">*</span></label>
<input type="text" id="MarkOfIdentification" name="MarkOfIdentification"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Exact height of measurement">Exact height of
measurement <span class="text-danger">*</span></label>
<input type="text" id="ExactHeightOfMeasurement" name="ExactHeightOfMeasurement"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4" style="display: none;" id="MarriageCertificate_field">
<div class="form-group mb-2">
<label class="mb-0" for="MarriageCertificate">Marriage Certificate </label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="MarriageCertificate"
class="custom-file-input form-control-sm" id="MarriageCertificate"
accept="image/*, .pdf">
<label class="custom-file-label" for="MarriageCertificate">Choose
Certificate</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Sign of the employees">Sign of the Employee <span
class="text-danger">*</span></label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="EmployeeSign"
class="custom-file-input form-control-sm" id="EmployeeSign"
accept="image/*">
<label class="custom-file-label" for="Sign of the employees">Choose
file</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="EmployeePhoto">Employee Photo </label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="EmployeePhoto"
class="custom-file-input form-control-sm" id="EmployeePhoto"
accept="image/*" />
<label class="custom-file-label" for="EmployeePhoto">Choose
photo</label>
</div>
</div>
</div>
</div>
</div>
<hr />
<div class="row">
<div class="col-12">
<div class="d-flex align-items-center justify-content-center">
<button type="button" class="btn btn-sm btn-outline-secondary mx-1"
data-dismiss="modal" aria-label="Close">Cancel</button>
<button type="submit" id="btn-save-name" name="Save" value="Save"
class="btn btn-sm btn-info mx-1">Save</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="updateEmpGeneralDetail">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Employee Name <span id="EditGenerelDetailEmployeeName" class="text-info"></span>
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- Main content -->
<form id="updateEmpGeneralDetailform">
<input type="hidden" name="_token" id="EditGenerelDetailToken" value="<?php echo e(csrf_token()); ?>">
<input type="hidden" id="EditGenerelDetailEmployeeId" name="EmployeeId">
<input type="hidden" id="EmpGeneralDetailId" name="EmpGeneralDetailId">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="FatherName">Fathers's name <span
class="text-danger">*</span></label>
<input type="text" id="EditFatherName" name="FatherName"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="FatherResidence">Fathers's Residence <span
class="text-danger">*</span></label>
<input type="text" id="EditFatherResidence" name="FatherResidence"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0">Gender <span class="text-danger">*</span></label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="Gender" id="EditGender"
data-placeholder="Select Gender">
<option value="" selected disabled>Select Gender</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="MaritalStatus">Marital Status <span
class="text-danger">*</span></label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="MaritalStatus" id="EditMaritalStatus"
data-placeholder="Select Marital Status">
<option value="" selected disabled>Select Marital Status</option>
</select>
</div>
</div>
<div class="col-md-4" id="Edithusband_field" style="display: none">
<div class="form-group mb-2">
<label class="mb-0" for="HusbandName">Husband's name <span
class="text-danger">*</span></label>
<input type="text" id="EditHusbandName" name="HusbandName"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4" id="Edithusband_address_field" style="display: none">
<div class="form-group mb-2">
<label class="mb-0" for="HusbandResidence">Husband's Residence <span
class="text-danger">*</span></label>
<input type="text" id="EditHusbandResidence" name="HusbandResidence"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Personal mark of Identification">Personal mark of
Identification <span class="text-danger">*</span></label>
<input type="text" id="EditMarkOfIdentification" name="MarkOfIdentification"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Exact height of measurement">Exact height of
measurement <span class="text-danger">*</span></label>
<input type="text" id="EditExactHeightOfMeasurement" name="ExactHeightOfMeasurement"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4" style="display: none;" id="EditMarriageCertificate_field">
<div class="form-group mb-2">
<label class="mb-0" for="MarriageCertificate">Marriage Certificate </label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="MarriageCertificate"
class="custom-file-input form-control-sm" id="EditMarriageCertificate"
accept="image/*, .pdf">
<label class="custom-file-label" for="MarriageCertificate">Choose
Certificate</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="Sign of the employees">Sign of the Employee </label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="EmployeeSign"
class="custom-file-input form-control-sm" id="EditEmployeeSign"
accept="image/*">
<label class="custom-file-label" for="Sign of the employees">Choose
file</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="EmployeePhoto">Employee Photo </label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="EmployeePhoto"
class="custom-file-input form-control-sm" id="EditEmployeePhoto"
accept="image/*" />
<label class="custom-file-label" for="EmployeePhoto">Choose
photo</label>
</div>
</div>
</div>
</div>
</div>
<hr />
<div class="row">
<div class="col-12">
<div class="d-flex align-items-center justify-content-center">
<button type="button" class="btn btn-sm btn-outline-secondary mx-1"
data-dismiss="modal" aria-label="Close">Cancel</button>
<button type="submit" name="Update" value="Update"
class="btn btn-sm btn-info mx-1">Update</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script>
// Marital Status
$(document).ready(function() {
$.ajax({
type: "GET",
url: "<?php echo e(url('/marital-status-list')); ?>",
dataType: "json",
success: function(response) {
var json = response.MaritalStatus;
$.each(json, function(i, marital) {
$("#MaritalStatus, #EditMaritalStatus").append("<option value='" + marital.MaritalStatusId + "'>" + marital.MaritalStatusName + "</option>");
$('#MaritalStatus, #EditMaritalStatus').trigger('change');
});
}
});
});
// Gender List
$(document).ready(function() {
$.ajax({
type: "GET",
url: "<?php echo e(url('/gender-list')); ?>",
dataType: "json",
success: function(response) {
var json = response.Gender;
$.each(json, function(i, gender) {
$("#Gender, #EditGender").append("<option value='" + gender.GenderId + "'>" + gender.GenderName + "</option>");
$('#Gender, #EditGender').trigger('change');
});
}
});
});
</script>
<script>
$(document).ready(function() {
$("#MaritalStatus, #Gender").change(function() {
//alert($(this).val())
if ($('#MaritalStatus').val() == "aS5kX3SrEoVsUbaKgjWoGDuRXfUaWHrV15qbW" && $('#Gender').val() == "08WMYIHgVlaDipwSoeCV7mDLylEhfjjxlVbaI") { // Married and Female
$("#husband_field, #husband_address_field").css('display', 'block');
$("#HusbandName, #HusbandResidence").prop('required', true);
} else {
$("#husband_field, #husband_address_field").css('display', 'none');
$("#HusbandName, #HusbandResidence").prop('required', false);
}
});
});
// Edit Case Form
$(document).ready(function() {
$("#EditMaritalStatus, #EditGender").change(function() {
//alert($(this).val())
if ($('#EditMaritalStatus').val() == "aS5kX3SrEoVsUbaKgjWoGDuRXfUaWHrV15qbW" && $('#EditGender').val() == "08WMYIHgVlaDipwSoeCV7mDLylEhfjjxlVbaI") { // Married and Female
$("#Edithusband_field, #Edithusband_address_field").css('display', 'block');
$("#EditHusbandName, #EditHusbandResidence").prop('required', true);
} else {
$("#Edithusband_field, #Edithusband_address_field").css('display', 'none');
$("#EditHusbandName, #EditHusbandResidence").prop('required', false);
}
});
});
</script>
<script>
$(document).ready(function() {
$("#MaritalStatus").change(function() {
//alert($(this).val())
if ($(this).val() == "aS5kX3SrEoVsUbaKgjWoGDuRXfUaWHrV15qbW") { // Married
$("#MarriageCertificate_field").css('display', 'block');
// $("#MarriageCertificate").prop('required', true);
} else {
$("#MarriageCertificate_field").css('display', 'none');
// $("#MarriageCertificate").prop('required', false);
}
});
});
//Edit Case Form
$(document).ready(function() {
$("#EditMaritalStatus").change(function() {
//alert($(this).val())
if ($(this).val() == "aS5kX3SrEoVsUbaKgjWoGDuRXfUaWHrV15qbW") { // Married
$("#EditMarriageCertificate_field").css('display', 'block');
// $("#EditMarriageCertificate").prop('required', true);
} else {
$("#EditMarriageCertificate_field").css('display', 'none');
//$("#EditMarriageCertificate").prop('required', false);
}
});
});
</script>
<script>
function addPendingEmpGeneralDetail(EmployeeId)
{
var EmployeeId = EmployeeId;
$('#addEmpGeneralDetail').modal('show');
$.ajax({
type: "POST",
url: "<?php echo e(url('/')); ?>/get-employee-detail",
dataType: 'json',
data: {
EmployeeId: EmployeeId,
_token: "<?php echo e(csrf_token()); ?>",
},
success: function (response) {
$('#AddGenerelDetailEmployeeId').val(response.GetEmployee.EmployeeId);
$('#AddGenerelDetailEmployeeCode').val(response.GetEmployee.EmployeeCode);
$('span#AddGenerelDetailEmployeeName').html('#' +response.GetEmployee.EmployeeName);
}
});
}
</script>
<script>
$(function () {
$.validator.setDefaults({
submitHandler: function () {
event.preventDefault();
// Get Form Data
var token = $("#AddGenerelDetailToken").val();
var EmployeeId = $("#AddGenerelDetailEmployeeId").val();
var EmployeeCode = $("#AddGenerelDetailEmployeeCode").val();
var Gender = $('#Gender :selected').val();
var MaritalStatus = $('#MaritalStatus :selected').val();
var FatherName = $('#FatherName').val();
var HusbandName = $('#HusbandName').val();
var FatherResidence = $('#FatherResidence').val();
var HusbandResidence = $('#HusbandResidence').val();
var MarkOfIdentification = $('#MarkOfIdentification').val();
var ExactHeightOfMeasurement = $('#ExactHeightOfMeasurement').val();
var MarriageCertificate = $('#MarriageCertificate')[0].files;
var EmployeeSign = $('#EmployeeSign')[0].files;
var EmployeePhoto = $('#EmployeePhoto')[0].files;
var fd = new FormData();
fd.append('_token',token);
fd.append('EmployeeId',EmployeeId);
fd.append('EmployeeCode',EmployeeCode);
fd.append('GenderId',Gender);
fd.append('MaritalStatusId',MaritalStatus);
fd.append('FatherName',FatherName);
fd.append('HusbandName',HusbandName);
fd.append('FatherAddress',FatherResidence);
fd.append('HusbandAddress',HusbandResidence);
fd.append('PersonalMarkOfIdentification',MarkOfIdentification);
fd.append('ExactHeightOfMeasurement',ExactHeightOfMeasurement);
// files data
fd.append('MarriageCertificate',MarriageCertificate[0]);
fd.append('EmployeeSign',EmployeeSign[0]);
fd.append('EmployeePhoto',EmployeePhoto[0]);
$.ajax({
type: "post",
url: "<?php echo e(url('store-employee-general-detail')); ?>",
data: fd,
contentType: false,
processData: false,
success: function(response) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'General detail added successfully!'
});
setTimeout(function(){
window.location.reload(1);
}, 2000);
},
error: function(data) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'error',
title: 'Something went wrong!'
});
}
});
}
});
$('#addEmpGeneralDetailform').validate({
rules: {
FatherName: {
required: true,
},
FatherResidence: {
required: true,
},
Gender: {
required: true,
},
MaritalStatus: {
required: true,
},
MarkOfIdentification: {
required: true,
},
ExactHeightOfMeasurement: {
required: true,
},
MarriageCertificate: {
accept: "image/*, pdf"
},
EmployeeSign: {
required: true,
accept: "image/*"
},
EmployeePhoto: {
required: true,
accept: "image/*"
},
},
messages: {
Gender: {
required: "Gender is required.",
},
MaritalStatus: {
required: "Marital Status is required.",
},
},
errorElement: 'span',
errorPlacement: function (error, element) {
error.addClass('invalid-feedback');
element.closest('.form-group').append(error);
},
highlight: function (element, errorClass, validClass) {
$(element).addClass('is-invalid');
},
unhighlight: function (element, errorClass, validClass) {
$(element).removeClass('is-invalid');
}
});
});
</script>
<script>
function editEmpGeneralDetail(EmpGeneralDetailId)
{
var EmpGeneralDetailId = EmpGeneralDetailId;
$.ajax({
type: "POST",
url: "<?php echo e(url('/')); ?>/edit-emp-general-detail",
dataType: 'json',
data: {
EmpGeneralDetailId: EmpGeneralDetailId,
_token: "<?php echo e(csrf_token()); ?>",
},
success: function (response) {
$('#EditGenerelDetailEmployeeId').val(response.EmpGeneralDetail.EmployeeId);
$('#EmpGeneralDetailId').val(response.EmpGeneralDetail.EmpGeneralDetailId);
$('span#EditGenerelDetailEmployeeName').html('#' +response.EmpGeneralDetail.EmployeeName);
$('#EditGender').val(response.EmpGeneralDetail.GenderId);
$('#EditGender').trigger('change')
$('#EditMaritalStatus').val(response.EmpGeneralDetail.MaritalStatusId);
$('#EditMaritalStatus').trigger('change')
$('#EditFatherName').val(response.EmpGeneralDetail.FatherName);
$('#EditFatherResidence').val(response.EmpGeneralDetail.FatherAddress);
$('#EditHusbandName').val(response.EmpGeneralDetail.HusbandName);
$('#EditHusbandResidence').val(response.EmpGeneralDetail.HusbandAddress);
$('#EditMarkOfIdentification').val(response.EmpGeneralDetail.PersonalMarkOfIdentification);
$('#EditExactHeightOfMeasurement').val(response.EmpGeneralDetail.ExactHeightOfMeasurement);
}
});
$('#updateEmpGeneralDetail').modal('show');
}
</script>
<script>
$(function () {
$.validator.setDefaults({
submitHandler: function () {
event.preventDefault();
// Get Form Data
var token = $("#EditGenerelDetailToken").val();
var EmployeeId = $("#EditGenerelDetailEmployeeId").val();
var EmpGeneralDetailId = $("#EmpGeneralDetailId").val();
var Gender = $('#EditGender :selected').val();
var MaritalStatus = $('#EditMaritalStatus :selected').val();
var FatherName = $('#EditFatherName').val();
var HusbandName = $('#EditHusbandName').val();
var FatherResidence = $('#EditFatherResidence').val();
var HusbandResidence = $('#EditHusbandResidence').val();
var MarkOfIdentification = $('#EditMarkOfIdentification').val();
var ExactHeightOfMeasurement = $('#EditExactHeightOfMeasurement').val();
var MarriageCertificate = $('#EditMarriageCertificate')[0].files;
var EmployeeSign = $('#EditEmployeeSign')[0].files;
var EmployeePhoto = $('#EditEmployeePhoto')[0].files;
var fd = new FormData();
fd.append('_token',token);
fd.append('EmployeeId',EmployeeId);
fd.append('EmpGeneralDetailId',EmpGeneralDetailId);
fd.append('GenderId',Gender);
fd.append('MaritalStatusId',MaritalStatus);
fd.append('FatherName',FatherName);
fd.append('HusbandName',HusbandName);
fd.append('FatherAddress',FatherResidence);
fd.append('HusbandAddress',HusbandResidence);
fd.append('PersonalMarkOfIdentification',MarkOfIdentification);
fd.append('ExactHeightOfMeasurement',ExactHeightOfMeasurement);
// files data
fd.append('MarriageCertificate',MarriageCertificate[0]);
fd.append('EmployeeSign',EmployeeSign[0]);
fd.append('EmployeePhoto',EmployeePhoto[0]);
$.ajax({
type: "post",
url: "<?php echo e(url('update-employee-general-detail')); ?>",
data: fd,
contentType: false,
processData: false,
success: function(response) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'General detail updated successfully!'
});
setTimeout(function(){
window.location.reload(1);
}, 2000);
},
error: function(data) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 2000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'error',
title: 'Something went wrong!'
});
}
});
}
});
$('#updateEmpGeneralDetailform').validate({
rules: {
FatherName: {
required: true,
},
FatherResidence: {
required: true,
},
Gender: {
required: true,
},
MaritalStatus: {
required: true,
},
MarkOfIdentification: {
required: true,
},
ExactHeightOfMeasurement: {
required: true,
},
MarriageCertificate: {
accept: "image/*, pdf"
},
EmployeeSign: {
accept: "image/*"
},
EmployeePhoto: {
accept: "image/*"
},
},
messages: {
Gender: {
required: "Gender is required.",
},
MaritalStatus: {
required: "Marital Status is required.",
},
},
errorElement: 'span',
errorPlacement: function (error, element) {
error.addClass('invalid-feedback');
element.closest('.form-group').append(error);
},
highlight: function (element, errorClass, validClass) {
$(element).addClass('is-invalid');
},
unhighlight: function (element, errorClass, validClass) {
$(element).removeClass('is-invalid');
}
});
});
</script>
<?php /**PATH /var/www/html/hrms/resources/views/components/employee-general-detail-modal.blade.php ENDPATH**/ ?>