Commit 09a5498b178628485768de4acaf21837ecbf7924
1 parent
e905cec2e3
Exists in
master
and in
1 other branch
Баг с ajax запросами рекламы
Showing 3 changed files with 4 additions and 5 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 | let id = e.target.id; | 44 | let id = e.target.id; |
45 | let form = document.getElementById("form_modal_del"); | 45 | let form = document.getElementById("form_modal_del"); |
46 | form.action = "<?=$_SERVER['REDIRECT_URL']?>/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); | 46 | form.action = "<?=$_SERVER['APP_URL']?>admin/employers/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 | 84 | ||
85 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 85 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
86 | <div class="w-full overflow-x-auto"> | 86 | <div class="w-full overflow-x-auto"> |
87 | <table class="w-full whitespace-no-wrap"> | 87 | <table class="w-full whitespace-no-wrap"> |
88 | <thead> | 88 | <thead> |
89 | <tr | 89 | <tr |
90 | 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" | 90 | 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" |
91 | > | 91 | > |
92 | <th class="px-4 py-3">№</th> | 92 | <th class="px-4 py-3">№</th> |
93 | <th class="px-4 py-3">Лого</th> | 93 | <th class="px-4 py-3">Лого</th> |
94 | <th class="px-4 py-3">Название компании/Email/Тел/Пароль</th> | 94 | <th class="px-4 py-3">Название компании/Email/Тел/Пароль</th> |
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">Редакт.</th> | 98 | <th class="px-4 py-3">Редакт.</th> |
99 | </tr> | 99 | </tr> |
100 | </thead> | 100 | </thead> |
101 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 101 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
102 | @foreach($users as $user) | 102 | @foreach($users as $user) |
103 | <tr class="text-gray-700 dark:text-gray-400"> | 103 | <tr class="text-gray-700 dark:text-gray-400"> |
104 | <td class="px-4 py-3"> | 104 | <td class="px-4 py-3"> |
105 | {{$user->id}} | 105 | {{$user->id}} |
106 | </td> | 106 | </td> |
107 | <td class="px-4 py-3"> | 107 | <td class="px-4 py-3"> |
108 | @if (isset($user->emp_logo) && ($user->emp_logo)) | 108 | @if (isset($user->emp_logo) && ($user->emp_logo)) |
109 | <div class="flex items-center text-sm"> | 109 | <div class="flex items-center text-sm"> |
110 | <div | 110 | <div |
111 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" | 111 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" |
112 | > | 112 | > |
113 | <img | 113 | <img |
114 | class="object-cover w-full h-full rounded-full" | 114 | class="object-cover w-full h-full rounded-full" |
115 | src="{{ asset(Storage::url($user->emp_logo)) }}" | 115 | src="{{ asset(Storage::url($user->emp_logo)) }}" |
116 | alt="" | 116 | alt="" |
117 | loading="lazy" | 117 | loading="lazy" |
118 | /> | 118 | /> |
119 | <div | 119 | <div |
120 | class="absolute inset-0 rounded-full shadow-inner" | 120 | class="absolute inset-0 rounded-full shadow-inner" |
121 | aria-hidden="true" | 121 | aria-hidden="true" |
122 | ></div> | 122 | ></div> |
123 | </div> | 123 | </div> |
124 | </div> | 124 | </div> |
125 | @else | 125 | @else |
126 | - | 126 | - |
127 | @endif | 127 | @endif |
128 | </td> | 128 | </td> |
129 | 129 | ||
130 | <td class="px-4 py-3"> | 130 | <td class="px-4 py-3"> |
131 | <div class="flex items-center text-sm"> | 131 | <div class="flex items-center text-sm"> |
132 | <div> | 132 | <div> |
133 | <p class="font-semibold">{{$user->name}}</p> | 133 | <p class="font-semibold">{{$user->name}}</p> |
134 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | 134 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> |
135 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 135 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
136 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | 136 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} |
137 | </p> | 137 | </p> |
138 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 138 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
139 | @if (!empty($user->pubpassword)) | 139 | @if (!empty($user->pubpassword)) |
140 | {{ base64_decode($user->pubpassword) }} | 140 | {{ base64_decode($user->pubpassword) }} |
141 | @endif | 141 | @endif |
142 | </p> | 142 | </p> |
143 | </div> | 143 | </div> |
144 | </div> | 144 | </div> |
145 | 145 | ||
146 | </td> | 146 | </td> |
147 | <td class="px-4 py-3 text-sm"> | 147 | <td class="px-4 py-3 text-sm"> |
148 | {{ $user->category }} | 148 | {{ $user->category }} |
149 | </td> | 149 | </td> |
150 | <td class="px-4 py-3 text-sm"> | 150 | <td class="px-4 py-3 text-sm"> |
151 | @if (!empty($user->comment_admin)) | 151 | @if (!empty($user->comment_admin)) |
152 | 152 | ||
153 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->emp_id]) }}">Есть</a> | 153 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->emp_id]) }}">Есть</a> |
154 | @else | 154 | @else |
155 | Нет | 155 | Нет |
156 | @endif | 156 | @endif |
157 | </td> | 157 | </td> |
158 | <td class="px-4 py-3 text-sm"> | 158 | <td class="px-4 py-3 text-sm"> |
159 | {{ date('d.m.Y', strtotime($user->created_at)) }} | 159 | {{ date('d.m.Y', strtotime($user->created_at)) }} |
160 | </td> | 160 | </td> |
161 | <td class="px-4 py-3 text-sm"> | 161 | <td class="px-4 py-3 text-sm"> |
162 | @if (!empty($user->emp_id)) | 162 | @if (!empty($user->emp_id)) |
163 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | | 163 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | |
164 | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> | 164 | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> |
165 | @endif | 165 | @endif |
166 | </td> | 166 | </td> |
167 | <!--<td class="px-4 py-3 text-sm"> | 167 | <!--<td class="px-4 py-3 text-sm"> |
168 | @if ($user->usr_id > 1) | 168 | @if ($user->usr_id > 1) |
169 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 169 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
170 | @endif | 170 | @endif |
171 | </td>--> | 171 | </td>--> |
172 | </tr> | 172 | </tr> |
173 | @endforeach | 173 | @endforeach |
174 | </tbody> | 174 | </tbody> |
175 | </table> | 175 | </table> |
176 | </div> | 176 | </div> |
177 | 177 | ||
178 | <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"> | 178 | <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"> |
179 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> | 179 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> |
180 | </div> | 180 | </div> |
181 | </div> | 181 | </div> |
182 | @endsection | 182 | @endsection |
183 | 183 |
resources/views/admin/reclames/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', '.btn-eye', function () { | 6 | $(document).on('click', '.btn-eye', function () { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var status_ = this_.attr('data-status'); | 8 | var status_ = this_.attr('data-status'); |
9 | var id_ = this_.attr('data-id'); | 9 | var id_ = this_.attr('data-id'); |
10 | var ajax_block = $('#ajax_block'); | 10 | var ajax_block = $('#ajax_block'); |
11 | 11 | ||
12 | $.ajax({ | 12 | $.ajax({ |
13 | type: "GET", | 13 | type: "GET", |
14 | url: "{{ url()->full()}}", | 14 | url: "{{ url()->full()}}", |
15 | data: "id=" + id_ + "&status=" + status_, | 15 | data: "id=" + id_ + "&status=" + status_, |
16 | success: function (data) { | 16 | success: function (data) { |
17 | console.log('Обновление таблицы '); | 17 | console.log('Обновление таблицы '); |
18 | //data = JSON.parse(data); | 18 | //data = JSON.parse(data); |
19 | //console.log(data); | 19 | //console.log(data); |
20 | ajax_block.html(data); | 20 | ajax_block.html(data); |
21 | }, | 21 | }, |
22 | headers: { | 22 | headers: { |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
24 | }, | 24 | }, |
25 | error: function (data) { | 25 | error: function (data) { |
26 | console.log('Error: ' + data); | 26 | console.log('Error: ' + data); |
27 | } | 27 | } |
28 | }); | 28 | }); |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | </script> | 31 | </script> |
32 | 32 | ||
33 | <script> | 33 | <script> |
34 | const btns = document.querySelectorAll('.btn_del'); | 34 | const btns = document.querySelectorAll('.btn_del'); |
35 | btns.forEach(btn => { | 35 | btns.forEach(btn => { |
36 | btn.addEventListener('click', (e) => { | 36 | btn.addEventListener('click', (e) => { |
37 | console.log('click button'); | 37 | console.log('click button'); |
38 | //let id = e.target.id; | 38 | //let id = e.target.id; |
39 | let form = document.getElementById("form_modal_del"); | 39 | let form = document.getElementById("form_modal_del"); |
40 | form.action = "<?=$_SERVER['REDIRECT_URL'];?>/delete/"+e.target.getAttribute('data-reclame'); | 40 | form.action = "<?=$_SERVER['APP_URL'];?>admin/reclames/delete/"+e.target.getAttribute('data-reclame'); |
41 | //document.getElementById("title_modal").innerHTML = id; | 41 | //document.getElementById("title_modal").innerHTML = id; |
42 | console.log(e.target.getAttribute('data-employer')); | 42 | console.log(e.target.getAttribute('data-employer')); |
43 | console.log(e.target.getAttribute('data-user')); | 43 | console.log(e.target.getAttribute('data-user')); |
44 | 44 | ||
45 | }); | 45 | }); |
46 | }); | 46 | }); |
47 | </script> | 47 | </script> |
48 | @endsection | 48 | @endsection |
49 | 49 | ||
50 | @section('modal') | 50 | @section('modal') |
51 | @include('admin.reclames.modal') | 51 | @include('admin.reclames.modal') |
52 | @endsection | 52 | @endsection |
53 | 53 | ||
54 | @section('search') | 54 | @section('search') |
55 | 55 | ||
56 | @endsection | 56 | @endsection |
57 | 57 | ||
58 | @section('content') | 58 | @section('content') |
59 | 59 | ||
60 | <a href="{{ route('admin.add-reclames') }}" style="width: 160px" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | 60 | <a href="{{ route('admin.add-reclames') }}" style="width: 160px" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> |
61 | Добавить рекламу | 61 | Добавить рекламу |
62 | </a> | 62 | </a> |
63 | <br> | 63 | <br> |
64 | <pre><? //print_r($_SERVER);?></pre> | 64 | <pre><? //print_r($_SERVER);?></pre> |
65 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 65 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
66 | 66 | ||
67 | <div class="w-full overflow-x-auto"> | 67 | <div class="w-full overflow-x-auto"> |
68 | <table class="w-full whitespace-no-wrap"> | 68 | <table class="w-full whitespace-no-wrap"> |
69 | <thead> | 69 | <thead> |
70 | <tr | 70 | <tr |
71 | 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" | 71 | 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" |
72 | > | 72 | > |
73 | <th class="px-4 py-3">№</th> | 73 | <th class="px-4 py-3">№</th> |
74 | <th class="px-4 py-3">Имя в админке/Заголовок</th> | 74 | <th class="px-4 py-3">Имя в админке/Заголовок</th> |
75 | <th class="px-4 py-3">Позиция</th> | 75 | <th class="px-4 py-3">Позиция</th> |
76 | <th class="px-4 py-3">Клики</th> | 76 | <th class="px-4 py-3">Клики</th> |
77 | <th class="px-4 py-3">Редактировать</th> | 77 | <th class="px-4 py-3">Редактировать</th> |
78 | </tr> | 78 | </tr> |
79 | </thead> | 79 | </thead> |
80 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 80 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
81 | @foreach($reclames as $reclame) | 81 | @foreach($reclames as $reclame) |
82 | <tr class="text-gray-700 dark:text-gray-400"> | 82 | <tr class="text-gray-700 dark:text-gray-400"> |
83 | <td class="px-4 py-3"> | 83 | <td class="px-4 py-3"> |
84 | {{$reclame->id}} | 84 | {{$reclame->id}} |
85 | </td> | 85 | </td> |
86 | <td class="px-4 py-3"> | 86 | <td class="px-4 py-3"> |
87 | <div class="flex items-center text-sm"> | 87 | <div class="flex items-center text-sm"> |
88 | <div> | 88 | <div> |
89 | <p class="font-semibold"> | 89 | <p class="font-semibold"> |
90 | {{$reclame->name}} | 90 | {{$reclame->name}} |
91 | </p> | 91 | </p> |
92 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 92 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
93 | {{$reclame->title}} | 93 | {{$reclame->title}} |
94 | </p> | 94 | </p> |
95 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 95 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
96 | {{$reclame->link}} | 96 | {{$reclame->link}} |
97 | </p> | 97 | </p> |
98 | </div> | 98 | </div> |
99 | </div> | 99 | </div> |
100 | </td> | 100 | </td> |
101 | <td class="px-4 py-3"> | 101 | <td class="px-4 py-3"> |
102 | {{$reclame->position}} | 102 | {{$reclame->position}} |
103 | </td> | 103 | </td> |
104 | 104 | ||
105 | <td class="px-4 py-3"> | 105 | <td class="px-4 py-3"> |
106 | {{$reclame->col_vo_click}} | 106 | {{$reclame->col_vo_click}} |
107 | </td> | 107 | </td> |
108 | <td class="px-4 py-3 text-sm_"> | 108 | <td class="px-4 py-3 text-sm_"> |
109 | <form action="{{ route('admin.delete-reclames', ['reclame' => $reclame->id]) }}" method="POST"> | 109 | <form action="{{ route('admin.delete-reclames', ['reclame' => $reclame->id]) }}" method="POST"> |
110 | <a href="{{ route('admin.edit-reclames', ['reclame' => $reclame->id]) }}" style="float:left">Изменить |</a> | 110 | <a href="{{ route('admin.edit-reclames', ['reclame' => $reclame->id]) }}" style="float:left">Изменить |</a> |
111 | @csrf | 111 | @csrf |
112 | @method('DELETE') | 112 | @method('DELETE') |
113 | @if ($reclame->is_hidden) | 113 | @if ($reclame->is_hidden) |
114 | <img class="btn-eye" name="btn_close_{{$reclame->id}}" data-status="close" data-id="{{$reclame->id}}" src="{{asset('/assets/img/close-eye.png')}}" style="width:25px; float:left; margin: 0px 5px 0px 5px; cursor: pointer;" /> | 114 | <img class="btn-eye" name="btn_close_{{$reclame->id}}" data-status="close" data-id="{{$reclame->id}}" src="{{asset('/assets/img/close-eye.png')}}" style="width:25px; float:left; margin: 0px 5px 0px 5px; cursor: pointer;" /> |
115 | @else | 115 | @else |
116 | <img class="btn-eye" name="btn_open_{{$reclame->id}}" data-status="open" data-id="{{$reclame->id}}" src="{{asset('/assets/img/open-eye.png')}}" style="width:25px; float: left; margin: 0px 5px 0px 5px; cursor: pointer;"/> | 116 | <img class="btn-eye" name="btn_open_{{$reclame->id}}" data-status="open" data-id="{{$reclame->id}}" src="{{asset('/assets/img/open-eye.png')}}" style="width:25px; float: left; margin: 0px 5px 0px 5px; cursor: pointer;"/> |
117 | @endif | 117 | @endif |
118 | 118 | ||
119 | <a @click="openModal" style="cursor: pointer;" data-reclame="{{$reclame->id}}" class="btn_del btn btn-danger">| Удалить</a> | 119 | <a @click="openModal" style="cursor: pointer;" data-reclame="{{$reclame->id}}" class="btn_del btn btn-danger">| Удалить</a> |
120 | <!--<input class="btn btn-danger" type="submit" style="float:left" value="Удалить"/>--> | 120 | <!--<input class="btn btn-danger" type="submit" style="float:left" value="Удалить"/>--> |
121 | </form> | 121 | </form> |
122 | </td> | 122 | </td> |
123 | </tr> | 123 | </tr> |
124 | @endforeach | 124 | @endforeach |
125 | </tbody> | 125 | </tbody> |
126 | </table> | 126 | </table> |
127 | </div> | 127 | </div> |
128 | 128 | ||
129 | <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"> | 129 | <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"> |
130 | <?=$reclames->appends($_GET)->links('admin.pagginate'); ?> | 130 | <?=$reclames->appends($_GET)->links('admin.pagginate'); ?> |
131 | </div> | 131 | </div> |
132 | </div> | 132 | </div> |
133 | @endsection | 133 | @endsection |
134 | 134 |
resources/views/admin/reclames/index_ajax.blade.php
1 | <div class="w-full overflow-x-auto"> | 1 | <div class="w-full overflow-x-auto"> |
2 | <table class="w-full whitespace-no-wrap"> | 2 | <table class="w-full whitespace-no-wrap"> |
3 | <thead> | 3 | <thead> |
4 | <tr | 4 | <tr |
5 | 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" | 5 | 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" |
6 | > | 6 | > |
7 | <th class="px-4 py-3">№</th> | 7 | <th class="px-4 py-3">№</th> |
8 | <th class="px-4 py-3">Имя в админке/Заголовок</th> | 8 | <th class="px-4 py-3">Имя в админке/Заголовок</th> |
9 | <th class="px-4 py-3">Позиция</th> | 9 | <th class="px-4 py-3">Позиция</th> |
10 | <th class="px-4 py-3">Клики</th> | 10 | <th class="px-4 py-3">Клики</th> |
11 | <th class="px-4 py-3">Редактировать</th> | 11 | <th class="px-4 py-3">Редактировать</th> |
12 | </tr> | 12 | </tr> |
13 | </thead> | 13 | </thead> |
14 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 14 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
15 | @foreach($reclames as $reclame) | 15 | @foreach($reclames as $reclame) |
16 | <tr class="text-gray-700 dark:text-gray-400"> | 16 | <tr class="text-gray-700 dark:text-gray-400"> |
17 | <td class="px-4 py-3"> | 17 | <td class="px-4 py-3"> |
18 | {{$reclame->id}} | 18 | {{$reclame->id}} |
19 | </td> | 19 | </td> |
20 | <td class="px-4 py-3"> | 20 | <td class="px-4 py-3"> |
21 | <div class="flex items-center text-sm"> | 21 | <div class="flex items-center text-sm"> |
22 | <div> | 22 | <div> |
23 | <p class="font-semibold"> | 23 | <p class="font-semibold"> |
24 | {{$reclame->name}} | 24 | {{$reclame->name}} |
25 | </p> | 25 | </p> |
26 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 26 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
27 | {{$reclame->title}} | 27 | {{$reclame->title}} |
28 | </p> | 28 | </p> |
29 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 29 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
30 | {{$reclame->link}} | 30 | {{$reclame->link}} |
31 | </p> | 31 | </p> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | </td> | 34 | </td> |
35 | <td class="px-4 py-3"> | 35 | <td class="px-4 py-3"> |
36 | {{$reclame->position}} | 36 | {{$reclame->position}} |
37 | </td> | 37 | </td> |
38 | 38 | ||
39 | <td class="px-4 py-3"> | 39 | <td class="px-4 py-3"> |
40 | {{$reclame->col_vo_click}} | 40 | {{$reclame->col_vo_click}} |
41 | </td> | 41 | </td> |
42 | <td class="px-4 py-3 text-sm_"> | 42 | <td class="px-4 py-3 text-sm_"> |
43 | <form action="{{ route('admin.delete-reclames', ['reclame' => $reclame->id]) }}" method="POST"> | 43 | <form action="{{ route('admin.delete-reclames', ['reclame' => $reclame->id]) }}" method="POST"> |
44 | <a href="{{ route('admin.edit-reclames', ['reclame' => $reclame->id]) }}" style="float:left">Изменить |</a> | 44 | <a href="{{ route('admin.edit-reclames', ['reclame' => $reclame->id]) }}" style="float:left">Изменить |</a> |
45 | @csrf | 45 | @csrf |
46 | @method('DELETE') | 46 | @method('DELETE') |
47 | @if ($reclame->is_hidden) | 47 | @if ($reclame->is_hidden) |
48 | <img class="btn-eye" name="btn_close_{{$reclame->id}}" data-status="close" data-id="{{$reclame->id}}" src="{{asset('/assets/img/close-eye.png')}}" style="width:25px; float:left; margin: 0px 5px 0px 5px; cursor: pointer;" /> | 48 | <img class="btn-eye" name="btn_close_{{$reclame->id}}" data-status="close" data-id="{{$reclame->id}}" src="{{asset('/assets/img/close-eye.png')}}" style="width:25px; float:left; margin: 0px 5px 0px 5px; cursor: pointer;" /> |
49 | <p style="float:left">|</p> | ||
50 | @else | 49 | @else |
51 | <img class="btn-eye" name="btn_open_{{$reclame->id}}" data-status="open" data-id="{{$reclame->id}}" src="{{asset('/assets/img/open-eye.png')}}" style="width:25px; float: left; margin: 0px 5px 0px 5px; cursor: pointer;"/> | 50 | <img class="btn-eye" name="btn_open_{{$reclame->id}}" data-status="open" data-id="{{$reclame->id}}" src="{{asset('/assets/img/open-eye.png')}}" style="width:25px; float: left; margin: 0px 5px 0px 5px; cursor: pointer;"/> |
52 | <p style="float:left">|</p> | ||
53 | @endif | 51 | @endif |
54 | 52 | ||
55 | <input class="btn btn-danger" type="submit" style="float:left" value="Удалить"/> | 53 | <a @click="openModal" style="cursor: pointer;" data-reclame="{{$reclame->id}}" class="btn_del btn btn-danger">| Удалить</a> |
54 | <!--<input class="btn btn-danger" type="submit" style="float:left" value="Удалить"/>--> | ||
56 | </form> | 55 | </form> |
57 | </td> | 56 | </td> |
58 | </tr> | 57 | </tr> |
59 | @endforeach | 58 | @endforeach |
60 | </tbody> | 59 | </tbody> |
61 | </table> | 60 | </table> |
62 | </div> | 61 | </div> |
63 | 62 | ||
64 | <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"> | 63 | <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"> |
65 | <?=$reclames->appends($_GET)->links('admin.pagginate'); ?> | 64 | <?=$reclames->appends($_GET)->links('admin.pagginate'); ?> |
66 | </div> | 65 | </div> |
67 | 66 | ||
68 | 67 |