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
6c499864
Commit
6c499864
authored
Jul 25, 2019
by
Ajay Barthwal
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
Develop See merge request
!5
parents
a93b6e0a
2a26d8db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
53 deletions
+44
-53
SearchController.php
application/app/Http/Controllers/SearchController.php
+18
-38
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+9
-11
location_element.blade.php
application/resources/views/frontend/searchs/location_element.blade.php
+17
-4
No files found.
application/app/Http/Controllers/SearchController.php
View file @
6c499864
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Homepage
;
use
App\Helpers\Apihelpers
;
use
App\Helpers\Apihelpers
;
use
App\Traits\Apitraits
;
use
App\Traits\Apitraits
;
use
App\Locater
;
use
App\Locater
;
...
@@ -100,8 +99,9 @@ class SearchController extends Controller
...
@@ -100,8 +99,9 @@ class SearchController extends Controller
}
}
$locality
=
$request
->
locality
;
$locality
=
$request
->
locality
;
$ratingOrder
=
$request
->
ratingOrder
;
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'meta'
,
'locality'
))
->
render
();
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'meta'
,
'locality'
,
'ratingOrder'
))
->
render
();
return
[
'status'
=>
'success'
,
'data'
=>
$html
];
return
[
'status'
=>
'success'
,
'data'
=>
$html
];
}
}
...
@@ -121,8 +121,7 @@ class SearchController extends Controller
...
@@ -121,8 +121,7 @@ class SearchController extends Controller
$api_url
=
config
(
'app.api_location'
);
$api_url
=
config
(
'app.api_location'
);
$locationDetailAPIdata
=
$this
->
call_api
(
$api_url
,
$locatorID
);
$locationDetailAPIdata
=
$this
->
call_api
(
$api_url
,
$locatorID
);
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.detail'
,
compact
(
'locatorID'
,
'locationDetailAPIdata'
,
'pageData'
));
return
view
(
'frontend.searchs.detail'
,
compact
(
'homepage'
,
'locatorID'
,
'locationDetailAPIdata'
,
'pageData'
));
}
}
...
@@ -132,59 +131,40 @@ class SearchController extends Controller
...
@@ -132,59 +131,40 @@ class SearchController extends Controller
$api_url
=
config
(
'app.api_search'
);
$api_url
=
config
(
'app.api_search'
);
$locationDetailAPIdata
=
$this
->
call_api_page
(
$api_url
,
$request
[
'query'
]);
$locationDetailAPIdata
=
$this
->
call_api_page
(
$api_url
,
$request
[
'query'
]);
if
(
empty
(
$locationDetailAPIdata
[
'data'
])){
$html
=
view
(
'frontend.searchs.autocomplete'
,
compact
(
'locationDetailAPIdata'
))
->
render
();
return
[
$html
=
view
(
'frontend.searchs.autocomplete'
,
compact
(
'locationDetailAPIdata'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
$html
]);
}
else
{
$html
=
view
(
'frontend.searchs.autocomplete'
,
compact
(
'locationDetailAPIdata'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'success'
,
'status'
=>
'success'
,
'data'
=>
$html
'data'
=>
$html
]);
];
}
}
}
/**
/**
* For render Review ajax
* For render Review ajax
* */
* */
public
function
review
p
aginate
(
Request
$request
)
public
function
review
P
aginate
(
Request
$request
)
{
{
$api_url
=
config
(
'app.api'
);
$api_url
=
config
(
'app.api'
);
$reviewData
=
$this
->
review_api_detail
(
$api_url
,
$request
->
locatorID
,
$request
->
page
);
$reviewData
=
$this
->
review_api_detail
(
$api_url
,
$request
->
locatorID
,
$request
->
page
);
if
(
count
(
$reviewData
[
'data'
])
<
1
)
return
''
;
return
view
(
'frontend.searchs.review_element'
,
compact
(
'reviewData'
));
return
view
(
'frontend.searchs.review_element'
,
compact
(
'reviewData'
));
}
}
public
function
getCityValue
(
Request
$request
)
public
function
getCityValue
(
Request
$request
)
{
{
$getCityData
=
City
::
where
(
'cities.name'
,
'!='
,
''
)
->
where
(
'cities.parent_id'
,
'='
,
$request
->
state
)
->
pluck
(
'name'
,
'id'
)
->
toarray
();
$getCityData
=
City
::
where
(
'cities.name'
,
'!='
,
''
)
->
where
(
'cities.parent_id'
,
'='
,
$request
->
state
)
->
where
(
'cities.is_deleted'
,
'='
,
'0'
)
->
where
(
'cities.status'
,
'='
,
'1'
)
->
pluck
(
'name'
,
'id'
)
->
toarray
();
if
(
!
empty
(
$getCityData
)){
$html
=
view
(
'frontend.searchs.city_dropdown'
,
compact
(
'getCityData'
))
->
render
();
return
[
$html
=
view
(
'frontend.searchs.city_dropdown'
,
compact
(
'getCityData'
))
->
render
();
'status'
=>
'success'
,
return
response
()
->
json
([
'data'
=>
$html
'status'
=>
'success'
,
];
'data'
=>
$html
]);
}
else
{
$html
=
view
(
'frontend.searchs.city_dropdown'
,
compact
(
'getCityData'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
$html
]);
}
}
}
}
}
application/resources/views/frontend/searchs/index.blade.php
View file @
6c499864
...
@@ -99,21 +99,17 @@
...
@@ -99,21 +99,17 @@
var
location
=
$
(
'.location'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
city
=
$
(
'.getCityValue'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
var
ratingOrder
=
$
(
'.ratingDropDown'
).
val
(
);
e
.
preventDefault
();
e
.
preventDefault
();
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
type
:
'post'
,
url
:
"{{route('searchlocater')}}"
,
url
:
"{{route('searchlocater')}}"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
locality
:
locality
,
location
:
location
,
state
:
state
,
city
:
city
,
ratingOrder
:
ratingOrder
},
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
locality
:
locality
,
location
:
location
,
state
:
state
,
city
:
city
,
ratingOrder
:
ratingOrder
},
success
:
function
(
datanew
)
{
success
:
function
(
datanew
)
{
if
(
datanew
.
status
==
'success'
)
{
//PRELOADER
loader
();
loader
();
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
}
else
{
$
(
".locality"
).
val
(
locality
);
loader
();
$
(
".ratingDropDown"
).
val
(
ratingOrder
).
attr
(
"selected"
,
"selected"
);
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
}
}
}
});
});
});
});
...
@@ -126,18 +122,18 @@
...
@@ -126,18 +122,18 @@
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
city
=
$
(
'.getCityValue'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
var
ratingOrder
=
$
(
'.ratingDropDown'
).
val
(
);
paginate
(
page
,
locality
,
state
,
city
,
location
);
paginate
(
page
,
locality
,
state
,
city
,
location
,
ratingOrder
);
});
});
$
(
"#searchlocaterid"
).
on
(
'c
lick'
,
'.ratingDropDown a
'
,
function
()
{
$
(
"#searchlocaterid"
).
on
(
'c
hange'
,
'.ratingDropDown
'
,
function
()
{
var
page
=
$
(
this
).
data
(
'page'
);
var
page
=
$
(
this
).
data
(
'page'
);
var
locality
=
$
(
'.locality'
).
val
();
var
locality
=
$
(
'.locality'
).
val
();
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
city
=
$
(
'.getCityValue'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
var
ratingOrder
=
$
(
'.ratingDropDown'
).
val
(
);
paginate
(
page
,
locality
,
state
,
city
,
location
,
ratingOrder
);
paginate
(
page
,
locality
,
state
,
city
,
location
,
ratingOrder
);
});
});
...
@@ -150,6 +146,8 @@
...
@@ -150,6 +146,8 @@
loader
();
loader
();
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
$
(
".locality"
).
val
(
locality
);
$
(
".locality"
).
val
(
locality
);
$
(
".ratingDropDown"
).
val
(
ratingOrder
).
attr
(
"selected"
,
"selected"
);
}
}
});
});
}
}
...
...
application/resources/views/frontend/searchs/location_element.blade.php
View file @
6c499864
...
@@ -17,15 +17,24 @@
...
@@ -17,15 +17,24 @@
{{ $meta['total'] }} locations found
</span>
{{ $meta['total'] }} locations found
</span>
</div>
</div>
<div
class=
"col-6 text-right"
>
<div
class=
"col-6 text-right"
>
<div
class=
"dropdown"
>
<div
class=
"select"
>
<select
name=
"state"
class=
"form-control ratingDropDown"
>
<option
value=
""
>
Sort By
</option>
<?php
$rating
=
array
(
'desc'
=>
'Highest rating'
,
'asc'
=>
'Lowest rating'
)
?>
@foreach($rating as $key => $option)
<option
data-rating=
"
<?php
echo
$key
;
?>
"
value=
"
<?php
echo
$key
;
?>
"
>
<?php
echo
$option
;
?>
</option>
@endforeach
</select>
</div>
<!--<div class="dropdown">
<div class="btn btn-secondary dropdown-toggle custom-dropdown" id="reviewbyfilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div class="btn btn-secondary dropdown-toggle custom-dropdown" id="reviewbyfilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Sort By
Sort By
</div>
</div>
<div class="dropdown-menu ratingDropDown" aria-labelledby="reviewbyfilter">
<div class="dropdown-menu ratingDropDown" aria-labelledby="reviewbyfilter">
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
data-rating=
"desc"
>
Highest rating
</a>
<a class="dropdown-item
ratingHigest
" href="javascript:void(0);" data-rating="desc">Highest rating</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
data-rating=
"asc"
>
Lowest rating
</a>
<a class="dropdown-item
ratingLowest
" href="javascript:void(0);" data-rating="asc">Lowest rating</a>
</div>
</div>
</div>
</div>
-->
</div>
</div>
</div>
</div>
<!--location listing start-->
<!--location listing start-->
...
@@ -35,7 +44,11 @@
...
@@ -35,7 +44,11 @@
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<div
class=
"location_data-img"
>
<div
class=
"location_data-img"
>
@if(!empty($data['media'][0]['thumbnailUrl']))
<img
src=
"{{$data['media'][0]['thumbnailUrl']}}"
/>
@else
<img
src=
"vendor/frontend/img/location-img.png"
/>
<img
src=
"vendor/frontend/img/location-img.png"
/>
@endif
</div>
</div>
<div
class=
"location_data-content"
>
<div
class=
"location_data-content"
>
<h5
class=
"title"
>
<h5
class=
"title"
>
...
...
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