File: /var/www/html/hrms-production/storage/framework/views/70dc8400a38a03977971078061213080db381cca.php
<?php $__env->startSection('content'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
</div>
<div class="col-sm-6 text-right">
<a href="<?php echo e(url('previous-job-detail')); ?>" target="blank"
class="btn btn-sm btn-outline-info mx-1">Add New</a>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5>List of Employee Previous Job</h5>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="emplaoyeePreviousJobTable" class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>S.No.</th>
<th>Employee Code</th>
<th>Employee Name</th>
<th>ControllingOfficer</th>
<th>Designation</th>
<th>SanctionPost</th>
<th>From Date</th>
<th>To Date</th>
<th>Created By</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $EmpPreviousJobList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $EmpPreviousJobList): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($loop->iteration); ?></td>
<td><a href="<?php echo e(url('view-employee',$EmpPreviousJobList->EmployeeId)); ?>"
target="blank"><?php echo e($EmpPreviousJobList->EmployeeCode); ?></a></td>
<td><?php echo e($EmpPreviousJobList->EmployeeName); ?></td>
<td><?php echo e($EmpPreviousJobList->ControllingOfficer); ?></td>
<td><?php echo e($EmpPreviousJobList->Designation); ?></td>
<td><?php echo e($EmpPreviousJobList->SanctionPost); ?></td>
<td><?php echo e(date('d-M-Y', strtotime($EmpPreviousJobList->StartDate))); ?></td>
<td><?php echo e(date('d-M-Y', strtotime($EmpPreviousJobList->EndDate))); ?></td>
<td><?php echo e($EmpPreviousJobList->Created_by); ?>, <?php echo e(date('d-M-y h:m a', strtotime($EmpPreviousJobList->Created_at))); ?></td>
<td style="width: 10%">
<div class="btn-group">
<button type="button"
class="btn btn-default btn-sm dropdown-toggle dropdown-icon"
data-toggle="dropdown" aria-expanded="false">
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<a href="<?php echo e(url('view-emp-previous-job-detail', $EmpPreviousJobList->PreviousJobDetailId)); ?>"
class="dropdown-item btn btn-default" target="blank">View</a>
<button type="button" class="dropdown-item btn btn-default" onclick="editPreviousJobDetail('<?php echo e($EmpPreviousJobList->PreviousJobDetailId); ?>')">Edit</button>
<button type="button" class="dropdown-item btn btn-default" onclick="deletePreviousJobDetail('<?php echo e($EmpPreviousJobList->PreviousJobDetailId); ?>')" data-id="'<?php echo e($EmpPreviousJobList->PreviousJobDetailId); ?>'">Delete</button>
</div>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<div class="modal fade" id="updatePreviousJobDetail">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Employee <span id="EmployeeNameEdit" 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="updatePreviousDetailForm">
<input type="hidden" name="_token" id="token_update" value="<?php echo e(csrf_token()); ?>">
<input type="hidden" id="PreviousJobDetailId" name="PreviousJobDetailId">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label class="mb-0" for="DDO">Prev DDO </label>
<input type="text" id="EditDDO" name="DDO" class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevControllingOfficer" class="mb-0">Prev Contr. Officer </label>
<input type="text" id="EditControllingOfficer" name="ControllingOfficer"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevWorkPlace" class="mb-0">Prev Location </label>
<input type="text" id="EditWorkPlace" name="PreviousLocation"
class="form-control form-control-sm">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevDepartment" class="mb-0">Prev Department </label>
<input type="text" id="EditDepartment" name="Department"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevGroup" class="mb-0">Prev Group </label>
<input type="text" id="EditGroup" name="Group" class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevCadre" class="mb-0">Prev Cadre </label>
<input type="text" id="EditCadre" name="Cadre" class="form-control form-control-sm">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevDesignation" class="mb-0">Prev Designation </label>
<input type="text" id="EditDesignation" name="Designation"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevSanctionPost" class="mb-0">Prev Sanction Post </label>
<input type="text" id="EditSanctionPost" name="PrevSanctionPost"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevStation" class="mb-0">Prev Station </label>
<input type="text" class="form-control form-control-sm" style="width: 100%;"
name="PrevStation" id="EditStation">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevDA" class="mb-0">Prev DA </label>
<input type="text" class="form-control form-control-sm" style="width: 100%;"
name="PrevDearnessAllowance" id="EditDearnessAllowance">
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="FromDate" class="mb-0">From Date <span
class="text-danger">*</span></label>
<div class="input-group date" id="jobFromDate" data-target-input="nearest">
<input type="text" id="fromDate" name="jobFromDate"
class="form-control form-control-sm datetimepicker-input"
data-target="#fromDate" placeholder="DD/MM/YYYY" />
<div class="input-group-append" data-target="#fromDate"
data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-2">
<label for="ToDate" class="mb-0">To Date <span class="text-danger">*</span></label>
<div class="input-group date" id="jobToDate" data-target-input="nearest">
<input type="text" id="toDate" name="jobToDate"
class="form-control form-control-sm datetimepicker-input"
data-target="#toDate" placeholder="DD/MM/YYYY" />
<div class="input-group-append" data-target="#toDate"
data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label for="PrevPayScale" class="mb-0">Prev Pay Scale </label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="PrevPayScale" id="EditPayScale"
data-placeholder="Select PayScale">
</select>
</div>
</div>
<div class="col-md-4" id="PayBandId_field" style="display: none;">
<div class="form-group mb-2">
<label for="PayBandId" class="mb-0">Prev Pay Band </label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="PayBandId" id="PayBandId"
data-placeholder="Select PayBand">
<option value="" disabled selected>Select PayBand</option>
</select>
</div>
</div>
<div class="col-md-4" id="PayLevelId_field" style="display: none;">
<div class="form-group mb-2">
<label for="PrevPayLevel" class="mb-0">Prev PayLevel <span
class="text-danger">*</span></label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="PayLevelId" id="PayLevelId"
data-placeholder="Select PayLevel">
</select>
</div>
</div>
<div class="col-md-4" id="GradePayId_field" style="display: none;">
<div class="form-group mb-2">
<label for="PrevGradePay" class="mb-0">Prev Grade Pay </label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="PrevGradePay" id="GradePayId"
data-placeholder="Select GradePay">
</select>
</div>
</div>
<div class="col-md-4" id="PayLevelAmount_field" style="display: none;">
<div class="form-group mb-2">
<label for="PrevPayLevelAmount" class="mb-0">Prev BasicPay + G.P. </label>
<input type="text" id="PayLevelAmount" name="PayLevelAmount"
class="form-control form-control-sm">
</div>
</div>
<div class="col-md-4" id="PayLevelAmountId_field" style="display: none;">
<div class="form-group mb-2">
<label for="PayLevelAmount" class="mb-0">Prev BasicPay + G.P. </label>
<select class="form-control form-control-sm select2" style="width: 100%;"
aria-hidden="true" name="PayLevelAmountId" id="PayLevelAmountId"
data-placeholder="Select PayLevel">
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-0">
<label for="LastPayCertificate" class="mb-0">Last pay certificate</label>
<div class="input-group input-group-sm">
<div class="custom-file">
<input type="file" class="custom-file-input" name="LastPayCertificate"
id="lastPayCertificate" accept="image/*, .pdf">
<label class="custom-file-label" for="LastPayCertificate">Choose
file</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group mb-0">
<label for="SubmittedResignation" class="mb-0">Submitted Resignation</label>
<div class="input-group input-group-sm">
<div class="custom-file">
<input type="file" class="custom-file-input" name="SubmittedResignation"
id="submittedResignation" accept="image/*, .pdf">
<label class="custom-file-label" for="SubmittedResignation">Choose
file</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group mb-2 mt-2">
<label for="Reason" class="mb-0">Reason For Leaving Job </label>
<textarea class="form-control form-control-sm" name="Reason" id="EditReason"
cols="30" rows="2"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group clearfix mb-0">
<div class="icheck-primary d-inline">
<input type="checkbox" name="InService" id="InService">
<label for="InService">In Service</label>
</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>
</div>
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script>
$(function() {
$("#emplaoyeePreviousJobTable").DataTable({
"responsive": true,
"lengthChange": true,
"autoWidth": false,
"lengthMenu": [10, 20, 50, 100, 250, 500],
"buttons": ["csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#emplaoyeePreviousJobTable_wrapper .col-md-6:eq(0)');
});
</script>
<script>
// PayScale List
$(document).ready(function() {
$.ajax({
type: "GET",
url: "<?php echo e(url('/payscale-list')); ?>",
dataType: "json",
success: function(response) {
var json = response.PayScale;
$.each(json, function(i, payscale) {
$("#EditPayScale").append("<option value='" + payscale.PayScaleId + "'>" + payscale.PayScaleName + "</option>");
$('#EditPayScale').trigger('change');
});
}
});
});
// PayBand List
$(document).ready(function() {
$.ajax({
type: "GET",
url: "<?php echo e(url('/payband-list')); ?>",
dataType: "json",
success: function(response) {
var json = response.PayBand;
$.each(json, function(i, payband) {
$("#PayBandId").append("<option value='" + payband.PayBandId + "'>" + payband.PayBandName + "</option>");
$('#PayBandId').trigger('change');
});
}
});
});
</script>
<script>
$(document).ready(function() {
$("#EditPayScale").change(function() {
//alert($(this).val())
$('#PayBandId').val(null).trigger('change');
$('#GradePayId').empty();
$('#PayLevelId').val(null).trigger('change');
$('#PayLevelAmount').val('');
$('#PayLevelAmountId').empty();
if ($(this).val() == "l7Is9HD8Yr2nMQKmSwm189AEr3yawtvPrZrn4") { // 6th payscale
$("#PayLevelId_field").css('display', 'none');
$("#PayLevelId").prop('required', false);
$("#PayLevelAmountId_field").css('display', 'none');
$("#PayLevelAmountId").prop('required', false);
$("#PayBandId_field").css('display', '');
//$("#PayBandId").prop('required', true);
$("#GradePayId_field").css('display', '');
//$("#GradePayId").prop('required', true);
$("#PayLevelAmount_field").css('display', '');
//$("#PayLevelAmount").prop('required', true);
} else if ($(this).val() == "KmmsPcY7uGEnMyRYmSYlD66z6dwLsMtqG19Qs") { // 7th payscale
$("#PayLevelId_field").css('display', '');
//$("#PayLevelId").prop('required', true);
$("#PayLevelAmountId_field").css('display', '');
//$("#PayLevelAmountId").prop('required', true);
$("#PayBandId_field").css('display', 'none');
$("#PayBandId").prop('required', false);
$("#GradePayId_field").css('display', 'none');
$("#GradePayId").prop('required', false);
$("#PayLevelAmount_field").css('display', 'none');
$("#PayLevelAmount").prop('required', false);
} else if ($(this).val() == "jpWwVaivsVq9dys2kPocbd0kfmQeM7FM8DuRm" || $(this).val() == "aJd0V3oRX2YI5G8hVN6PTDU1WrSIjOE9oQmSU") {
$("#PayLevelId_field").css('display', 'none');
$("#PayLevelId").prop('required', false);
$("#PayLevelAmountId_field").css('display', 'none');
$("#PayLevelAmountId").prop('required', false);
$("#PayBandId_field").css('display', 'none');
$("#PayBandId").prop('required', false);
$("#GradePayId_field").css('display', 'none');
$("#GradePayId").prop('required', false);
$("#PayLevelAmount_field").css('display', '');
//$("#PayLevelAmount").prop('required', true);
}
});
});
</script>
<script>
$('#PayBandId').on('select2:select', function (e) {
//alert(e.params.data);
var data = e.params.data;
var PayBandId = data.id;
getGradePayList(PayBandId);
});
function getGradePayList(PayBandId, GradePayId = ''){
var PayBandId = PayBandId;
$('#EditGradePayId').empty();
$.ajax({
type: "GET",
url: "<?php echo e(url('/')); ?>/get-gradepay-list/" +PayBandId,
dataType: "json",
success: function(response) {
var json = response.GradePay;
$.each(json, function(i, gradepay) {
if (GradePayId == gradepay.GradePayId) {
$("#GradePayId").append("<option selected value='" + gradepay.GradePayId + "'>" + gradepay.GradePayName + "</option>");
$('#GradePayId').trigger('change');
} else {
$("#GradePayId").append("<option value='" + gradepay.GradePayId + "'>" + gradepay.GradePayName + "</option>");
$('#GradePayId').trigger('change');
}
});
}
});
}
// Get PayLevel List based on PayScale
$('#EditPayScale').on('select2:select', function (e) {
//alert(e.params.data);
var data = e.params.data;
var PayScaleId = data.id;
getPayLevelList(PayScaleId);
});
function getPayLevelList(PayScaleId){
var PayScaleId = PayScaleId;
$('#PayLevelId').empty();
$.ajax({
type: "GET",
url: "<?php echo e(url('/')); ?>/get-paylevel-list/" +PayScaleId,
dataType: "json",
success: function(response) {
var json = response.PayLevel;
$.each(json, function(i, paylevel) {
$("#PayLevelId").append("<option value='" + paylevel.PayLevelId + "'>" + paylevel.PayLevelName + " (" + paylevel.AmountRange + ")" +"</option>");
$('#PayLevelId').trigger('change');
});
}
});
}
// PayLevel Amount on select PayLevel
$('#PayLevelId').on('select2:select', function (e) {
//alert(e.params.data);
var data = e.params.data;
var PayLevelId = data.id;
getPayLevelAmountList(PayLevelId);
});
function getPayLevelAmountList(PayLevelId){
var PayLevelId = PayLevelId;
$('#PayLevelAmountId').empty();
$.ajax({
type: "GET",
url: "<?php echo e(url('/')); ?>/get-paylevel-amount-list/" +PayLevelId,
dataType: "json",
success: function(response) {
var json = response.PayLevelAmount;
$.each(json, function(i, paylevelamount) {
$("#PayLevelAmountId").append("<option value='" + paylevelamount.PayLevelAmountId + "'>" + paylevelamount.PayLevelAmount + "</option>");
$('#PayLevelAmountId').trigger('change');
});
}
});
}
</script>
<script>
function editPreviousJobDetail(PreviousJobDetailId)
{
var PreviousJobDetailId = PreviousJobDetailId;
$('#updatePreviousJobDetail').modal('show');
$.ajax({
type: "POST",
url: "<?php echo e(url('/')); ?>/edit-emp-previous-job-detail",
dataType: 'json',
data: {
PreviousJobDetailId: PreviousJobDetailId,
_token: "<?php echo e(csrf_token()); ?>",
},
success: function (response) {
$('#PreviousJobDetailId').val(response.GetPreviousJobDetail.PreviousJobDetailId);
$('span#EmployeeNameEdit').html('#' +response.GetPreviousJobDetail.EmployeeCode);
$('#EditDDO').val(response.GetPreviousJobDetail.DDO);
$('#EditControllingOfficer').val(response.GetPreviousJobDetail.ControllingOfficer);
$('#EditWorkPlace').val(response.GetPreviousJobDetail.ActualWorkPlace);
$('#EditDepartment').val(response.GetPreviousJobDetail.Department);
$('#EditGroup').val(response.GetPreviousJobDetail.Group);
$('#EditCadre').val(response.GetPreviousJobDetail.Cadre);
$('#EditDesignation').val(response.GetPreviousJobDetail.Designation);
$('#EditSanctionPost').val(response.GetPreviousJobDetail.SanctionPost);
$('#EditStation').val(response.GetPreviousJobDetail.Station);
$('#EditDearnessAllowance').val(response.GetPreviousJobDetail.DearnessAllowance);
var SDate = new Date(response.GetPreviousJobDetail.StartDate);
$('#fromDate').val(((SDate.getDate() > 9) ? SDate.getDate() : ('0' + SDate.getDate())) + '/' + ((SDate.getMonth() > 8) ? (SDate.getMonth() + 1) : ('0' + (SDate.getMonth() + 1))) + '/' + SDate.getFullYear());
var EDate = new Date(response.GetPreviousJobDetail.EndDate);
$('#toDate').val(((EDate.getDate() > 9) ? EDate.getDate() : ('0' + EDate.getDate())) + '/' + ((EDate.getMonth() > 8) ? (EDate.getMonth() + 1) : ('0' + (EDate.getMonth() + 1))) + '/' + EDate.getFullYear());
$('#EditPayScale').val(response.GetPreviousJobDetail.PayScaleId);
$('#EditPayScale').select2().trigger('change');
var payscale_id = response.GetPreviousJobDetail.PayScaleId;
// If 4th and 5th PayScale
if (payscale_id == 'jpWwVaivsVq9dys2kPocbd0kfmQeM7FM8DuRm' || payscale_id == 'aJd0V3oRX2YI5G8hVN6PTDU1WrSIjOE9oQmSU') {
// PayLevelAmount
$('#PayLevelAmount_field').css('display', 'block');
$('#PayLevelAmount').val(response.GetPreviousJobDetail.PayLevelAmount);
}
// If 6th PayScale
if (payscale_id == 'l7Is9HD8Yr2nMQKmSwm189AEr3yawtvPrZrn4') {
// PayBand
$('#PayBandId_field').css('display', 'block');
$('#PayBandId').val(response.GetPreviousJobDetail.PayBandId);
$('#PayBandId').select2().trigger('change');
// GradePay
getGradePayList(response.GetPreviousJobDetail.PayBandId);
$('#GradePayId_field').css('display', 'block');
$('#GradePayId').val(response.GetPreviousJobDetail.GradePayId);
$('#GradePayId').select2().trigger('change');
// PayLevelAmount
$('#PayLevelAmount_field').css('display', 'block');
$('#PayLevelAmount').val(response.GetPreviousJobDetail.PayLevelAmount);
}
// If 7th PayScale
if (payscale_id == 'KmmsPcY7uGEnMyRYmSYlD66z6dwLsMtqG19Qs') {
// PayLevel
$('#PayLevelId_field').css('display', 'block');
$('#PayLevelId').val(response.GetPreviousJobDetail.PayLevelId);
$('#PayLevelId').select2().trigger('change');
// PayLevelAmpuntId
getPayLevelAmountList(response.GetPreviousJobDetail.PayLevelId);
$('#PayLevelAmountId_field').css('display', 'block');
$('#PayLevelAmountId').val(response.GetPreviousJobDetail.PayLevelAmountId);
$('#PayLevelAmountId').select2().trigger('change');
}
$('#EditReason').val(response.GetPreviousJobDetail.ReasonForLeavingJob);
if (response.GetPreviousJobDetail.InService == '1') {
$("input#InService").prop('checked', true);
} else {
$("input#InService").prop('checked', false);
}
}
});
}
</script>
<script>
$(function () {
$.validator.setDefaults({
submitHandler: function () {
event.preventDefault();
// Get Form Data
var token = $("#token_update").val();
var PreviousJobDetailId = $("#PreviousJobDetailId").val();
var DDO = $('#EditDDO').val();
var controllingOfficer = $('#EditControllingOfficer').val();
var PrevSanctionPost = $('#EditSanctionPost').val();
var PrevPayScale = $('#EditPayScale :selected').val();
var PayBandId = $('#PayBandId :selected').val();
var GradePayId = $('#GradePayId :selected').val();
var PayLevelId = $('#PayLevelId :selected').val();
var PayLevelAmount = $('#PayLevelAmount').val();
var PayLevelAmountId = $('#PayLevelAmountId :selected').val();
var fromDate = $('#fromDate').val();
var station = $('#EditStation').val();
var reasonForLeavingJob = $('#EditReason').val();
var previousLocation = $('#EditWorkPlace').val();
var Department = $('#EditDepartment').val();
var PrevGroup = $('#EditGroup').val();
var PrevCadre = $('#EditCadre').val();
var PrevDesignation = $('#EditDesignation').val();
var dearnessAllowance = $('#EditDearnessAllowance').val();
var toDate = $('#toDate').val();
var InService = '';
if($('#InService').is(":checked"))
{
var InService = '1'
}
else
{
var InService = '0'
}
var lastPayCertificate = $('#lastPayCertificate')[0].files;
var submittedResignation = $('#submittedResignation')[0].files;
var fd = new FormData();
fd.append('_token',token);
fd.append('PreviousJobDetailId',PreviousJobDetailId);
fd.append('DDO',DDO);
fd.append('ControllingOfficer',controllingOfficer);
fd.append('SanctionPost',PrevSanctionPost);
fd.append('PayScaleId',PrevPayScale);
fd.append('PayBandId',PayBandId);
fd.append('GradePayId',GradePayId);
fd.append('PayLevelId',PayLevelId);
fd.append('PayLevelAmount',PayLevelAmount);
fd.append('PayLevelAmountId',PayLevelAmountId);
fd.append('fromDate',fromDate);
fd.append('Station',station);
fd.append('ReasonForLeavingJob',reasonForLeavingJob);
fd.append('ActualWorkPlace',previousLocation);
fd.append('Department',Department);
fd.append('Group',PrevGroup);
fd.append('Cadre',PrevCadre);
fd.append('Designation',PrevDesignation);
fd.append('DearnessAllowance',dearnessAllowance);
fd.append('toDate',toDate);
fd.append('InService',InService);
// files data
fd.append('lastPayCertificate',lastPayCertificate[0]);
fd.append('submittedResignation',submittedResignation[0]);
$.ajax({
type: "post",
url: "<?php echo e(url('update-previous-job-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: 'Job 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!'
});
}
});
}
});
$('#updatePreviousDetailForm').validate({
rules: {
PrevDDO: {
required: true,
},
PrevControllingOfficer: {
required: true,
},
PrevSanctionPost: {
required: true
},
fromDate: {
required: true,
},
toDate: {
required: true,
},
lastPayCertificate: {
required: true,
accept: "image/*, pdf",
//filesize: 2,
},
submittedResignation: {
required: true,
accept: "image/*, pdf",
//filesize: 2,
},
PrevDepartment: {
required: true,
},
PrevDesignation: {
required: true,
},
},
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 deletePreviousJobDetail(PreviousJobDetailId) {
var PreviousJobDetailId = PreviousJobDetailId;
Swal.fire({
title: "Delete Record?",
text: "Are you sure you want to delete this Record?",
icon: "warning",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Yes, delete it!",
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "post",
url: "<?php echo e(url('/')); ?>/delete-previous-job",
dataType: "json",
data: {
_token: "<?php echo e(csrf_token()); ?>",
PreviousJobDetailId: PreviousJobDetailId,
},
success: function (response) {
Swal.fire({
icon: "success",
title: "Record has been deleted!",
showConfirmButton: false,
timer: 1500,
}).then(function () {
location.reload();
});
},
});
}
});
}
</script>
<!-- /.content-wrapper -->
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.include.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/hrms-production/resources/views/admin/EmployeeProfile/employee-previous-job-list.blade.php ENDPATH**/ ?>