@@ -1,13 +1,13 @@
|
||||
// Login js
|
||||
$(document).on("click", "#admin_login_btn", function (e) {
|
||||
$("#admin_login_form").validate({
|
||||
$(document).on("click", "#admin_login_btn", function(e) {
|
||||
$('#admin_login_form').validate({
|
||||
rules: {
|
||||
email: {
|
||||
required: true,
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
@@ -15,150 +15,153 @@ $(document).on("click", "#admin_login_btn", function (e) {
|
||||
},
|
||||
password: {
|
||||
required: "Please enter the password.",
|
||||
},
|
||||
}
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
submitHandler: function(form) {
|
||||
e.preventDefault();
|
||||
let base_url = url_path;
|
||||
var formData = new FormData(form);
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr(
|
||||
"content"
|
||||
),
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + "/check_login",
|
||||
type: "POST",
|
||||
url: base_url + '/check_login',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
beforeSend: function () {
|
||||
$("#admin_login_btn").text("Please wait...");
|
||||
$("#admin_login_btn").attr("disabled", true);
|
||||
beforeSend: function() {
|
||||
$('#admin_login_btn').text('Please wait...');
|
||||
$('#admin_login_btn').attr('disabled', true);
|
||||
},
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (response) {
|
||||
if (response.status == 200) {
|
||||
$("#admin_login_btn").prop("disabled", false);
|
||||
$("#admin_login_btn").text("Login");
|
||||
window.location.href = base_url + "/dashboard";
|
||||
}
|
||||
if (response.status == 401) {
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$('#admin_login_btn').prop('disabled', false);
|
||||
$('#admin_login_btn').text('Login');
|
||||
|
||||
if (response.status_code == 200) {
|
||||
toastr.success(response.message);
|
||||
setTimeout(function() {
|
||||
window.location.href = base_url + "/dashboard";
|
||||
}, 2000);
|
||||
} else if (response.status_code == 401) {
|
||||
toastr.error(response.message);
|
||||
form.reset();
|
||||
$("#admin_login_btn").prop("disabled", false);
|
||||
$("#admin_login_btn").text("Sign In");
|
||||
} else {
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
toastr.error('An unexpected error occurred.');
|
||||
$('#admin_login_btn').prop('disabled', false);
|
||||
$('#admin_login_btn').text('Sign In');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// forgot password js
|
||||
$(document).on("click", "#forgot_password_btn", function (e) {
|
||||
let base_url = url_path;
|
||||
$("#forgot_pass_form").validate({
|
||||
$('#forgot_pass_form').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
email: {
|
||||
required: true,
|
||||
},
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
required: "Please Enter email",
|
||||
},
|
||||
required: "Please Enter email"
|
||||
}
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
var formData = new FormData(form);
|
||||
e.preventDefault(),
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr(
|
||||
"content"
|
||||
),
|
||||
},
|
||||
});
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + "/send_otp",
|
||||
type: "POST",
|
||||
url: base_url + '/send_otp',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.status == 200) {
|
||||
if (response.status_code == 200) {
|
||||
form.reset();
|
||||
toastr.success("Otp send it your mail id please check");
|
||||
setTimeout(function () {
|
||||
// toastr.info('Please check your email to reset your password. The link is valid for 5 minutes.');
|
||||
toastr.success('An OTP has been sent to your email address');
|
||||
setTimeout(function() {
|
||||
window.location.href = base_url + "/otp";
|
||||
}, 1000);
|
||||
} else if (response.status == 404) {
|
||||
toastr.error("This email id is not exits");
|
||||
} else {
|
||||
toastr.error("Something went wrong");
|
||||
}, 2000);
|
||||
}else if (response.status == 404) {
|
||||
toastr.error('This email id is not exits');
|
||||
}
|
||||
else {
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// otp varification
|
||||
$(document).on("click", "#otp_verify_button", function (e) {
|
||||
$(document).on('click', '#otp_verify_button', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get base URL
|
||||
let base_url = url_path;
|
||||
|
||||
// Get admin ID
|
||||
var id = $("#admin_otp_id").val();
|
||||
var id = $('#admin_otp_id').val();
|
||||
|
||||
// Get OTP by concatenating values of all OTP input fields
|
||||
var otp = $(".otp")
|
||||
.map(function () {
|
||||
return this.value;
|
||||
})
|
||||
.get()
|
||||
.join("");
|
||||
var otp = $('.otp').map(function() {
|
||||
return this.value;
|
||||
}).get().join('');
|
||||
|
||||
if (otp === '') {
|
||||
toastr.error('Please enter OTP');
|
||||
return;
|
||||
}
|
||||
// Send AJAX request for OTP verification
|
||||
$.ajax({
|
||||
url: base_url + "/otp_verify",
|
||||
type: "POST",
|
||||
url: base_url + '/otp_verify',
|
||||
type: 'POST',
|
||||
data: {
|
||||
id: id,
|
||||
otp: otp,
|
||||
_token: $('meta[name="csrf-token"]').attr("content"),
|
||||
'_token': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.status == 200) {
|
||||
if (response.status_code == 200) {
|
||||
// Display success message
|
||||
toastr.success("Otp Verify Successfully");
|
||||
toastr.success('Otp Verify Successfully');
|
||||
// Redirect to the dashboard after a delay
|
||||
setTimeout(function () {
|
||||
window.location.href = base_url + "/password_reset";
|
||||
}, 1000);
|
||||
} else if (response.status == 401) {
|
||||
// Display error message for invalid OTP or expired
|
||||
toastr.error(response.message);
|
||||
} else {
|
||||
// Display error message for other issues
|
||||
toastr.error("Something went wrong");
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("input", ".otp", function () {
|
||||
this.value = this.value.replace(/[^0-9]/g, "");
|
||||
$(document).on('input', '.otp', function() {
|
||||
this.value = this.value.replace(/[^0-9]/g, '');
|
||||
|
||||
if (this.value.length >= this.maxLength) {
|
||||
$(this).next(".otp").focus();
|
||||
$(this).next('.otp').focus();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -224,15 +227,44 @@ $(document).on("click", "#password_reset", function (e) {
|
||||
});
|
||||
});
|
||||
|
||||
$("#passwordToggle").click(function () {
|
||||
var passwordInput = $("#password");
|
||||
var eyeIcon = $("#passwordToggle");
|
||||
$('#passwordToggle').click(function() {
|
||||
var passwordInput = $('#password');
|
||||
var eyeIcon = $('#passwordToggle');
|
||||
|
||||
if (passwordInput.attr("type") === "password") {
|
||||
passwordInput.attr("type", "text");
|
||||
eyeIcon.removeClass("fa-eye-slash").addClass("fa-eye");
|
||||
if (passwordInput.attr('type') === 'password') {
|
||||
passwordInput.attr('type', 'text');
|
||||
eyeIcon.removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
} else {
|
||||
passwordInput.attr("type", "password");
|
||||
eyeIcon.removeClass("fa-eye").addClass("fa-eye-slash");
|
||||
passwordInput.attr('type', 'password');
|
||||
eyeIcon.removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('togglePassword').addEventListener('click', function() {
|
||||
var passwordField = document.getElementById('password');
|
||||
var icon = document.getElementById('togglePassword');
|
||||
if (passwordField.type === 'password') {
|
||||
passwordField.type = 'text';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
} else {
|
||||
passwordField.type = 'password';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('toggleConfirmPassword').addEventListener('click', function() {
|
||||
var confirmPasswordField = document.getElementById('confirm_password');
|
||||
var icon = document.getElementById('toggleConfirmPassword');
|
||||
if (confirmPasswordField.type === 'password') {
|
||||
confirmPasswordField.type = 'text';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
} else {
|
||||
confirmPasswordField.type = 'password';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,89 +1,39 @@
|
||||
@extends('Admin.layouts.app_login')
|
||||
@section('title', 'Forgot Password')
|
||||
@section('content')
|
||||
<div class="row w-100" style="height: 100vh;">
|
||||
<div class=" col-md-6 m-auto h-100 d-flex flex-column align-itms-center justify-content-center"
|
||||
style="background-color: #05244D;">
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="{{ asset('public/assets/img/seasons_logo.png')}}" width="150" height="150" alt="">
|
||||
<div class="row w-100" style="height: 100vh;">
|
||||
<div class=" col-md-6 m-auto h-100 d-flex flex-column align-itms-center justify-content-center"
|
||||
style="background-color: #05244D;">
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="{{ asset('public/assets/img/seasons_logo.png') }}" width="150" height="150" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-md-6 h-100 d-flex justify-content-center align-items-center login-background-img"
|
||||
style="background-image: url(public/assets/img/login_screen_background.png);">
|
||||
<div class="row d-flex flex-column justify-content-center align-items-center m-auto"
|
||||
style="width: 60%; z-index: 999;">
|
||||
<h4 class="text-start font-weight-bold mb-3 text-white">FORGOT PASSWORD</h4>
|
||||
<form id="forgot_pass_form">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-3 input-parent">
|
||||
<i class="fa fa-envelope" aria-hidden="true"></i>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div>
|
||||
<button type="Submit" id="forgot_password_btn" class="p-0 download-btn">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-md-6 h-100 d-flex justify-content-center align-items-center login-background-img"
|
||||
style="background-image: url(public/assets/img/login_screen_background.png);">
|
||||
<div class="row d-flex flex-column justify-content-center align-items-center m-auto"
|
||||
style="width: 60%; z-index: 999;">
|
||||
<h4 class="text-start font-weight-bold mb-3 text-white">FORGOT PASSWORD</h4>
|
||||
<form id="forgot_pass_form">
|
||||
<div class="col-md-12">
|
||||
<div class="mb-3 input-parent">
|
||||
<i class="fa fa-envelope" aria-hidden="true"></i>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div>
|
||||
<button type="Submit" id="forgot_password_btn" class="p-0 download-btn">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script>
|
||||
$(document).on("click", "#forgot_password_btn", function (e) {
|
||||
let base_url = url_path;
|
||||
$('#forgot_pass_form').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
email: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
required: "Please Enter email"
|
||||
}
|
||||
},
|
||||
submitHandler: function (form) {
|
||||
var formData = new FormData(form);
|
||||
e.preventDefault(),
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + '/send_otp',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.status_code == 200) {
|
||||
form.reset();
|
||||
toastr.success('An OTP has been sent to your email address');
|
||||
setTimeout(function() {
|
||||
window.location.href = base_url + "/otp";
|
||||
}, 2000);
|
||||
}else if (response.status == 404) {
|
||||
toastr.error('This email id is not exits');
|
||||
}
|
||||
else {
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="{{ asset('public/assets/js/admin/auth/login.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
@@ -52,84 +52,6 @@
|
||||
@section('scripts')
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script>
|
||||
$(document).on("click", "#admin_login_btn", function(e) {
|
||||
$('#admin_login_form').validate({
|
||||
rules: {
|
||||
email: {
|
||||
required: true,
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
required: "Please enter the email address.",
|
||||
},
|
||||
password: {
|
||||
required: "Please enter the password.",
|
||||
}
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
e.preventDefault();
|
||||
let base_url = url_path;
|
||||
var formData = new FormData(form);
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: base_url + '/check_login',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
beforeSend: function() {
|
||||
$('#admin_login_btn').text('Please wait...');
|
||||
$('#admin_login_btn').attr('disabled', true);
|
||||
},
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$('#admin_login_btn').prop('disabled', false);
|
||||
$('#admin_login_btn').text('Login');
|
||||
|
||||
if (response.status_code == 200) {
|
||||
toastr.success(response.message);
|
||||
setTimeout(function() {
|
||||
window.location.href = base_url + "/dashboard";
|
||||
}, 2000);
|
||||
} else if (response.status_code == 401) {
|
||||
toastr.error(response.message);
|
||||
form.reset();
|
||||
} else {
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
toastr.error('An unexpected error occurred.');
|
||||
$('#admin_login_btn').prop('disabled', false);
|
||||
$('#admin_login_btn').text('Sign In');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#passwordToggle').click(function() {
|
||||
var passwordInput = $('#password');
|
||||
var eyeIcon = $('#passwordToggle');
|
||||
|
||||
if (passwordInput.attr('type') === 'password') {
|
||||
passwordInput.attr('type', 'text');
|
||||
eyeIcon.removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
} else {
|
||||
passwordInput.attr('type', 'password');
|
||||
eyeIcon.removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('public/assets/js/admin/auth/login.js') }}"></script>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@extends('Admin.layouts.app_login')
|
||||
@section('title', 'Cheers to the Season - Otp')
|
||||
@section('content')
|
||||
<div class="row w-100" style="height: 100vh;">
|
||||
<div class=" col-md-6 m-auto h-100 d-flex flex-column align-itms-center justify-content-center"
|
||||
<div class="row w-100" style="height: 100vh;">
|
||||
<div class=" col-md-6 m-auto h-100 d-flex flex-column align-itms-center justify-content-center"
|
||||
style="background-color: #05244D;">
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="{{ asset('public/assets/img/seasons_logo.png')}}" width="150" height="150" alt="">
|
||||
<img src="{{ asset('public/assets/img/seasons_logo.png') }}" width="150" height="150" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-md-6 h-100 d-flex justify-content-center align-items-center login-background-img"
|
||||
@@ -15,81 +15,30 @@
|
||||
<h4 class="text-start font-weight-bold text-white">VERIFICATION CODE</h4>
|
||||
<h5 class="text-white mb-3">Please enter the OTP</h5>
|
||||
<form id="otpVerificationForm">
|
||||
<div class="col-sm-12 bgWhite">
|
||||
<div class="col-sm-12 bgWhite">
|
||||
<input type="hidden" name="time" value="{{ session('admin_data.valid_till') }}">
|
||||
<input type="hidden" id="admin_otp_id" name="id" value="{{ session('admin_data.principal_xid') }}">
|
||||
<input type="hidden" id="admin_otp_id" name="id"
|
||||
value="{{ session('admin_data.principal_xid') }}">
|
||||
<input class="otp" type="text" name="digit1" maxlength="1">
|
||||
<input class="otp" type="text" name="digit2" maxlength="1">
|
||||
<input class="otp" type="text" name="digit3" maxlength="1">
|
||||
<input class="otp" type="text" name="digit4" maxlength="1">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div>
|
||||
<button type="submit" id="otp_verify_button" class="download-btn w-100">Submit</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-md-12">
|
||||
<div>
|
||||
<button type="submit" id="otp_verify_button" class="download-btn w-100">Submit</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script>
|
||||
$(document).on('click', '#otp_verify_button', function(e) {
|
||||
e.preventDefault();
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="{{ asset('public/assets/js/admin/auth/login.js') }}"></script>
|
||||
|
||||
// Get base URL
|
||||
let base_url = url_path;
|
||||
|
||||
// Get admin ID
|
||||
var id = $('#admin_otp_id').val();
|
||||
|
||||
// Get OTP by concatenating values of all OTP input fields
|
||||
var otp = $('.otp').map(function() {
|
||||
return this.value;
|
||||
}).get().join('');
|
||||
|
||||
if (otp === '') {
|
||||
toastr.error('Please enter OTP');
|
||||
return;
|
||||
}
|
||||
// Send AJAX request for OTP verification
|
||||
$.ajax({
|
||||
url: base_url + '/otp_verify',
|
||||
type: 'POST',
|
||||
data: {
|
||||
id: id,
|
||||
otp: otp,
|
||||
'_token': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.status_code == 200) {
|
||||
// Display success message
|
||||
toastr.success('Otp Verify Successfully');
|
||||
// Redirect to the dashboard after a delay
|
||||
setTimeout(function () {
|
||||
window.location.href = base_url + "/password_reset";
|
||||
}, 1000);
|
||||
} else if (response.status == 401) {
|
||||
toastr.error(response.message);
|
||||
} else {
|
||||
toastr.error(response.message);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('input', '.otp', function() {
|
||||
this.value = this.value.replace(/[^0-9]/g, '');
|
||||
|
||||
if (this.value.length >= this.maxLength) {
|
||||
$(this).next('.otp').focus();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -124,119 +124,4 @@
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
|
||||
<script src="{{ asset('public/assets/js/admin/auth/login.js') }}"></script>
|
||||
|
||||
|
||||
<script>
|
||||
document.getElementById('togglePassword').addEventListener('click', function() {
|
||||
var passwordField = document.getElementById('password');
|
||||
var icon = document.getElementById('togglePassword');
|
||||
if (passwordField.type === 'password') {
|
||||
passwordField.type = 'text';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
} else {
|
||||
passwordField.type = 'password';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('toggleConfirmPassword').addEventListener('click', function() {
|
||||
var confirmPasswordField = document.getElementById('confirm_password');
|
||||
var icon = document.getElementById('toggleConfirmPassword');
|
||||
if (confirmPasswordField.type === 'password') {
|
||||
confirmPasswordField.type = 'text';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
} else {
|
||||
confirmPasswordField.type = 'password';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Form validation and submission
|
||||
// $('#password_reset_form').validate({
|
||||
// rules: {
|
||||
// password: {
|
||||
// required: true,
|
||||
// minlength: 8
|
||||
// },
|
||||
// confirm_password: {
|
||||
// required: true,
|
||||
// equalTo: "#password"
|
||||
// },
|
||||
// },
|
||||
// messages: {
|
||||
// password: {
|
||||
// required: "Please enter a password.",
|
||||
// minlength: "The password field must be at least 8 characters."
|
||||
// },
|
||||
// confirm_password: {
|
||||
// required: "Please Confirm Your Password",
|
||||
// equalTo: "Your Password Do Not Match"
|
||||
// },
|
||||
// },
|
||||
// // invalidHandler: function(event, validator) {
|
||||
// // var errors = validator.errorList;
|
||||
// // $.each(errors, function(index, error) {
|
||||
// // toastr.error(error.message);
|
||||
// // });
|
||||
// // },
|
||||
// submitHandler: function(form) {
|
||||
// let base_url = url_path;
|
||||
// var formData = new FormData(form);
|
||||
|
||||
// $.ajaxSetup({
|
||||
// headers: {
|
||||
// "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
// },
|
||||
// });
|
||||
|
||||
// $('#password_reset').prop('disabled', true).text('Processing...');
|
||||
|
||||
// $.ajax({
|
||||
// url: base_url + '/password_update',
|
||||
// type: 'POST',
|
||||
// data: formData,
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// success: function(response) {
|
||||
// if (response.status_code == 200) {
|
||||
// toastr.success(response.message);
|
||||
// window.location.href = base_url + "/";
|
||||
// } else if (response.status_code == 404) {
|
||||
// toastr.error(response.message);
|
||||
// form.reset();
|
||||
// }
|
||||
// $('#password_reset').prop('disabled', false).text('Sign In');
|
||||
// },
|
||||
// error: function(xhr) {
|
||||
// if (xhr.status === 422) {
|
||||
// var errors = xhr.responseJSON.message;
|
||||
// $.each(errors, function(index, value) {
|
||||
// toastr.error(value);
|
||||
// });
|
||||
// } else {
|
||||
// toastr.error('An unexpected error occurred. Please try again.');
|
||||
// }
|
||||
// $('#password_reset').prop('disabled', false).text('Sign In');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
// $(document).on("click", "#password_reset", function(e) {
|
||||
// e.preventDefault();
|
||||
// $('#password_reset_form').submit();
|
||||
// });
|
||||
// });
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user