165 lines
8.5 KiB
PHP
165 lines
8.5 KiB
PHP
|
@extends('form')
|
||
|
|
||
|
@section('title')
|
||
|
Регистрация
|
||
|
@endsection
|
||
|
|
||
|
@section('main_view')
|
||
|
<div class="text-center">
|
||
|
<H1>Регистрация</H1>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<div class="container py-3 col-12 col-md-9 col-lg-7 col-xl-6">
|
||
|
<div class="card p-5 " style="border-radius: 15px;">
|
||
|
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputEmail1" class="form-label">Имя</label>
|
||
|
<input type="text" class="form-control name" id="name" name="name" required
|
||
|
placeholder="Введите Имя">
|
||
|
<div id="error_name"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputEmail1" class="form-label">Фамилия</label>
|
||
|
<input type="text" class="form-control sure_name" id="sure_name" name="sure_name" required
|
||
|
placeholder="Введите фамилию">
|
||
|
<div id="error_sure_name"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputEmail1" class="form-label">Отчество</label>
|
||
|
<input type="text" class="form-control patronymic" id="patronymic" name="patronymic" required
|
||
|
placeholder="Введите отчество" >
|
||
|
<div id="error_patronymic"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputEmail1" class="form-label">Email</label>
|
||
|
<input type="email" class="form-control email" id="email" name="email" aria-describedby="emailHelp"
|
||
|
required placeholder="Введите email">
|
||
|
<div id="error_email"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputEmail1" class="form-label">Логин</label>
|
||
|
<input type="text" class="form-control login" id="login" name="login" required
|
||
|
placeholder="Введите логин">
|
||
|
<div id="error_login"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputPassword1" class="form-label">Пароль</label>
|
||
|
<input type="password" class="form-control password" id="password" name="password" required
|
||
|
placeholder="Введите пароль">
|
||
|
<div id="error_password"></div>
|
||
|
</div>
|
||
|
<div class="mb-3">
|
||
|
<label for="exampleInputPassword1" class="form-label">Повторите пароль</label>
|
||
|
<input type="password" class="form-control password_confirmation" id="password_confirmation"
|
||
|
name="password_confirmation" required placeholder="Повторите пароль">
|
||
|
<div id="error_password_confirmation"></div>
|
||
|
</div>
|
||
|
<div class="mb-3 form-check">
|
||
|
<input type="checkbox" class="checkbox" id="checkbox" required>
|
||
|
<label class="checkbox form-check-label" for="exampleCheck1">Даю согласие на обработку своих
|
||
|
данных</label>
|
||
|
<div id="error_checkbox"></div>
|
||
|
</div>
|
||
|
<div class="text-center">
|
||
|
<button type="submit" class="btn btn-dark">Зарегистрироваться</button>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@endsection
|
||
|
|
||
|
{{--@section('script')--}}
|
||
|
{{-- <script>--}}
|
||
|
{{-- $(document).ready(function () {--}}
|
||
|
{{-- $(document).on('click', '.register', function (e) {--}}
|
||
|
{{-- e.preventDefault();--}}
|
||
|
{{-- //Передача данных--}}
|
||
|
{{-- var data = {--}}
|
||
|
{{-- 'name': $('.name').val(),--}}
|
||
|
{{-- 'sure_name': $('.sure_name').val(),--}}
|
||
|
{{-- 'patronymic': $('.patronymic').val(),--}}
|
||
|
{{-- 'login': $('.login').val(),--}}
|
||
|
{{-- 'email': $('.email').val(),--}}
|
||
|
{{-- 'password': $('.password').val(),--}}
|
||
|
{{-- 'password_confirmation': $('.password_confirmation').val(),--}}
|
||
|
{{-- }--}}
|
||
|
|
||
|
{{-- //Проверка токена--}}
|
||
|
{{-- $.ajaxSetup({--}}
|
||
|
{{-- headers: {--}}
|
||
|
{{-- 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')--}}
|
||
|
{{-- }--}}
|
||
|
{{-- });--}}
|
||
|
{{-- //Передача запроса--}}
|
||
|
{{-- $.ajax({--}}
|
||
|
{{-- type: "POST",--}}
|
||
|
{{-- url: "/register",--}}
|
||
|
{{-- data: data,--}}
|
||
|
{{-- dataType: "json",--}}
|
||
|
{{-- success: function (response) {--}}
|
||
|
{{-- if (response.status == 400) {--}}
|
||
|
|
||
|
{{-- if (response.errors.name) {--}}
|
||
|
{{-- $('#error_name').addClass(' text-danger');--}}
|
||
|
{{-- $('#error_name').html("");--}}
|
||
|
{{-- $('#error_name').append('<a>' + response.errors.name + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_name').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- if (response.errors.sure_name) {--}}
|
||
|
{{-- $('#error_sure_name').addClass(' text-danger');--}}
|
||
|
{{-- $('#error_sure_name').html("");--}}
|
||
|
{{-- $('#error_sure_name').append('<a>' + response.errors.sure_name + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_sure_name').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- if (response.errors.patronymic) {--}}
|
||
|
{{-- $('#error_patronymic').addClass(' text-danger');--}}
|
||
|
{{-- $('#error_patronymic').html("");--}}
|
||
|
{{-- $('#error_patronymic').append('<a>' + response.errors.patronymic + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_patronymic').html("");--}}
|
||
|
{{-- }--}}
|
||
|
|
||
|
{{-- if (response.errors.login) {--}}
|
||
|
{{-- $('#error_login').html("");--}}
|
||
|
{{-- $('#error_login').addClass(' text-danger');--}}
|
||
|
{{-- $('#error_login').append('<a>' + response.errors.login + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_login').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- if (response.errors.email) {--}}
|
||
|
{{-- $('#error_email').html("");--}}
|
||
|
{{-- $('#error_email').addClass(' text-danger');--}}
|
||
|
{{-- $('#error_email').append('<a>' + response.errors.email + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_email').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- if (response.errors.password) {--}}
|
||
|
{{-- $('#error_password').html("");--}}
|
||
|
{{-- $('#error_password').addClass('text-danger');--}}
|
||
|
{{-- $('#error_password').append('<a>' + response.errors.password + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_password').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- if (response.errors.password_confirmation) {--}}
|
||
|
{{-- $('#error_password_confirmation').html("");--}}
|
||
|
{{-- $('#error_password_confirmation').addClass('text-danger');--}}
|
||
|
{{-- $('#error_password_confirmation').append('<a>' + response.errors.password_confirmation + '</a>');--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- $('#error_password_confirmation').html("");--}}
|
||
|
{{-- }--}}
|
||
|
{{-- } else {--}}
|
||
|
{{-- window.location = "/Profile"--}}
|
||
|
|
||
|
{{-- }--}}
|
||
|
{{-- }--}}
|
||
|
{{-- });--}}
|
||
|
{{-- });--}}
|
||
|
{{-- });--}}
|
||
|
{{-- </script>--}}
|
||
|
@endsection
|