Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-locator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ajay Barthwal
store-locator
Commits
a77f5c98
Commit
a77f5c98
authored
Jul 11, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on pagination task
parent
43a9b46c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
270 additions
and
271 deletions
+270
-271
HomepageController.php
application/app/Http/Controllers/Admin/HomepageController.php
+26
-80
LocaterController.php
application/app/Http/Controllers/Admin/LocaterController.php
+1
-1
SearchController.php
application/app/Http/Controllers/SearchController.php
+15
-5
Apitraits.php
application/app/Traits/Apitraits.php
+22
-0
custom.css
application/public/vendor/frontend/css/custom.css
+7
-0
edit.blade.php
application/resources/views/admin/homepages/edit.blade.php
+2
-2
homepages_mng.blade.php
application/resources/views/admin/homepages/homepages_mng.blade.php
+3
-3
autocomplete.blade.php
application/resources/views/frontend/searchs/autocomplete.blade.php
+2
-1
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+71
-159
location_element (copy).blade.php
application/resources/views/frontend/searchs/location_element (copy).blade.php
+28
-0
location_element.blade.php
application/resources/views/frontend/searchs/location_element.blade.php
+93
-20
No files found.
application/app/Http/Controllers/Admin/HomepageController.php
View file @
a77f5c98
...
...
@@ -17,7 +17,6 @@ class HomepageController extends AdminController
$this
->
record_per_page
=
10
;
}
public
function
homepagesList
(
Request
$request
)
{
$admin_id
=
$request
->
session
()
->
get
(
'id'
);
...
...
@@ -39,13 +38,12 @@ class HomepageController extends AdminController
public
function
saveHomepage
(
Request
$request
)
{
$user_id
=
auth
()
->
user
(
'id'
);
if
(
$request
->
all
())
{
dd
(
$request
->
all
());
if
(
$request
->
all
())
{
$header_image_normal
=
trim
(
$request
->
header_image_normal
);
$header_image_mobile
=
trim
(
$request
->
header_image_mobile
);
$footer_image_normal
=
trim
(
$request
->
footer_image_normal
);
$footer_image_mobile
=
trim
(
$request
->
footer_image_mobile
);
$created_by
=
trim
(
$user_id
->
id
);
$status
=
trim
(
$request
->
status
);
$meta_title
=
trim
(
$request
->
meta_title
);
$meta_keyword
=
trim
(
$request
->
meta_keyword
);
$meta_description
=
trim
(
$request
->
meta_description
);
...
...
@@ -78,7 +76,6 @@ class HomepageController extends AdminController
$homepage
->
footer_image_mobile
=
$request
->
file
(
'footer_image_mobile'
)
->
store
(
'image'
);
}
$homepage
->
status
=
$status
;
$homepage
->
meta_title
=
$meta_title
;
$homepage
->
meta_keyword
=
$meta_keyword
;
$homepage
->
meta_description
=
$meta_description
;
...
...
@@ -95,73 +92,44 @@ class HomepageController extends AdminController
if
(
!
empty
(
$id
)){
$data
=
Homepage
::
find
(
$id
);
}
return
view
(
'admin.homepages.edit'
);
return
view
(
'admin.homepages.edit'
,
compact
(
'data'
)
);
}
/**
* Function add_homepage
*
* function to add homepage
*
* @Created Date: 02 July,2019
* @Modified Date: 02 July,2019
* @param ARRAY
* @return STRING
*/
public
function
add_homepage
(
Request
$request
,
$id
=
''
)
{
public
function
updateHomepage
(
Request
$request
,
$id
)
{
$user_id
=
auth
()
->
user
(
'id'
);
$data
=
array
();
if
(
!
empty
(
$id
)){
$data
=
Homepage
::
find
(
$id
);
}
if
(
$request
->
all
())
{
//post
if
(
$request
->
all
())
{
//dd($request->all());
$header_image_normal
=
trim
(
$request
->
header_image_normal
);
$header_image_mobile
=
trim
(
$request
->
header_image_mobile
);
$footer_image_normal
=
trim
(
$request
->
footer_image_normal
);
$footer_image_mobile
=
trim
(
$request
->
footer_image_mobile
);
$created_by
=
trim
(
$user_id
->
id
);
$status
=
trim
(
$request
->
status
);
$meta_title
=
trim
(
$request
->
meta_title
);
$meta_keyword
=
trim
(
$request
->
meta_keyword
);
$meta_description
=
trim
(
$request
->
meta_description
);
if
(
$id
)
{
//Validate the input
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'header_image_normal'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'header_image_mobile'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_normal'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_mobile'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
$messages
=
$validator
->
messages
();
}
else
{
//Validate the input
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'header_image_normal'
=>
'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'header_image_mobile'
=>
'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_normal'
=>
'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_mobile'
=>
'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
}
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'header_image_normal'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'header_image_mobile'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_normal'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
'footer_image_mobile'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
$messages
=
$validator
->
messages
();
if
(
$validator
->
fails
())
{
if
(
$id
)
{
return
redirect
()
->
route
(
'admin-edithomepage'
,[
'id'
=>
$id
])
return
redirect
()
->
route
(
'admin.homepages.edit'
,[
'id'
=>
$id
])
->
withErrors
(
$validator
)
->
withInput
();
}
else
{
return
redirect
()
->
route
(
'admin-addhomepage'
)
->
withErrors
(
$validator
)
->
withInput
();
}
}
else
{
if
(
$id
)
{
//update case
$homepage
=
Homepage
::
find
(
$id
);
//->with('userlists');
$modified_by
=
trim
(
$user_id
->
id
);
$homepage
->
modified_by
=
$modified_by
;
}
else
{
$homepage
=
new
Homepage
;
$homepage
->
created_by
=
$user_id
->
id
;
}
$homepage
=
Homepage
::
find
(
$id
);
//->with('userlists');
$modified_by
=
trim
(
$user_id
->
id
);
$homepage
->
modified_by
=
$modified_by
;
if
(
!
empty
(
$request
->
header_image_normal
)){
$homepage
->
header_image_normal
=
$request
->
file
(
'header_image_normal'
)
->
store
(
'image'
);
}
...
...
@@ -175,50 +143,28 @@ class HomepageController extends AdminController
$homepage
->
footer_image_mobile
=
$request
->
file
(
'footer_image_mobile'
)
->
store
(
'image'
);
}
$homepage
->
status
=
$status
;
$homepage
->
meta_title
=
$meta_title
;
$homepage
->
meta_keyword
=
$meta_keyword
;
$homepage
->
meta_description
=
$meta_description
;
$homepage
->
save
();
if
(
$id
)
{
$msg
=
'Homepage has been updated successfully.'
;
$request
->
session
()
->
flash
(
'add_message'
,
$msg
);
return
redirect
()
->
route
(
'admin.homepages'
);
}
else
if
(
!
empty
(
$id
)){
try
{
$msg
=
'Homepage has been added successfully.'
;
$request
->
session
()
->
flash
(
'add_message'
,
$msg
);
return
redirect
()
->
route
(
'admin.homepages'
);
}
catch
(
\Exception
$e
){
//
}
}
else
{
try
{
$msg
=
'Homepage has been added successfully.'
;
$request
->
session
()
->
flash
(
'add_message'
,
$msg
);
return
redirect
()
->
route
(
'admin.homepages'
);
}
catch
(
\Exception
$e
){
//
}
}
$msg
=
'Homepage has been updated successfully.'
;
$request
->
session
()
->
flash
(
'add_message'
,
$msg
);
return
redirect
()
->
route
(
'admin.homepages'
);
}
}
else
{
return
view
(
'admin.homepages.add_homepage'
,
[
'data'
=>
$data
,
'request'
=>
$request
]);
}
}
public
function
homepage_delet
e
(
$id
,
Request
$request
)
{
public
function
deleteHomepag
e
(
$id
,
Request
$request
)
{
if
(
$id
)
{
$homepage
=
Homepage
::
find
(
$id
);
$homepage
->
is_deleted
=
'1'
;
if
(
$homepage
->
save
()){
$msg
=
'Homepage has been deleted successfully.'
;
$request
->
session
()
->
flash
(
'message'
,
$msg
);
}
}
return
redirect
()
->
route
(
'admin.homepages'
);
}
...
...
application/app/Http/Controllers/Admin/LocaterController.php
View file @
a77f5c98
...
...
@@ -16,7 +16,7 @@ class LocaterController extends AdminController
public
function
__construct
()
{
$this
->
middleware
(
'auth'
);
$this
->
record_per_page
=
1
0
;
$this
->
record_per_page
=
1
;
}
public
function
locatersList
(
Request
$request
)
{
...
...
application/app/Http/Controllers/SearchController.php
View file @
a77f5c98
...
...
@@ -54,7 +54,6 @@ class SearchController extends Controller
}))
->
get
();
$locaterData
=
!
empty
(
$locaterData
)
?
$locaterData
->
groupBy
(
'locater_identity'
)
:
[];
$finalData
=
array_map
(
function
(
$data
)
use
(
$locaterData
)
{
...
...
@@ -69,9 +68,14 @@ class SearchController extends Controller
return
$data
;
},
$apiLocaterData
[
'data'
]);
$links
=
$apiLocaterData
[
'links'
];
//echo"<pre>";
//print_r($links);die;
$meta
=
$apiLocaterData
[
'meta'
];
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.index'
,
compact
(
'homepage'
,
'finalData'
));
return
view
(
'frontend.searchs.index'
,
compact
(
'homepage'
,
'finalData'
,
'links'
,
'meta'
));
}
/**
...
...
@@ -80,8 +84,9 @@ class SearchController extends Controller
public
function
searchlocator
(
Request
$request
)
{
$api_url
=
config
(
'app.api_list'
);
$apiLocaterData
=
$this
->
call_api
(
$request
->
locality
,
$api_url
);
$apiLocaterData
=
$this
->
call_api_page
(
$api_url
,
$request
->
locality
,
$request
->
page
);
if
(
count
(
$apiLocaterData
[
'data'
])
<
1
)
return
''
;
$locaterIds
=
collect
(
$apiLocaterData
[
'data'
])
->
pluck
(
'id'
);
...
...
@@ -105,8 +110,13 @@ class SearchController extends Controller
return
$data
;
},
$apiLocaterData
[
'data'
]);
$links
=
$apiLocaterData
[
'links'
];
$meta
=
$apiLocaterData
[
'meta'
];
$locality
=
$request
->
locality
;
//print_r($links);
return
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
));
return
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'meta'
));
}
/**
...
...
application/app/Traits/Apitraits.php
View file @
a77f5c98
...
...
@@ -20,4 +20,25 @@ Trait Apitraits
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
public
function
call_api_page
(
$api_url
,
$locatorID
=
null
,
$page
=
1
)
{
$query_param
=
array
(
'keyword'
=>
$locatorID
,
'page'
=>
empty
(
$page
)
?
1
:
$page
);
//print_r($query_param);
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api_url
,[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
getenv
(
'API_KEY'
)],
'query'
=>
$query_param
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
}
\ No newline at end of file
application/public/vendor/frontend/css/custom.css
View file @
a77f5c98
...
...
@@ -37,3 +37,10 @@ div#localitylist {
top
:
9px
;
left
:
4px
;
}
.current
{
background
:
#EAEAEA
;
border
:
0px
;
padding
:
.3rem
.75rem
;
font-size
:
0.9rem
;
color
:
rgba
(
0
,
0
,
0
,
0.6
);
}
application/resources/views/admin/homepages/edit.blade.php
View file @
a77f5c98
...
...
@@ -33,7 +33,7 @@
</div>
@endif
<form class="
form
-
horizontal
" id="
add
-
pageform
" action="
{{
route
(
'admin.homepages.
save'
)}}
" method="
POST
" enctype="
multipart
/
form
-
data
">
<form class="
form
-
horizontal
" id="
add
-
pageform
" action="
{{
route
(
'admin.homepages.
update'
,[
'id'
=>@
$data
->
id
]
)}}
" method="
POST
" enctype="
multipart
/
form
-
data
">
{{ csrf_field() }}
...
...
@@ -50,7 +50,7 @@
<div class="
form
-
group
@
if
(
$errors
->
first
(
'other_setting'
))
{{
' has-error has-feedback'
}}
@
endif
">
<label for="
inputError
" class="
col
-
sm
-
2
control
-
label
">other_setting</label>
<div class="
col
-
sm
-
10
">
<input type="
text
" name="
other_setting
" class="
form
-
control
">
<input type="
text
" name="
other_setting
" class="
form
-
control
"
value="
{{
old
(
'other_setting'
,
@
$data
->
other_setting
)}}
"
>
</div>
</div>
</div>
...
...
application/resources/views/admin/homepages/homepages_mng.blade.php
View file @
a77f5c98
...
...
@@ -4,12 +4,12 @@
<
div
class
="
container
-
fluid
">
<div class="">
<div class="
col
-
sm
-
6
">
<h2>
Locater
s</h2>
<h2>
Homepage
s</h2>
</div>
<div class="
col
-
sm
-
6
">
<ol class="
breadcrumb
float
-
sm
-
right
">
<li class="
breadcrumb
-
item
"><a href="
#">Home</a></li>
<
li
class
="
breadcrumb
-
item
active
">
Locater
Tables</li>
<
li
class
="
breadcrumb
-
item
active
">
Homepages
Tables</li>
</ol>
</div>
</div>
...
...
@@ -63,7 +63,7 @@
<!-- /.box-header -->
<form id="
locater
s
-
add
" method="
get
" action="">
<form id="
homepage
s
-
add
" method="
get
" action="">
<div class="
card
">
<!-- /.card-header -->
...
...
application/resources/views/frontend/searchs/autocomplete.blade.php
View file @
a77f5c98
<ul
class=
"dropdown-menu"
style=
"display:block; position:relative"
>
@foreach($locationDetailAPIdata['data'] as $row)
<li><i
class=
"mdi mdi-map-marker"
></i><a
href=
"
#
"
>
{{ $row['name'] }}
</a></li>
<li><i
class=
"mdi mdi-map-marker"
></i><a
href=
"
javascript:void(0);
"
>
{{ $row['name'] }}
</a></li>
@endforeach
</ul>
\ No newline at end of file
application/resources/views/frontend/searchs/index.blade.php
View file @
a77f5c98
...
...
@@ -9,7 +9,7 @@
<div class="
searchbar_form
">
<div class="
searchfield
">
<div class="
os
"><i class="
mdi
mdi
-
magnify
"></i>
<input
type=
"text"
class=
"form-control locality"
autocomplete=
"off"
name=
"locality"
placeholder=
"--Search Nearby--"
>
<input type="
text
" class="
form
-
control
locality
" autocomplete="
off
" name="
locality
"
value="
@
if
(
@
$locality
)
{{
$locality
}}
@
else
@
endif
"
placeholder="
--
Search
Nearby
--
">
<div id="
localitylist
"></div>
</div>
</div>
...
...
@@ -22,8 +22,8 @@
</div>
<div class="
select
">
<select class="
form
-
control
">
<option>
City
</option>
</select>
<option>City</option>
</select>
</div>
<div class="
select
">
<input type="
text
" class="
form
-
control
" placeholder="
Location
">
...
...
@@ -47,8 +47,8 @@
</section>
<section class="
container
-
fluid
location_data
no
-
pb
">
<div
class=
"row
"
>
<aside
class=
"col-md-5 col-lg-3 location_data-lw"
>
<div class="
row
">
<aside class="
col
-
md
-
5
col
-
lg
-
3
location_data
-
lw
"
id="
searchlocaterid
"
>
<!--search count and filter start-->
<div class="
row
result_head
">
<div class="
col
-
6
">
...
...
@@ -72,21 +72,21 @@
</div>
<!--location listing start-->
<div class="
row
no
-
gutters
">
<div
class=
" mt-4 location_data-listing"
id=
"searchlocaterid"
>
<?php
foreach
(
$finalData
as
$key
=>
$data
){
/*$link = '';
if(isset($locaterkeyvalueddata[$data->id])){
$link = $locaterkeyvalueddata[$data->id];
}*/
?>
<div class="
mt
-
4
location_data
-
listing
">
<?php foreach(
$finalData
as
$key
=>
$data
){ ?>
<div class="
card
">
<div class="
card
-
body
">
<div class="
location_data
-
img
">
<img src="
vendor
/
frontend
/
img
/
location
-
img
.
png
" />
</div>
<div class="
location_data
-
content
">
<h5
class=
"title"
><a
href=
"{{route('detail',['slug'=>$data['slug']])}}"
>
<?php
echo
$data
[
'name'
];
?>
</a></h5>
<h5 class="
title
">
@if(!empty(
$data['slug']
))
<a href="
{{
route
(
'detail'
,[
'slug'
=>
$data
[
'slug'
]])}}
"><?php echo
$data['name']
; ?></a>
@else
{
{$data['name']}
}
@endif
</h5>
<span class="
ratings
">
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
...
...
@@ -103,162 +103,52 @@
</div>
</div>
<?php } ?>
<!--<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi- Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="location_data-img">
<img src="vendor/frontend/img/location-img.png" />
</div>
<div class="location_data-content">
<h5 class="title"><a href="location.html">Global Desi - Women Clothing Store</a></h5>
<span class="ratings">
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star"></i>
<i class="mdi mdi-star-outline"></i>
<span class="counts">(20)</span>
</span>
<p class="address"><a href="location.html">Vasant Kunj, Sector C, Mehruali Road New Delhi - 110070</a></p>
</div>
</div>
</div>
</div>-->
</div>
</div>
<!--pagination start-->
<
!--<
div class="pagination-wrapper justify-content-center">
<div class="
pagination
-
wrapper
justify
-
content
-
center
">
<nav>
<ul class="
pagination
">
<li class="page-item">
<a class="page-link" href="#" aria-label="Previous">
<?php
$links['first']
= explode('page=',
$links['first']
);
if(!empty(
$links['last']
)){
$links['last']
= explode('page=',
$links['last']
);
}else{
$links['last']
= '';
}
if(!empty(
$links['prev']
)){
$links['prev']
= explode('page=',
$links['prev']
);
}else{
$links['prev']
= '';
}
if(!empty(
$links['next']
)){
$links['next']
= explode('page=',
$links['next']
);
}else{
$links['next']
= '';
}
?>
<li class="
page
-
item
active
">
<a class="
page
-
link
" id="
first
" title="
First
" data-page="
{{
$links
[
'first'
][
1
]
}}
" href="
javascript
:
void
(
0
);
">
<i class="
mdi
mdi
-
chevron
-
double
-
left
"></i>
</a>
</li>
<li class="
page
-
item
active
">
<a class="
page
-
link
" title="
Prev
" href="
javascript
:
void
(
0
);
" id="
prev
" data-page="
@
if
(
@
$links
[
'prev'
])
{{
$links
[
'prev'
][
1
]
}}
@
else
@
endif
" aria-label="
Previous
">
<i class="
mdi
mdi
-
chevron
-
left
"></i>
</a>
</li>
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<li class="
page
-
item
active
">
<a class="
page
-
link
" title="
Next
" href="
javascript
:
void
(
0
);
" id="
next
" data-page="
@
if
(
@
$links
[
'next'
])
{{
$links
[
'next'
][
1
]
}}
@
else
@
endif
" name="
next
" aria-label="
Next
">
<i class="
mdi
mdi
-
chevron
-
right
"></i>
</a>
</li>
<li class="
page
-
item
active
">
<a class="
page
-
link
" title="
Last
" id="
last
" data-page="
{{
$links
[
'last'
][
1
]
}}
" href="
javascript
:
void
(
0
);
"><i class="
mdi
mdi
-
chevron
-
double
-
right
"></i></a>
</li>
</ul>
</nav>
</div>
-->
</div>
</aside>
<div class="
col
-
md
-
7
col
-
lg
-
9
location_data
-
map
"><iframe src="
https
://
www
.
google
.
com
/
maps
/
embed
?
pb
=!
1
m16
!
1
m12
!
1
m3
!
1
d56122
.
436645511465
!
2
d77
.
0416
8293906328
!
3
d28
.
459896286104527
!
2
m3
!
1
f0
!
2
f0
!
3
f0
!
3
m2
!
1
i1024
!
2
i768
!
4
f13
.
1
!
2
m1
!
1
sanita
+
dongre
!
5e0
!
3
m2
!
1
sen
!
2
sin
!
4
v1560423783107
!
5
m2
!
1
sen
!
2
sin
" width="
100
%
"
frameborder="
0
" style="
border
:
0
" allowfullscreen></iframe></div>
...
...
@@ -365,8 +255,30 @@
});
});
});
</script>
$
(
"#searchlocaterid"
)
.
on
(
'click'
,
'.pagination li a'
,
function
()
{
var
page
=
$
(
this
)
.
data
(
'page'
);
var
locality
=
$
(
'.locality'
)
.
val
();
paginate
(
page
,
locality
);
});
function
paginate
(
page
,
locality
){
$
.
ajax
({
type
:
'post'
,
url
:
"
{
{route('searchlocator')}
}
"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locality
:
locality
},
success
:
function
(
datanew
)
{
$
(
"#searchlocaterid"
)
.
html
(
datanew
);
$
(
".locality"
)
.
val
(
locality
);
}
});
}
</
script
>
@
endsection
application/resources/views/frontend/searchs/location_element (copy).blade.php
0 → 100644
View file @
a77f5c98
@
foreach
(
$finalData
as
$key
=>
$data
)
<
div
class
="
card
">
<div class="
card
-
body
">
<div class="
location_data
-
img
">
<img src="
vendor
/
frontend
/
img
/
location
-
img
.
png
" />
</div>
<div class="
location_data
-
content
">
<h5 class="
title
">
<a href="
{{
route
(
'detail'
,[
'slug'
=>
$data
[
'slug'
]])}}
">{{
$data['name']
}}</a>
</h5>
<span class="
ratings
">
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
-
outline
"></i>
<br>
<span class="
counts
">{{
$data['reviewCounts']
}}</span>
</span>
<p class="
address
">{{
$data['fullAddress']['addressLines'][0]
}}
<?php if(!empty(
$data['fullAddress']['addressLines'][1]
)){ ?>
<br> {{
$data['fullAddress']['addressLines'][1]
}}</p>
<?php } ?>
</div>
</div>
</div>
@endforeach
application/resources/views/frontend/searchs/location_element.blade.php
View file @
a77f5c98
@
foreach
(
$finalData
as
$key
=>
$data
)
<
div
class
="
card
">
<div class="
card
-
body
">
<div class="
location_data
-
img
">
<img src="
vendor
/
frontend
/
img
/
location
-
img
.
png
" />
<!--search count and filter start-->
<div
class=
"row result_head"
>
<div
class=
"col-6"
>
<span
class=
"result_head-counts"
>
<?php
$totalFoundLocation
=
count
(
$finalData
);
?>
{{ $totalFoundLocation }} locations found
</span>
</div>
<div
class=
"col-6 text-right"
>
<div
class=
"dropdown"
>
<div
class=
"btn btn-secondary dropdown-toggle custom-dropdown"
id=
"reviewbyfilter"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
Most relevant
</div>
<div class="
location_data
-
content
">
<h5 class="
title
">
<a href="
{{
route
(
'detail'
,[
'slug'
=>
$data
[
'slug'
]])}}
">{{
$data['name']
}}</a>
</h5>
<span class="
ratings
">
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
"></i>
<i class="
mdi
mdi
-
star
-
outline
"></i>
<br>
<span class="
counts
">{{
$data['reviewCounts']
}}</span>
</span>
<p class="
address
">{{
$data['fullAddress']['addressLines'][0]
}} <br> {{
$data['fullAddress']['addressLines'][1]
}}</p>
<div
class=
"dropdown-menu"
aria-labelledby=
"reviewbyfilter"
>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Most relevant
</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Newest
</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Highest rating
</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Lowest rating
</a>
</div>
</div>
</div>
@endforeach
</div>
<!--location listing start-->
<div
class=
"row no-gutters"
>
<div
class=
" mt-4 location_data-listing"
>
<?php
foreach
(
$finalData
as
$key
=>
$data
){
?>
<div
class=
"card"
>
<div
class=
"card-body"
>
<div
class=
"location_data-img"
>
<img
src=
"vendor/frontend/img/location-img.png"
/>
</div>
<div
class=
"location_data-content"
>
<h5
class=
"title"
><a
href=
"{{route('detail',['slug'=>$data['slug']])}}"
>
<?php
echo
$data
[
'name'
];
?>
</a></h5>
<span
class=
"ratings"
>
<i
class=
"mdi mdi-star"
></i>
<i
class=
"mdi mdi-star"
></i>
<i
class=
"mdi mdi-star"
></i>
<i
class=
"mdi mdi-star"
></i>
<i
class=
"mdi mdi-star-outline"
></i>
<br>
<span
class=
"counts"
>
({{ $data['reviewCounts'] }})
</span>
</span>
<p
class=
"address"
>
<?php
echo
$data
[
'fullAddress'
][
'addressLines'
][
0
];
?>
<?php
if
(
!
empty
(
$data
[
'fullAddress'
][
'addressLines'
][
1
])){
?>
<br>
{{ $data['fullAddress']['addressLines'][1] }}
</p>
<?php
}
?>
</p>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
<!--pagination start-->
<div
class=
"pagination-wrapper justify-content-center"
>
<nav>
<ul
class=
"pagination"
>
<?php
$links
[
'first'
]
=
explode
(
'page='
,
$links
[
'first'
]);
if
(
!
empty
(
$links
[
'last'
])){
$links
[
'last'
]
=
explode
(
'page='
,
$links
[
'last'
]);
}
else
{
$links
[
'last'
]
=
''
;
}
if
(
!
empty
(
$links
[
'prev'
])){
$links
[
'prev'
]
=
explode
(
'page='
,
$links
[
'prev'
]);
}
else
{
$links
[
'prev'
]
=
''
;
}
if
(
!
empty
(
$links
[
'next'
])){
$links
[
'next'
]
=
explode
(
'page='
,
$links
[
'next'
]);
}
else
{
$links
[
'next'
]
=
''
;
}
?>
<li
class=
"page-item active"
>
<a
class=
"page-link"
id=
"first"
title=
"First"
data-page=
"{{ $links['first'][1] }}"
href=
"javascript:void(0);"
>
<i
class=
"mdi mdi-chevron-double-left"
></i>
</a>
</li>
<li
class=
"page-item active"
>
<a
class=
"page-link"
title=
"Prev"
href=
"javascript:void(0);"
id=
"prev"
data-page=
"@if(@$links['prev']) {{ $links['prev'][1] }} @else @endif"
aria-label=
"Previous"
>
<i
class=
"mdi mdi-chevron-left"
></i>
</a>
</li>
<li
class=
"page-item active"
>
<a
class=
"page-link"
title=
"Next"
href=
"javascript:void(0);"
id=
"next"
data-page=
"@if(@$links['next']) {{ $links['next'][1] }} @else @endif"
name=
"next"
aria-label=
"Next"
>
<i
class=
"mdi mdi-chevron-right"
></i>
</a>
</li>
<li
class=
"page-item active"
>
<a
class=
"page-link"
title=
"Last"
id=
"last"
data-page=
"{{ $links['last'][1] }}"
href=
"javascript:void(0);"
><i
class=
"mdi mdi-chevron-double-right"
></i></a>
</li>
</ul>
</nav>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment