delete_people.blade.php
5.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
@extends('layout.frontend', ['title' => 'Удаление пользователя - РекаМоре'])
@section('scripts')
<script>
console.log('Validation password');
$(document).on('submit', '#form_del', function() {
var this_ = $(this);
var email = $('#email').val();
var password = $('#password').val();
$.ajax({
type: "GET",
url: "{{ route('employer.ajax_delete_user') }}",
data: "email=" + email + "&password=" + password +"&preview=1",
success: function (data) {
console.log('Предупреждение!');
let d = JSON.parse(data);
if(typeof d['SUCCESS'] !== "undefined") {
$('#password_delete').val(d['password']);
$('#email_delete').val(d['email']);
$('#button_submit_hidden').click();
console.log(d['SUCCESS']);
}
if (typeof d['ERROR'] !== "undefined") {
console.log(d['ERROR']);
$('#block_light').css('display', 'block');
$('#mess_arr').html(d['ERROR']);
}
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
data = JSON.stringify(data);
console.log('Error: ' + data);
$('#mess_arr').html(data);
}
});
return false;
});
</script>
@endsection
@section('content')
<section class="cabinet">
<div class="container">
<ul class="breadcrumbs cabinet__breadcrumbs">
<li><a href="{{ route('index') }}">Главная</a></li>
<li><b>Личный кабинет</b></li>
</ul>
<div class="cabinet__wrapper">
<div class="cabinet__side">
<div class="cabinet__side-toper">
@include('employers.emblema')
</div>
@include('employers.menu', ['item' => 14])
</div>
<div class="cabinet__body">
<div class="cabinet__body-item">
<h2 class="title cabinet__title">Удалить профиль</h2>
<p class="cabinet__text"><b>Вы уверены, что хотите удалить свой профиль?</b></p>
<div class="notify notify_red">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
</svg>
<span>Это действие не может быть отменено!</span>
</div>
<div class="notify" id="block_light" name="block_light" style="display:none">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
</svg>
<span id="mess_arr" name="mess_arr">
</span>
</div>
<form class="cabinet__inputs" id="form_del" name="form_del" method="GET">
@csrf
<input type="hidden" name="email" id="email" value="{{ $login }}"/>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">Пожалуйста, введите пароль от учётной записи для подтверждения:</label>
<div class="form-group__item">
<input type="password" name="password" id="password" class="input" placeholder="**********" required>
<button type="button" class="eye">
<svg class="js-password-show">
<use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
</svg>
<svg class="js-password-hide">
<use xlink:href="{{ asset('images/sprite.svg#eye-2') }}"></use>
</svg>
</button>
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<div class="buttons">
<a href="{{ route('employer.cabinet') }}" class="button">Отменить</a>
<button type="submit" id="button_submit" class="button button_light">Удалить профиль</button>
<button style="display:none;" type="submit" id="button_submit_hidden" data-fancybox data-src="#delete" data-options='{"touch":false,"autoFocus":false}' class="button button_light">Удалить профиль</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
@endsection