File: /var/www/html/hrms-production/storage/framework/views/f859fe97bbdefb74634d5035dc5998de610700fd.php
<style>
.error{
color: red;
font-size: 11px;
}
</style>
<?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-12">
<h2>User Password Change</h2>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card card-default">
<div class="card-body">
<form class="form-horizontal" id="frmUserPasswordChange" method="post" action="" >
<input type="hidden" name="_token" id="token" value="<?php echo e(csrf_token()); ?>">
<input type="hidden" name="UserId" id="UserId" value="<?php echo e(Session::get('UserId')); ?>">
<div class="row">
<div class="col-md-12">
<div class="form-group row">
<label for="EmployeeCode"
class="col-sm-4 col-form-label text-right">Email:</label>
<div class="col-sm-8">
<input type="text" class="form-control form-control-sm"
name="Email" id="Email" readonly="readonly" value="<?php echo e(Session::get('UserEmail')); ?>">
</div>
</div>
<div class="form-group row">
<label for="EmployeeCode"
class="col-sm-4 col-form-label text-right">Current Password:</label>
<div class="col-sm-8">
<input type="password" class="form-control form-control-sm"
name="ExistingPassword" id="ExistingPassword" required >
</div>
</div>
<div class="form-group row">
<label for="EmployeeCode"
class="col-sm-4 col-form-label text-right">New Password:</label>
<div class="col-sm-8">
<input type="password" class="form-control form-control-sm"
name="NewPassword" id="NewPassword" required >
</div>
</div>
<div class="form-group row">
<label for="EmployeeCode"
class="col-sm-4 col-form-label text-right">Confirm New Password:</label>
<div class="col-sm-8">
<input type="password" class="form-control form-control-sm"
name="ConfirmNewPassword" id="ConfirmNewPassword" required >
<small></small>
</div>
</div>
</div>
<div class="col-md-12">
<div class="float-right">
<button type="button" id="btn-save-job-detail"
class="btn btn-warning text-white" id="updateUserPassword" onclick="updateUserPassword();">Submit</button>
<a href="<?php echo e(url('/dashboard')); ?>"
class="btn btn-warning text-white">Cancel</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section><br />
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $__env->stopSection(); ?>
<script>
function updateUserPassword() {
//event.preventDefault();
$("#frmUserPasswordChange").valid();
var token = $('#token').val();
var UserId = $('#UserId').val();
var ExistingPassword = $('#ExistingPassword').val();
var NewPassword = $('#NewPassword').val();
var ConfirmNewPassword = $('#ConfirmNewPassword').val();
if(!ExistingPassword){
Swal.fire({
icon: 'warning',
title: 'Current Password Required!',
showConfirmButton: false,
timer: 2000
});
return false;
} else if(!NewPassword){
Swal.fire({
icon: 'warning',
title: 'New Password Required!',
showConfirmButton: false,
timer: 2000
});
return false;
} else if(!ConfirmNewPassword){
Swal.fire({
icon: 'warning',
title: 'Confirm New Password Required!',
showConfirmButton: false,
timer: 2000
});
return false;
} else if(NewPassword != ConfirmNewPassword){
Swal.fire({
icon: 'warning',
title: 'Your new password and confirmation new password do not match!',
showConfirmButton: false,
timer: 2000
});
return false;
} else {
var formData = new FormData();
formData.append('_token', token);
formData.append('UserId', UserId);
formData.append('ExistingPassword', ExistingPassword);
formData.append('NewPassword', NewPassword);
$.ajax({
type: "post",
url: "<?php echo e(url('ajax/user/password/update')); ?>",
//data: $('form#addEmpQualificationForm').serialize(),
data : formData,
processData: false,
contentType: false,
success: function(response) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'success',
title: 'Password has been changed successfully!'
});
$('form#addEmpQualificationForm').each(function() {
this.reset();
});
$('span#CheckActualWorkPlace').html('');
if(response == 2)
{
Swal.fire({
icon: 'warning',
title: 'Current Password is incorrect!',
showConfirmButton: false,
timer: 2000
});
return false;
}
else if(response == 3)
{
Swal.fire({
icon: 'warning',
title: 'User not found!',
showConfirmButton: false,
timer: 2000
});
return false;
}
else if(response == 1)
{
location.href="<?php echo e(url('/dashboard')); ?>";
}
},
error: function(response) {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
Toast.fire({
icon: 'error',
title: 'Something went wrong!'
})
}
});
}
}
</script>
<?php echo $__env->make('admin.include.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/hrms/resources/views/admin/edit-user-password.blade.php ENDPATH**/ ?>