This commit is contained in:
tanch0
2024-06-20 18:07:40 +05:45
parent adfc826e9c
commit 5b3c44aa33
10 changed files with 135 additions and 90 deletions

View File

@ -12,6 +12,8 @@
</div>
</div>
</div>
<!-- End Page Banner -->
<!-- Start Login Area -->
@ -19,19 +21,20 @@
<div class="container">
<div class="login-form">
<h2>लगइन फर्म</h2>
<form>
<form id="login-form" action={{ route('postLogin') }} method="POST">
@csrf
<div class="form-group">
<label>युजरनेम</label>
<input type="text" class="form-control" placeholder="युजरनेम">
<input type="text" class="form-control" placeholder="युजरनेम" id="email">
</div>
<div class="form-group">
<label>पासवर्ड </label>
<input type="text" class="form-control" placeholder="पासवर्ड">
<input type="password" class="form-control" placeholder="पासवर्ड" id="password">
</div>
<div class="row align-items-center">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="checkme">
<input type="checkbox" class="form-check-input" id="remember-me">
<label class="form-check-label" for="checkme"> याद राख्नुहोस</label>
</div>
</div>
@ -48,7 +51,6 @@
</div>
</section>
@endsection
@push('js')
<script>
$(document).ready(function() {

View File

@ -19,9 +19,8 @@
<div class="container">
<div class="register-form">
<h2>रजिस्टर</h2>
<form id="register-form" action={{ route('postresgistration') }} method="POST">
<form id="register-form" action={{ route('postresgistration') }}>
@csrf
@method('POST')
<div class="form-group">
<label>नाम</label>
<input type="text" class="form-control" placeholder="नाम" id="name">
@ -36,7 +35,7 @@
</div>
<div class="form-group">
<label>पासवर्ड</label>
<input type="text" class="form-control" placeholder="पासवर्ड" id="password">
<input type="password" class="form-control" placeholder="पासवर्ड" id="password">
</div>
<div class="row align-items-center">
<div class="col-lg-6 col-md-6 col-sm-6">
@ -58,51 +57,59 @@
@push('js')
<script>
$('#register-form').submit(function(e) {
e.preventDefault();
let form = $(this);
let name = $('#name').val();
let email = $('#email').val();
let password = $('#password').val();
let phone = $('#phone').val();
$.ajax({
url: form.attr('action'),
type: "POST",
data: {
name: name,
email: email,
phone: phone,
password: password,
_token: "{{ csrf_token() }}"
},
success: function(response) {
if (response.success) {
Swal.fire({
icon: 'success',
title: 'Success',
text: response.message
}).then((result) => {
if (result.isConfirmed) {
window.location.href = response.redirect_url;
}
});
} else {
Swal.fire({
icon: 'error',
title: 'Error',
text: response.message
});
}
},
error: function(xhr, status, error) {
let err = JSON.parse(xhr.responseText);
$(document).ready(function() {
$('#register-form').submit(function(e) {
e.preventDefault();
let form = $(this);
let name = $('#name').val();
let email = $('#email').val();
let password = $('#password').val();
let phone = $('#phone').val();
$.ajax({
url: form.attr('action'),
type: "POST",
data: {
name: name,
email: email,
phone: phone,
password: password,
_token: "{{ csrf_token() }}"
},
success: function(response) {
if (response.success) {
Swal.fire({
icon: 'success',
title: 'Success',
text: response.message
}).then((result) => {
if (result.isConfirmed) {
window.location.href = response.redirect_url;
}
});
} else {
Swal.fire({
icon: 'error',
title: 'Error',
text: err.message || 'An error occurred during the request.'
text: response.message
});
}
});
},
error: function(xhr, status, error) {
let err = xhr.responseJSON;
let errorMsg = 'An error occurred during the request.';
if (err.errors) {
errorMsg = Object.values(err.errors).map(errMsg => errMsg.join(', ')).join(' ');
}
Swal.fire({
icon: 'error',
title: 'Error',
text: errorMsg
});
}
});
</script>
});
});
</script>
@endpush

View File

@ -66,6 +66,7 @@
<script src="{{ asset('hulaki/assets/js/owl.carousel.min.js') }}"></script>
<!-- Magnific Popup JS -->
<script src="{{ asset('hulaki/assets/js/jquery.magnific-popup.min.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript"
src="https://platform-api.sharethis.com/js/sharethis.js#property=61da909ca3f186001956822c&product=inline-share-buttons"

View File

@ -40,10 +40,18 @@
</a>
</div>
</li>
<li>
<i class='bx bx-user'></i>
<a href="{{route('userLogin')}}">लगइन</a>
</li>
@if (!auth()->check())
<li>
<i class='bx bx-user'></i>
<a href="{{ route('userLogin') }}">लगइन</a>
</li>
@else
<li>
<i class='bx bx-user'></i>
<a href="#"><span class="fs-10">{{ auth()->user()->name }}</span> </a>
<i class='bx bx-power-off'></i>
</li>
@endif
</ul>
</div>
</div>
@ -56,7 +64,7 @@
<div class="main-responsive-nav">
<div class="container">
<div class="logo">
<a href="{{route('home')}}">
<a href="{{ route('home') }}">
<img src="<?php echo asset(SITEVARS->primary_logo); ?>" class="black-logo" alt="image">
<img src="<?php echo asset(SITEVARS->secondary_logo); ?>" class="white-logo" alt="image">
</a>
@ -66,7 +74,7 @@
@if ($ads->isNotEmpty())
@foreach ($ads as $ad)
@if ($ad->ad_categories_id == 1)
<img src="{{ asset($ad->thumb) }}" alt="image">
<img src="{{ asset($ad->thumb) }}" alt="image">
@endif
@endforeach
@endif
@ -77,7 +85,7 @@
<div class="row align-items-center">
<div class="col-lg-6">
<nav class="navbar navbar-expand-sm navbar-light">
<a class="navbar-brand" href="{{route('home')}}">
<a class="navbar-brand" href="{{ route('home') }}">
<img src="<?php echo asset(SITEVARS->primary_logo); ?>" class="black-logo" alt="image"
style="margin-left: -20px;max-width: 350px; height: auto; display: block;">
<img src="<?php echo asset(SITEVARS->secondary_logo); ?>" class="white-logo" alt="image" style="margin-left: -20px;">