Commit 28e5481503ba65efb2aecebb2eae0d23ba7dfe36
1 parent
0a94fb81dd
Exists in
master
Рефакторинг кода и устранение бага в сортировке данных
Showing 8 changed files with 145 additions and 4 deletions Inline Diff
app/Classes/FilterData.php
File was created | 1 | <?php | |
2 | |||
3 | |||
4 | namespace App\Classes; | ||
5 | |||
6 | |||
7 | class FilterData | ||
8 | { | ||
9 | protected $builder; | ||
10 | protected $request; | ||
11 | |||
12 | public function __construct($builder, $request) { | ||
13 | $this->builder = $builder; | ||
14 | $this->request = $request; | ||
15 | } | ||
16 | |||
17 | public function apply() { | ||
18 | foreach ($this->filters() as $filter => $value) { | ||
19 | if (method_exists($this, $filter)) { | ||
20 | $this->filter($value); | ||
21 | } | ||
22 | } | ||
23 | return $this->builder; | ||
24 | } | ||
25 | |||
26 | public function area($value) { | ||
27 | return $this->builder->where('area_id', '=', $value); | ||
28 | } | ||
29 | |||
30 | public function type_area($value) { | ||
31 | return $this->builder->where('type_area_id', '=', $value); | ||
32 | } | ||
33 | |||
34 | public function format_area($value) { | ||
35 | return $this->builder->where('format_area_id', '=', $value); | ||
36 | } | ||
37 | |||
38 | public function area_m2_min($value) { | ||
39 | return $this->builder->where('area', '>', $value); | ||
40 | } | ||
41 | |||
42 | public function area_m2_max($value) { | ||
43 | return $this->builder->where('area', '<', $value); | ||
44 | } | ||
45 | |||
46 | public function price_min($value) { | ||
47 | return $this->builder->where('price', '>', $value); | ||
48 | } | ||
49 | |||
50 | public function price_max($value) { | ||
51 | return $this->builder->where('price', '<', $value); | ||
52 | } | ||
53 | |||
54 | public function address($value) { | ||
55 | return $this->builder->where('address', 'LIKE', "%".$value."%"); | ||
56 | } | ||
57 | |||
58 | public function filters() { | ||
59 | return $this->request->all(); | ||
60 | } | ||
61 | } | ||
62 |
app/Classes/SortData.php
File was created | 1 | <?php | |
2 | |||
3 | |||
4 | namespace App\Classes; | ||
5 | |||
6 | |||
7 | class SortData | ||
8 | { | ||
9 | protected $builder; | ||
10 | protected $request; | ||
11 | |||
12 | public function __construct($builder, $request) { | ||
13 | $this->builder = $builder; | ||
14 | $this->request = $request; | ||
15 | } | ||
16 | |||
17 | public function apply() { | ||
18 | foreach ($this->sorter() as $filter => $value) { | ||
19 | if (method_exists($this, $filter)) { | ||
20 | $this->filter($value); | ||
21 | } | ||
22 | } | ||
23 | return $this->builder; | ||
24 | } | ||
25 | |||
26 | public function sort_price($value) { | ||
27 | switch ($value) { | ||
28 | case 1: $this->builder = $this->builder->orderBy('price');break; | ||
29 | case 2: $this->builder = $this->builder->orderByDesc('price');break; | ||
30 | default: $this->builder = $this->builder->orderBy('price');break; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | public function sort_new($value) { | ||
35 | switch ($value) { | ||
36 | case 1: $this->builder = $this->builder->orderByDesc('created_at');break; | ||
37 | case 2: $this->builder = $this->builder->orderBy('created_at');break; | ||
38 | default: $this->builder = $this->builder->orderByDesc('created_at');break; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | public function sort_area($value) { | ||
43 | switch ($value) { | ||
44 | case 1: $this->builder = $this->builder->orderByDesc('area');break; | ||
45 | case 2: $this->builder = $this->builder->orderBy('area');break; | ||
46 | default: $this->builder = $this->builder->orderByDesc('area');break; | ||
47 | } | ||
48 | } | ||
49 | |||
50 | public function sorter() { | ||
51 | return $this->request->all(); | ||
52 | } | ||
53 | |||
54 | } | ||
55 |
app/Http/Controllers/MainController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Http\Requests\EmailRequest; | 5 | use App\Http\Requests\EmailRequest; |
6 | use App\Http\Requests\FooterFeedbackRequest; | 6 | use App\Http\Requests\FooterFeedbackRequest; |
7 | use App\Models\Area; | 7 | use App\Models\Area; |
8 | use App\Models\Contact; | 8 | use App\Models\Contact; |
9 | use App\Models\format_area; | 9 | use App\Models\format_area; |
10 | use App\Models\House; | 10 | use App\Models\House; |
11 | use App\Models\ModelMailFeedback; | 11 | use App\Models\ModelMailFeedback; |
12 | use App\Models\News; | 12 | use App\Models\News; |
13 | use App\Models\Page; | 13 | use App\Models\Page; |
14 | use App\Models\Partners; | 14 | use App\Models\Partners; |
15 | use App\Models\type_area; | 15 | use App\Models\type_area; |
16 | use Illuminate\Database\Eloquent\Model; | 16 | use Illuminate\Database\Eloquent\Model; |
17 | use Illuminate\Http\Request; | 17 | use Illuminate\Http\Request; |
18 | use App\Classes\RusDate; | 18 | use App\Classes\RusDate; |
19 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
20 | use Illuminate\Support\Facades\Mail; | 20 | use Illuminate\Support\Facades\Mail; |
21 | use PhpParser\Node\Stmt\Switch_; | 21 | use PhpParser\Node\Stmt\Switch_; |
22 | use Illuminate\Support\Facades\Response; | 22 | use Illuminate\Support\Facades\Response; |
23 | use App\Classes\FilterData; | ||
23 | 24 | ||
24 | class MainController extends Controller | 25 | class MainController extends Controller |
25 | { | 26 | { |
26 | /* | 27 | /* |
27 | * Главная страница проекта | 28 | * Главная страница проекта |
28 | */ | 29 | */ |
29 | public function index() { | 30 | public function index() { |
30 | $houses = House::with('areas')->orderByDesc('created_at')->limit(8)->get(); | 31 | $houses = House::with('areas')->orderByDesc('created_at')->limit(8)->get(); |
31 | $news = News::query()->orderByDesc('created_at')->limit(8)->get(); | 32 | $news = News::query()->orderByDesc('created_at')->limit(8)->get(); |
32 | $partners = Partners::query()->limit(18)->get(); | 33 | $partners = Partners::query()->limit(18)->get(); |
33 | return view('index', compact('houses', 'news', 'partners')); | 34 | return view('index', compact('houses', 'news', 'partners')); |
34 | } | 35 | } |
35 | 36 | ||
36 | /* | 37 | /* |
37 | * Фильтр ajax в каталоге | 38 | * Фильтр ajax в каталоге |
38 | */ | 39 | */ |
39 | public function catalog_ajax_filter(Request $request) { | 40 | public function catalog_ajax_filter(Request $request) { |
40 | $Res = Array(); | 41 | $Res = Array(); |
41 | if (!empty($request->area)) { | 42 | if (!empty($request->area)) { |
42 | $area_table = Area::where('id', '=', $request->area)->get(); | 43 | $area_table = Area::where('id', '=', $request->area)->get(); |
43 | $Res[] = $area_table[0]->name_area; | 44 | $Res[] = $area_table[0]->name_area; |
44 | } else { | 45 | } else { |
45 | $Res[] = "Все объекты"; | 46 | $Res[] = "Все объекты"; |
46 | } | 47 | } |
47 | 48 | ||
48 | if (!empty($request->type_area)) { | 49 | if (!empty($request->type_area)) { |
49 | $type_area_table = type_area::where('id', '=', $request->type_area)->get(); | 50 | $type_area_table = type_area::where('id', '=', $request->type_area)->get(); |
50 | $Res[] = $type_area_table[0]->name_type; | 51 | $Res[] = $type_area_table[0]->name_type; |
51 | } else { | 52 | } else { |
52 | $Res[] = "Тип недвижимости"; | 53 | $Res[] = "Тип недвижимости"; |
53 | } | 54 | } |
54 | 55 | ||
55 | if (!empty($request->format_area)) { | 56 | if (!empty($request->format_area)) { |
56 | $format_area_table = format_area::where('id', '=', $request->format_area)->get(); | 57 | $format_area_table = format_area::where('id', '=', $request->format_area)->get(); |
57 | $Res[] = $format_area_table[0]->name_format; | 58 | $Res[] = $format_area_table[0]->name_format; |
58 | } else { | 59 | } else { |
59 | $Res[] = "Формат недвижимости"; | 60 | $Res[] = "Формат недвижимости"; |
60 | } | 61 | } |
61 | 62 | ||
62 | return json_encode($Res); | 63 | return json_encode($Res); |
63 | } | 64 | } |
64 | 65 | ||
65 | /* | 66 | /* |
66 | * Страница ЖК | 67 | * Страница ЖК |
67 | */ | 68 | */ |
68 | public function Complex(Area $area, Request $request) { | 69 | public function Complex(Area $area, Request $request) { |
69 | //////////раздел аренда | 70 | //////////раздел аренда |
70 | $house_arenda = House::with('areas')-> | 71 | $house_arenda = House::with('areas')-> |
71 | where('area_id', '=', $area->id)-> | 72 | where('area_id', '=', $area->id)-> |
72 | where('format_house', '=', 'Аренда'); | 73 | where('format_house', '=', 'Аренда'); |
73 | 74 | ||
74 | if ($request->view == 'arenda') { | 75 | if ($request->view == 'arenda') { |
75 | switch ($request->sort_price) { | 76 | switch ($request->sort_price) { |
76 | case 1: $house_arenda = $house_arenda->orderBy('price');break; | 77 | case 1: $house_arenda = $house_arenda->orderBy('price');break; |
77 | case 2: $house_arenda = $house_arenda->orderByDesc('price');break; | 78 | case 2: $house_arenda = $house_arenda->orderByDesc('price');break; |
78 | } | 79 | } |
79 | switch ($request->sort_new) { | 80 | switch ($request->sort_new) { |
80 | case 1: $house_arenda = $house_arenda->orderByDesc('created_at');break; | 81 | case 1: $house_arenda = $house_arenda->orderByDesc('created_at');break; |
81 | case 2: $house_arenda = $house_arenda->orderBy('created_at');break; | 82 | case 2: $house_arenda = $house_arenda->orderBy('created_at');break; |
82 | } | 83 | } |
83 | switch ($request->sort_area) { | 84 | switch ($request->sort_area) { |
84 | case 1: $house_arenda = $house_arenda->orderByDesc('area')->get();break; | 85 | case 1: $house_arenda = $house_arenda->orderByDesc('area')->get();break; |
85 | case 2: $house_arenda = $house_arenda->orderBy('area')->get();break; | 86 | case 2: $house_arenda = $house_arenda->orderBy('area')->get();break; |
86 | } | 87 | } |
87 | } else { | 88 | } else { |
88 | $house_arenda = $house_arenda->orderBy('price')-> | 89 | $house_arenda = $house_arenda->orderBy('price')-> |
89 | orderByDesc('created_at')-> | 90 | orderByDesc('created_at')-> |
90 | orderByDesc('area')->get(); | 91 | orderByDesc('area')->get(); |
91 | } | 92 | } |
92 | 93 | ||
93 | ////////раздел продажа | 94 | ////////раздел продажа |
94 | $house_prodaja = House::with('areas')-> | 95 | $house_prodaja = House::with('areas')-> |
95 | where('area_id', '=', $area->id)-> | 96 | where('area_id', '=', $area->id)-> |
96 | where('format_house', '=', 'Продажа'); | 97 | where('format_house', '=', 'Продажа'); |
97 | 98 | ||
98 | if ($request->view == 'prodaja') { | 99 | if ($request->view == 'prodaja') { |
99 | switch ($request->sort_price) { | 100 | switch ($request->sort_price) { |
100 | case 1: $house_prodaja = $house_prodaja->orderBy('price');break; | 101 | case 1: $house_prodaja = $house_prodaja->orderBy('price');break; |
101 | case 2: $house_prodaja = $house_prodaja->orderByDesc('price');break; | 102 | case 2: $house_prodaja = $house_prodaja->orderByDesc('price');break; |
102 | } | 103 | } |
103 | switch ($request->sort_new) { | 104 | switch ($request->sort_new) { |
104 | case 1: $house_prodaja = $house_prodaja->orderByDesc('created_at');break; | 105 | case 1: $house_prodaja = $house_prodaja->orderByDesc('created_at');break; |
105 | case 2: $house_prodaja = $house_prodaja->orderBy('created_at');break; | 106 | case 2: $house_prodaja = $house_prodaja->orderBy('created_at');break; |
106 | } | 107 | } |
107 | switch ($request->sort_area) { | 108 | switch ($request->sort_area) { |
108 | case 1: $house_prodaja = $house_prodaja->orderByDesc('area')->get();break; | 109 | case 1: $house_prodaja = $house_prodaja->orderByDesc('area')->get();break; |
109 | case 2: $house_prodaja = $house_prodaja->orderBy('area')->get();break; | 110 | case 2: $house_prodaja = $house_prodaja->orderBy('area')->get();break; |
110 | } | 111 | } |
111 | } else { | 112 | } else { |
112 | $house_prodaja = $house_prodaja->orderBy('price')-> | 113 | $house_prodaja = $house_prodaja->orderBy('price')-> |
113 | orderByDesc('created_at')-> | 114 | orderByDesc('created_at')-> |
114 | orderByDesc('area')->get(); | 115 | orderByDesc('area')->get(); |
115 | } | 116 | } |
116 | 117 | ||
117 | //////////////// Раздел бизнеса | 118 | //////////////// Раздел бизнеса |
118 | $house_bissnes = House::with('areas')-> | 119 | $house_bissnes = House::with('areas')-> |
119 | where('area_id', '=', $area->id)-> | 120 | where('area_id', '=', $area->id)-> |
120 | where('format_house', '=', 'Бизнес'); | 121 | where('format_house', '=', 'Бизнес'); |
121 | //orderByDesc('created_at')->get(); | 122 | //orderByDesc('created_at')->get(); |
122 | 123 | ||
123 | if ($request->view == 'bissnes') { | 124 | if ($request->view == 'bissnes') { |
124 | switch ($request->sort_price) { | 125 | switch ($request->sort_price) { |
125 | case 1: $house_bissnes = $house_bissnes->orderBy('price');break; | 126 | case 1: $house_bissnes = $house_bissnes->orderBy('price');break; |
126 | case 2: $house_bissnes = $house_bissnes->orderByDesc('price');break; | 127 | case 2: $house_bissnes = $house_bissnes->orderByDesc('price');break; |
127 | } | 128 | } |
128 | switch ($request->sort_new) { | 129 | switch ($request->sort_new) { |
129 | case 1: $house_bissnes = $house_bissnes->orderByDesc('created_at');break; | 130 | case 1: $house_bissnes = $house_bissnes->orderByDesc('created_at');break; |
130 | case 2: $house_bissnes = $house_bissnes->orderBy('created_at');break; | 131 | case 2: $house_bissnes = $house_bissnes->orderBy('created_at');break; |
131 | } | 132 | } |
132 | switch ($request->sort_area) { | 133 | switch ($request->sort_area) { |
133 | case 1: $house_bissnes = $house_bissnes->orderByDesc('area')->get();break; | 134 | case 1: $house_bissnes = $house_bissnes->orderByDesc('area')->get();break; |
134 | case 2: $house_bissnes = $house_bissnes->orderBy('area')->get();break; | 135 | case 2: $house_bissnes = $house_bissnes->orderBy('area')->get();break; |
135 | } | 136 | } |
136 | } else { | 137 | } else { |
137 | $house_bissnes = $house_bissnes->orderBy('price')-> | 138 | $house_bissnes = $house_bissnes->orderBy('price')-> |
138 | orderByDesc('created_at')-> | 139 | orderByDesc('created_at')-> |
139 | orderByDesc('area')->get(); | 140 | orderByDesc('area')->get(); |
140 | } | 141 | } |
141 | 142 | ||
142 | //////////раздел арендованные | 143 | //////////раздел арендованные |
143 | $house_arendovannie = House::with('areas')-> | 144 | $house_arendovannie = House::with('areas')-> |
144 | where('area_id', '=', $area->id)-> | 145 | where('area_id', '=', $area->id)-> |
145 | where('format_house', '=', 'Арендованные'); | 146 | where('format_house', '=', 'Арендованные'); |
146 | //orderByDesc('created_at')->get(); | 147 | //orderByDesc('created_at')->get(); |
147 | 148 | ||
148 | if ($request->view == 'arendovannie') { | 149 | if ($request->view == 'arendovannie') { |
149 | switch ($request->sort_price) { | 150 | switch ($request->sort_price) { |
150 | case 1: $house_arendovannie = $house_arendovannie->orderBy('price');break; | 151 | case 1: $house_arendovannie = $house_arendovannie->orderBy('price');break; |
151 | case 2: $house_arendovannie = $house_arendovannie->orderByDesc('price');break; | 152 | case 2: $house_arendovannie = $house_arendovannie->orderByDesc('price');break; |
152 | } | 153 | } |
153 | switch ($request->sort_new) { | 154 | switch ($request->sort_new) { |
154 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('created_at');break; | 155 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('created_at');break; |
155 | case 2: $house_arendovannie = $house_arendovannie->orderBy('created_at');break; | 156 | case 2: $house_arendovannie = $house_arendovannie->orderBy('created_at');break; |
156 | } | 157 | } |
157 | switch ($request->sort_area) { | 158 | switch ($request->sort_area) { |
158 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('area')->get();break; | 159 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('area')->get();break; |
159 | case 2: $house_arendovannie = $house_arendovannie->orderBy('area')->get();break; | 160 | case 2: $house_arendovannie = $house_arendovannie->orderBy('area')->get();break; |
160 | } | 161 | } |
161 | } else { | 162 | } else { |
162 | $house_arendovannie = $house_arendovannie->orderBy('price')-> | 163 | $house_arendovannie = $house_arendovannie->orderBy('price')-> |
163 | orderByDesc('created_at')-> | 164 | orderByDesc('created_at')-> |
164 | orderByDesc('area')->get(); | 165 | orderByDesc('area')->get(); |
165 | } | 166 | } |
166 | 167 | ||
167 | if ($request->ajax()) { | 168 | if ($request->ajax()) { |
168 | switch($request->view) { | 169 | switch($request->view) { |
169 | case 'arenda': return view('ajax.complex.arenda', compact('house_arenda')); break; | 170 | case 'arenda': return view('ajax.complex.arenda', compact('house_arenda')); break; |
170 | case 'prodaja': return view('ajax.complex.prodaja', compact('house_prodaja'));break; | 171 | case 'prodaja': return view('ajax.complex.prodaja', compact('house_prodaja'));break; |
171 | case 'bissnes': return view('ajax.complex.bissnes', compact('house_bissnes')); break; | 172 | case 'bissnes': return view('ajax.complex.bissnes', compact('house_bissnes')); break; |
172 | case 'arendovannie': return view('ajax.complex.arendovannie', compact('house_arendovannie')); break; | 173 | case 'arendovannie': return view('ajax.complex.arendovannie', compact('house_arendovannie')); break; |
173 | } | 174 | } |
174 | } | 175 | } |
175 | 176 | ||
176 | return view('complex', compact('area', | 177 | return view('complex', compact('area', |
177 | 'house_arenda', | 178 | 'house_arenda', |
178 | 'house_prodaja', | 179 | 'house_prodaja', |
179 | 'house_bissnes', | 180 | 'house_bissnes', |
180 | 'house_arendovannie')); | 181 | 'house_arendovannie')); |
181 | 182 | ||
182 | } | 183 | } |
183 | 184 | ||
184 | /* | 185 | /* |
185 | * О компании | 186 | * О компании |
186 | */ | 187 | */ |
187 | public function About(): \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Contracts\Foundation\Application | 188 | public function About(): \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Contracts\Foundation\Application |
188 | { | 189 | { |
189 | $news = News::query()->orderByDesc('created_at')->limit(8)->get(); | 190 | $news = News::query()->orderByDesc('created_at')->limit(8)->get(); |
190 | $partners = Partners::query()->limit(18)->get(); | 191 | $partners = Partners::query()->limit(18)->get(); |
191 | return view('about', compact('news', 'partners')); | 192 | return view('about', compact('news', 'partners')); |
192 | } | 193 | } |
193 | 194 | ||
194 | /* | 195 | /* |
195 | * Форма обратной связи внизу сайта | 196 | * Форма обратной связи внизу сайта |
196 | */ | 197 | */ |
197 | public function main_form(FooterFeedbackRequest $request) { | 198 | public function main_form(FooterFeedbackRequest $request) { |
198 | $RentTorg = Contact::query()->limit(1)->get(); | 199 | $RentTorg = Contact::query()->limit(1)->get(); |
199 | $MailBD = new ModelMailFeedback(); | 200 | $MailBD = new ModelMailFeedback(); |
200 | $MailBD->to = 'Администрации сайта'; | 201 | $MailBD->to = 'Администрации сайта'; |
201 | $MailBD->from = $request->TelephoneUser; | 202 | $MailBD->from = $request->TelephoneUser; |
202 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; | 203 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; |
203 | $MailBD->form = 'Форма в футере'; | 204 | $MailBD->form = 'Форма в футере'; |
204 | $MailBD->text = "От пользователя: ".$request->NameUser.". Заявка на лучшие предложения. Сообщение: ".$request->TextUser; | 205 | $MailBD->text = "От пользователя: ".$request->NameUser.". Заявка на лучшие предложения. Сообщение: ".$request->TextUser; |
205 | $MailBD->save(); | 206 | $MailBD->save(); |
206 | 207 | ||
207 | //return true; | 208 | //return true; |
208 | /* | 209 | /* |
209 | Mail::send('emails.feedback', ['user' => $user], | 210 | Mail::send('emails.feedback', ['user' => $user], |
210 | function ($message) use ($user) { | 211 | function ($message) use ($user) { |
211 | $message->from('sender@gmail.com', 'Sender'); | 212 | $message->from('sender@gmail.com', 'Sender'); |
212 | $message->to($user->email, $user->name)->subject('Test message'); | 213 | $message->to($user->email, $user->name)->subject('Test message'); |
213 | }); | 214 | }); |
214 | */ | 215 | */ |
215 | } | 216 | } |
216 | 217 | ||
217 | /* | 218 | /* |
218 | * Форма обратной связе в хедере | 219 | * Форма обратной связе в хедере |
219 | */ | 220 | */ |
220 | public function header_form(FooterFeedbackRequest $request) { | 221 | public function header_form(FooterFeedbackRequest $request) { |
221 | $RentTorg = Contact::query()->limit(1)->get(); | 222 | $RentTorg = Contact::query()->limit(1)->get(); |
222 | $MailBD = new ModelMailFeedback(); | 223 | $MailBD = new ModelMailFeedback(); |
223 | $MailBD->to = 'Администрации сайта'; | 224 | $MailBD->to = 'Администрации сайта'; |
224 | $MailBD->from = $request->TelephoneUser; | 225 | $MailBD->from = $request->TelephoneUser; |
225 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; | 226 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; |
226 | $MailBD->form = 'Форма в заголовке сайта'; | 227 | $MailBD->form = 'Форма в заголовке сайта'; |
227 | $MailBD->text = "От пользователя: ".$request->NameUser." Сообщение: Заказываю обратный звонок"; | 228 | $MailBD->text = "От пользователя: ".$request->NameUser." Сообщение: Заказываю обратный звонок"; |
228 | $MailBD->save(); | 229 | $MailBD->save(); |
229 | } | 230 | } |
230 | 231 | ||
231 | /* | 232 | /* |
232 | * Форма записаться на просмотр | 233 | * Форма записаться на просмотр |
233 | */ | 234 | */ |
234 | public function rec_view_form(FooterFeedbackRequest $request) { | 235 | public function rec_view_form(FooterFeedbackRequest $request) { |
235 | $RentTorg = Contact::query()->limit(1)->get(); | 236 | $RentTorg = Contact::query()->limit(1)->get(); |
236 | $MailBD = new ModelMailFeedback(); | 237 | $MailBD = new ModelMailFeedback(); |
237 | $MailBD->to = 'Администрации сайта'; | 238 | $MailBD->to = 'Администрации сайта'; |
238 | $MailBD->from = $request->TelephoneUser; | 239 | $MailBD->from = $request->TelephoneUser; |
239 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; | 240 | $MailBD->subject = "Пользователь <".$request->NameUser.">"; |
240 | $MailBD->form = 'Форма записи на просмотр'; | 241 | $MailBD->form = 'Форма записи на просмотр'; |
241 | $MailBD->text = "От пользователя: ".$request->NameUser." Сообщение: Заказываю просмотр офиса"; | 242 | $MailBD->text = "От пользователя: ".$request->NameUser." Сообщение: Заказываю просмотр офиса"; |
242 | $MailBD->text .= "Адрес офиса-объекта: ".url()->previous()." "; | 243 | $MailBD->text .= "Адрес офиса-объекта: ".url()->previous()." "; |
243 | $MailBD->save(); | 244 | $MailBD->save(); |
244 | } | 245 | } |
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Форма обратной связи на странице "Контакты" | 248 | * Форма обратной связи на странице "Контакты" |
248 | */ | 249 | */ |
249 | public function page_contact_form(FooterFeedbackRequest $request) { | 250 | public function page_contact_form(FooterFeedbackRequest $request) { |
250 | $RentTorg = Contact::query()->limit(1)->get(); | 251 | $RentTorg = Contact::query()->limit(1)->get(); |
251 | $MailBD = new ModelMailFeedback(); | 252 | $MailBD = new ModelMailFeedback(); |
252 | $MailBD->to = 'Администрации сайта'; | 253 | $MailBD->to = 'Администрации сайта'; |
253 | $MailBD->from = $request->TelephoneUser; | 254 | $MailBD->from = $request->TelephoneUser; |
254 | $MailBD->subject = "Пользователь <".$request->NameUser."> Компания <".$request->NameCompany.">"; | 255 | $MailBD->subject = "Пользователь <".$request->NameUser."> Компания <".$request->NameCompany.">"; |
255 | $MailBD->form = 'Форма на странице "Контакты"'; | 256 | $MailBD->form = 'Форма на странице "Контакты"'; |
256 | $MailBD->text = "От пользователя: ".$request->NameUser."Телефон: ".$request->TelephoneUser." Почта: <".$request->EmailUser."> Сообщение:".$request->TextUser; | 257 | $MailBD->text = "От пользователя: ".$request->NameUser."Телефон: ".$request->TelephoneUser." Почта: <".$request->EmailUser."> Сообщение:".$request->TextUser; |
257 | $MailBD->save(); | 258 | $MailBD->save(); |
258 | } | 259 | } |
259 | /* | 260 | /* |
260 | * Форма обратной связи по емайлу | 261 | * Форма обратной связи по емайлу |
261 | */ | 262 | */ |
262 | public function email_form(EmailRequest $request) { | 263 | public function email_form(EmailRequest $request) { |
263 | $RentTorg = Contact::query()->limit(1)->get(); | 264 | $RentTorg = Contact::query()->limit(1)->get(); |
264 | $MailBD = new ModelMailFeedback(); | 265 | $MailBD = new ModelMailFeedback(); |
265 | $MailBD->to = 'Администрации сайта'; | 266 | $MailBD->to = 'Администрации сайта'; |
266 | $MailBD->from = $request->EmailUser; | 267 | $MailBD->from = $request->EmailUser; |
267 | $MailBD->subject = "Пользователь <".$request->EmailUser.">"; | 268 | $MailBD->subject = "Пользователь <".$request->EmailUser.">"; |
268 | $MailBD->form = 'Форма обратной связи по Email'; | 269 | $MailBD->form = 'Форма обратной связи по Email'; |
269 | $MailBD->text = "От почты: ".$request->EmailUser." Сообщение: Отправить на данную почту предложения RentTorg"; | 270 | $MailBD->text = "От почты: ".$request->EmailUser." Сообщение: Отправить на данную почту предложения RentTorg"; |
270 | $MailBD->save(); | 271 | $MailBD->save(); |
271 | //dd('Email form'); | 272 | //dd('Email form'); |
272 | return redirect()->route('index'); | 273 | return redirect()->route('index'); |
273 | } | 274 | } |
274 | 275 | ||
275 | /* | 276 | /* |
276 | * Избранное | 277 | * Избранное |
277 | */ | 278 | */ |
278 | public function Favorite(Request $request) { | 279 | public function Favorite(Request $request) { |
279 | if (empty($_COOKIE['favorite_house'])) { | 280 | if (empty($_COOKIE['favorite_house'])) { |
280 | $Arr = Array(); | 281 | $Arr = Array(); |
281 | } else { | 282 | } else { |
282 | $Arr = json_decode($_COOKIE['favorite_house'], true); | 283 | $Arr = json_decode($_COOKIE['favorite_house'], true); |
283 | } | 284 | } |
284 | if (!empty($Arr) && is_array($Arr)) { | 285 | if (!empty($Arr) && is_array($Arr)) { |
285 | $houses = House::with('areas')->whereIn('id', $Arr); | 286 | $houses = House::with('areas')->whereIn('id', $Arr); |
286 | 287 | ||
287 | if (isset($request->sort_price)) { | 288 | if (isset($request->sort_price)) { |
288 | switch ($request->sort_price) { | 289 | switch ($request->sort_price) { |
289 | case 1: $houses = $houses->orderBy('price');break; | 290 | case 1: $houses = $houses->orderBy('price');break; |
290 | case 2: $houses = $houses->orderByDesc('price');break; | 291 | case 2: $houses = $houses->orderByDesc('price');break; |
291 | } | 292 | } |
292 | switch ($request->sort_new) { | 293 | switch ($request->sort_new) { |
293 | case 1: $houses = $houses->orderByDesc('created_at');break; | 294 | case 1: $houses = $houses->orderByDesc('created_at');break; |
294 | case 2: $houses = $houses->orderBy('created_at');break; | 295 | case 2: $houses = $houses->orderBy('created_at');break; |
295 | } | 296 | } |
296 | switch ($request->sort_area) { | 297 | switch ($request->sort_area) { |
297 | case 1: $houses = $houses->orderByDesc('area');break; | 298 | case 1: $houses = $houses->orderByDesc('area');break; |
298 | case 2: $houses = $houses->orderBy('area');break; | 299 | case 2: $houses = $houses->orderBy('area');break; |
299 | } | 300 | } |
300 | 301 | ||
301 | } else { | 302 | } else { |
302 | $houses = $houses->orderBy('price')-> | 303 | $houses = $houses->orderBy('price')-> |
303 | orderByDesc('created_at')-> | 304 | orderByDesc('created_at')-> |
304 | orderByDesc('area'); | 305 | orderByDesc('area'); |
305 | } | 306 | } |
306 | 307 | ||
307 | $houses = $houses->paginate(4); | 308 | $houses = $houses->paginate(4); |
308 | 309 | ||
309 | if ($request->ajax()) { | 310 | if ($request->ajax()) { |
310 | return view('ajax.complex.favorite', compact('houses')); | 311 | return view('ajax.complex.favorite', compact('houses')); |
311 | } | 312 | } |
312 | 313 | ||
313 | return view('favorite_data', compact('houses')); | 314 | return view('favorite_data', compact('houses')); |
314 | } else { | 315 | } else { |
315 | return view('favorite', compact('Arr')); | 316 | return view('favorite', compact('Arr')); |
316 | } | 317 | } |
317 | 318 | ||
318 | 319 | ||
319 | } | 320 | } |
320 | 321 | ||
321 | /* | 322 | /* |
322 | * Категории каталога Аренда/Продажа/Бизнес | 323 | * Категории каталога Аренда/Продажа/Бизнес |
323 | */ | 324 | */ |
324 | public function Category($cat, Request $request) { | 325 | public function Category($cat, Request $request) { |
325 | switch ($cat) { | 326 | switch ($cat) { |
326 | case 'arenda': | 327 | case 'arenda': |
327 | $title = "Аренда торговых помещениий"; | 328 | $title = "Аренда торговых помещениий"; |
328 | $format_house = 'Аренда'; | 329 | $format_house = 'Аренда'; |
329 | break; | 330 | break; |
330 | case 'sale': | 331 | case 'sale': |
331 | $title = "Продажа торговых помещений"; | 332 | $title = "Продажа торговых помещений"; |
332 | $format_house = 'Продажа'; | 333 | $format_house = 'Продажа'; |
333 | break; | 334 | break; |
334 | case 'bussiness': | 335 | case 'bussiness': |
335 | $title = "Арендый бизнес"; | 336 | $title = "Арендый бизнес"; |
336 | $format_house = 'Бизнес'; | 337 | $format_house = 'Бизнес'; |
337 | break; | 338 | break; |
338 | default: | 339 | default: |
339 | $title = "Аренда торговых помещениий"; | 340 | $title = "Аренда торговых помещениий"; |
340 | $format_house = 'Аренда'; | 341 | $format_house = 'Аренда'; |
341 | break; | 342 | break; |
342 | } | 343 | } |
343 | 344 | ||
344 | $houses = House::with('areas')-> | 345 | $houses = House::with('areas')-> |
345 | where('format_house', '=', $format_house); | 346 | where('format_house', '=', $format_house); |
346 | //->appends(request()->query()); | 347 | //->appends(request()->query()); |
347 | 348 | ||
348 | if (!empty($request->area)) { | 349 | if (!empty($request->area)) { |
349 | $houses = $houses->where('area_id', '=', $request->area); | 350 | $houses = $houses->where('area_id', '=', $request->area); |
350 | } | 351 | } |
351 | // условия поиска по типу недвижимости | 352 | // условия поиска по типу недвижимости |
352 | if (!empty($request->type_area)) { | 353 | if (!empty($request->type_area)) { |
353 | $houses = $houses->where('type_area_id', '=', $request->type_area); | 354 | $houses = $houses->where('type_area_id', '=', $request->type_area); |
354 | } | 355 | } |
355 | // условия поиска по формату недвижимости | 356 | // условия поиска по формату недвижимости |
356 | if (!empty($request->format_area)) { | 357 | if (!empty($request->format_area)) { |
357 | $houses = $houses->where('format_area_id', '=', $request->format_area); | 358 | $houses = $houses->where('format_area_id', '=', $request->format_area); |
358 | } | 359 | } |
359 | // условия поиска по площади - минимальная площадь | 360 | // условия поиска по площади - минимальная площадь |
360 | if (!empty($request->area_m2_min)) { | 361 | if (!empty($request->area_m2_min)) { |
361 | $houses = $houses->where('area', '>', $request->area_m2_min); | 362 | $houses = $houses->where('area', '>', $request->area_m2_min); |
362 | } | 363 | } |
363 | // условия поиска по площади - максимальная площадь | 364 | // условия поиска по площади - максимальная площадь |
364 | if (!empty($request->area_m2_max)) { | 365 | if (!empty($request->area_m2_max)) { |
365 | $houses = $houses->where('area', '<', $request->area_m2_max); | 366 | $houses = $houses->where('area', '<', $request->area_m2_max); |
366 | } | 367 | } |
367 | // условия поиска по цене - минимальная цена | 368 | // условия поиска по цене - минимальная цена |
368 | if (!empty($request->price_min)) { | 369 | if (!empty($request->price_min)) { |
369 | $houses = $houses->where('price', '>', $request->price_min); | 370 | $houses = $houses->where('price', '>', $request->price_min); |
370 | } | 371 | } |
371 | // условия поиска по цене - максимальная цена | 372 | // условия поиска по цене - максимальная цена |
372 | if (!empty($request->price_max)) { | 373 | if (!empty($request->price_max)) { |
373 | $houses = $houses->where('price', '<', $request->price_max); | 374 | $houses = $houses->where('price', '<', $request->price_max); |
374 | } | 375 | } |
375 | // условия поиска по адресу | 376 | // условия поиска по адресу |
376 | if (!empty($request->address)) { | 377 | if (!empty($request->address)) { |
377 | $houses = $houses->where('address', 'LIKE', "%".$request->address."%"); | 378 | $houses = $houses->where('address', 'LIKE', "%".$request->address."%"); |
378 | } | 379 | } |
379 | 380 | ||
380 | if (isset($request->sort_price)) { | 381 | if (isset($request->sort_price)) { |
381 | switch ($request->sort_price) { | 382 | switch ($request->sort_price) { |
382 | case 1: $houses = $houses->orderBy('price');break; | 383 | case 1: $houses = $houses->orderBy('price');break; |
383 | case 2: $houses = $houses->orderByDesc('price');break; | 384 | case 2: $houses = $houses->orderByDesc('price');break; |
384 | } | 385 | } |
385 | switch ($request->sort_new) { | 386 | switch ($request->sort_new) { |
386 | case 1: $houses = $houses->orderByDesc('created_at');break; | 387 | case 1: $houses = $houses->orderByDesc('created_at');break; |
387 | case 2: $houses = $houses->orderBy('created_at');break; | 388 | case 2: $houses = $houses->orderBy('created_at');break; |
388 | } | 389 | } |
389 | switch ($request->sort_area) { | 390 | switch ($request->sort_area) { |
390 | case 1: $houses = $houses->orderByDesc('area');break; | 391 | case 1: $houses = $houses->orderByDesc('area');break; |
391 | case 2: $houses = $houses->orderBy('area');break; | 392 | case 2: $houses = $houses->orderBy('area');break; |
392 | } | 393 | } |
393 | 394 | ||
394 | } else { | 395 | } else { |
395 | $houses = $houses->orderBy('price')-> | 396 | $houses = $houses->orderBy('price')-> |
396 | orderByDesc('created_at')-> | 397 | orderByDesc('created_at')-> |
397 | orderByDesc('area'); | 398 | orderByDesc('area'); |
398 | } | 399 | } |
399 | 400 | ||
400 | $houses = $houses->paginate(4); | 401 | $houses = $houses->paginate(4); |
401 | 402 | ||
402 | if ($request->ajax()) { | 403 | if ($request->ajax()) { |
403 | return view('ajax.complex.category', compact('houses')); | 404 | return view('ajax.complex.category', compact('houses')); |
404 | } | 405 | } |
405 | 406 | ||
406 | return view('category_catalog', compact('title', 'cat', 'houses')); | 407 | return view('category_catalog', compact('title', 'cat', 'houses')); |
407 | } | 408 | } |
408 | 409 | ||
410 | public function Test(Request $request) { | ||
411 | $house_arenda = House::with('areas')-> | ||
412 | where('format_house', '=', 'Аренда'); | ||
413 | |||
414 | $house_arenda = $house_arenda->orderByDesc('price')-> | ||
415 | orderByDesc('created_at')-> | ||
416 | orderByDesc('area')->get(); | ||
417 | |||
418 | |||
419 | return view('ajax.complex.arenda', compact('house_arenda')); | ||
420 | |||
421 | } | ||
422 | |||
409 | 423 | ||
410 | /* | 424 | /* |
411 | * Каталог | 425 | * Каталог |
412 | */ | 426 | */ |
413 | public function Catalog(Request $request) { | 427 | public function Catalog(Request $request) { |
414 | 428 | ||
415 | //////////раздел аренда///////////////////////////////////////////////////////////////// | 429 | //////////раздел аренда///////////////////////////////////////////////////////////////// |
416 | $house_arenda = House::with('areas')-> | 430 | $house_arenda = House::with('areas')-> |
417 | where('format_house', '=', 'Аренда'); | 431 | where('format_house', '=', 'Аренда'); |
418 | // условия поиска по объектам комплексов | 432 | // условия поиска по объектам комплексов |
433 | |||
434 | //$house_arenda = (new FilterData($house_arenda, $request))->apply(); | ||
435 | |||
436 | |||
419 | if (!empty($request->area)) { | 437 | if (!empty($request->area)) { |
420 | $house_arenda = $house_arenda->where('area_id', '=', $request->area); | 438 | $house_arenda = $house_arenda->where('area_id', '=', $request->area); |
421 | } | 439 | } |
422 | // условия поиска по типу недвижимости | 440 | // условия поиска по типу недвижимости |
423 | if (!empty($request->type_area)) { | 441 | if (!empty($request->type_area)) { |
424 | $house_arenda = $house_arenda->where('type_area_id', '=', $request->type_area); | 442 | $house_arenda = $house_arenda->where('type_area_id', '=', $request->type_area); |
425 | } | 443 | } |
426 | // условия поиска по формату недвижимости | 444 | // условия поиска по формату недвижимости |
427 | if (!empty($request->format_area)) { | 445 | if (!empty($request->format_area)) { |
428 | $house_arenda = $house_arenda->where('format_area_id', '=', $request->format_area); | 446 | $house_arenda = $house_arenda->where('format_area_id', '=', $request->format_area); |
429 | } | 447 | } |
430 | // условия поиска по площади - минимальная площадь | 448 | // условия поиска по площади - минимальная площадь |
431 | if (!empty($request->area_m2_min)) { | 449 | if (!empty($request->area_m2_min)) { |
432 | $house_arenda = $house_arenda->where('area', '>', $request->area_m2_min); | 450 | $house_arenda = $house_arenda->where('area', '>', $request->area_m2_min); |
433 | } | 451 | } |
434 | // условия поиска по площади - максимальная площадь | 452 | // условия поиска по площади - максимальная площадь |
435 | if (!empty($request->area_m2_max)) { | 453 | if (!empty($request->area_m2_max)) { |
436 | $house_arenda = $house_arenda->where('area', '<', $request->area_m2_max); | 454 | $house_arenda = $house_arenda->where('area', '<', $request->area_m2_max); |
437 | } | 455 | } |
438 | // условия поиска по цене - минимальная цена | 456 | // условия поиска по цене - минимальная цена |
439 | if (!empty($request->price_min)) { | 457 | if (!empty($request->price_min)) { |
440 | $house_arenda = $house_arenda->where('price', '>', $request->price_min); | 458 | $house_arenda = $house_arenda->where('price', '>', $request->price_min); |
441 | } | 459 | } |
442 | // условия поиска по цене - максимальная цена | 460 | // условия поиска по цене - максимальная цена |
443 | if (!empty($request->price_max)) { | 461 | if (!empty($request->price_max)) { |
444 | $house_arenda = $house_arenda->where('price', '<', $request->price_max); | 462 | $house_arenda = $house_arenda->where('price', '<', $request->price_max); |
445 | } | 463 | } |
446 | // условия поиска по адресу | 464 | // условия поиска по адресу |
447 | if (!empty($request->address)) { | 465 | if (!empty($request->address)) { |
448 | $house_arenda = $house_arenda->where('address', 'LIKE', "%".$request->address."%"); | 466 | $house_arenda = $house_arenda->where('address', 'LIKE', "%".$request->address."%"); |
449 | } | 467 | } |
450 | 468 | ||
469 | |||
451 | if ($request->view == 'arenda') { | 470 | if ($request->view == 'arenda') { |
452 | switch ($request->sort_price) { | 471 | switch ($request->sort_price) { |
453 | case 1: $house_arenda = $house_arenda->orderBy('price');break; | 472 | case 1: $house_arenda = $house_arenda->orderBy('price');break; |
454 | case 2: $house_arenda = $house_arenda->orderByDesc('price');break; | 473 | case 2: $house_arenda = $house_arenda->orderByDesc('price');break; |
455 | } | 474 | } |
456 | switch ($request->sort_new) { | 475 | switch ($request->sort_new) { |
457 | case 1: $house_arenda = $house_arenda->orderByDesc('created_at');break; | 476 | case 1: $house_arenda = $house_arenda->orderByDesc('created_at');break; |
458 | case 2: $house_arenda = $house_arenda->orderBy('created_at');break; | 477 | case 2: $house_arenda = $house_arenda->orderBy('created_at');break; |
459 | } | 478 | } |
460 | switch ($request->sort_area) { | 479 | switch ($request->sort_area) { |
461 | case 1: $house_arenda = $house_arenda->orderByDesc('area')->get();break; | 480 | case 1: $house_arenda = $house_arenda->orderByDesc('area')->get();break; |
462 | case 2: $house_arenda = $house_arenda->orderBy('area')->get();break; | 481 | case 2: $house_arenda = $house_arenda->orderBy('area')->get();break; |
463 | } | 482 | } |
464 | } else { | 483 | } else { |
465 | $house_arenda = $house_arenda->orderBy('price')-> | 484 | $house_arenda = $house_arenda->orderBy('price')-> |
466 | orderByDesc('created_at')-> | 485 | orderByDesc('created_at')-> |
467 | orderByDesc('area')->get(); | 486 | orderByDesc('area')->get(); |
468 | } | 487 | } |
469 | 488 | ||
470 | ////////раздел продажа////////////////////////////////////////////////////////////////// | 489 | ////////раздел продажа////////////////////////////////////////////////////////////////// |
471 | $house_prodaja = House::with('areas')-> | 490 | $house_prodaja = House::with('areas')-> |
472 | where('format_house', '=', 'Продажа'); | 491 | where('format_house', '=', 'Продажа'); |
473 | 492 | ||
474 | // условия поиска по объектам комплексов | 493 | // условия поиска по объектам комплексов |
475 | if (!empty($request->area)) { | 494 | if (!empty($request->area)) { |
476 | $house_prodaja = $house_prodaja->where('area_id', '=', $request->area); | 495 | $house_prodaja = $house_prodaja->where('area_id', '=', $request->area); |
477 | } | 496 | } |
478 | // условия поиска по типу недвижимости | 497 | // условия поиска по типу недвижимости |
479 | if (!empty($request->type_area)) { | 498 | if (!empty($request->type_area)) { |
480 | $house_prodaja = $house_prodaja->where('type_area_id', '=', $request->type_area); | 499 | $house_prodaja = $house_prodaja->where('type_area_id', '=', $request->type_area); |
481 | } | 500 | } |
482 | // условия поиска по формату недвижимости | 501 | // условия поиска по формату недвижимости |
483 | if (!empty($request->format_area)) { | 502 | if (!empty($request->format_area)) { |
484 | $house_prodaja = $house_prodaja->where('format_area_id', '=', $request->format_area); | 503 | $house_prodaja = $house_prodaja->where('format_area_id', '=', $request->format_area); |
485 | } | 504 | } |
486 | // условия поиска по площади - минимальная площадь | 505 | // условия поиска по площади - минимальная площадь |
487 | if (!empty($request->area_m2_min)) { | 506 | if (!empty($request->area_m2_min)) { |
488 | $house_prodaja = $house_prodaja->where('area', '>', $request->area_m2_min); | 507 | $house_prodaja = $house_prodaja->where('area', '>', $request->area_m2_min); |
489 | } | 508 | } |
490 | // условия поиска по площади - максимальная площадь | 509 | // условия поиска по площади - максимальная площадь |
491 | if (!empty($request->area_m2_max)) { | 510 | if (!empty($request->area_m2_max)) { |
492 | $house_prodaja = $house_prodaja->where('area', '<', $request->area_m2_max); | 511 | $house_prodaja = $house_prodaja->where('area', '<', $request->area_m2_max); |
493 | } | 512 | } |
494 | // условия поиска по цене - минимальная цена | 513 | // условия поиска по цене - минимальная цена |
495 | if (!empty($request->price_min)) { | 514 | if (!empty($request->price_min)) { |
496 | $house_prodaja = $house_prodaja->where('price', '>', $request->price_min); | 515 | $house_prodaja = $house_prodaja->where('price', '>', $request->price_min); |
497 | } | 516 | } |
498 | // условия поиска по цене - максимальная цена | 517 | // условия поиска по цене - максимальная цена |
499 | if (!empty($request->price_max)) { | 518 | if (!empty($request->price_max)) { |
500 | $house_prodaja = $house_prodaja->where('price', '<', $request->price_max); | 519 | $house_prodaja = $house_prodaja->where('price', '<', $request->price_max); |
501 | } | 520 | } |
502 | // условия поиска по адресу | 521 | // условия поиска по адресу |
503 | if (!empty($request->address)) { | 522 | if (!empty($request->address)) { |
504 | $house_prodaja = $house_prodaja->where('address', 'LIKE', "%".$request->address."%"); | 523 | $house_prodaja = $house_prodaja->where('address', 'LIKE', "%".$request->address."%"); |
505 | } | 524 | } |
506 | 525 | ||
507 | if ($request->view == 'prodaja') { | 526 | if ($request->view == 'prodaja') { |
508 | switch ($request->sort_price) { | 527 | switch ($request->sort_price) { |
509 | case 1: $house_prodaja = $house_prodaja->orderBy('price');break; | 528 | case 1: $house_prodaja = $house_prodaja->orderBy('price');break; |
510 | case 2: $house_prodaja = $house_prodaja->orderByDesc('price');break; | 529 | case 2: $house_prodaja = $house_prodaja->orderByDesc('price');break; |
511 | } | 530 | } |
512 | switch ($request->sort_new) { | 531 | switch ($request->sort_new) { |
513 | case 1: $house_prodaja = $house_prodaja->orderByDesc('created_at');break; | 532 | case 1: $house_prodaja = $house_prodaja->orderByDesc('created_at');break; |
514 | case 2: $house_prodaja = $house_prodaja->orderBy('created_at');break; | 533 | case 2: $house_prodaja = $house_prodaja->orderBy('created_at');break; |
515 | } | 534 | } |
516 | switch ($request->sort_area) { | 535 | switch ($request->sort_area) { |
517 | case 1: $house_prodaja = $house_prodaja->orderByDesc('area')->get();break; | 536 | case 1: $house_prodaja = $house_prodaja->orderByDesc('area')->get();break; |
518 | case 2: $house_prodaja = $house_prodaja->orderBy('area')->get();break; | 537 | case 2: $house_prodaja = $house_prodaja->orderBy('area')->get();break; |
519 | } | 538 | } |
520 | } else { | 539 | } else { |
521 | $house_prodaja = $house_prodaja->orderBy('price')-> | 540 | $house_prodaja = $house_prodaja->orderBy('price')-> |
522 | orderByDesc('created_at')-> | 541 | orderByDesc('created_at')-> |
523 | orderByDesc('area')->get(); | 542 | orderByDesc('area')->get(); |
524 | } | 543 | } |
525 | 544 | ||
526 | //////////////// Раздел бизнеса///////////////////////////////////////////////////////// | 545 | //////////////// Раздел бизнеса///////////////////////////////////////////////////////// |
527 | $house_bissnes = House::with('areas')-> | 546 | $house_bissnes = House::with('areas')-> |
528 | where('format_house', '=', 'Бизнес'); | 547 | where('format_house', '=', 'Бизнес'); |
529 | //orderByDesc('created_at')->get(); | 548 | //orderByDesc('created_at')->get(); |
530 | 549 | ||
531 | // условия поиска по объектам комплексов | 550 | // условия поиска по объектам комплексов |
532 | if (!empty($request->area)) { | 551 | if (!empty($request->area)) { |
533 | $house_bissnes = $house_bissnes->where('area_id', '=', $request->area); | 552 | $house_bissnes = $house_bissnes->where('area_id', '=', $request->area); |
534 | } | 553 | } |
535 | // условия поиска по типу недвижимости | 554 | // условия поиска по типу недвижимости |
536 | if (!empty($request->type_area)) { | 555 | if (!empty($request->type_area)) { |
537 | $house_bissnes = $house_bissnes->where('type_area_id', '=', $request->type_area); | 556 | $house_bissnes = $house_bissnes->where('type_area_id', '=', $request->type_area); |
538 | } | 557 | } |
539 | // условия поиска по формату недвижимости | 558 | // условия поиска по формату недвижимости |
540 | if (!empty($request->format_area)) { | 559 | if (!empty($request->format_area)) { |
541 | $house_bissnes = $house_bissnes->where('format_area_id', '=', $request->format_area); | 560 | $house_bissnes = $house_bissnes->where('format_area_id', '=', $request->format_area); |
542 | } | 561 | } |
543 | // условия поиска по площади - минимальная площадь | 562 | // условия поиска по площади - минимальная площадь |
544 | if (!empty($request->area_m2_min)) { | 563 | if (!empty($request->area_m2_min)) { |
545 | $house_bissnes = $house_bissnes->where('area', '>', $request->area_m2_min); | 564 | $house_bissnes = $house_bissnes->where('area', '>', $request->area_m2_min); |
546 | } | 565 | } |
547 | // условия поиска по площади - максимальная площадь | 566 | // условия поиска по площади - максимальная площадь |
548 | if (!empty($request->area_m2_max)) { | 567 | if (!empty($request->area_m2_max)) { |
549 | $house_bissnes = $house_bissnes->where('area', '<', $request->area_m2_max); | 568 | $house_bissnes = $house_bissnes->where('area', '<', $request->area_m2_max); |
550 | } | 569 | } |
551 | // условия поиска по цене - минимальная цена | 570 | // условия поиска по цене - минимальная цена |
552 | if (!empty($request->price_min)) { | 571 | if (!empty($request->price_min)) { |
553 | $house_bissnes = $house_bissnes->where('price', '>', $request->price_min); | 572 | $house_bissnes = $house_bissnes->where('price', '>', $request->price_min); |
554 | } | 573 | } |
555 | // условия поиска по цене - максимальная цена | 574 | // условия поиска по цене - максимальная цена |
556 | if (!empty($request->price_max)) { | 575 | if (!empty($request->price_max)) { |
557 | $house_bissnes = $house_bissnes->where('price', '<', $request->price_max); | 576 | $house_bissnes = $house_bissnes->where('price', '<', $request->price_max); |
558 | } | 577 | } |
559 | // условия поиска по адресу | 578 | // условия поиска по адресу |
560 | if (!empty($request->address)) { | 579 | if (!empty($request->address)) { |
561 | $house_bissnes = $house_bissnes->where('address', 'LIKE', "%".$request->address."%"); | 580 | $house_bissnes = $house_bissnes->where('address', 'LIKE', "%".$request->address."%"); |
562 | } | 581 | } |
563 | 582 | ||
564 | if ($request->view == 'bissnes') { | 583 | if ($request->view == 'bissnes') { |
565 | switch ($request->sort_price) { | 584 | switch ($request->sort_price) { |
566 | case 1: $house_bissnes = $house_bissnes->orderBy('price');break; | 585 | case 1: $house_bissnes = $house_bissnes->orderBy('price');break; |
567 | case 2: $house_bissnes = $house_bissnes->orderByDesc('price');break; | 586 | case 2: $house_bissnes = $house_bissnes->orderByDesc('price');break; |
568 | } | 587 | } |
569 | switch ($request->sort_new) { | 588 | switch ($request->sort_new) { |
570 | case 1: $house_bissnes = $house_bissnes->orderByDesc('created_at');break; | 589 | case 1: $house_bissnes = $house_bissnes->orderByDesc('created_at');break; |
571 | case 2: $house_bissnes = $house_bissnes->orderBy('created_at');break; | 590 | case 2: $house_bissnes = $house_bissnes->orderBy('created_at');break; |
572 | } | 591 | } |
573 | switch ($request->sort_area) { | 592 | switch ($request->sort_area) { |
574 | case 1: $house_bissnes = $house_bissnes->orderByDesc('area')->get();break; | 593 | case 1: $house_bissnes = $house_bissnes->orderByDesc('area')->get();break; |
575 | case 2: $house_bissnes = $house_bissnes->orderBy('area')->get();break; | 594 | case 2: $house_bissnes = $house_bissnes->orderBy('area')->get();break; |
576 | } | 595 | } |
577 | } else { | 596 | } else { |
578 | $house_bissnes = $house_bissnes->orderBy('price')-> | 597 | $house_bissnes = $house_bissnes->orderBy('price')-> |
579 | orderByDesc('created_at')-> | 598 | orderByDesc('created_at')-> |
580 | orderByDesc('area')->get(); | 599 | orderByDesc('area')->get(); |
581 | } | 600 | } |
582 | 601 | ||
583 | //////////раздел арендованные////////////////////////////////////////////////////////// | 602 | //////////раздел арендованные////////////////////////////////////////////////////////// |
584 | $house_arendovannie = House::with('areas')-> | 603 | $house_arendovannie = House::with('areas')-> |
585 | where('format_house', '=', 'Арендованные'); | 604 | where('format_house', '=', 'Арендованные'); |
586 | //orderByDesc('created_at')->get(); | 605 | //orderByDesc('created_at')->get(); |
587 | 606 | ||
588 | // условия поиска по объектам комплексов | 607 | // условия поиска по объектам комплексов |
589 | if (!empty($request->area)) { | 608 | if (!empty($request->area)) { |
590 | $house_arendovannie = $house_arendovannie->where('area_id', '=', $request->area); | 609 | $house_arendovannie = $house_arendovannie->where('area_id', '=', $request->area); |
591 | } | 610 | } |
592 | // условия поиска по типу недвижимости | 611 | // условия поиска по типу недвижимости |
593 | if (!empty($request->type_area)) { | 612 | if (!empty($request->type_area)) { |
594 | $house_arendovannie = $house_arendovannie->where('type_area_id', '=', $request->type_area); | 613 | $house_arendovannie = $house_arendovannie->where('type_area_id', '=', $request->type_area); |
595 | } | 614 | } |
596 | // условия поиска по формату недвижимости | 615 | // условия поиска по формату недвижимости |
597 | if (!empty($request->format_area)) { | 616 | if (!empty($request->format_area)) { |
598 | $house_arendovannie = $house_arendovannie->where('format_area_id', '=', $request->format_area); | 617 | $house_arendovannie = $house_arendovannie->where('format_area_id', '=', $request->format_area); |
599 | } | 618 | } |
600 | // условия поиска по площади - минимальная площадь | 619 | // условия поиска по площади - минимальная площадь |
601 | if (!empty($request->area_m2_min)) { | 620 | if (!empty($request->area_m2_min)) { |
602 | $house_arendovannie = $house_arendovannie->where('area', '>', $request->area_m2_min); | 621 | $house_arendovannie = $house_arendovannie->where('area', '>', $request->area_m2_min); |
603 | } | 622 | } |
604 | // условия поиска по площади - максимальная площадь | 623 | // условия поиска по площади - максимальная площадь |
605 | if (!empty($request->area_m2_max)) { | 624 | if (!empty($request->area_m2_max)) { |
606 | $house_arendovannie = $house_arendovannie->where('area', '<', $request->area_m2_max); | 625 | $house_arendovannie = $house_arendovannie->where('area', '<', $request->area_m2_max); |
607 | } | 626 | } |
608 | // условия поиска по цене - минимальная цена | 627 | // условия поиска по цене - минимальная цена |
609 | if (!empty($request->price_min)) { | 628 | if (!empty($request->price_min)) { |
610 | $house_arendovannie = $house_arendovannie->where('price', '>', $request->price_min); | 629 | $house_arendovannie = $house_arendovannie->where('price', '>', $request->price_min); |
611 | } | 630 | } |
612 | // условия поиска по цене - максимальная цена | 631 | // условия поиска по цене - максимальная цена |
613 | if (!empty($request->price_max)) { | 632 | if (!empty($request->price_max)) { |
614 | $house_arendovannie = $house_arendovannie->where('price', '<', $request->price_max); | 633 | $house_arendovannie = $house_arendovannie->where('price', '<', $request->price_max); |
615 | } | 634 | } |
616 | // условия поиска по адресу | 635 | // условия поиска по адресу |
617 | if (!empty($request->address)) { | 636 | if (!empty($request->address)) { |
618 | $house_arendovannie = $house_arendovannie->where('address', 'LIKE', "%".$request->address."%"); | 637 | $house_arendovannie = $house_arendovannie->where('address', 'LIKE', "%".$request->address."%"); |
619 | } | 638 | } |
620 | 639 | ||
621 | if ($request->view == 'arendovannie') { | 640 | if ($request->view == 'arendovannie') { |
622 | switch ($request->sort_price) { | 641 | switch ($request->sort_price) { |
623 | case 1: $house_arendovannie = $house_arendovannie->orderBy('price');break; | 642 | case 1: $house_arendovannie = $house_arendovannie->orderBy('price');break; |
624 | case 2: $house_arendovannie = $house_arendovannie->orderByDesc('price');break; | 643 | case 2: $house_arendovannie = $house_arendovannie->orderByDesc('price');break; |
625 | } | 644 | } |
626 | switch ($request->sort_new) { | 645 | switch ($request->sort_new) { |
627 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('created_at');break; | 646 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('created_at');break; |
628 | case 2: $house_arendovannie = $house_arendovannie->orderBy('created_at');break; | 647 | case 2: $house_arendovannie = $house_arendovannie->orderBy('created_at');break; |
629 | } | 648 | } |
630 | switch ($request->sort_area) { | 649 | switch ($request->sort_area) { |
631 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('area')->get();break; | 650 | case 1: $house_arendovannie = $house_arendovannie->orderByDesc('area')->get();break; |
632 | case 2: $house_arendovannie = $house_arendovannie->orderBy('area')->get();break; | 651 | case 2: $house_arendovannie = $house_arendovannie->orderBy('area')->get();break; |
633 | } | 652 | } |
634 | } else { | 653 | } else { |
635 | $house_arendovannie = $house_arendovannie->orderBy('price')-> | 654 | $house_arendovannie = $house_arendovannie->orderBy('price')-> |
636 | orderByDesc('created_at')-> | 655 | orderByDesc('created_at')-> |
637 | orderByDesc('area')->get(); | 656 | orderByDesc('area')->get(); |
638 | } | 657 | } |
639 | 658 | ||
640 | if ($request->ajax()) { | 659 | if ($request->ajax()) { |
641 | switch($request->view) { | 660 | switch($request->view) { |
642 | case 'arenda': return view('ajax.complex.arenda', compact('house_arenda')); break; | 661 | case 'arenda': return view('ajax.complex.arenda', compact('house_arenda')); break; |
643 | case 'prodaja': return view('ajax.complex.prodaja', compact('house_prodaja'));break; | 662 | case 'prodaja': return view('ajax.complex.prodaja', compact('house_prodaja'));break; |
644 | case 'bissnes': return view('ajax.complex.bissnes', compact('house_bissnes')); break; | 663 | case 'bissnes': return view('ajax.complex.bissnes', compact('house_bissnes')); break; |
645 | case 'arendovannie': return view('ajax.complex.arendovannie', compact('house_arendovannie')); break; | 664 | case 'arendovannie': return view('ajax.complex.arendovannie', compact('house_arendovannie')); break; |
646 | } | 665 | } |
647 | } | 666 | } |
648 | if (session('message') == 'Искать') { | 667 | if (session('message') == 'Искать') { |
649 | session()->flash('message', 'Сброс'); | 668 | session()->flash('message', 'Сброс'); |
650 | } else { | 669 | } else { |
651 | session()->flash('message', 'Искать'); | 670 | session()->flash('message', 'Искать'); |
652 | } | 671 | } |
653 | 672 | ||
654 | if (empty($request)) { | 673 | if (empty($request)) { |
655 | session()->flash('message', 'Искать'); | 674 | session()->flash('message', 'Искать'); |
656 | } | 675 | } |
657 | 676 | ||
658 | return view('catalog', compact( | 677 | return view('catalog', compact( |
659 | 'house_arenda', | 678 | 'house_arenda', |
660 | 'house_prodaja', | 679 | 'house_prodaja', |
661 | 'house_bissnes', | 680 | 'house_bissnes', |
662 | 'house_arendovannie' | 681 | 'house_arendovannie' |
663 | )); | 682 | )); |
664 | 683 | ||
665 | 684 | ||
666 | } | 685 | } |
667 | 686 | ||
668 | /* | 687 | /* |
669 | * Новости | 688 | * Новости |
670 | */ | 689 | */ |
671 | public function News() { | 690 | public function News() { |
672 | //$news = News::orderByDesc('created_at')->limit(1)->paginate(); | 691 | //$news = News::orderByDesc('created_at')->limit(1)->paginate(); |
673 | $news_ = News::query()->orderByDesc('created_at')->paginate(4); | 692 | $news_ = News::query()->orderByDesc('created_at')->paginate(4); |
674 | return view('news', compact('news_')); | 693 | return view('news', compact('news_')); |
675 | } | 694 | } |
676 | 695 | ||
677 | /* | 696 | /* |
678 | * Контакты | 697 | * Контакты |
679 | */ | 698 | */ |
680 | public function Contact() { | 699 | public function Contact() { |
681 | return view('contact'); | 700 | return view('contact'); |
682 | } | 701 | } |
683 | 702 | ||
684 | /* | 703 | /* |
685 | * Карта объектов | 704 | * Карта объектов |
686 | */ | 705 | */ |
687 | public function MapsObj(Request $request) { | 706 | public function MapsObj(Request $request) { |
688 | //$houses = House::with('areas'); | 707 | //$houses = House::with('areas'); |
689 | //$houses = $houses->orderBy('id')->get(); | 708 | //$houses = $houses->orderBy('id')->get(); |
690 | $input = $request->all(); | 709 | $input = $request->all(); |
691 | 710 | ||
692 | $houses = House::with('areas'); | 711 | $houses = House::with('areas'); |
693 | if (empty($input)) { | 712 | if (empty($input)) { |
694 | 713 | ||
695 | } else { | 714 | } else { |
696 | 715 | ||
697 | // условия поиска по объектам комплексов | 716 | // условия поиска по объектам комплексов |
698 | if (!empty($request->area)) { | 717 | if (!empty($request->area)) { |
699 | $houses = $houses->where('area_id', '=', $request->area); | 718 | $houses = $houses->where('area_id', '=', $request->area); |
700 | } | 719 | } |
701 | // условия поиска по типу недвижимости | 720 | // условия поиска по типу недвижимости |
702 | if (!empty($request->type_area)) { | 721 | if (!empty($request->type_area)) { |
703 | $houses = $houses->where('type_area_id', '=', $request->type_area); | 722 | $houses = $houses->where('type_area_id', '=', $request->type_area); |
704 | } | 723 | } |
705 | // условия поиска по формату недвижимости | 724 | // условия поиска по формату недвижимости |
706 | if (!empty($request->format_area)) { | 725 | if (!empty($request->format_area)) { |
707 | $houses = $houses->where('format_area_id', '=', $request->format_area); | 726 | $houses = $houses->where('format_area_id', '=', $request->format_area); |
708 | } | 727 | } |
709 | // условия поиска по площади - минимальная площадь | 728 | // условия поиска по площади - минимальная площадь |
710 | if (!empty($request->area_m2_min)) { | 729 | if (!empty($request->area_m2_min)) { |
711 | $houses = $houses->where('area', '>', $request->area_m2_min); | 730 | $houses = $houses->where('area', '>', $request->area_m2_min); |
712 | } | 731 | } |
713 | // условия поиска по площади - максимальная площадь | 732 | // условия поиска по площади - максимальная площадь |
714 | if (!empty($request->area_m2_max)) { | 733 | if (!empty($request->area_m2_max)) { |
715 | $houses = $houses->where('area', '<', $request->area_m2_max); | 734 | $houses = $houses->where('area', '<', $request->area_m2_max); |
716 | } | 735 | } |
717 | // условия поиска по цене - минимальная цена | 736 | // условия поиска по цене - минимальная цена |
718 | if (!empty($request->price_min)) { | 737 | if (!empty($request->price_min)) { |
719 | $houses = $houses->where('price', '>', $request->price_min); | 738 | $houses = $houses->where('price', '>', $request->price_min); |
720 | } | 739 | } |
721 | // условия поиска по цене - максимальная цена | 740 | // условия поиска по цене - максимальная цена |
722 | if (!empty($request->price_max)) { | 741 | if (!empty($request->price_max)) { |
723 | $houses = $houses->where('price', '<', $request->price_max); | 742 | $houses = $houses->where('price', '<', $request->price_max); |
724 | } | 743 | } |
725 | // условия поиска по адресу | 744 | // условия поиска по адресу |
726 | if (!empty($request->address)) { | 745 | if (!empty($request->address)) { |
727 | $houses = $houses->where('address', 'LIKE', "%".$request->address."%"); | 746 | $houses = $houses->where('address', 'LIKE', "%".$request->address."%"); |
728 | } | 747 | } |
729 | } | 748 | } |
730 | 749 | ||
731 | $houses = $houses->orderByDesc('id')->get(); | 750 | $houses = $houses->orderByDesc('id')->get(); |
732 | 751 | ||
733 | $areas = Area::query()->orderBy('id')->get(); | 752 | $areas = Area::query()->orderBy('id')->get(); |
734 | 753 | ||
735 | return view('mapsobj', compact('areas', 'input', 'houses')); | 754 | return view('mapsobj', compact('areas', 'input', 'houses')); |
736 | } | 755 | } |
737 | 756 | ||
738 | /* | 757 | /* |
739 | * Посмотр конктретного предложение офиса | 758 | * Посмотр конктретного предложение офиса |
740 | */ | 759 | */ |
741 | public function Offer(House $house, Request $request) { | 760 | public function Offer(House $house, Request $request) { |
742 | $houses = House::with('areas'); | 761 | $houses = House::with('areas'); |
743 | $houses = $houses->where('type_area_id', '=', $house->typearea->id); | 762 | $houses = $houses->where('type_area_id', '=', $house->typearea->id); |
744 | $houses = $houses->where('format_house', '=', $house->format_house); | 763 | $houses = $houses->where('format_house', '=', $house->format_house); |
745 | $houses = $houses->orderByDesc('created_at')->limit(8)->get(); | 764 | $houses = $houses->orderByDesc('created_at')->limit(8)->get(); |
746 | 765 | ||
747 | //получение адреса страницы | 766 | //получение адреса страницы |
748 | $url = $request->url(); | 767 | $url = $request->url(); |
749 | // получение ip-адреса клиента | 768 | // получение ip-адреса клиента |
750 | $ip = RusDate::ip_addr_client(); | 769 | $ip = RusDate::ip_addr_client(); |
751 | 770 | ||
752 | //получение выборки данных из базы данных по данной странице | 771 | //получение выборки данных из базы данных по данной странице |
753 | $page_ = Page::query()->where('url', '=', "$url")-> | 772 | $page_ = Page::query()->where('url', '=', "$url")-> |
754 | orderBy('created_at')->limit(1)->get(); | 773 | orderBy('created_at')->limit(1)->get(); |
755 | 774 | ||
756 | //если интервал времени больше суток, то обнуляем счетчик | 775 | //если интервал времени больше суток, то обнуляем счетчик |
757 | if ($page_->count()) { | 776 | if ($page_->count()) { |
758 | $result = RusDate::interval_day($page_[0]->created_at); | 777 | $result = RusDate::interval_day($page_[0]->created_at); |
759 | if ($result) { | 778 | if ($result) { |
760 | DB::table('pages')->where('url', '=', "$url")->delete(); | 779 | DB::table('pages')->where('url', '=', "$url")->delete(); |
761 | } | 780 | } |
762 | } | 781 | } |
763 | // проверяем если в базе данных данный ip-адрес | 782 | // проверяем если в базе данных данный ip-адрес |
764 | $count_user = DB::table('pages')->where('ipaddress', '=', "$ip")-> | 783 | $count_user = DB::table('pages')->where('ipaddress', '=', "$ip")-> |
765 | where('url', '=', "$url")->get(); | 784 | where('url', '=', "$url")->get(); |
766 | // если есть, то обновляем дату просмотра | 785 | // если есть, то обновляем дату просмотра |
767 | if ($count_user->count() > 0) { | 786 | if ($count_user->count() > 0) { |
768 | DB::table('pages')->where('ipaddress', '=', "$ip")-> | 787 | DB::table('pages')->where('ipaddress', '=', "$ip")-> |
769 | where('url', '=', "$url")->update(['created_at' => date('Y-m-d H:i')]); | 788 | where('url', '=', "$url")->update(['created_at' => date('Y-m-d H:i')]); |
770 | } else { | 789 | } else { |
771 | // в противном случае добавляем новый ip В бд | 790 | // в противном случае добавляем новый ip В бд |
772 | $page = new Page(); | 791 | $page = new Page(); |
773 | $page->ipaddress = $ip; | 792 | $page->ipaddress = $ip; |
774 | $page->url = $url; | 793 | $page->url = $url; |
775 | $page->save(); | 794 | $page->save(); |
776 | } | 795 | } |
777 | 796 | ||
778 | // выводим количество пользователей гостей данной страницы | 797 | // выводим количество пользователей гостей данной страницы |
779 | $count_user = DB::table('pages')->where('url', '=', "$url")->get(); | 798 | $count_user = DB::table('pages')->where('url', '=', "$url")->get(); |
780 | return view('house.post', compact('house', 'houses', 'count_user')); | 799 | return view('house.post', compact('house', 'houses', 'count_user')); |
781 | } | 800 | } |
782 | 801 | ||
783 | /* | 802 | /* |
784 | * Просмотр детально конкретной новости | 803 | * Просмотр детально конкретной новости |
785 | */ | 804 | */ |
786 | public function DetailNew(News $news) { | 805 | public function DetailNew(News $news) { |
787 | $news_list = News::query()->orderByDesc('created_at')->limit(8)->get(); | 806 | $news_list = News::query()->orderByDesc('created_at')->limit(8)->get(); |
788 | return view('new.post', compact('news', 'news_list')); | 807 | return view('new.post', compact('news', 'news_list')); |
789 | } | 808 | } |
790 | } | 809 | } |
791 | 810 |
app/Providers/ComposerServiceProvider.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Providers; | 3 | namespace App\Providers; |
4 | 4 | ||
5 | use App\Models\Area; | 5 | use App\Models\Area; |
6 | use App\Models\Contact; | 6 | use App\Models\Contact; |
7 | use App\Models\format_area; | 7 | use App\Models\format_area; |
8 | use App\Models\Tag; | 8 | use App\Models\Tag; |
9 | use App\Models\type_area; | 9 | use App\Models\type_area; |
10 | use Illuminate\Support\ServiceProvider; | 10 | use Illuminate\Support\ServiceProvider; |
11 | use Illuminate\Support\Facades\View; | 11 | use Illuminate\Support\Facades\View; |
12 | 12 | ||
13 | class ComposerServiceProvider extends ServiceProvider | 13 | class ComposerServiceProvider extends ServiceProvider |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | * Register services. | 16 | * Register services. |
17 | * | 17 | * |
18 | * @return void | 18 | * @return void |
19 | */ | 19 | */ |
20 | public function register() | 20 | public function register() |
21 | { | 21 | { |
22 | $views = ['part.filter.main','part.filter.catalog', 'part.filter.category', 'part.filter.mapsobj']; | 22 | $views = ['part.filter.main','part.filter.catalog', 'part.filter.category', 'part.filter.mapsobj']; |
23 | 23 | ||
24 | View::composer($views, | 24 | View::composer($views, |
25 | function($view) { | 25 | function($view) { |
26 | $items_type_area = type_area::all(); | 26 | $items_type_area = type_area::all(); |
27 | $items_format_area = format_area::all(); | 27 | $items_format_area = format_area::all(); |
28 | $items_area = Area::all(); | 28 | $items_area = Area::all(); |
29 | $view->with([ | 29 | $view->with([ |
30 | 'items_area' => $items_area, | 30 | 'items_area' => $items_area, |
31 | 'items_type_area' => $items_type_area, | 31 | 'items_type_area' => $items_type_area, |
32 | 'items_format_area' => $items_format_area, | 32 | 'items_format_area' => $items_format_area, |
33 | ]); | 33 | ]); |
34 | } | 34 | } |
35 | ); | 35 | ); |
36 | 36 | ||
37 | $views = ['layout.site', 'index', 'about', 'house.post', 'catalog', 'category_catalog']; | 37 | $views = ['layout.site', 'index', 'about', 'house.post', 'catalog', 'category_catalog', |
38 | 'catalogs.elemhouse', 'catalogs.house_mini']; | ||
38 | View::composer($views, function($view) { | 39 | View::composer($views, function($view) { |
39 | $view->with(['items_contact' => Contact::limit(1)->get()]); | 40 | $view->with(['items_contact' => Contact::limit(1)->get()]); |
40 | }); | 41 | }); |
41 | 42 | ||
42 | 43 | ||
43 | } | 44 | } |
44 | 45 | ||
45 | /** | 46 | /** |
46 | * Bootstrap services. | 47 | * Bootstrap services. |
47 | * | 48 | * |
48 | * @return void | 49 | * @return void |
49 | */ | 50 | */ |
50 | public function boot() | 51 | public function boot() |
51 | { | 52 | { |
52 | // | 53 | // |
53 | } | 54 | } |
54 | } | 55 | } |
55 | 56 |
resources/views/catalog.blade.php
1 | @extends('layout.site', ['title' => 'Каталог RentTorg']) | 1 | @extends('layout.site', ['title' => 'Каталог RentTorg']) |
2 | 2 | ||
3 | @section('filter') | 3 | @section('filter') |
4 | @include('part.filter.catalog') | 4 | @include('part.filter.catalog') |
5 | @endsection | 5 | @endsection |
6 | 6 | ||
7 | @section('custom_js') | 7 | @section('custom_js') |
8 | @include('js.filter_value') | 8 | @include('js.filter_value') |
9 | <script> | 9 | <script> |
10 | $(document).on('click', '.js_sort_group_item', function() { | 10 | $(document).on('click', '.js_sort_group_item', function() { |
11 | var val = $(this).data('val'); | 11 | var val = $(this).data('val'); |
12 | var sort_price_val = ''; | 12 | var sort_price_val = ''; |
13 | var sort_area_val = ''; | 13 | var sort_area_val = ''; |
14 | var sort_new_val = ''; | 14 | var sort_new_val = ''; |
15 | 15 | ||
16 | $('.sort-price').each(function() { | 16 | $('.sort-price').each(function() { |
17 | var this_ = $(this); | 17 | var this_ = $(this); |
18 | var v = $(this).data('val'); | 18 | var v = $(this).data('val'); |
19 | if (this_.hasClass('active')) | 19 | if (this_.hasClass('active')) |
20 | sort_price_val = v; | 20 | sort_price_val = v; |
21 | }); | 21 | }); |
22 | 22 | ||
23 | $('.sort-new').each(function() { | 23 | $('.sort-new').each(function() { |
24 | var v = $(this).data('val'); | 24 | var v = $(this).data('val'); |
25 | var this_ = $(this); | 25 | var this_ = $(this); |
26 | if (this_.hasClass('active')) | 26 | if (this_.hasClass('active')) |
27 | sort_new_val = v; | 27 | sort_new_val = v; |
28 | }); | 28 | }); |
29 | 29 | ||
30 | $('.sort-area').each(function() { | 30 | $('.sort-area').each(function() { |
31 | var v = $(this).data('val'); | 31 | var v = $(this).data('val'); |
32 | var this_ = $(this); | 32 | var this_ = $(this); |
33 | if (this_.hasClass('active')) | 33 | if (this_.hasClass('active')) |
34 | sort_area_val = v; | 34 | sort_area_val = v; |
35 | 35 | ||
36 | }); | 36 | }); |
37 | 37 | ||
38 | console.log('-------------------'); | 38 | console.log('-----Загрузка ajax аренда---------'); |
39 | $.ajax({ | 39 | $.ajax({ |
40 | type: "GET", | 40 | type: "GET", |
41 | url: "{{ route('catalog') }}", | 41 | url: "{{ route('catalog') }}", |
42 | data: "view=arenda&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ | 42 | data: "view=arenda&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ |
43 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ | 43 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ |
44 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ | 44 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ |
45 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", | 45 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", |
46 | success: function(data) { | 46 | success: function(data) { |
47 | console.log('Успешно обновлены данные АРЕНДА таблиц '); | 47 | console.log('Успешно обновлены данные АРЕНДА таблиц '); |
48 | $('#arenda_block').html(data); | 48 | $('#arenda_block').html(data); |
49 | }, | 49 | }, |
50 | headers: { | 50 | headers: { |
51 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 51 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
52 | }, | 52 | }, |
53 | error: function(data) { | 53 | error: function(data) { |
54 | console.log('Error: '+ data); | 54 | console.log('Error: '+ data); |
55 | } | 55 | } |
56 | }); | 56 | }); |
57 | 57 | ||
58 | console.log('---ajax продажи---'); | ||
58 | $.ajax({ | 59 | $.ajax({ |
59 | type: "GET", | 60 | type: "GET", |
60 | url: "{{ route('catalog') }}", | 61 | url: "{{ route('catalog') }}", |
61 | data: "view=prodaja&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ | 62 | data: "view=prodaja&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ |
62 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ | 63 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ |
63 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ | 64 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ |
64 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", | 65 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", |
65 | success: function(data) { | 66 | success: function(data) { |
66 | console.log('Успешно обновлены данные ПРОДАЖА таблиц '); | 67 | console.log('Успешно обновлены данные ПРОДАЖА таблиц '); |
67 | $('#prodaja_block').html(data); | 68 | $('#prodaja_block').html(data); |
68 | }, | 69 | }, |
69 | headers: { | 70 | headers: { |
70 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 71 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
71 | }, | 72 | }, |
72 | error: function(data) { | 73 | error: function(data) { |
73 | console.log('Error: '+ data); | 74 | console.log('Error: '+ data); |
74 | } | 75 | } |
75 | }); | 76 | }); |
76 | 77 | ||
78 | console.log('---ajax бизнес---'); | ||
77 | $.ajax({ | 79 | $.ajax({ |
78 | type: "GET", | 80 | type: "GET", |
79 | url: "{{ route('catalog') }}", | 81 | url: "{{ route('catalog') }}", |
80 | data: "view=bissnes&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ | 82 | data: "view=bissnes&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ |
81 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ | 83 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ |
82 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ | 84 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ |
83 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", | 85 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", |
84 | success: function(data) { | 86 | success: function(data) { |
85 | console.log('Успешно обновлены данные БИЗНЕС таблиц '); | 87 | console.log('Успешно обновлены данные БИЗНЕС таблиц '); |
86 | $('#bissnes_block').html(data); | 88 | $('#bissnes_block').html(data); |
87 | }, | 89 | }, |
88 | headers: { | 90 | headers: { |
89 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 91 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
90 | }, | 92 | }, |
91 | error: function(data) { | 93 | error: function(data) { |
92 | console.log('Error: '+ data); | 94 | console.log('Error: '+ data); |
93 | } | 95 | } |
94 | }); | 96 | }); |
95 | 97 | ||
98 | console.log('---ajax арендованные---'); | ||
96 | $.ajax({ | 99 | $.ajax({ |
97 | type: "GET", | 100 | type: "GET", |
98 | url: "{{ route('catalog') }}", | 101 | url: "{{ route('catalog') }}", |
99 | data: "view=arendovannie&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ | 102 | data: "view=arendovannie&sort_price="+sort_price_val+"&sort_new="+sort_new_val+"&sort_area="+sort_area_val+""+ |
100 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ | 103 | "&area=<?if (isset($_GET['area'])) echo $_GET['area'];?>&type_area=<?if (isset($_GET['type_area'])) echo $_GET['type_area'];?>&format_area=<? if (isset($_GET['format_area'])) echo $_GET['format_area'];?>"+ |
101 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ | 104 | "&area_m2_min=<? if (isset($_GET['area_m2_min'])) echo $_GET['area_m2_min'];?>&area_m2_max=<? if (isset($_GET['area_m2_max'])) echo $_GET['area_m2_max'];?>"+ |
102 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", | 105 | "&price_min=<? if (isset($_GET['price_min'])) echo $_GET['price_min'];?>&price_max=<? if (isset($_GET['price_max'])) echo $_GET['price_max'];?>&address=<? if (isset($_GET['address'])) echo $_GET['address'];?>", |
103 | success: function(data) { | 106 | success: function(data) { |
104 | console.log('Успешно обновлены данные таблиц '); | 107 | console.log('Успешно обновлены данные таблиц АРЕНДОВАННЫЕ '); |
105 | $('#arendovannie_block').html(data); | 108 | $('#arendovannie_block').html(data); |
106 | //.append(data); | 109 | //.append(data); |
107 | }, | 110 | }, |
108 | headers: { | 111 | headers: { |
109 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 112 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
110 | }, | 113 | }, |
111 | error: function(data) { | 114 | error: function(data) { |
112 | console.log('Error: '+ data); | 115 | console.log('Error: '+ data); |
113 | } | 116 | } |
114 | }); | 117 | }); |
115 | 118 | ||
116 | } | 119 | } |
117 | ); | 120 | ); |
118 | </script> | 121 | </script> |
119 | @endsection | 122 | @endsection |
120 | 123 | ||
121 | @section('content') | 124 | @section('content') |
122 | <section class="catalog"> | 125 | <section class="catalog"> |
123 | <div class="container"> | 126 | <div class="container"> |
124 | <div class="catalog__top top-catalog"> | 127 | <div class="catalog__top top-catalog"> |
125 | <div class="top-catalog__inner"> | 128 | <div class="top-catalog__inner"> |
126 | <h2 class="top-catalog__title title">Каталог коммерческой недвижимости</h2> | 129 | <h2 class="top-catalog__title title">Каталог коммерческой недвижимости</h2> |
127 | <div class="top-catalog__result">Найдено объектов по Вашему запросу: <span><?=$house_arenda->count()+$house_prodaja->count()+$house_bissnes->count()+$house_arendovannie->count(); ?></span></div> | 130 | <div class="top-catalog__result">Найдено объектов по Вашему запросу: <span><?=$house_arenda->count()+$house_prodaja->count()+$house_bissnes->count()+$house_arendovannie->count(); ?></span></div> |
128 | </div> | 131 | </div> |
129 | <form class="top-catalog__sorts"> | 132 | <form class="top-catalog__sorts"> |
130 | <div class="top-catalog__sort-group sort-group js_sort_group"> | 133 | <div class="top-catalog__sort-group sort-group js_sort_group"> |
131 | <input class="js_sort_group_input" type="hidden"> | 134 | <input class="js_sort_group_input" type="hidden"> |
132 | <div class="sort-group__current js_sort_group_current">Сначала дешевле</div> | 135 | <div class="sort-group__current js_sort_group_current">Сначала дешевле</div> |
133 | <ul class="sort-group__list js_sort_group_list"> | 136 | <ul class="sort-group__list js_sort_group_list"> |
134 | <li class="sort-price sort-group__item js_sort_group_item active" data-val="1">Сначала дешевле</li> | 137 | <li class="sort-price sort-group__item js_sort_group_item active" data-val="1">Сначала дешевле</li> |
135 | <li class="sort-price sort-group__item js_sort_group_item" data-val="2">Сначала дороже</li> | 138 | <li class="sort-price sort-group__item js_sort_group_item" data-val="2">Сначала дороже</li> |
136 | </ul> | 139 | </ul> |
137 | </div> | 140 | </div> |
138 | <div class="top-catalog__sort-group sort-group js_sort_group"> | 141 | <div class="top-catalog__sort-group sort-group js_sort_group"> |
139 | <input class="js_sort_group_input" type="hidden"> | 142 | <input class="js_sort_group_input" type="hidden"> |
140 | <div class="sort-group__current js_sort_group_current">Сначала новые</div> | 143 | <div class="sort-group__current js_sort_group_current">Сначала новые</div> |
141 | <ul class="sort-group__list js_sort_group_list"> | 144 | <ul class="sort-group__list js_sort_group_list"> |
142 | <li class="sort-new sort-group__item js_sort_group_item active" data-val="1">Сначала новые</li> | 145 | <li class="sort-new sort-group__item js_sort_group_item active" data-val="1">Сначала новые</li> |
143 | <li class="sort-new sort-group__item js_sort_group_item" data-val="2">Сначала старые</li> | 146 | <li class="sort-new sort-group__item js_sort_group_item" data-val="2">Сначала старые</li> |
144 | </ul> | 147 | </ul> |
145 | </div> | 148 | </div> |
146 | <div class="top-catalog__sort-group sort-group sort-group--wide js_sort_group"> | 149 | <div class="top-catalog__sort-group sort-group sort-group--wide js_sort_group"> |
147 | <input class="js_sort_group_input" type="hidden"> | 150 | <input class="js_sort_group_input" type="hidden"> |
148 | <div class="sort-group__current js_sort_group_current">Сначала с большей площадью</div> | 151 | <div class="sort-group__current js_sort_group_current">Сначала с большей площадью</div> |
149 | <ul class="sort-group__list js_sort_group_list"> | 152 | <ul class="sort-group__list js_sort_group_list"> |
150 | <li class="sort-area sort-group__item js_sort_group_item active" data-val="1">Сначала с большей площадью</li> | 153 | <li class="sort-area sort-group__item js_sort_group_item active" data-val="1">Сначала с большей площадью</li> |
151 | <li class="sort-area sort-group__item js_sort_group_item" data-val="2">Сначала с меньшей площадью</li> | 154 | <li class="sort-area sort-group__item js_sort_group_item" data-val="2">Сначала с меньшей площадью</li> |
152 | </ul> | 155 | </ul> |
153 | </div> | 156 | </div> |
154 | </form> | 157 | </form> |
155 | </div> | 158 | </div> |
156 | </div> | 159 | </div> |
157 | <div class="complex__sliders"> | 160 | <div class="complex__sliders"> |
158 | <section class="slider"> | 161 | <section class="slider"> |
159 | <div class="container"> | 162 | <div class="container"> |
160 | <div class="slider__wrap"> | 163 | <div class="slider__wrap"> |
161 | <div class="slider__top"> | 164 | <div class="slider__top"> |
162 | <h2 class="slider__title title">Аренда торговых помещений</h2><a class="slider__more" href="#">Показать все объекты</a> | 165 | <h2 class="slider__title title">Аренда торговых помещений</h2><a class="slider__more" href="#">Показать все объекты</a> |
163 | <div class="slider__control"> | 166 | <div class="slider__control"> |
164 | <div class="swiper-button-prev"> | 167 | <div class="swiper-button-prev"> |
165 | <svg width="10" height="17"> | 168 | <svg width="10" height="17"> |
166 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 169 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
167 | </svg> | 170 | </svg> |
168 | </div> | 171 | </div> |
169 | <div class="swiper-button-next"> | 172 | <div class="swiper-button-next"> |
170 | <svg width="10" height="17"> | 173 | <svg width="10" height="17"> |
171 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 174 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
172 | </svg> | 175 | </svg> |
173 | </div> | 176 | </div> |
174 | </div> | 177 | </div> |
175 | </div> | 178 | </div> |
176 | <div class="slider__swiper swiper"> | 179 | <div class="slider__swiper swiper"> |
177 | <div class="swiper-wrapper" id="arenda_block"> | 180 | <div class="swiper-wrapper" id="arenda_block"> |
178 | @if ($house_arenda->count()) | 181 | @if ($house_arenda->count()) |
179 | @foreach ($house_arenda as $house1) | 182 | @foreach ($house_arenda as $house1) |
180 | @include('catalogs.elemhouse', ['house' => $house1]) | 183 | @include('catalogs.elemhouse', ['house' => $house1]) |
181 | @endforeach | 184 | @endforeach |
182 | @else | 185 | @else |
183 | <h3>Здесь пока что нет предложений</h3> | 186 | <h3>Здесь пока что нет предложений</h3> |
184 | @endif | 187 | @endif |
185 | 188 | ||
186 | </div> | 189 | </div> |
187 | </div> | 190 | </div> |
188 | <div class="swiper-pagination"></div> | 191 | <div class="swiper-pagination"></div> |
189 | </div> | 192 | </div> |
190 | </div> | 193 | </div> |
191 | </section> | 194 | </section> |
192 | <section class="slider"> | 195 | <section class="slider"> |
193 | <div class="container"> | 196 | <div class="container"> |
194 | <div class="slider__wrap"> | 197 | <div class="slider__wrap"> |
195 | <div class="slider__top"> | 198 | <div class="slider__top"> |
196 | <h2 class="slider__title title">Продажа торговых помещений</h2><a class="slider__more" href="#">Показать все объекты</a> | 199 | <h2 class="slider__title title">Продажа торговых помещений</h2><a class="slider__more" href="#">Показать все объекты</a> |
197 | <div class="slider__control"> | 200 | <div class="slider__control"> |
198 | <div class="swiper-button-prev"> | 201 | <div class="swiper-button-prev"> |
199 | <svg width="10" height="17"> | 202 | <svg width="10" height="17"> |
200 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 203 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
201 | </svg> | 204 | </svg> |
202 | </div> | 205 | </div> |
203 | <div class="swiper-button-next"> | 206 | <div class="swiper-button-next"> |
204 | <svg width="10" height="17"> | 207 | <svg width="10" height="17"> |
205 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 208 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
206 | </svg> | 209 | </svg> |
207 | </div> | 210 | </div> |
208 | </div> | 211 | </div> |
209 | </div> | 212 | </div> |
210 | <div class="slider__swiper swiper"> | 213 | <div class="slider__swiper swiper"> |
211 | <div class="swiper-wrapper" id="prodaja_block"> | 214 | <div class="swiper-wrapper" id="prodaja_block"> |
212 | @if ($house_prodaja->count()) | 215 | @if ($house_prodaja->count()) |
213 | @foreach ($house_prodaja as $house2) | 216 | @foreach ($house_prodaja as $house2) |
214 | @include('catalogs.elemhouse', ['house' => $house2]) | 217 | @include('catalogs.elemhouse', ['house' => $house2]) |
215 | @endforeach | 218 | @endforeach |
216 | @else | 219 | @else |
217 | <h3>Здесь пока что нет предложений</h3> | 220 | <h3>Здесь пока что нет предложений</h3> |
218 | @endif | 221 | @endif |
219 | </div> | 222 | </div> |
220 | </div> | 223 | </div> |
221 | <div class="swiper-pagination"></div> | 224 | <div class="swiper-pagination"></div> |
222 | </div> | 225 | </div> |
223 | </div> | 226 | </div> |
224 | </section> | 227 | </section> |
225 | <section class="slider"> | 228 | <section class="slider"> |
226 | <div class="container"> | 229 | <div class="container"> |
227 | <div class="slider__wrap"> | 230 | <div class="slider__wrap"> |
228 | <div class="slider__top"> | 231 | <div class="slider__top"> |
229 | <h2 class="slider__title title">Арендный бизнес</h2><a class="slider__more" href="#">Показать все объекты</a> | 232 | <h2 class="slider__title title">Арендный бизнес</h2><a class="slider__more" href="#">Показать все объекты</a> |
230 | <div class="slider__control"> | 233 | <div class="slider__control"> |
231 | <div class="swiper-button-prev"> | 234 | <div class="swiper-button-prev"> |
232 | <svg width="10" height="17"> | 235 | <svg width="10" height="17"> |
233 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 236 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
234 | </svg> | 237 | </svg> |
235 | </div> | 238 | </div> |
236 | <div class="swiper-button-next"> | 239 | <div class="swiper-button-next"> |
237 | <svg width="10" height="17"> | 240 | <svg width="10" height="17"> |
238 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 241 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
239 | </svg> | 242 | </svg> |
240 | </div> | 243 | </div> |
241 | </div> | 244 | </div> |
242 | </div> | 245 | </div> |
243 | <div class="slider__swiper swiper"> | 246 | <div class="slider__swiper swiper"> |
244 | <div class="swiper-wrapper" id="bissnes_block"> | 247 | <div class="swiper-wrapper" id="bissnes_block"> |
245 | @if ($house_bissnes->count()) | 248 | @if ($house_bissnes->count()) |
246 | @foreach ($house_bissnes as $house3) | 249 | @foreach ($house_bissnes as $house3) |
247 | @include('catalogs.elemhouse', ['house' => $house3]) | 250 | @include('catalogs.elemhouse', ['house' => $house3]) |
248 | @endforeach | 251 | @endforeach |
249 | @else | 252 | @else |
250 | <h3>Здесь пока что нет предложений</h3> | 253 | <h3>Здесь пока что нет предложений</h3> |
251 | @endif | 254 | @endif |
252 | </div> | 255 | </div> |
253 | </div> | 256 | </div> |
254 | <div class="swiper-pagination"></div> | 257 | <div class="swiper-pagination"></div> |
255 | </div> | 258 | </div> |
256 | </div> | 259 | </div> |
257 | </section> | 260 | </section> |
258 | <section class="slider"> | 261 | <section class="slider"> |
259 | <div class="container"> | 262 | <div class="container"> |
260 | <div class="slider__wrap"> | 263 | <div class="slider__wrap"> |
261 | <div class="slider__top"> | 264 | <div class="slider__top"> |
262 | <h2 class="slider__title title">Арендованные</h2><a class="slider__more" href="#">Показать все объекты</a> | 265 | <h2 class="slider__title title">Арендованные</h2><a class="slider__more" href="#">Показать все объекты</a> |
263 | <div class="slider__control"> | 266 | <div class="slider__control"> |
264 | <div class="swiper-button-prev"> | 267 | <div class="swiper-button-prev"> |
265 | <svg width="10" height="17"> | 268 | <svg width="10" height="17"> |
266 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 269 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
267 | </svg> | 270 | </svg> |
268 | </div> | 271 | </div> |
269 | <div class="swiper-button-next"> | 272 | <div class="swiper-button-next"> |
270 | <svg width="10" height="17"> | 273 | <svg width="10" height="17"> |
271 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> | 274 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow') }}"></use> |
272 | </svg> | 275 | </svg> |
273 | </div> | 276 | </div> |
274 | </div> | 277 | </div> |
275 | </div> | 278 | </div> |
276 | <div class="slider__swiper swiper"> | 279 | <div class="slider__swiper swiper"> |
277 | <div class="swiper-wrapper" id="arendovannie_block"> | 280 | <div class="swiper-wrapper" id="arendovannie_block"> |
278 | @if ($house_arendovannie->count()) | 281 | @if ($house_arendovannie->count()) |
279 | @foreach ($house_arendovannie as $house1) | 282 | @foreach ($house_arendovannie as $house1) |
280 | @include('catalogs.elemhouse', ['house' => $house1]) | 283 | @include('catalogs.elemhouse', ['house' => $house1]) |
281 | @endforeach | 284 | @endforeach |
282 | @else | 285 | @else |
283 | <h3>Здесь пока что нет предложений</h3> | 286 | <h3>Здесь пока что нет предложений</h3> |
284 | @endif | 287 | @endif |
285 | 288 | ||
286 | </div> | 289 | </div> |
287 | </div> | 290 | </div> |
288 | <div class="swiper-pagination"></div> | 291 | <div class="swiper-pagination"></div> |
289 | </div> | 292 | </div> |
290 | </div> | 293 | </div> |
291 | </section> | 294 | </section> |
292 | </div> | 295 | </div> |
293 | </section> | 296 | </section> |
294 | @endsection | 297 | @endsection |
295 | 298 | ||
296 | @section('form_feedback') | 299 | @section('form_feedback') |
297 | <!-- Форма обратной связи --> | 300 | <!-- Форма обратной связи --> |
298 | @include('form.form_feedback') | 301 | @include('form.form_feedback') |
299 | @endsection | 302 | @endsection |
300 | 303 | ||
301 | 304 |
resources/views/catalogs/elemhouse.blade.php
1 | <div class="swiper-slide"> | 1 | <div class="swiper-slide"> |
2 | <div class="card"> | 2 | <div class="card"> |
3 | <div class="card__top"> | 3 | <div class="card__top"> |
4 | @if (empty($house->foto_main)) | 4 | @if (empty($house->foto_main)) |
5 | 5 | ||
6 | @else | 6 | @else |
7 | <img src="{{ asset(Storage::url($house->foto_main)) }}" alt="{{ $house->title }}" loading="lazy"/> | 7 | <img src="{{ asset(Storage::url($house->foto_main)) }}" alt="{{ $house->title }}" loading="lazy"/> |
8 | @endif; | 8 | @endif; |
9 | 9 | ||
10 | <h3 class="card__title">{{$house->typearea->name_type }}</h3> | 10 | <h3 class="card__title">{{$house->typearea->name_type }}</h3> |
11 | <div class="card__labels"> | 11 | <div class="card__labels"> |
12 | <span class="card__label card__label-favorites js_card_favorites <?=\App\Classes\RusDate::selected_item($house->id);?>" data-val="{{$house->id}}" id="card_favorite{{$house->id}}" name="card_favorite{{$house->id}}"> | 12 | <span class="card__label card__label-favorites js_card_favorites <?=\App\Classes\RusDate::selected_item($house->id);?>" data-val="{{$house->id}}" id="card_favorite{{$house->id}}" name="card_favorite{{$house->id}}"> |
13 | <svg width="18" height="18"> | 13 | <svg width="18" height="18"> |
14 | <use xlink:href="{{ asset('images/sprite.svg#card-favorites-empty') }}"></use> | 14 | <use xlink:href="{{ asset('images/sprite.svg#card-favorites-empty') }}"></use> |
15 | </svg> | 15 | </svg> |
16 | <svg width="18" height="18"> | 16 | <svg width="18" height="18"> |
17 | <use xlink:href="{{ asset('images/sprite.svg#card-favorites') }}"></use> | 17 | <use xlink:href="{{ asset('images/sprite.svg#card-favorites') }}"></use> |
18 | </svg> | 18 | </svg> |
19 | </span> | 19 | </span> |
20 | <a class="card__label card__label-messenger" href="tel:{{ $items_contact[0]->telephone }}"> | 20 | <a class="card__label card__label-messenger" href="tel:<?=$items_contact[0]->telephone;?>"> |
21 | <svg width="25" height="25"> | 21 | <svg width="25" height="25"> |
22 | <use xlink:href="{{ asset('images/sprite.svg#card-messenger') }}"></use> | 22 | <use xlink:href="{{ asset('images/sprite.svg#card-messenger') }}"></use> |
23 | </svg></a></div> | 23 | </svg></a></div> |
24 | </div> | 24 | </div> |
25 | <div class="card__cnt"> | 25 | <div class="card__cnt"> |
26 | <div class="card__info"> | 26 | <div class="card__info"> |
27 | <address class="card__line card__line-complex">{{ $house->areas->name_area }}</address> | 27 | <address class="card__line card__line-complex">{{ $house->areas->name_area }}</address> |
28 | <address class="card__line">{{$house->metro}} ({{$house->description_metro }})<span style="background-color: #FFC955;"></span></address> | 28 | <address class="card__line">{{$house->metro}} ({{$house->description_metro }})<span style="background-color: #FFC955;"></span></address> |
29 | <address class="card__line">{{$house->address }}</address> | 29 | <address class="card__line">{{$house->address }}</address> |
30 | <div class="card__line">Площадь: <b>{{$house->area}} м2</b></div> | 30 | <div class="card__line">Площадь: <b>{{$house->area}} м2</b></div> |
31 | <div class="card__line">Цена за м<sup>2</sup>: <b>{{ $house->price_m2 }}₽</b></div> | 31 | <div class="card__line">Цена за м<sup>2</sup>: <b>{{ $house->price_m2 }}₽</b></div> |
32 | </div> | 32 | </div> |
33 | <? switch ($house->format_house) { | 33 | <? switch ($house->format_house) { |
34 | case 'Аренда': | 34 | case 'Аренда': |
35 | $comment = "<span>в месяц</span>"; | 35 | $comment = "<span>в месяц</span>"; |
36 | break; | 36 | break; |
37 | case 'Продажа': | 37 | case 'Продажа': |
38 | $comment = ""; | 38 | $comment = ""; |
39 | break; | 39 | break; |
40 | case 'Бизнес': | 40 | case 'Бизнес': |
41 | $comment= "<span>в месяц</span>"; | 41 | $comment= "<span>в месяц</span>"; |
42 | break; | 42 | break; |
43 | case 'Арендованные': | 43 | case 'Арендованные': |
44 | $comment = "<span>в месяц</span>"; | 44 | $comment = "<span>в месяц</span>"; |
45 | break; | 45 | break; |
46 | default: | 46 | default: |
47 | $comment = "<span>в месяц</span>"; | 47 | $comment = "<span>в месяц</span>"; |
48 | break; | 48 | break; |
49 | } | 49 | } |
50 | ?> | 50 | ?> |
51 | <div class="card__price"><span>{{ $house->price }} ₽ </span><? echo $comment; ?> | 51 | <div class="card__price"><span>{{ $house->price }} ₽ </span><? echo $comment; ?> |
52 | </div><a class="card__btn btn btn--bordered" href="{{ route('offer', ['house' => $house->id]) }}">Подробнее</a> | 52 | </div><a class="card__btn btn btn--bordered" href="{{ route('offer', ['house' => $house->id]) }}">Подробнее</a> |
53 | </div> | 53 | </div> |
54 | </div> | 54 | </div> |
55 | </div> | 55 | </div> |
56 | 56 |
resources/views/layout/site.blade.php
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | 2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> |
3 | <head> | 3 | <head> |
4 | <meta charset="UTF-8"> | 4 | <meta charset="UTF-8"> |
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
7 | <meta name="csrf-token" content="<?=csrf_token() ?>"> | ||
7 | <title>{{$title}}</title> | 8 | <title>{{$title}}</title> |
8 | <link rel="shortcut icon" href="{{ asset('images/favicon.png')}}" type="image/x-icon"> | 9 | <link rel="shortcut icon" href="{{ asset('images/favicon.png')}}" type="image/x-icon"> |
9 | <link rel="preload" href="{{ asset('fonts/Manrope-ExtraLight.woff2') }}" as="font" type="font/woff2" crossorigin> | 10 | <link rel="preload" href="{{ asset('fonts/Manrope-ExtraLight.woff2') }}" as="font" type="font/woff2" crossorigin> |
10 | <link rel="preload" href="{{ asset('fonts/Manrope-Light.woff2" as="font') }}" type="font/woff2" crossorigin> | 11 | <link rel="preload" href="{{ asset('fonts/Manrope-Light.woff2" as="font') }}" type="font/woff2" crossorigin> |
11 | <link rel="preload" href="{{ asset('fonts/Manrope-Regular.woff2') }}" as="font" type="font/woff2" crossorigin> | 12 | <link rel="preload" href="{{ asset('fonts/Manrope-Regular.woff2') }}" as="font" type="font/woff2" crossorigin> |
12 | <link rel="preload" href="{{ asset('fonts/Manrope-Medium.woff2') }}" as="font" type="font/woff2" crossorigin> | 13 | <link rel="preload" href="{{ asset('fonts/Manrope-Medium.woff2') }}" as="font" type="font/woff2" crossorigin> |
13 | <link rel="preload" href="{{ asset('fonts/Manrope-SemiBold.woff2') }}" as="font" type="font/woff2" crossorigin> | 14 | <link rel="preload" href="{{ asset('fonts/Manrope-SemiBold.woff2') }}" as="font" type="font/woff2" crossorigin> |
14 | <link rel="preload" href="{{ asset('fonts/Manrope-Bold.woff2') }}" as="font" type="font/woff2" crossorigin> | 15 | <link rel="preload" href="{{ asset('fonts/Manrope-Bold.woff2') }}" as="font" type="font/woff2" crossorigin> |
15 | <link rel="preload" href="{{ asset('fonts/Manrope-ExtraBold.woff2') }}" as="font" type="font/woff2" crossorigin> | 16 | <link rel="preload" href="{{ asset('fonts/Manrope-ExtraBold.woff2') }}" as="font" type="font/woff2" crossorigin> |
16 | <link rel="stylesheet" href="{{ asset('css/swiper-bundle.min.css') }}"> | 17 | <link rel="stylesheet" href="{{ asset('css/swiper-bundle.min.css') }}"> |
17 | <link rel="stylesheet" href="{{ asset('css/style.css') }}"> | 18 | <link rel="stylesheet" href="{{ asset('css/style.css') }}"> |
18 | </head> | 19 | </head> |
19 | <body> | 20 | <body> |
20 | <div class="spinner"></div> | 21 | <div class="spinner"></div> |
21 | <div class="wrapper"> | 22 | <div class="wrapper"> |
22 | <header class="header js_header"> | 23 | <header class="header js_header"> |
23 | <div class="container"> | 24 | <div class="container"> |
24 | <div class="header__wrap"><a class="header__logo" href="{{ route('index') }}"><img src="{{ asset('images/logo.svg') }}" alt="Лого"></a> | 25 | <div class="header__wrap"><a class="header__logo" href="{{ route('index') }}"><img src="{{ asset('images/logo.svg') }}" alt="Лого"></a> |
25 | <nav class="header__nav nav"> | 26 | <nav class="header__nav nav"> |
26 | <ul class="nav__list"> | 27 | <ul class="nav__list"> |
27 | <li class="nav__item"><a class="nav__link" href="{{ route('catalog') }}">Каталог</a></li> | 28 | <li class="nav__item"><a class="nav__link" href="{{ route('catalog') }}">Каталог</a></li> |
28 | <li class="nav__item"><a class="nav__link" href="{{ route('about') }}">О компании</a></li> | 29 | <li class="nav__item"><a class="nav__link" href="{{ route('about') }}">О компании</a></li> |
29 | <li class="nav__item"><a class="nav__link" href="{{ route('contact') }}">Контакты</a></li> | 30 | <li class="nav__item"><a class="nav__link" href="{{ route('contact') }}">Контакты</a></li> |
30 | <li class="nav__item"><a class="nav__link nav__link-favorites" href="{{ route('favorite') }}">Избранное<span><?=\App\Classes\RusDate::count_item_fav();?></span></a></li> | 31 | <li class="nav__item"><a class="nav__link nav__link-favorites" href="{{ route('favorite') }}">Избранное<span><?=\App\Classes\RusDate::count_item_fav();?></span></a></li> |
31 | </ul> | 32 | </ul> |
32 | </nav> | 33 | </nav> |
33 | <div class="header__buttons"><a class="header__btn-phone" href="#" data-btn="feedback"> | 34 | <div class="header__buttons"><a class="header__btn-phone" href="#" data-btn="feedback"> |
34 | <svg width="22" height="22"> | 35 | <svg width="22" height="22"> |
35 | <use xlink:href="{{ asset('images/sprite.svg#header-btn-phone') }}"></use> | 36 | <use xlink:href="{{ asset('images/sprite.svg#header-btn-phone') }}"></use> |
36 | </svg></a> | 37 | </svg></a> |
37 | <div class="header__contacts"> | 38 | <div class="header__contacts"> |
38 | <div class="header__col"><a class="header__contact" href="mailto:{{ $items_contact[0]->email }}">{{ $items_contact[0]->email }}</a></div> | 39 | <div class="header__col"><a class="header__contact" href="mailto:{{ $items_contact[0]->email }}">{{ $items_contact[0]->email }}</a></div> |
39 | <div class="header__col"><a class="header__contact" href="tel:{{ $items_contact[0]->telephone }}">{{ $items_contact[0]->telephone }}</a> | 40 | <div class="header__col"><a class="header__contact" href="tel:{{ $items_contact[0]->telephone }}">{{ $items_contact[0]->telephone }}</a> |
40 | <button class="header__btn-callback" type="button" data-btn="feedback">Обратный звонок</button> | 41 | <button class="header__btn-callback" type="button" data-btn="feedback">Обратный звонок</button> |
41 | </div> | 42 | </div> |
42 | </div> | 43 | </div> |
43 | <button class="header__burger js_header_burger" type="button">Меню | 44 | <button class="header__burger js_header_burger" type="button">Меню |
44 | <svg width="28" height="18"> | 45 | <svg width="28" height="18"> |
45 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> | 46 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> |
46 | </svg> | 47 | </svg> |
47 | </button> | 48 | </button> |
48 | </div> | 49 | </div> |
49 | <div class="menu js_menu"> | 50 | <div class="menu js_menu"> |
50 | <div class="menu__wrap"> | 51 | <div class="menu__wrap"> |
51 | <button class="menu__close js_menu_close" type="button">Меню | 52 | <button class="menu__close js_menu_close" type="button">Меню |
52 | <svg width="20" height="20"> | 53 | <svg width="20" height="20"> |
53 | <use xlink:href="{{ asset('images/sprite.svg#popup-close') }}"></use> | 54 | <use xlink:href="{{ asset('images/sprite.svg#popup-close') }}"></use> |
54 | </svg> | 55 | </svg> |
55 | </button> | 56 | </button> |
56 | <div class="menu__inner"> | 57 | <div class="menu__inner"> |
57 | <nav class="menu__nav"> | 58 | <nav class="menu__nav"> |
58 | <ul class="menu__list"> | 59 | <ul class="menu__list"> |
59 | <li class="menu__item"><a class="menu__link" href="{{ route('about') }}">О компании</a></li> | 60 | <li class="menu__item"><a class="menu__link" href="{{ route('about') }}">О компании</a></li> |
60 | <li class="menu__item"><a class="menu__link menu__link-favorites" href="{{ route('favorite') }}">Избранное<span>5</span></a></li> | 61 | <li class="menu__item"><a class="menu__link menu__link-favorites" href="{{ route('favorite') }}">Избранное<span>5</span></a></li> |
61 | <li class="menu__item"><a class="menu__link" href="{{ route('catalog') }}">Каталог</a></li> | 62 | <li class="menu__item"><a class="menu__link" href="{{ route('catalog') }}">Каталог</a></li> |
62 | <li class="menu__item"><a class="menu__link" href="{{ route('news') }}">Новости</a></li> | 63 | <li class="menu__item"><a class="menu__link" href="{{ route('news') }}">Новости</a></li> |
63 | <li class="menu__item"><a class="menu__link" href="{{ route('contact') }}">Контакты</a></li> | 64 | <li class="menu__item"><a class="menu__link" href="{{ route('contact') }}">Контакты</a></li> |
64 | </ul> | 65 | </ul> |
65 | </nav> | 66 | </nav> |
66 | <div class="menu__contacts"><a class="menu__contact" href="mailto:info@renttorg.ru">E-MAIL<span>info@renttorg.ru</span></a><a class="menu__contact" href="tel:+79290127262">ТЕЛЕФОН<span>+7 (929) 012-72-62</span></a></div> | 67 | <div class="menu__contacts"><a class="menu__contact" href="mailto:info@renttorg.ru">E-MAIL<span>info@renttorg.ru</span></a><a class="menu__contact" href="tel:+79290127262">ТЕЛЕФОН<span>+7 (929) 012-72-62</span></a></div> |
67 | <div class="menu__social social"> | 68 | <div class="menu__social social"> |
68 | <ul class="social__list"> | 69 | <ul class="social__list"> |
69 | <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg') }}" alt=""></a></li> | 70 | <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg') }}" alt=""></a></li> |
70 | <li class="social__item"><a class="social__link" href="#" target="_blank"> | 71 | <li class="social__item"><a class="social__link" href="#" target="_blank"> |
71 | <svg width="40" height="40"> | 72 | <svg width="40" height="40"> |
72 | <use xlink:href="{{ asset('images/sprite.svg#wa')}}"></use> | 73 | <use xlink:href="{{ asset('images/sprite.svg#wa')}}"></use> |
73 | </svg></a></li> | 74 | </svg></a></li> |
74 | </ul> | 75 | </ul> |
75 | </div> | 76 | </div> |
76 | </div> | 77 | </div> |
77 | </div> | 78 | </div> |
78 | </div> | 79 | </div> |
79 | </div> | 80 | </div> |
80 | </div> | 81 | </div> |
81 | </header> | 82 | </header> |
82 | <main> | 83 | <main> |
83 | 84 | ||
84 | 85 | ||
85 | <!-- Фильтр --> | 86 | <!-- Фильтр --> |
86 | @yield('filter') | 87 | @yield('filter') |
87 | 88 | ||
88 | @if ($message = Session::get('success')) | 89 | @if ($message = Session::get('success')) |
89 | <section> | 90 | <section> |
90 | <div class="alert alert-success alert-dismissible mt-0" role="alert"> | 91 | <div class="alert alert-success alert-dismissible mt-0" role="alert"> |
91 | <button type="button" class="close" data-dismiss="alert" aria-label="Закрыть"> | 92 | <button type="button" class="close" data-dismiss="alert" aria-label="Закрыть"> |
92 | <span aria-hidden="true">×</span> | 93 | <span aria-hidden="true">×</span> |
93 | </button> | 94 | </button> |
94 | {{ $message }} | 95 | {{ $message }} |
95 | </div> | 96 | </div> |
96 | </section> | 97 | </section> |
97 | @endif | 98 | @endif |
98 | 99 | ||
99 | @if ($errors->any()) | 100 | @if ($errors->any()) |
100 | <section> | 101 | <section> |
101 | <div class="alert alert-danger alert-dismissible mt-4" role="alert"> | 102 | <div class="alert alert-danger alert-dismissible mt-4" role="alert"> |
102 | <button type="button" class="close" data-dismiss="alert" aria-label="Закрыть"> | 103 | <button type="button" class="close" data-dismiss="alert" aria-label="Закрыть"> |
103 | <span aria-hidden="true">×</span> | 104 | <span aria-hidden="true">×</span> |
104 | </button> | 105 | </button> |
105 | <ul class="mb-0"> | 106 | <ul class="mb-0"> |
106 | @foreach ($errors->all() as $error) | 107 | @foreach ($errors->all() as $error) |
107 | <li>{{ $error }}</li> | 108 | <li>{{ $error }}</li> |
108 | @endforeach | 109 | @endforeach |
109 | </ul> | 110 | </ul> |
110 | </div> | 111 | </div> |
111 | </section> | 112 | </section> |
112 | @endif | 113 | @endif |
113 | <!-- Основной контент --> | 114 | <!-- Основной контент --> |
114 | @yield('content') | 115 | @yield('content') |
115 | 116 | ||
116 | </main> | 117 | </main> |
117 | 118 | ||
118 | <footer class="footer" style="background-image:url({{ asset('images/footer-bg.jpg')}})"> | 119 | <footer class="footer" style="background-image:url({{ asset('images/footer-bg.jpg')}})"> |
119 | <div class="footer__buttons"> | 120 | <div class="footer__buttons"> |
120 | <button class="footer__btn footer__btn-phone js_btn_contact_us" type="button"> | 121 | <button class="footer__btn footer__btn-phone js_btn_contact_us" type="button"> |
121 | <svg width="30" height="32"> | 122 | <svg width="30" height="32"> |
122 | <use xlink:href="{{ asset('images/sprite.svg#footer-btn-phone')}}"></use> | 123 | <use xlink:href="{{ asset('images/sprite.svg#footer-btn-phone')}}"></use> |
123 | </svg> | 124 | </svg> |
124 | </button> | 125 | </button> |
125 | <button class="footer__btn footer__btn-up js_btn_up" type="button"> | 126 | <button class="footer__btn footer__btn-up js_btn_up" type="button"> |
126 | <svg width="19" height="11"> | 127 | <svg width="19" height="11"> |
127 | <use xlink:href="{{ asset('images/sprite.svg#footer-btn-up')}}"></use> | 128 | <use xlink:href="{{ asset('images/sprite.svg#footer-btn-up')}}"></use> |
128 | </svg> | 129 | </svg> |
129 | </button> | 130 | </button> |
130 | </div> | 131 | </div> |
131 | <!-- Форма обратной связи --> | 132 | <!-- Форма обратной связи --> |
132 | @yield('form_feedback') | 133 | @yield('form_feedback') |
133 | 134 | ||
134 | <!-- Сам футер мееню --> | 135 | <!-- Сам футер мееню --> |
135 | <div class="footer-middle"> | 136 | <div class="footer-middle"> |
136 | <div class="container"> | 137 | <div class="container"> |
137 | <div class="footer-middle__wrap"> | 138 | <div class="footer-middle__wrap"> |
138 | <div class="footer__col footer__col-intro"><a class="footer__logo" href="index.html"><img src="{{ asset('images/logo-footer.svg')}}" alt="Лого"></a> | 139 | <div class="footer__col footer__col-intro"><a class="footer__logo" href="index.html"><img src="{{ asset('images/logo-footer.svg')}}" alt="Лого"></a> |
139 | <p class="footer__descr">В группу “Renttorg” входит ряд ведущих российских девелоперских компаний полного цикла, реализующих масштабные объекты недвижимости.</p> | 140 | <p class="footer__descr">В группу “Renttorg” входит ряд ведущих российских девелоперских компаний полного цикла, реализующих масштабные объекты недвижимости.</p> |
140 | <div class="footer-questions"> | 141 | <div class="footer-questions"> |
141 | <h3 class="footer-questions__title">Есть вопросы или предложения?</h3><a class="footer-questions__btn btn btn--main" href="#" data-btn="feedback">Напишите нам</a> | 142 | <h3 class="footer-questions__title">Есть вопросы или предложения?</h3><a class="footer-questions__btn btn btn--main" href="#" data-btn="feedback">Напишите нам</a> |
142 | </div> | 143 | </div> |
143 | </div> | 144 | </div> |
144 | <div class="footer__col footer__col-menu js_footer_col"> | 145 | <div class="footer__col footer__col-menu js_footer_col"> |
145 | <h3 class="footer__caption js_footer_caption">Меню</h3> | 146 | <h3 class="footer__caption js_footer_caption">Меню</h3> |
146 | <div class="footer__block js_footer_block"> | 147 | <div class="footer__block js_footer_block"> |
147 | <ul class="footer__list"> | 148 | <ul class="footer__list"> |
148 | <li class="footer__item"><a class="footer__link" href="{{ route('catalog') }}">Каталог</a></li> | 149 | <li class="footer__item"><a class="footer__link" href="{{ route('catalog') }}">Каталог</a></li> |
149 | <li class="footer__item"><a class="footer__link" href="{{ route('about') }}">О компании</a></li> | 150 | <li class="footer__item"><a class="footer__link" href="{{ route('about') }}">О компании</a></li> |
150 | <li class="footer__item"><a class="footer__link" href="{{ route('contact') }}">Контакты</a></li> | 151 | <li class="footer__item"><a class="footer__link" href="{{ route('contact') }}">Контакты</a></li> |
151 | <li class="footer__item"><a class="footer__link" href="{{ route('favorite') }}">Избранное</a></li> | 152 | <li class="footer__item"><a class="footer__link" href="{{ route('favorite') }}">Избранное</a></li> |
152 | <li class="footer__item"><a class="footer__link" href="{{ route('news') }}">Новости</a></li> | 153 | <li class="footer__item"><a class="footer__link" href="{{ route('news') }}">Новости</a></li> |
153 | </ul> | 154 | </ul> |
154 | 155 | ||
155 | </div><a class="footer__author" href="#" target="_blank"><img src="{{ asset('images/author.png')}}" alt="Лого разработчика"></a> | 156 | </div><a class="footer__author" href="#" target="_blank"><img src="{{ asset('images/author.png')}}" alt="Лого разработчика"></a> |
156 | </div> | 157 | </div> |
157 | <div class="footer__col js_footer_col"> | 158 | <div class="footer__col js_footer_col"> |
158 | <h3 class="footer__caption js_footer_caption">Услуги</h3> | 159 | <h3 class="footer__caption js_footer_caption">Услуги</h3> |
159 | <div class="footer__block js_footer_block"> | 160 | <div class="footer__block js_footer_block"> |
160 | <ul class="footer__list"> | 161 | <ul class="footer__list"> |
161 | <li class="footer__item"><a class="footer__link" href="#">Продажа арендного бизнеса</a></li> | 162 | <li class="footer__item"><a class="footer__link" href="#">Продажа арендного бизнеса</a></li> |
162 | <li class="footer__item"><a class="footer__link" href="#">Арендованные помещения</a></li> | 163 | <li class="footer__item"><a class="footer__link" href="#">Арендованные помещения</a></li> |
163 | <li class="footer__item"><a class="footer__link" href="#">Свободные для аренды</a></li> | 164 | <li class="footer__item"><a class="footer__link" href="#">Свободные для аренды</a></li> |
164 | </ul> | 165 | </ul> |
165 | </div> | 166 | </div> |
166 | </div> | 167 | </div> |
167 | <div class="footer__col js_footer_col"> | 168 | <div class="footer__col js_footer_col"> |
168 | <h3 class="footer__caption js_footer_caption">Страницы</h3> | 169 | <h3 class="footer__caption js_footer_caption">Страницы</h3> |
169 | <div class="footer__block js_footer_block"> | 170 | <div class="footer__block js_footer_block"> |
170 | <ul class="footer__list"> | 171 | <ul class="footer__list"> |
171 | <li class="footer__item"><a class="footer__link" href="{{ route('auth.login') }}">Админка</a></li> | 172 | <li class="footer__item"><a class="footer__link" href="{{ route('auth.login') }}">Админка</a></li> |
172 | <li class="footer__item"><a class="footer__link" href="{{ route('cookies') }}">Cookies</a></li> | 173 | <li class="footer__item"><a class="footer__link" href="{{ route('cookies') }}">Cookies</a></li> |
173 | 174 | ||
174 | <!--<li class="footer__item"><a class="footer__link" href="#">Новая Москва</a></li> | 175 | <!--<li class="footer__item"><a class="footer__link" href="#">Новая Москва</a></li> |
175 | <li class="footer__item"><a class="footer__link" href="#">Подмосковье</a></li> | 176 | <li class="footer__item"><a class="footer__link" href="#">Подмосковье</a></li> |
176 | <li class="footer__item"><a class="footer__link" href="#">Москва</a></li> | 177 | <li class="footer__item"><a class="footer__link" href="#">Москва</a></li> |
177 | <li class="footer__item"><a class="footer__link" href="#">Тип недвижимости</a></li>--> | 178 | <li class="footer__item"><a class="footer__link" href="#">Тип недвижимости</a></li>--> |
178 | </ul> | 179 | </ul> |
179 | </div> | 180 | </div> |
180 | </div> | 181 | </div> |
181 | <div class="footer__col footer__col-contacts"> | 182 | <div class="footer__col footer__col-contacts"> |
182 | <h3 class="footer__caption js_footer_caption">Контакты</h3> | 183 | <h3 class="footer__caption js_footer_caption">Контакты</h3> |
183 | <ul class="footer__list"> | 184 | <ul class="footer__list"> |
184 | <li class="footer__item"><a class="footer__link" href="#mailto:{{ $items_contact[0]->email }}">{{ $items_contact[0]->email }}</a></li> | 185 | <li class="footer__item"><a class="footer__link" href="#mailto:{{ $items_contact[0]->email }}">{{ $items_contact[0]->email }}</a></li> |
185 | <li class="footer__item"><a class="footer__link" href="tel:{{ $items_contact[0]->telephone }}">{{ $items_contact[0]->telephone }}</a></li> | 186 | <li class="footer__item"><a class="footer__link" href="tel:{{ $items_contact[0]->telephone }}">{{ $items_contact[0]->telephone }}</a></li> |
186 | </ul> | 187 | </ul> |
187 | <div class="footer__social social"> | 188 | <div class="footer__social social"> |
188 | <ul class="social__list"> | 189 | <ul class="social__list"> |
189 | <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg')}}" alt=""></a></li> | 190 | <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg')}}" alt=""></a></li> |
190 | <li class="social__item"><a class="social__link" href="#" target="_blank"> | 191 | <li class="social__item"><a class="social__link" href="#" target="_blank"> |
191 | <svg width="40" height="40"> | 192 | <svg width="40" height="40"> |
192 | <use xlink:href="{{ asset('images/sprite.svg#wa') }}"></use> | 193 | <use xlink:href="{{ asset('images/sprite.svg#wa') }}"></use> |
193 | </svg></a></li> | 194 | </svg></a></li> |
194 | </ul> | 195 | </ul> |
195 | </div> | 196 | </div> |
196 | </div> | 197 | </div> |
197 | </div> | 198 | </div> |
198 | </div> | 199 | </div> |
199 | </div> | 200 | </div> |
200 | 201 | ||
201 | <div class="footer-bottom"> | 202 | <div class="footer-bottom"> |
202 | <div class="container"> | 203 | <div class="container"> |
203 | <div class="footer-bottom__wrap"> | 204 | <div class="footer-bottom__wrap"> |
204 | <div class="footer__copy">© 2023 RentTorg</div><a class="footer__plicy" href="{{ route('conf') }}">Политика конфиденциальности</a> | 205 | <div class="footer__copy">© 2023 RentTorg</div><a class="footer__plicy" href="{{ route('conf') }}">Политика конфиденциальности</a> |
205 | </div> | 206 | </div> |
206 | </div> | 207 | </div> |
207 | </div> | 208 | </div> |
208 | </footer> | 209 | </footer> |
209 | </div> | 210 | </div> |
210 | 211 | ||
211 | <!-- Вплывающие окна --> | 212 | <!-- Вплывающие окна --> |
212 | <div class="popup popup-feedback" data-popup="feedback"> | 213 | <div class="popup popup-feedback" data-popup="feedback"> |
213 | <div class="popup__wrap"> | 214 | <div class="popup__wrap"> |
214 | <button class="popup__close js_popup_close" type="button"> | 215 | <button class="popup__close js_popup_close" type="button"> |
215 | <svg width="20" height="20"> | 216 | <svg width="20" height="20"> |
216 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> | 217 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> |
217 | </svg> | 218 | </svg> |
218 | </button> | 219 | </button> |
219 | <form class="popup-feedback__form js_popup_feedback_form" action="{{ route('header_form') }}" method="POST"> | 220 | <form class="popup-feedback__form js_popup_feedback_form" action="{{ route('header_form') }}" method="POST"> |
220 | @csrf | 221 | @csrf |
221 | <div class="popup-feedback__title">Как с вами связаться</div> | 222 | <div class="popup-feedback__title">Как с вами связаться</div> |
222 | <div class="popup-feedback__fields"> | 223 | <div class="popup-feedback__fields"> |
223 | <label class="popup-feedback__field field"> | 224 | <label class="popup-feedback__field field"> |
224 | <input type="text" placeholder="Имя" name="NameUser"> | 225 | <input type="text" placeholder="Имя" name="NameUser"> |
225 | </label> | 226 | </label> |
226 | <label class="popup-feedback__field field"> | 227 | <label class="popup-feedback__field field"> |
227 | <input class="js_input_phone" type="text" placeholder="Телефон" name="TelephoneUser"> | 228 | <input class="js_input_phone" type="text" placeholder="Телефон" name="TelephoneUser"> |
228 | </label> | 229 | </label> |
229 | </div> | 230 | </div> |
230 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> | 231 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> |
231 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="{{ route('conf') }}">Политикой конфиденциальности</a>.</p> | 232 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="{{ route('conf') }}">Политикой конфиденциальности</a>.</p> |
232 | </form> | 233 | </form> |
233 | </div> | 234 | </div> |
234 | </div> | 235 | </div> |
235 | <div class="popup popup-feedback" data-popup="viewing"> | 236 | <div class="popup popup-feedback" data-popup="viewing"> |
236 | <div class="popup__wrap"> | 237 | <div class="popup__wrap"> |
237 | <button class="popup__close js_popup_close" type="button"> | 238 | <button class="popup__close js_popup_close" type="button"> |
238 | <svg width="20" height="20"> | 239 | <svg width="20" height="20"> |
239 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> | 240 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> |
240 | </svg> | 241 | </svg> |
241 | </button> | 242 | </button> |
242 | <form class="popup-feedback__form js_popup_viewing_form" action="{{ route('rec_view_form') }}" method="POST"> | 243 | <form class="popup-feedback__form js_popup_viewing_form" action="{{ route('rec_view_form') }}" method="POST"> |
243 | @csrf | 244 | @csrf |
244 | <div class="popup-feedback__title">Записаться на просмотр</div> | 245 | <div class="popup-feedback__title">Записаться на просмотр</div> |
245 | <div class="popup-feedback__fields"> | 246 | <div class="popup-feedback__fields"> |
246 | <label class="popup-feedback__field field"> | 247 | <label class="popup-feedback__field field"> |
247 | <input type="text" placeholder="Имя" name="NameUser"> | 248 | <input type="text" placeholder="Имя" name="NameUser"> |
248 | </label> | 249 | </label> |
249 | <label class="popup-feedback__field field"> | 250 | <label class="popup-feedback__field field"> |
250 | <input class="js_input_phone" type="text" placeholder="Телефон" name="TelephoneUser"> | 251 | <input class="js_input_phone" type="text" placeholder="Телефон" name="TelephoneUser"> |
251 | </label> | 252 | </label> |
252 | </div> | 253 | </div> |
253 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> | 254 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> |
254 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="#">Политикой конфиденциальности</a>.</p> | 255 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="#">Политикой конфиденциальности</a>.</p> |
255 | </form> | 256 | </form> |
256 | </div> | 257 | </div> |
257 | </div> | 258 | </div> |
258 | <div class="popup popup-success" data-popup="success"> | 259 | <div class="popup popup-success" data-popup="success"> |
259 | <div class="popup__wrap"> | 260 | <div class="popup__wrap"> |
260 | <button class="popup__close js_popup_close" type="button"> | 261 | <button class="popup__close js_popup_close" type="button"> |
261 | <svg width="20" height="20"> | 262 | <svg width="20" height="20"> |
262 | <use xlink:href="{{ asset('images/sprite.svg#popup-close') }}"></use> | 263 | <use xlink:href="{{ asset('images/sprite.svg#popup-close') }}"></use> |
263 | </svg> | 264 | </svg> |
264 | </button> | 265 | </button> |
265 | <div class="popup-success__inner"> | 266 | <div class="popup-success__inner"> |
266 | <div class="popup-success__logo"> | 267 | <div class="popup-success__logo"> |
267 | <svg width="48" height="39"> | 268 | <svg width="48" height="39"> |
268 | <use xlink:href="{{ asset('images/sprite.svg#popup-success-logo')}}"></use> | 269 | <use xlink:href="{{ asset('images/sprite.svg#popup-success-logo')}}"></use> |
269 | </svg> | 270 | </svg> |
270 | </div> | 271 | </div> |
271 | <div class="popup-success__title">Спасибо за заявку</div> | 272 | <div class="popup-success__title">Спасибо за заявку</div> |
272 | <p class="popup-success__descr">В ближайшее время с вами свяжется наш специалист для уточнения деталей вашей задачи.</p> | 273 | <p class="popup-success__descr">В ближайшее время с вами свяжется наш специалист для уточнения деталей вашей задачи.</p> |
273 | </div> | 274 | </div> |
274 | </div> | 275 | </div> |
275 | </div> | 276 | </div> |
276 | <div class="popup popup-feedback" data-popup="sending"> | 277 | <div class="popup popup-feedback" data-popup="sending"> |
277 | <div class="popup__wrap"> | 278 | <div class="popup__wrap"> |
278 | <button class="popup__close js_popup_close" type="button"> | 279 | <button class="popup__close js_popup_close" type="button"> |
279 | <svg width="20" height="20"> | 280 | <svg width="20" height="20"> |
280 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> | 281 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> |
281 | </svg> | 282 | </svg> |
282 | </button> | 283 | </button> |
283 | <form class="popup-feedback__form js_popup_sending_form_" action="{{ route('email_form') }}" method="POST"> | 284 | <form class="popup-feedback__form js_popup_sending_form_" action="{{ route('email_form') }}" method="POST"> |
284 | @csrf | 285 | @csrf |
285 | <div class="popup-feedback__title">Отправить на почту</div> | 286 | <div class="popup-feedback__title">Отправить на почту</div> |
286 | <div class="popup-feedback__fields"> | 287 | <div class="popup-feedback__fields"> |
287 | <label class="popup-feedback__field field"> | 288 | <label class="popup-feedback__field field"> |
288 | <input class="js_input_email" type="text" placeholder="Электронная почта" name="EmailUser"> | 289 | <input class="js_input_email" type="text" placeholder="Электронная почта" name="EmailUser"> |
289 | </label> | 290 | </label> |
290 | </div> | 291 | </div> |
291 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> | 292 | <button class="popup-feedback__btn btn btn--main js_form_btn">Отправить</button> |
292 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="{{ route('conf') }}">Политикой конфиденциальности</a>.</p> | 293 | <p class="popup-feedback__confirm">Нажимая на кнопку «Отправить», Вы даете согласие на обработку персональных данных в соответствии с <a href="{{ route('conf') }}">Политикой конфиденциальности</a>.</p> |
293 | </form> | 294 | </form> |
294 | </div> | 295 | </div> |
295 | </div> | 296 | </div> |
296 | <div class="contact-us js_contact_us"> | 297 | <div class="contact-us js_contact_us"> |
297 | <div class="contact-us__top"> | 298 | <div class="contact-us__top"> |
298 | <button class="contact-us__close js_contact_us_close" type="button"> | 299 | <button class="contact-us__close js_contact_us_close" type="button"> |
299 | <svg width="20" height="20"> | 300 | <svg width="20" height="20"> |
300 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> | 301 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> |
301 | </svg> | 302 | </svg> |
302 | </button> | 303 | </button> |
303 | <div class="contact-us__title">Свяжитесь с нами</div> | 304 | <div class="contact-us__title">Свяжитесь с нами</div> |
304 | </div> | 305 | </div> |
305 | <div class="contact-us__body"> | 306 | <div class="contact-us__body"> |
306 | <div class="contact-us__items"><a class="contact-us-item js_contact_us_close" data-btn="feedback"> | 307 | <div class="contact-us__items"><a class="contact-us-item js_contact_us_close" data-btn="feedback"> |
307 | <div class="contact-us-item__icon"> | 308 | <div class="contact-us-item__icon"> |
308 | <svg width="34" height="34"> | 309 | <svg width="34" height="34"> |
309 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-phone')}}"></use> | 310 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-phone')}}"></use> |
310 | </svg> | 311 | </svg> |
311 | </div> | 312 | </div> |
312 | <div class="contact-us-item__name">Позвонить</div></a> | 313 | <div class="contact-us-item__name">Позвонить</div></a> |
313 | 314 | ||
314 | <a class="contact-us-item js_contact_us_close" data-btn="sending"> | 315 | <a class="contact-us-item js_contact_us_close" data-btn="sending"> |
315 | <div class="contact-us-item__icon"> | 316 | <div class="contact-us-item__icon"> |
316 | <svg width="44" height="44"> | 317 | <svg width="44" height="44"> |
317 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-email')}}"></use> | 318 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-email')}}"></use> |
318 | </svg> | 319 | </svg> |
319 | </div> | 320 | </div> |
320 | <div class="contact-us-item__name">Написать</div></a> | 321 | <div class="contact-us-item__name">Написать</div></a> |
321 | 322 | ||
322 | <a class="contact-us-item js_contact_us_close" > | 323 | <a class="contact-us-item js_contact_us_close" > |
323 | <div class="contact-us-item__icon"> | 324 | <div class="contact-us-item__icon"> |
324 | <svg width="34" height="34"> | 325 | <svg width="34" height="34"> |
325 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-chat')}}"></use> | 326 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-chat')}}"></use> |
326 | </svg> | 327 | </svg> |
327 | </div> | 328 | </div> |
328 | <div class="contact-us-item__name">Онлайн-чат</div></a></div> | 329 | <div class="contact-us-item__name">Онлайн-чат</div></a></div> |
329 | <div class="contact-us__socials"><a class="contact-us-social js_contact_us_close" href="#" target="_blank"> | 330 | <div class="contact-us__socials"><a class="contact-us-social js_contact_us_close" href="#" target="_blank"> |
330 | <div class="contact-us-social__icon contact-us-social__icon-tg"><img src="{{ asset('images/contact-us-tg.svg')}}" alt=""></div> | 331 | <div class="contact-us-social__icon contact-us-social__icon-tg"><img src="{{ asset('images/contact-us-tg.svg')}}" alt=""></div> |
331 | <div class="contact-us-social__name">Telegram</div></a><a class="contact-us-social js_contact_us_close" href="#" target="_blank"> | 332 | <div class="contact-us-social__name">Telegram</div></a><a class="contact-us-social js_contact_us_close" href="#" target="_blank"> |
332 | <div class="contact-us-social__icon contact-us-social__icon-wa"> | 333 | <div class="contact-us-social__icon contact-us-social__icon-wa"> |
333 | <svg width="31" height="31"> | 334 | <svg width="31" height="31"> |
334 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-wa')}}"></use> | 335 | <use xlink:href="{{ asset('images/sprite.svg#contact-us-wa')}}"></use> |
335 | </svg> | 336 | </svg> |
336 | </div> | 337 | </div> |
337 | <div class="contact-us-social__name">WhatsApp</div></a></div> | 338 | <div class="contact-us-social__name">WhatsApp</div></a></div> |
338 | </div> | 339 | </div> |
339 | </div> | 340 | </div> |
340 | 341 | ||
341 | <!-- Всплывашка этажа и объекта | 342 | <!-- Всплывашка этажа и объекта |
342 | <div class="offer-side-popup" data-popup="offer-side-popup"> | 343 | <div class="offer-side-popup" data-popup="offer-side-popup"> |
343 | <div class="offer-side-popup__wrap"> | 344 | <div class="offer-side-popup__wrap"> |
344 | <button class="offer-side-popup__close js_popup_close" type="button"> | 345 | <button class="offer-side-popup__close js_popup_close" type="button"> |
345 | <svg width="20" height="20"> | 346 | <svg width="20" height="20"> |
346 | <use xlink:href="images/sprite.svg#popup-close"></use> | 347 | <use xlink:href="images/sprite.svg#popup-close"></use> |
347 | </svg> | 348 | </svg> |
348 | </button> | 349 | </button> |
349 | <div class="offer-side-popup__cnt"> | 350 | <div class="offer-side-popup__cnt"> |
350 | <div class="offer-side-popup__item js_offer_side_popup_item active" data-item="1"><img src="images/offer-side-item-img-1.jpg" alt="План объекта"></div> | 351 | <div class="offer-side-popup__item js_offer_side_popup_item active" data-item="1"><img src="images/offer-side-item-img-1.jpg" alt="План объекта"></div> |
351 | <div class="offer-side-popup__item js_offer_side_popup_item" data-item="2"><img src="images/offer-side-item-img-2.jpg" alt="План этажа"></div> | 352 | <div class="offer-side-popup__item js_offer_side_popup_item" data-item="2"><img src="images/offer-side-item-img-2.jpg" alt="План этажа"></div> |
352 | </div> | 353 | </div> |
353 | <div class="offer-side-popup__tabs"> | 354 | <div class="offer-side-popup__tabs"> |
354 | <button class="offer-side-popup__tab js_offer_side_popup_tab active" type="button" data-tab="1">План объекта</button> | 355 | <button class="offer-side-popup__tab js_offer_side_popup_tab active" type="button" data-tab="1">План объекта</button> |
355 | <button class="offer-side-popup__tab js_offer_side_popup_tab" type="button" data-tab="2">План этажа</button> | 356 | <button class="offer-side-popup__tab js_offer_side_popup_tab" type="button" data-tab="2">План этажа</button> |
356 | </div> | 357 | </div> |
357 | <button class="offer-side-popup__sizeoff js_popup_close" type="button"> | 358 | <button class="offer-side-popup__sizeoff js_popup_close" type="button"> |
358 | <svg width="18" height="18"> | 359 | <svg width="18" height="18"> |
359 | <use xlink:href="images/sprite.svg#popup-sizeoff"></use> | 360 | <use xlink:href="images/sprite.svg#popup-sizeoff"></use> |
360 | </svg> | 361 | </svg> |
361 | </button> | 362 | </button> |
362 | </div> | 363 | </div> |
363 | </div> | 364 | </div> |
364 | --> | 365 | --> |
365 | 366 | ||
366 | <div class="img-viewer js_img_viewer"> | 367 | <div class="img-viewer js_img_viewer"> |
367 | <div class="img-viewer__wrap"> | 368 | <div class="img-viewer__wrap"> |
368 | <button class="img-viewer__close js_img_viewer_close" type="button"> | 369 | <button class="img-viewer__close js_img_viewer_close" type="button"> |
369 | <svg width="20" height="20"> | 370 | <svg width="20" height="20"> |
370 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> | 371 | <use xlink:href="{{ asset('images/sprite.svg#popup-close')}}"></use> |
371 | </svg> | 372 | </svg> |
372 | </button> | 373 | </button> |
373 | <div class="img-viewer__thumbs js_img_viewer_thumbs"> | 374 | <div class="img-viewer__thumbs js_img_viewer_thumbs"> |
374 | <div class="img-viewer__thumbs-swiper js_img_viewer_thumbs_swiper swiper"> | 375 | <div class="img-viewer__thumbs-swiper js_img_viewer_thumbs_swiper swiper"> |
375 | <div class="swiper-wrapper"></div> | 376 | <div class="swiper-wrapper"></div> |
376 | </div> | 377 | </div> |
377 | </div> | 378 | </div> |
378 | <div class="img-viewer__slider"> | 379 | <div class="img-viewer__slider"> |
379 | <div class="img-viewer__slider-swiper js_img_viewer_slider_swiper swiper"> | 380 | <div class="img-viewer__slider-swiper js_img_viewer_slider_swiper swiper"> |
380 | <div class="swiper-wrapper"></div> | 381 | <div class="swiper-wrapper"></div> |
381 | </div> | 382 | </div> |
382 | <div class="swiper-button-prev"> | 383 | <div class="swiper-button-prev"> |
383 | <svg width="10" height="17"> | 384 | <svg width="10" height="17"> |
384 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> | 385 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> |
385 | </svg> | 386 | </svg> |
386 | </div> | 387 | </div> |
387 | <div class="swiper-button-next"> | 388 | <div class="swiper-button-next"> |
388 | <svg width="10" height="17"> | 389 | <svg width="10" height="17"> |
389 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> | 390 | <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> |
390 | </svg> | 391 | </svg> |
391 | </div> | 392 | </div> |
392 | </div> | 393 | </div> |
393 | <div class="img-viewer__caption js_img_viewer_caption"></div> | 394 | <div class="img-viewer__caption js_img_viewer_caption"></div> |
394 | <button class="img-viewer__sizeoff js_img_viewer_close" type="button"> | 395 | <button class="img-viewer__sizeoff js_img_viewer_close" type="button"> |
395 | <svg width="18" height="18"> | 396 | <svg width="18" height="18"> |
396 | <use xlink:href="{{ asset('images/sprite.svg#popup-sizeoff') }}"></use> | 397 | <use xlink:href="{{ asset('images/sprite.svg#popup-sizeoff') }}"></use> |
397 | </svg> | 398 | </svg> |
398 | </button> | 399 | </button> |
399 | </div> | 400 | </div> |
400 | </div> | 401 | </div> |
401 | <div class="cookies js_cookies"> | 402 | <div class="cookies js_cookies"> |
402 | <div class="container"> | 403 | <div class="container"> |
403 | <div class="cookies__wrap"> | 404 | <div class="cookies__wrap"> |
404 | <div class="cookies__top"> | 405 | <div class="cookies__top"> |
405 | <div class="cookies__img"><img src="{{ asset('images/cookies.svg') }}" alt="cookies"></div> | 406 | <div class="cookies__img"><img src="{{ asset('images/cookies.svg') }}" alt="cookies"></div> |
406 | <div class="cookies__title">Cookies</div> | 407 | <div class="cookies__title">Cookies</div> |
407 | </div> | 408 | </div> |
408 | <p class="cookies__descr">Мы используем cookie-файлы для наилучшего представления нашего сайта.<br>Продолжая использовать сайт, вы даете согласие с использованием cookie-файлов.</p> | 409 | <p class="cookies__descr">Мы используем cookie-файлы для наилучшего представления нашего сайта.<br>Продолжая использовать сайт, вы даете согласие с использованием cookie-файлов.</p> |
409 | <div class="cookies__buttons"> | 410 | <div class="cookies__buttons"> |
410 | <button class="cookies__btn btn btn--main js_cookies_confirm" type="button">Принять</button><a class="cookies__link" href="{{ route('cookies') }}">Подробнее</a> | 411 | <button class="cookies__btn btn btn--main js_cookies_confirm" type="button">Принять</button><a class="cookies__link" href="{{ route('cookies') }}">Подробнее</a> |
411 | </div> | 412 | </div> |
412 | </div> | 413 | </div> |
413 | </div> | 414 | </div> |
414 | </div> | 415 | </div> |
415 | <script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU"></script> | 416 | <script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU"></script> |
416 | <script src="{{ asset('js/swiper-bundle.min.js') }}"></script> | 417 | <script src="{{ asset('js/swiper-bundle.min.js') }}"></script> |
417 | <script src="{{ asset('js/main_main.js') }}"></script> | 418 | <script src="{{ asset('js/main_main.js') }}"></script> |
418 | <script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script> | 419 | <script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script> |
419 | <script type="text/javascript" src="{{ asset('js/jquery.cookie.js') }}"></script> | 420 | <script type="text/javascript" src="{{ asset('js/jquery.cookie.js') }}"></script> |
420 | @yield('custom_js') | 421 | @yield('custom_js') |
421 | @include('js.cookies_favorite') | 422 | @include('js.cookies_favorite') |
422 | </body> | 423 | </body> |
423 | </html> | 424 | </html> |
424 | 425 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use Illuminate\Support\Facades\Auth; | 3 | use Illuminate\Support\Facades\Auth; |
4 | use Illuminate\Support\Facades\Route; | 4 | use Illuminate\Support\Facades\Route; |
5 | use App\Http\Controllers\MainController; | 5 | use App\Http\Controllers\MainController; |
6 | use App\Http\Controllers\RegisterController; | 6 | use App\Http\Controllers\RegisterController; |
7 | use App\Http\Controllers\LoginController; | 7 | use App\Http\Controllers\LoginController; |
8 | use App\Http\Controllers\AdminController; | 8 | use App\Http\Controllers\AdminController; |
9 | use App\Http\Controllers\Admin\AreaController; | 9 | use App\Http\Controllers\Admin\AreaController; |
10 | use App\Http\Controllers\Admin\NewsController; | 10 | use App\Http\Controllers\Admin\NewsController; |
11 | use App\Http\Controllers\Admin\CompanyAreaController; | 11 | use App\Http\Controllers\Admin\CompanyAreaController; |
12 | use App\Http\Controllers\Admin\FormatAreaController; | 12 | use App\Http\Controllers\Admin\FormatAreaController; |
13 | use App\Http\Controllers\Admin\TypeAreaController; | 13 | use App\Http\Controllers\Admin\TypeAreaController; |
14 | use App\Http\Controllers\Admin\HousesController; | 14 | use App\Http\Controllers\Admin\HousesController; |
15 | use App\Http\Controllers\Admin\MessageAreaController; | 15 | use App\Http\Controllers\Admin\MessageAreaController; |
16 | 16 | ||
17 | /* | 17 | /* |
18 | |-------------------------------------------------------------------------- | 18 | |-------------------------------------------------------------------------- |
19 | | Web Routes | 19 | | Web Routes |
20 | |-------------------------------------------------------------------------- | 20 | |-------------------------------------------------------------------------- |
21 | | | 21 | | |
22 | | Here is where you can register web routes for your application. These | 22 | | Here is where you can register web routes for your application. These |
23 | | routes are loaded by the RouteServiceProvider within a group which | 23 | | routes are loaded by the RouteServiceProvider within a group which |
24 | | contains the "web" middleware group. Now create something great! | 24 | | contains the "web" middleware group. Now create something great! |
25 | | | 25 | | |
26 | */ | 26 | */ |
27 | 27 | ||
28 | //Главная страница | 28 | //Главная страница |
29 | Route::get('/',[MainController::class, 'index'])->name('index'); | 29 | Route::get('/',[MainController::class, 'index'])->name('index'); |
30 | 30 | ||
31 | //Страница Избранные | 31 | //Страница Избранные |
32 | Route::get('favorite',[MainController::class, 'favorite'])->name('favorite'); | 32 | Route::get('favorite',[MainController::class, 'favorite'])->name('favorite'); |
33 | 33 | ||
34 | //Страница контакты | 34 | //Страница контакты |
35 | Route::get('contact',[MainController::class, 'contact'])->name('contact'); | 35 | Route::get('contact',[MainController::class, 'contact'])->name('contact'); |
36 | 36 | ||
37 | //Страница каталог | 37 | //Страница каталог |
38 | Route::get('catalog',[MainController::class, 'catalog'])->name('catalog'); | 38 | Route::get('catalog',[MainController::class, 'catalog'])->name('catalog'); |
39 | 39 | ||
40 | Route::get('test', [MainController::class, 'test'])->name('test'); | ||
41 | |||
40 | //Страница новости | 42 | //Страница новости |
41 | Route::get('news',[MainController::class, 'news'])->name('news'); | 43 | Route::get('news',[MainController::class, 'news'])->name('news'); |
42 | 44 | ||
43 | //Страница о компании | 45 | //Страница о компании |
44 | Route::get('about',[MainController::class, 'about'])->name('about'); | 46 | Route::get('about',[MainController::class, 'about'])->name('about'); |
45 | 47 | ||
46 | //Страница объекты на карте | 48 | //Страница объекты на карте |
47 | Route::get('maps',[MainController::class, 'mapsobj'])->name('maps'); | 49 | Route::get('maps',[MainController::class, 'mapsobj'])->name('maps'); |
48 | 50 | ||
49 | // Политика конфедициальности | 51 | // Политика конфедициальности |
50 | Route::get('conf', function () { | 52 | Route::get('conf', function () { |
51 | return view('conf'); | 53 | return view('conf'); |
52 | })->name('conf'); | 54 | })->name('conf'); |
53 | 55 | ||
54 | //Детальная страница предложения недвижимости | 56 | //Детальная страница предложения недвижимости |
55 | Route::get('offer/{house:id}', [MainController::class, 'offer'])->name('offer'); | 57 | Route::get('offer/{house:id}', [MainController::class, 'offer'])->name('offer'); |
56 | 58 | ||
57 | //Детальная страница новостей | 59 | //Детальная страница новостей |
58 | Route::get('detail-new/{news:id}', [MainController::class, 'DetailNew'])->name('new'); | 60 | Route::get('detail-new/{news:id}', [MainController::class, 'DetailNew'])->name('new'); |
59 | 61 | ||
60 | //Страница ЖилойКомплекс | 62 | //Страница ЖилойКомплекс |
61 | Route::get('complex/{area:id}', [MainController::class, 'complex'])->name('complex'); | 63 | Route::get('complex/{area:id}', [MainController::class, 'complex'])->name('complex'); |
62 | 64 | ||
63 | // ajax-фильтры каталога | 65 | // ajax-фильтры каталога |
64 | Route::get('catalog_ajax_filter', [MainController::class, 'catalog_ajax_filter'])->name('catalog_ajax_filter'); | 66 | Route::get('catalog_ajax_filter', [MainController::class, 'catalog_ajax_filter'])->name('catalog_ajax_filter'); |
65 | 67 | ||
66 | //Категория | 68 | //Категория |
67 | Route::get('category/{cat}', [MainController::class, 'Category'])->name('category'); | 69 | Route::get('category/{cat}', [MainController::class, 'Category'])->name('category'); |
68 | 70 | ||
69 | //Категория ajax | 71 | //Категория ajax |
70 | Route::get('category_ajax/{cat}', [MainController::class, 'category_ajax'])->name('category_ajax'); | 72 | Route::get('category_ajax/{cat}', [MainController::class, 'category_ajax'])->name('category_ajax'); |
71 | 73 | ||
72 | //Страница куков | 74 | //Страница куков |
73 | Route::get('cookies', function () { | 75 | Route::get('cookies', function () { |
74 | return view('cookies'); | 76 | return view('cookies'); |
75 | })->name('cookies'); | 77 | })->name('cookies'); |
76 | 78 | ||
77 | //Форма обратной связи в футере | 79 | //Форма обратной связи в футере |
78 | Route::post('main_form', [MainController::class, 'main_form'])->name('main_form'); | 80 | Route::post('main_form', [MainController::class, 'main_form'])->name('main_form'); |
79 | 81 | ||
80 | //Форма обратной связи в хедере | 82 | //Форма обратной связи в хедере |
81 | Route::post('header_form', [MainController::class, 'header_form'])->name('header_form'); | 83 | Route::post('header_form', [MainController::class, 'header_form'])->name('header_form'); |
82 | 84 | ||
83 | //Форма записаться на просмотр в карточке офиса | 85 | //Форма записаться на просмотр в карточке офиса |
84 | Route::post('rec_view_form', [MainController::class, 'rec_view_form'])->name('rec_view_form'); | 86 | Route::post('rec_view_form', [MainController::class, 'rec_view_form'])->name('rec_view_form'); |
85 | 87 | ||
86 | //Форма обратной связи на странице контакты | 88 | //Форма обратной связи на странице контакты |
87 | Route::post('page_contact_form', [MainController::class, 'page_contact_form'])->name('page_contact_form'); | 89 | Route::post('page_contact_form', [MainController::class, 'page_contact_form'])->name('page_contact_form'); |
88 | 90 | ||
89 | //Форма обратной связи предложения по почте | 91 | //Форма обратной связи предложения по почте |
90 | Route::post('email_form', [MainController::class, 'email_form'])->name('email_form'); | 92 | Route::post('email_form', [MainController::class, 'email_form'])->name('email_form'); |
91 | 93 | ||
92 | Route::group([ | 94 | Route::group([ |
93 | 'as' => 'auth.', // имя маршрута, например auth.index | 95 | 'as' => 'auth.', // имя маршрута, например auth.index |
94 | 'prefix' => 'auth', // префикс маршрута, например auth/index | 96 | 'prefix' => 'auth', // префикс маршрута, например auth/index |
95 | ], function () { | 97 | ], function () { |
96 | // Форма регистрации | 98 | // Форма регистрации |
97 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 99 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
98 | 100 | ||
99 | // Создание пользователя | 101 | // Создание пользователя |
100 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 102 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
101 | //Форма входа | 103 | //Форма входа |
102 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 104 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
103 | 105 | ||
104 | // аутентификация | 106 | // аутентификация |
105 | Route::post('login', [LoginController::class, 'autenticate'])->name('auth'); | 107 | Route::post('login', [LoginController::class, 'autenticate'])->name('auth'); |
106 | 108 | ||
107 | // выход | 109 | // выход |
108 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 110 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
109 | 111 | ||
110 | //Страница неудачной авторизации | 112 | //Страница неудачной авторизации |
111 | Route::get('vefiry-message', function () { | 113 | Route::get('vefiry-message', function () { |
112 | return view('auth.vefiry-message'); | 114 | return view('auth.vefiry-message'); |
113 | })->name('vefiry-message'); | 115 | })->name('vefiry-message'); |
114 | 116 | ||
115 | }); | 117 | }); |
116 | 118 | ||
117 | /* | 119 | /* |
118 | * Личный кабинет пользователя | 120 | * Личный кабинет пользователя |
119 | */ | 121 | */ |
120 | Route::group([ | 122 | Route::group([ |
121 | 'as' => 'user.', // имя маршрута, например user.index | 123 | 'as' => 'user.', // имя маршрута, например user.index |
122 | 'prefix' => 'user', // префикс маршрута, например user/index | 124 | 'prefix' => 'user', // префикс маршрута, например user/index |
123 | //'namespace' => 'User', // пространство имен контроллеров | 125 | //'namespace' => 'User', // пространство имен контроллеров |
124 | 'middleware' => ['auth'] // один или несколько посредников | 126 | 'middleware' => ['auth'] // один или несколько посредников |
125 | ], function () { | 127 | ], function () { |
126 | // главная страница | 128 | // главная страница |
127 | Route::get('index', [AdminController::class, 'index'])->name('index'); | 129 | Route::get('index', [AdminController::class, 'index'])->name('index'); |
128 | }); | 130 | }); |
129 | 131 | ||
130 | /* | 132 | /* |
131 | * Панель управления: CRUD-операции над постами, категориями, тегами | 133 | * Панель управления: CRUD-операции над постами, категориями, тегами |
132 | */ | 134 | */ |
133 | Route::group([ | 135 | Route::group([ |
134 | 'as' => 'admin.', // имя маршрута, например admin.index | 136 | 'as' => 'admin.', // имя маршрута, например admin.index |
135 | 'prefix' => 'admin', // префикс маршрута, например admin/index | 137 | 'prefix' => 'admin', // префикс маршрута, например admin/index |
136 | //'namespace' => 'Admin', // пространство имен контроллеров | 138 | //'namespace' => 'Admin', // пространство имен контроллеров |
137 | 'middleware' => ['auth'] // один или несколько посредников | 139 | 'middleware' => ['auth'] // один или несколько посредников |
138 | ], function () { | 140 | ], function () { |
139 | /* | 141 | /* |
140 | * CRUD-операции над постами Жилых комплексов | 142 | * CRUD-операции над постами Жилых комплексов |
141 | */ | 143 | */ |
142 | Route::resource('area', AreaController::class, []); | 144 | Route::resource('area', AreaController::class, []); |
143 | 145 | ||
144 | //дополнительный маршрут для показа картинок объектов недвижимости | 146 | //дополнительный маршрут для показа картинок объектов недвижимости |
145 | Route::get('img/area/{area}', [AreaController::class, 'area_category']) | 147 | Route::get('img/area/{area}', [AreaController::class, 'area_category']) |
146 | ->name('img.area'); | 148 | ->name('img.area'); |
147 | 149 | ||
148 | //дополнительный маршрут для добавления картинок объектов недвижимости | 150 | //дополнительный маршрут для добавления картинок объектов недвижимости |
149 | Route::post('img/area/{area}', [AreaController::class, 'area_add_img']) | 151 | Route::post('img/area/{area}', [AreaController::class, 'area_add_img']) |
150 | ->name('img.add.area'); | 152 | ->name('img.add.area'); |
151 | 153 | ||
152 | //дополнительный маршрут для удаления картинок объектов недвжимости | 154 | //дополнительный маршрут для удаления картинок объектов недвжимости |
153 | Route::get('img/del/{id}/area/{area}', [AreaController::class, 'area_del_img']) | 155 | Route::get('img/del/{id}/area/{area}', [AreaController::class, 'area_del_img']) |
154 | ->name('img.del.area'); | 156 | ->name('img.del.area'); |
155 | 157 | ||
156 | /* | 158 | /* |
157 | * CRUD-операции над постами Новости | 159 | * CRUD-операции над постами Новости |
158 | */ | 160 | */ |
159 | Route::resource('news', NewsController::class, []); | 161 | Route::resource('news', NewsController::class, []); |
160 | 162 | ||
161 | /* | 163 | /* |
162 | * CRUD-операции над настройками Компании | 164 | * CRUD-операции над настройками Компании |
163 | */ | 165 | */ |
164 | Route::resource('company', CompanyAreaController::class, ['except' => ['create', 'store', 'destroy', 'index']]); | 166 | Route::resource('company', CompanyAreaController::class, ['except' => ['create', 'store', 'destroy', 'index']]); |
165 | 167 | ||
166 | //форма добавление партнера | 168 | //форма добавление партнера |
167 | Route::get('add/partner', [CompanyAreaController::class, 'add_partner'])->name('add.partner'); | 169 | Route::get('add/partner', [CompanyAreaController::class, 'add_partner'])->name('add.partner'); |
168 | 170 | ||
169 | //Добавление партнера | 171 | //Добавление партнера |
170 | Route::post('add/partner', [CompanyAreaController::class, 'add_partner_post'])->name('add.partner.post'); | 172 | Route::post('add/partner', [CompanyAreaController::class, 'add_partner_post'])->name('add.partner.post'); |
171 | 173 | ||
172 | //удаление партнера | 174 | //удаление партнера |
173 | Route::get('delete/partner/{partner}', [CompanyAreaController::class, 'delete_partner'])->name('delete.partner'); | 175 | Route::get('delete/partner/{partner}', [CompanyAreaController::class, 'delete_partner'])->name('delete.partner'); |
174 | 176 | ||
175 | 177 | ||
176 | /* | 178 | /* |
177 | * CRUD-операции над типами недвижимостью | 179 | * CRUD-операции над типами недвижимостью |
178 | */ | 180 | */ |
179 | Route::resource('typearea', TypeAreaController::class, ['except' => ['show']]); | 181 | Route::resource('typearea', TypeAreaController::class, ['except' => ['show']]); |
180 | 182 | ||
181 | /* | 183 | /* |
182 | * CRUD-операции над форматами недвижимостью | 184 | * CRUD-операции над форматами недвижимостью |
183 | */ | 185 | */ |
184 | Route::resource('formatarea', FormatAreaController::class, ['except' => ['show']]); | 186 | Route::resource('formatarea', FormatAreaController::class, ['except' => ['show']]); |
185 | 187 | ||
186 | /* | 188 | /* |
187 | * CRUD-операции над сообщениями сайта | 189 | * CRUD-операции над сообщениями сайта |
188 | */ | 190 | */ |
189 | Route::resource('message', MessageAreaController::class, ['except' => ['create', 'store', 'edit', 'update']]); | 191 | Route::resource('message', MessageAreaController::class, ['except' => ['create', 'store', 'edit', 'update']]); |
190 | 192 | ||
191 | /* | 193 | /* |
192 | * CRUD-операции над офисами | 194 | * CRUD-операции над офисами |
193 | */ | 195 | */ |
194 | Route::resource('houses', HousesController::class, ['except' => ['show']]); | 196 | Route::resource('houses', HousesController::class, ['except' => ['show']]); |
195 | 197 | ||
196 | // просмотр дополнительных картинок офиса | 198 | // просмотр дополнительных картинок офиса |
197 | Route::get('houses/{house}/images', [HousesController::class, 'view_images'])->name('view.images.houses'); | 199 | Route::get('houses/{house}/images', [HousesController::class, 'view_images'])->name('view.images.houses'); |
198 | 200 | ||
199 | // форма добавление дополнительной картинки офиса | 201 | // форма добавление дополнительной картинки офиса |
200 | Route::get('houses/{house}/add/images', [HousesController::class, 'add_images'])->name('add.images.houses'); | 202 | Route::get('houses/{house}/add/images', [HousesController::class, 'add_images'])->name('add.images.houses'); |
201 | 203 | ||
202 | // добавление дополнительной картинки офиса | 204 | // добавление дополнительной картинки офиса |
203 | Route::post('houses/{house}/add/images', [HousesController::class, 'add_images_store'])->name('add.image.post.houses'); | 205 | Route::post('houses/{house}/add/images', [HousesController::class, 'add_images_store'])->name('add.image.post.houses'); |
204 | 206 | ||
205 | // удаление дополнительной картинки офиса | 207 | // удаление дополнительной картинки офиса |
206 | Route::get('houses/{house}/del/{id}/images', [HousesController::class, 'del_images'])->name('del.images.houses'); | 208 | Route::get('houses/{house}/del/{id}/images', [HousesController::class, 'del_images'])->name('del.images.houses'); |
207 | 209 | ||
208 | //Форма смены пароля пользователя | 210 | //Форма смены пароля пользователя |
209 | Route::get('user/password', [AdminController::class, 'form_password'])->name('form_password'); | 211 | Route::get('user/password', [AdminController::class, 'form_password'])->name('form_password'); |
210 | 212 | ||
211 | //Смена пароля пользователя | 213 | //Смена пароля пользователя |
212 | Route::post('user/password', [AdminController::class, 'validate_password'])->name('validate_password'); | 214 | Route::post('user/password', [AdminController::class, 'validate_password'])->name('validate_password'); |
213 | }); | 215 | }); |
214 | 216 |