Commit c81785d9a5a08d49d09682e0ce0a6e9d6698be25
1 parent
6a15f441b4
Exists in
master
Блейд индекс
Showing 1 changed file with 2 additions and 1 deletions Inline Diff
resources/views/admin/employer/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Работодатели']) | 1 | @extends('layout.admin', ['title' => 'Админка - Работодатели']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | <script> | 4 | <script> |
5 | $(document).ready(function() { | 5 | $(document).ready(function() { |
6 | $(document).on('click', '.checkban', function () { | 6 | $(document).on('click', '.checkban', function () { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var value = this_.val(); | 8 | var value = this_.val(); |
9 | var ajax_block = $('#ajax_block'); | 9 | var ajax_block = $('#ajax_block'); |
10 | var bool = 0; | 10 | var bool = 0; |
11 | 11 | ||
12 | if(this.checked){ | 12 | if(this.checked){ |
13 | bool = 1; | 13 | bool = 1; |
14 | } else { | 14 | } else { |
15 | bool = 0; | 15 | bool = 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | $.ajax({ | 18 | $.ajax({ |
19 | type: "GET", | 19 | type: "GET", |
20 | url: "{{ url()->full()}}", | 20 | url: "{{ url()->full()}}", |
21 | data: "id=" + value + "&is_ban=" + bool, | 21 | data: "id=" + value + "&is_ban=" + bool, |
22 | success: function (data) { | 22 | success: function (data) { |
23 | console.log('Обновление таблицы пользователей '); | 23 | console.log('Обновление таблицы пользователей '); |
24 | //data = JSON.parse(data); | 24 | //data = JSON.parse(data); |
25 | //console.log(data); | 25 | //console.log(data); |
26 | ajax_block.html(data); | 26 | ajax_block.html(data); |
27 | }, | 27 | }, |
28 | headers: { | 28 | headers: { |
29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
30 | }, | 30 | }, |
31 | error: function (data) { | 31 | error: function (data) { |
32 | console.log('Error: ' + data); | 32 | console.log('Error: ' + data); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | }); | 35 | }); |
36 | 36 | ||
37 | }); | 37 | }); |
38 | </script> | 38 | </script> |
39 | <script> | 39 | <script> |
40 | const btns = document.querySelectorAll('.btn_del'); | 40 | const btns = document.querySelectorAll('.btn_del'); |
41 | btns.forEach(btn => { | 41 | btns.forEach(btn => { |
42 | btn.addEventListener('click', (e) => { | 42 | btn.addEventListener('click', (e) => { |
43 | console.log('click button'); | 43 | console.log('click button'); |
44 | const id = e.target.id; | 44 | const id = e.target.id; |
45 | let form = document.getElementById("form_modal_del"); | 45 | let form = document.getElementById("form_modal_del"); |
46 | form.action = "<?=$_SERVER['HTTP_REFERER']?>/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); | 46 | form.action = "<?=$_SERVER['HTTP_REFERER']?>/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); |
47 | //document.getElementById("title_modal").innerHTML = id; | 47 | //document.getElementById("title_modal").innerHTML = id; |
48 | console.log(e.target.getAttribute('data-employer')); | 48 | console.log(e.target.getAttribute('data-employer')); |
49 | console.log(e.target.getAttribute('data-user')); | 49 | console.log(e.target.getAttribute('data-user')); |
50 | 50 | ||
51 | }); | 51 | }); |
52 | }); | 52 | }); |
53 | </script> | 53 | </script> |
54 | @endsection | 54 | @endsection |
55 | 55 | ||
56 | @section('search') | 56 | @section('search') |
57 | @include('admin.find_employer', ['select_category' => $select_category]) | 57 | @include('admin.find_employer', ['select_category' => $select_category]) |
58 | @endsection | 58 | @endsection |
59 | 59 | ||
60 | @section('modal') | 60 | @section('modal') |
61 | @include('admin.employer.modal') | 61 | @include('admin.employer.modal') |
62 | @endsection | 62 | @endsection |
63 | 63 | ||
64 | @section('content') | 64 | @section('content') |
65 | <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> | 65 | <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> |
66 | 66 | ||
67 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> | 67 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> |
68 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> | 68 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> |
69 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> | 69 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
70 | <path | 70 | <path |
71 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> | 71 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> |
72 | </svg> | 72 | </svg> |
73 | </div> | 73 | </div> |
74 | <div> | 74 | <div> |
75 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> | 75 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> |
76 | Всего работодателей | 76 | Всего работодателей |
77 | </p> | 77 | </p> |
78 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> | 78 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> |
79 | {{ $all_employer }} | 79 | {{ $all_employer }} |
80 | </p> | 80 | </p> |
81 | </div> | 81 | </div> |
82 | </div> | 82 | </div> |
83 | </div> | 83 | </div> |
84 | <pre> | 84 | <pre> |
85 | <?//print_r($_SERVER);?> | 85 | <?//print_r($_SERVER);?> |
86 | </pre> | 86 | </pre> |
87 | 87 | ||
88 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 88 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
89 | <div class="w-full overflow-x-auto"> | 89 | <div class="w-full overflow-x-auto"> |
90 | <table class="w-full whitespace-no-wrap"> | 90 | <table class="w-full whitespace-no-wrap"> |
91 | <thead> | 91 | <thead> |
92 | <tr | 92 | <tr |
93 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | 93 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" |
94 | > | 94 | > |
95 | <th class="px-4 py-3">№</th> | 95 | <th class="px-4 py-3">№</th> |
96 | <th class="px-4 py-3">Название компании</th> | 96 | <th class="px-4 py-3">Название компании</th> |
97 | <th class="px-4 py-3">Лого</th> | 97 | <th class="px-4 py-3">Лого</th> |
98 | <th class="px-4 py-3">Email/Телефон</th> | 98 | <th class="px-4 py-3">Email/Телефон</th> |
99 | <th class="px-4 py-3">Категория</th> | 99 | <th class="px-4 py-3">Категория</th> |
100 | <th class="px-4 py-3">Комментарий</th> | 100 | <th class="px-4 py-3">Комментарий</th> |
101 | <th class="px-4 py-3">Дата регистрации</th> | 101 | <th class="px-4 py-3">Дата регистрации</th> |
102 | <th class="px-4 py-3">Редакт.</th> | 102 | <th class="px-4 py-3">Редакт.</th> |
103 | </tr> | 103 | </tr> |
104 | </thead> | 104 | </thead> |
105 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 105 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
106 | @foreach($users as $user) | 106 | @foreach($users as $user) |
107 | <tr class="text-gray-700 dark:text-gray-400"> | 107 | <tr class="text-gray-700 dark:text-gray-400"> |
108 | <td class="px-4 py-3"> | 108 | <td class="px-4 py-3"> |
109 | {{$user->id}} | 109 | {{$user->id}} |
110 | </td> | 110 | </td> |
111 | <td class="px-4 py-3"> | 111 | <td class="px-4 py-3"> |
112 | {{$user->name}} | 112 | {{$user->name}} |
113 | </td> | 113 | </td> |
114 | <td class="px-4 py-3"> | 114 | <td class="px-4 py-3"> |
115 | @if (isset($user->employers[0]->logo) && ($user->employers[0]->logo)) | 115 | <pre><? print_r($user->employers);?></pre> |
116 | @if (isset($user->employers[0]->logo)) | ||
116 | <img src="{{ asset(Storage::url($user->employers[0]->logo)) }}" style="width:50px"/> | 117 | <img src="{{ asset(Storage::url($user->employers[0]->logo)) }}" style="width:50px"/> |
117 | @else | 118 | @else |
118 | - | 119 | - |
119 | @endif | 120 | @endif |
120 | </td> | 121 | </td> |
121 | <td class="px-4 py-3"> | 122 | <td class="px-4 py-3"> |
122 | <div class="flex items-center text-sm"> | 123 | <div class="flex items-center text-sm"> |
123 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | 124 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> |
124 | <div | 125 | <div |
125 | class="absolute inset-0 rounded-full shadow-inner" | 126 | class="absolute inset-0 rounded-full shadow-inner" |
126 | aria-hidden="true" | 127 | aria-hidden="true" |
127 | ></div> | 128 | ></div> |
128 | </div>--> | 129 | </div>--> |
129 | <div> | 130 | <div> |
130 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | 131 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> |
131 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 132 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
132 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | 133 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} |
133 | </p> | 134 | </p> |
134 | </div> | 135 | </div> |
135 | </div> | 136 | </div> |
136 | 137 | ||
137 | </td> | 138 | </td> |
138 | <td class="px-4 py-3 text-sm"> | 139 | <td class="px-4 py-3 text-sm"> |
139 | {{ $user->category }} | 140 | {{ $user->category }} |
140 | </td> | 141 | </td> |
141 | <td class="px-4 py-3 text-sm"> | 142 | <td class="px-4 py-3 text-sm"> |
142 | @if (!empty($user->comment_admin)) | 143 | @if (!empty($user->comment_admin)) |
143 | 144 | ||
144 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->id]) }}">Есть</a> | 145 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->id]) }}">Есть</a> |
145 | @else | 146 | @else |
146 | Нет | 147 | Нет |
147 | @endif | 148 | @endif |
148 | </td> | 149 | </td> |
149 | <td class="px-4 py-3 text-sm"> | 150 | <td class="px-4 py-3 text-sm"> |
150 | {{ date('d.m.Y', strtotime($user->created_at)) }} | 151 | {{ date('d.m.Y', strtotime($user->created_at)) }} |
151 | </td> | 152 | </td> |
152 | <td class="px-4 py-3 text-sm"> | 153 | <td class="px-4 py-3 text-sm"> |
153 | @if (!empty($user->emp_id)) | 154 | @if (!empty($user->emp_id)) |
154 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | | 155 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | |
155 | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> | 156 | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> |
156 | @endif | 157 | @endif |
157 | </td> | 158 | </td> |
158 | <!--<td class="px-4 py-3 text-sm"> | 159 | <!--<td class="px-4 py-3 text-sm"> |
159 | @if ($user->usr_id > 1) | 160 | @if ($user->usr_id > 1) |
160 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 161 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
161 | @endif | 162 | @endif |
162 | </td>--> | 163 | </td>--> |
163 | </tr> | 164 | </tr> |
164 | @endforeach | 165 | @endforeach |
165 | </tbody> | 166 | </tbody> |
166 | </table> | 167 | </table> |
167 | </div> | 168 | </div> |
168 | 169 | ||
169 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> | 170 | <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> |
170 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> | 171 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> |
171 | </div> | 172 | </div> |
172 | </div> | 173 | </div> |
173 | @endsection | 174 | @endsection |
174 | 175 |