Files
freeu-project/resources/views/Frontend/Pages/login.blade.php
YasinShaikh123 1addb1bc97 fixing bugs
2024-05-03 19:13:20 +05:30

236 lines
10 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php $currentPage = 'login'; ?>
@extends('Frontend.layouts.master')
@section('content')
<div class="login">
<div class="container">
<div class="row d-flex align-items-center justify-content-center">
<!--<div class="col-md-6">-->
<!-- <img width="100%" src="{{ asset('public/assets/media/FrontendImages/login_image.png') }}" alt="">-->
<!--</div>-->
<div class="col-md-6 right aos-init aos-animate" data-aos="fade-left">
<div class="login-form custom-height-form">
<h1>Welcome Back</h1>
<h2>Sign in to continue to Jericho Alternatives</h2>
<ul id="myTabs" class="nav nav-pills nav-justified" role="tablist" data-tabs="tabs">
<li class="active"><a href="#Commentary" data-bs-toggle="tab" class="active show">Mobile
number</a></li>
<li><a href="#email_tab" data-bs-toggle="tab">Email</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="Commentary">
<form id="login_by_mobile" autocomplete="off">
@csrf
<div class="form-group">
<label>Enter Your Mobile Number</label>
<input name="contact_number" id="contact_number" class="form-control" type="tel"
placeholder="Eg.9898989898" />
</div>
<div class="g-recaptcha" data-sitekey="6Lel4Z4UAAAAAOa8LO1Q9mqKRUiMYl_00o5mXJrR"></div>
<button type="submit" id="login_btn" class="yellow-btn signin">Sign in</button>
</form>
<a href="{{ route('register') }}" class="regist">Dont have an account yet?<br><span>Create
an account</span></a>
</div>
<div role="tabpanel" class="tab-pane fade" id="email_tab">
<form id="login_by_email" autocomplete="off">
@csrf
<div class="form-group">
<label>Email ID</label>
<input type="email" name="email" id="email" class="form-control"
placeholder="Enter your registered email" />
</div>
<div class="form-group">
<label>Password</label>
<input name="password" id="password" class="form-control" type="password"
placeholder="Enter your password" />
</div>
<a href="{{ route('forget-password') }}" class="password">Forgot Password ?</a>
<div class="g-recaptcha" data-sitekey="6Lel4Z4UAAAAAOa8LO1Q9mqKRUiMYl_00o5mXJrR"></div>
<button type="submit" id="sign-in-btn" class="yellow-btn signin">Sign in</button>
<button id="loaderBtn" class="yellow-btn d-none signin" type="button">
<span class="spinner-border spinner-border-sm" role="status"
aria-hidden="true"></span>
Loading...
</button>
<a href="{{ route('register') }}" class="regist">Dont have an account yet?<br><span>
Create an account</span></a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
<script src="{{ asset('public/assets/js/FrontendJs/login/login_by_mobile.js') }}"></script>
<script src="{{ asset('public/assets/js/FrontendJs/login/verify_mobile_otp.js') }}"></script>
{{-- <script src="{{asset('/assets/js/FrontendJs/login/login_by_mail.js')}}"></script> --}}
<script src="{{ asset('public/assets/js/FrontendJs/reset_password/change_password.js') }}"></script>
<script src="{{ asset('public/assets/js/FrontendJs/reset_password/forgot_password.js') }}"></script>
<script src="{{ asset('public/assets/js/FrontendJs/reset_password/verify_otp.js') }}"></script>
<script>
$(document).ready(function() {
$.validator.addMethod("ValidEmail", function(value) {
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value);
}, "Please enter valid email");
// $.validator.addMethod("CheckEmail",function(value){
// var output = searchEmail(value);
// if(output == 201)
// {
// return 1;
// }
// },"Enter registered email address");
$("#login_by_email").validate({
rules: {
email: {
required: true,
ValidEmail: true,
// CheckEmail: true,
},
password: {
required: true,
// minlength: 8
},
},
messages: {
email: {
required: "Enter registered email address",
},
password: {
required: "Enter Password",
},
},
submitHandler: function(form) {
var formData = new FormData(form);
// $.ajaxSetup({
// headers: {
// "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr(
// "content"
// ),
// },
// });
$.ajax({
url: "{{ route('user-login-email') }}",
type: "POST",
data: formData,
beforeSend: function() {
$('#loaderBtn').removeClass('d-none');
$('#sign-in-btn').addClass('d-none');
},
processData: false,
contentType: false,
dataType: 'json',
success: function(data) {
$('#sign-in-btn').removeClass('d-none');
$('#loaderBtn').addClass('d-none');
if (data.status == 204) {
toastr.warning(data.message);
} else if (data.status == 400) {
toastr.warning(data.message);
} else {
Swal.fire({
text: data.message,
icon: "success",
buttonsStyling: !1,
// confirmButtonColor: "#1B243D",
confirmButtonText: "Proceed",
customClass: {
confirmButton: "yellow-btn",
},
}).then(function(t) {
if (t.isConfirmed) {
var route = sessionStorage.getItem('route');
if(route){
var url = route;
}else{
var url = "/";
}
window.location.replace(url);
}
});
}
},
});
},
});
// $("#email").on("input", function() {
// $("#error").hide();
// });
// $("#password").on("input", function() {
// $("#error").hide();
// });
});
// function searchEmail(email)
// {
// // var email = $('#email').val();
// // var url = '{{ route('search_email', ':email') }}';
// // url = url.replace(':email',email);
// // alert(email);
// // data: {'search': search},
// $.ajaxSetup({
// headers: {
// "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
// }
// });
// // url: url,
// $.ajax({
// url: "{{ route('search_email') }}",
// type: "get",
// data: {'email':email},
// dataType: 'json',
// // contentType: false,
// // processData: false,
// success: function(response){
// if(response.status == 201){
// return response.status;
// // $('#email_error').html(response.message);
// // toastr.success(response.message);
// }
// },
// });
// }
// $(document).ready(function (){
// $("#email").on('keyup',function(){
// var search = $(this).val();
// alert(search);
// });
// });
</script>
@endsection