master_template/resources/views/hulaki_khabar/Auth/registration.blade.php

116 lines
4.3 KiB
PHP
Raw Permalink Normal View History

2024-06-13 15:17:05 +00:00
@extends('hulaki_khabar.layout.layout')
@section('content')
<div class="page-title-area">
<div class="container">
<div class="page-title-content">
<h2>रजिस्टर</h2>
<ul>
<li><a href="index.php">होमपेज</a></li>
<li>रजिस्टर</li>
</ul>
</div>
</div>
</div>
<!-- End Page Banner -->
<!-- Start Register Area -->
<section class="register-area ptb-50">
<div class="container">
<div class="register-form">
<h2>रजिस्टर</h2>
2024-06-23 11:17:56 +00:00
<form id="register-form" action={{ route('postRegistration') }}>
2024-06-20 10:57:33 +00:00
@csrf
2024-06-13 15:17:05 +00:00
<div class="form-group">
<label>नाम</label>
2024-06-20 10:57:33 +00:00
<input type="text" class="form-control" placeholder="नाम" id="name">
2024-06-13 15:17:05 +00:00
</div>
<div class="form-group">
<label>ईमेल</label>
2024-06-20 10:57:33 +00:00
<input type="text" class="form-control" placeholder="ईमेल" id="email">
2024-06-13 15:17:05 +00:00
</div>
<div class="form-group">
<label>फोन</label>
2024-06-20 10:57:33 +00:00
<input type="text" class="form-control" placeholder="फोन" id="phone">
2024-06-13 15:17:05 +00:00
</div>
<div class="form-group">
<label>पासवर्ड</label>
2024-06-20 12:22:40 +00:00
<input type="password" class="form-control" placeholder="पासवर्ड" id="password">
2024-06-13 15:17:05 +00:00
</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">
<label class="form-check-label" for="checkme">पासवर्ड हेर्नुहोस?</label>
</div>
</div>
</div>
<button type="submit">रजिस्टर गर्नुहोस</button>
</form>
<div class="important-text">
2024-06-23 11:17:56 +00:00
<p>खाता ? <a href="{{route('postRegistration')}}">लगइन गर्नुहोस!</a></p>
2024-06-13 15:17:05 +00:00
</div>
</div>
</div>
</section>
@endsection
@push('js')
<script>
2024-06-20 12:22:40 +00:00
$(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 {
2024-06-13 15:17:05 +00:00
Swal.fire({
icon: 'error',
title: 'Error',
2024-06-20 12:22:40 +00:00
text: response.message
2024-06-13 15:17:05 +00:00
});
}
2024-06-20 12:22:40 +00:00
},
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
});
}
2024-06-13 15:17:05 +00:00
});
2024-06-20 12:22:40 +00:00
});
});
</script>
2024-06-13 15:17:05 +00:00
@endpush