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
17f72d79
Commit
17f72d79
authored
Jul 15, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked on ajax request and 15 days key genrate
parent
ff42b581
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
372 additions
and
240 deletions
+372
-240
.gitignore
application/.gitignore
+1
-0
Apihelpers.php
application/app/Helpers/Apihelpers.php
+11
-2
SearchController.php
application/app/Http/Controllers/SearchController.php
+92
-46
ViewServiceProvider.php
application/app/Http/View/Composers/ViewServiceProvider.php
+38
-0
Apitraits.php
application/app/Traits/Apitraits.php
+83
-11
app.php
application/config/app.php
+2
-0
autocomplete.blade.php
application/resources/views/frontend/searchs/autocomplete.blade.php
+11
-6
detail.blade.php
application/resources/views/frontend/searchs/detail.blade.php
+26
-29
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+15
-111
location_element (copy).blade.php
application/resources/views/frontend/searchs/location_element (copy).blade.php
+0
-28
location_element.blade.php
application/resources/views/frontend/searchs/location_element.blade.php
+20
-7
review_element.blade.php
application/resources/views/frontend/searchs/review_element.blade.php
+72
-0
web.php
application/routes/web.php
+1
-0
apikey.dba
application/storage/apikey.dba
+0
-0
No files found.
application/.gitignore
View file @
17f72d79
...
...
@@ -2,6 +2,7 @@
/public/hot
/public/storage
/storage/*.key
/storage/apikey.dba
/vendor
.env
.phpunit.result.cache
...
...
application/app/Helpers/Apihelpers.php
View file @
17f72d79
...
...
@@ -2,19 +2,28 @@
namespace
App\Helpers
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\Storage
;
Trait
Apihelpers
Class
Apihelpers
{
public
static
function
review_api
(
$locatorID
=
null
)
{
$file
=
Storage
::
disk
(
'public'
)
->
path
(
'key/apikey.dba'
);
if
(
is_file
(
$file
))
{
$fh
=
fopen
(
$file
,
'r'
)
or
$this
->
traceLog
(
'Code Error #: Unable to create .dba file'
);
$api_key
=
fgets
(
$fh
);
}
$api
=
config
(
'app.api'
)
.
$locatorID
.
'/reviews'
;
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api
,[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
config
(
'app.api_key'
)
]
'Authorization'
=>
$api_key
]
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
...
...
application/app/Http/Controllers/SearchController.php
View file @
17f72d79
...
...
@@ -11,7 +11,7 @@ use App\Page;
use
DB
;
use
Validator
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Storage
;
class
SearchController
extends
Controller
{
...
...
@@ -26,22 +26,14 @@ class SearchController extends Controller
}
/**
* For Rendring index page first time and FetchData in DataBase and ApiData then Match both Data Then show final array with slug
*
* */
public
function
index
(
Request
$request
)
{
// $file = storage_path('app/key/apikey.dba');
/*$file = Storage::disk('public')->path('key/apikey.dba');
$contents = Storage::get($file);
print_r($file);die;*/
private
function
getApiData
(
$locality
=
null
,
$page
=
null
){
$api_url
=
config
(
'app.api_list'
);
$apiLocaterData
=
$this
->
call_api
(
''
,
$api_url
);
$apiLocaterData
=
$this
->
call_api_page
(
$api_url
,
$locality
,
$page
);
if
(
count
(
$apiLocaterData
[
'data'
])
<
1
)
return
''
;
if
(
count
(
$apiLocaterData
[
'data'
])
<
1
)
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
'No data found!'
]);
$locaterIds
=
collect
(
$apiLocaterData
[
'data'
])
->
pluck
(
'id'
);
...
...
@@ -68,9 +60,40 @@ class SearchController extends Controller
$links
=
$apiLocaterData
[
'links'
];
$meta
=
$apiLocaterData
[
'meta'
];
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
$data
=
array
();
$data
[
'finalData'
]
=
$finalData
;
$data
[
'links'
]
=
$links
;
$data
[
'meta'
]
=
$meta
;
return
response
()
->
json
([
'status'
=>
'success'
,
'data'
=>
$data
]);
}
return
view
(
'frontend.searchs.index'
,
compact
(
'homepage'
,
'finalData'
,
'links'
,
'meta'
));
/**
* For Rendring index page first time and FetchData in DataBase and ApiData then Match both Data Then show final array with slug
*
* */
public
function
index
(
Request
$request
)
{
$detail
=
$this
->
getApiData
();
$final
=
$detail
->
original
;
if
(
$final
[
'status'
]
==
'success'
){
$finalData
=
$final
[
'data'
][
'finalData'
];
$links
=
$final
[
'data'
][
'links'
];
$meta
=
$final
[
'data'
][
'meta'
];
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.index'
,
compact
(
'homepage'
,
'finalData'
,
'links'
,
'meta'
));
}
else
{
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
'No data found!'
]);
}
}
/**
...
...
@@ -78,39 +101,30 @@ class SearchController extends Controller
* */
public
function
searchlocator
(
Request
$request
)
{
$
api_url
=
config
(
'app.api_list'
);
$
detail
=
$this
->
getApiData
(
$request
[
'locality'
],
$request
[
'page'
]
);
$
apiLocaterData
=
$this
->
call_api_page
(
$api_url
,
$request
->
locality
,
$request
->
page
)
;
$
final
=
$detail
->
original
;
if
(
count
(
$apiLocaterData
[
'data'
])
<
1
)
return
''
;
if
(
$final
[
'status'
]
==
'success'
){
$locaterIds
=
collect
(
$apiLocaterData
[
'data'
])
->
pluck
(
'id'
);
$locaterData
=
Locater
::
whereIn
(
'locater_identity'
,
$locaterIds
)
->
with
(
array
(
'page'
=>
function
(
$query
)
{
$query
->
select
([
'locater_id'
,
'title'
,
'slug'
]);
}))
->
get
();
$finalData
=
$final
[
'data'
][
'finalData'
];
$links
=
$final
[
'data'
][
'links'
];
$meta
=
$final
[
'data'
][
'meta'
];
$locaterData
=
!
empty
(
$locaterData
)
?
$locaterData
->
groupBy
(
'locater_identity'
)
:
[];
$locality
=
$request
->
locality
;
$finalData
=
array_map
(
function
(
$data
)
use
(
$locaterData
)
{
$data
[
'slug'
]
=
null
;
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'meta'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'success'
,
'data'
=>
$html
]);
if
(
count
(
$locaterData
)
<
1
)
return
$data
;
if
(
isset
(
$locaterData
[
$data
[
'id'
]])
)
{
$data
[
'name'
]
=
$locaterData
[
$data
[
'id'
]][
0
]
->
name
;
$data
[
'slug'
]
=
$locaterData
[
$data
[
'id'
]][
0
]
->
page
->
slug
??
null
;
}
return
$data
;
},
$apiLocaterData
[
'data'
]);
}
else
{
$links
=
$apiLocaterData
[
'links'
];
$meta
=
$apiLocaterData
[
'meta'
];
$locality
=
$request
->
locality
;
return
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'meta'
));
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'meta'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
$html
]);
}
}
/**
...
...
@@ -126,8 +140,9 @@ class SearchController extends Controller
/*Fetch Locater ID*/
$locatorID
=
$pageData
->
locaterlists
->
locater_identity
;
$api_url
=
config
(
'app.api_location'
);
$locationDetailAPIdata
=
$this
->
call_api
(
$
locatorID
,
$api_url
);
$locationDetailAPIdata
=
$this
->
call_api
(
$
api_url
,
$locatorID
);
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.detail'
,
compact
(
'homepage'
,
'locatorID'
,
'locationDetailAPIdata'
,
'pageData'
));
...
...
@@ -137,9 +152,40 @@ class SearchController extends Controller
public
function
autocomplete
(
Request
$request
)
{
$api_url
=
config
(
'app.api_search'
);
$locationDetailAPIdata
=
$this
->
call_api
(
$request
[
'query'
],
$api_url
);
$locationDetailAPIdata
=
$this
->
call_api
_page
(
$api_url
,
$request
[
'query'
]);
return
view
(
'frontend.searchs.autocomplete'
,
compact
(
'locationDetailAPIdata'
));
if
(
empty
(
$locationDetailAPIdata
[
'data'
])){
$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'
,
'data'
=>
$html
]);
}
}
/**
* For render Review ajax
* */
public
function
reviewpaginate
(
Request
$request
)
{
$api_url
=
config
(
'app.api'
);
$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'
));
}
}
application/app/Http/View/Composers/ViewServiceProvider.php
0 → 100644
View file @
17f72d79
<?php
namespace
App\Providers
;
use
Illuminate\Support\Facades\View
;
use
Illuminate\Support\ServiceProvider
;
class
ViewServiceProvider
extends
ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public
function
register
()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public
function
boot
()
{
// Using class based composers...
View
::
composer
(
'homepage'
,
'App\Http\View\Composers\HomepageComposer'
);
// Using Closure based composers...
/*View::composer('dashboard', function ($view) {
//
});*/
}
}
\ No newline at end of file
application/app/Traits/Apitraits.php
View file @
17f72d79
...
...
@@ -2,41 +2,112 @@
namespace
App\Traits
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\Storage
;
Trait
Apitraits
{
public
function
getAPiKey
(){
$modifiedtime
=
Storage
::
lastModified
(
'key/apikey.dba'
);
$time
=
date
(
'd-m-Y'
,
$modifiedtime
);
$expieryDate
=
date
(
'd-m-Y'
,
strtotime
(
$time
.
' + 15 days'
));
$expieryUpdationDate
=
date
(
'd-m-Y'
,
strtotime
(
$expieryDate
.
' - 1 days'
));
$currentDate
=
date
(
'd-m-Y'
);
if
(
strtotime
(
$currentDate
)
==
strtotime
(
$expieryUpdationDate
)){
$file
=
Storage
::
disk
(
'public'
)
->
exists
(
'key/apikey.dba'
);
$api_key_url
=
config
(
'app.api_key_url'
);
$client
=
new
Client
();
$response
=
$client
->
request
(
'POST'
,
$api_key_url
,[
'form_params'
=>
[
'client_id'
=>
1
,
'client_secret'
=>
'DJXCYjyCRDt5IHMbiKYbiKqjVWdeNKo1VixHYQaL'
]
]);
$body
=
$response
->
getBody
()
->
getContents
();
$keyDetailAPIdata
=
json_decode
(
$body
,
true
);
$updateKey
=
Storage
::
disk
(
'public'
)
->
put
(
'key/apikey.dba'
,
$keyDetailAPIdata
[
'access_token'
]);
if
(
$updateKey
==
true
){
$api_key
=
Storage
::
get
(
'key/apikey.dba'
);
}
else
{
return
false
;
}
}
else
{
$file
=
Storage
::
disk
(
'public'
)
->
exists
(
'key/apikey.dba'
);
if
(
$file
==
true
){
$api_key
=
Storage
::
get
(
'key/apikey.dba'
);
}
else
{
return
false
;
}
}
return
$api_key
;
}
public
function
call_api
(
$
locatorID
=
null
,
$api_url
=
null
)
public
function
call_api
(
$
api_url
,
$locatorID
)
{
$apiKey
=
$this
->
getAPiKey
();
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api_url
.
$locatorID
,[
'headers'
=>
[
$response
=
$client
->
request
(
'GET'
,
$api_url
.
$locatorID
,
[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
config
(
'app.api_key'
)
]
'Authorization'
=>
$apiKey
]
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
public
function
call_api_page
(
$api_url
,
$locatorID
=
null
,
$page
=
1
)
public
function
call_api_page
(
$api_url
,
$locatorID
=
null
,
$page
=
1
)
{
$apiKey
=
$this
->
getAPiKey
();
$query_param
=
array
(
'keyword'
=>
$locatorID
,
'page'
=>
empty
(
$page
)
?
1
:
$page
);
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api_url
,[
'headers'
=>
[
$response
=
$client
->
request
(
'GET'
,
$api_url
,
[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
config
(
'app.api_key'
)
],
'Authorization'
=>
$apiKey
],
'query'
=>
$query_param
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
public
function
review_api_detail
(
$api_url
,
$locatorID
,
$page
=
1
)
{
$apiKey
=
$this
->
getAPiKey
();
$api
=
$api_url
.
$locatorID
.
'/reviews'
.
'/'
;
$query_param
=
array
(
'page'
=>
empty
(
$page
)
?
1
:
$page
);
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api
,
[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
$apiKey
],
'query'
=>
$query_param
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
}
\ No newline at end of file
application/config/app.php
View file @
17f72d79
...
...
@@ -128,6 +128,7 @@ return [
'api_location'
=>
env
(
'API_LOCATION'
),
'api_key'
=>
env
(
'API_KEY'
),
'api'
=>
env
(
'API'
),
'api_key_url'
=>
env
(
'API_KEY_URL'
),
/*
|--------------------------------------------------------------------------
...
...
@@ -184,6 +185,7 @@ return [
App\Providers\RouteServiceProvider
::
class
,
Unisharp\Ckeditor\ServiceProvider
::
class
,
Collective\Html\HtmlServiceProvider
::
class
,
//App\Http\View\Composers\ViewServiceProvider::class,
],
...
...
application/resources/views/frontend/searchs/autocomplete.blade.php
View file @
17f72d79
<ul
class=
"dropdown-menu"
style=
"display:block; position:relative"
>
@foreach($locationDetailAPIdata['data'] as $row)
<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
@
if
(
!
empty
(
$locationDetailAPIdata
[
'data'
]))
<
ul
class
="
dropdown
-
menu
" style="
display
:
block
;
position
:
relative
">
@foreach(
$locationDetailAPIdata['data']
as
$row
)
<li><i class="
mdi
mdi
-
map
-
marker
"></i><a href="
javascript
:
void
(
0
);
">{{
$row['name']
}}</a></li>
@endforeach
</ul>
@else
<ul class="
dropdown
-
menu
" style="
display
:
block
;
position
:
relative
">
<li><i class="
mdi
mdi
-
map
-
marker
"></i><a href="
javascript
:
void
(
0
);
"></a>No data found!</li>
</ul>
@endif
application/resources/views/frontend/searchs/detail.blade.php
View file @
17f72d79
...
...
@@ -173,6 +173,7 @@
<div
class=
"row "
>
<div
class=
"col-md-8 col-12"
>
<section
class=
"location_reviews"
>
<input
type=
"hidden"
value=
"{{ $locatorID }}"
id=
"locaterid"
>
<?php
$reviewData
=
Apihelpers
::
review_api
(
$locatorID
);
$totalreviewcount
=
count
(
$reviewData
);
...
...
@@ -256,33 +257,8 @@
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-12 card-columns"
>
@foreach($reviewData['data'] as $data)
<article
class=
"card"
>
<div
class=
"card-body"
>
<p
class=
"rev-name"
>
{{ $data['reviewer']['name'] }}
</p>
<figure
class=
"rev-img"
><img
src=
"{{ $data['reviewer']['photoUrl'] }}"
></figure>
<p><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=
"timestamp"
>
{{ $data['postedAt'] }}
</span>
</span>
</p>
<p
class=
"rev-text"
>
{{ $data['review'] }}
</p>
</div>
</article>
@endforeach
<article
class=
"text-center"
>
<button
class=
"btn btn-secondary"
type=
"button"
disabled
>
<span
class=
"spinner-grow spinner-grow-sm"
role=
"status"
aria-hidden=
"true"
></span>
Loading...
</button>
</article>
</div>
<div
class=
"row"
id=
"reviewElement"
>
@include('frontend.searchs.review_element')
</div>
</section>
...
...
@@ -354,4 +330,25 @@
</div>
</section>
@endsection
\ No newline at end of file
<script
type=
"text/javascript"
>
$
(
"#reviewElement"
).
on
(
'click'
,
'.pagination li a'
,
function
()
{
var
page
=
$
(
this
).
data
(
'page'
);
var
locatorID
=
$
(
'#locaterid'
).
val
();
reviewpaginate
(
page
,
locatorID
);
});
function
reviewpaginate
(
page
,
locatorID
){
$
.
ajax
({
type
:
'post'
,
url
:
"{{route('reviewpaginate')}}"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locatorID
:
locatorID
},
success
:
function
(
datanew
)
{
$
(
"#reviewElement"
).
html
(
datanew
);
$
(
"#locatorID"
).
val
(
locatorID
);
}
});
}
</script>
@endsection
\ No newline at end of file
application/resources/views/frontend/searchs/index.blade.php
View file @
17f72d79
...
...
@@ -50,105 +50,7 @@
<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
">
<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="
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>
</div>
<!--location listing start-->
<div class="
row
no
-
gutters
">
<div class="
mt
-
4
location_data
-
listing
">
<?php foreach(
$finalData
as
$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
">
@if(empty(
$data['slug']
))
{
{$data['name']}
}
@else
<a href="
{{
route
(
'detail'
,[
'slug'
=>
$data
[
'slug'
]])}}
"><?php echo
$data['name']
; ?></a>
@endif
</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]
; ?>
</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
">
<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
">
<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
">
<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
">
<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>
@include('frontend.searchs.location_element')
</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>
...
...
@@ -207,15 +109,6 @@
<script type="
text
/
javascript
">
/*var path = "
{{
route
(
'autocomplete'
)
}}
";
$('input.locality').typeahead({
source: function (query, process) {
return $.get(path, { query: query }, function (data) {
return process(data);
});
}
});*/
$(document).ready(function(){
$('.locality').keyup(function(){
var query = $(this).val();
...
...
@@ -226,8 +119,13 @@
data: {query: query},
success:function(data)
{
$('#localitylist').fadeIn();
$('#localitylist').html(data);
if(data.status == 'success') {
$('#localitylist').fadeIn();
$('#localitylist').html(data.data);
} else {
$('#localitylist').fadeIn();
$('#localitylist').html(data.data);
}
}
})
}
...
...
@@ -250,7 +148,13 @@
url: "
{{
route
(
'searchlocator'
)}}
",
data: $('form').serialize(),
success: function (datanew) {
$( "
#searchlocaterid" ).html( datanew );
/*$( "
#searchlocaterid" ).html( datanew );*/
if
(
datanew
.
status
==
'success'
)
{
$
(
'#searchlocaterid'
)
.
html
(
datanew
.
data
);
}
else
{
$
(
'#searchlocaterid'
)
.
html
(
datanew
.
data
);
}
}
});
});
...
...
application/resources/views/frontend/searchs/location_element (copy).blade.php
deleted
100644 → 0
View file @
ff42b581
@
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 @
17f72d79
<!--search count and filter start-->
@if(empty($finalData))
<div
class=
"row result_head"
>
<div
class=
"col-6"
>
<span
class=
"result_head-counts"
>
No data found!
</span>
</div>
<div>
<div
class=
"row no-gutters"
>
</div>
<div
class=
"pagination-wrapper justify-content-center"
>
</div>
@else
<div
class=
"row result_head"
>
<div
class=
"col-6"
>
<span
class=
"result_head-counts"
>
...
...
@@ -29,13 +41,13 @@
<img
src=
"vendor/frontend/img/location-img.png"
/>
</div>
<div
class=
"location_data-content"
>
<h5
class=
"title"
>
@if(empty($data['slug']))
{{$data['name']}}
@else
<a
href=
"{{route('detail',['slug'=>$data['slug']])}}"
>
<?php
echo
$data
[
'name'
];
?>
</a>
@endif
</h5>
<h5
class=
"title"
>
@if(empty($data['slug']))
{{$data['name']}}
@else
<a
href=
"{{route('detail',['slug'=>$data['slug']])}}"
>
<?php
echo
$data
[
'name'
];
?>
</a>
@endif
</h5>
<span
class=
"ratings"
>
<i
class=
"mdi mdi-star"
></i>
<i
class=
"mdi mdi-star"
></i>
...
...
@@ -101,3 +113,4 @@
</ul>
</nav>
</div>
@endif
application/resources/views/frontend/searchs/review_element.blade.php
0 → 100644
View file @
17f72d79
<div
class=
"col-12 card-columns"
>
@foreach($reviewData['data'] as $data)
<article
class=
"card"
>
<div
class=
"card-body"
>
<p
class=
"rev-name"
>
{{ $data['reviewer']['name'] }}
</p>
<figure
class=
"rev-img"
><img
src=
"{{ $data['reviewer']['photoUrl'] }}"
></figure>
<p><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=
"timestamp"
>
{{ $data['postedAt'] }}
</span>
</span>
</p>
<p
class=
"rev-text"
>
{{ $data['review'] }}
</p>
</div>
</article>
@endforeach
<article
class=
"text-center"
>
<!--<button class="btn btn-secondary" type="button" disabled>
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
Loading...
</button>-->
<!-- For Pagination -->
<div
class=
"pagination-wrapper justify-content-center"
>
<nav>
<ul
class=
"pagination"
>
<?php
$reviewData
[
'links'
][
'first'
]
=
explode
(
'page='
,
$reviewData
[
'links'
][
'first'
]);
if
(
!
empty
(
$reviewData
[
'links'
][
'last'
])){
$reviewData
[
'links'
][
'last'
]
=
explode
(
'page='
,
$reviewData
[
'links'
][
'last'
]);
}
else
{
$reviewData
[
'links'
][
'last'
]
=
''
;
}
if
(
!
empty
(
$reviewData
[
'links'
][
'prev'
])){
$reviewData
[
'links'
][
'prev'
]
=
explode
(
'page='
,
$reviewData
[
'links'
][
'prev'
]);
}
else
{
$reviewData
[
'links'
][
'prev'
]
=
''
;
}
if
(
!
empty
(
$reviewData
[
'links'
][
'next'
])){
$reviewData
[
'links'
][
'next'
]
=
explode
(
'page='
,
$reviewData
[
'links'
][
'next'
]);
}
else
{
$reviewData
[
'links'
][
'next'
]
=
''
;
}
?>
<li
class=
"page-item"
>
<a
class=
"page-link"
id=
"first"
title=
"First"
data-page=
"{{ $reviewData['links']['first'][1] }}"
href=
"javascript:void(0);"
>
<i
class=
"mdi mdi-chevron-double-left"
></i>
</a>
</li>
<li
class=
"page-item"
>
<a
class=
"page-link"
title=
"Prev"
href=
"javascript:void(0);"
id=
"prev"
data-page=
"@if(@$reviewData['links']['prev']) {{ $reviewData['links']['prev'][1] }} @else @endif"
aria-label=
"Previous"
>
<i
class=
"mdi mdi-chevron-left"
></i>
</a>
</li>
<li
class=
"page-item"
>
<a
class=
"page-link"
title=
"Next"
href=
"javascript:void(0);"
id=
"next"
data-page=
"@if(@$reviewData['links']['next']) {{ $reviewData['links']['next'][1] }} @else @endif"
name=
"next"
aria-label=
"Next"
>
<i
class=
"mdi mdi-chevron-right"
></i>
</a>
</li>
<li
class=
"page-item"
>
<a
class=
"page-link"
title=
"Last"
id=
"last"
data-page=
"{{ $reviewData['links']['last'][1] }}"
href=
"javascript:void(0);"
><i
class=
"mdi mdi-chevron-double-right"
></i></a>
</li>
</ul>
</nav>
</div>
<!-- End Pagination -->
</article>
</div>
\ No newline at end of file
application/routes/web.php
View file @
17f72d79
...
...
@@ -19,6 +19,7 @@ Route::get('/', 'SearchController@index')->name('search');
Route
::
post
(
'searchlocator'
,
'SearchController@searchlocator'
)
->
name
(
'searchlocator'
);
Route
::
get
(
'autocomplete'
,
'SearchController@autocomplete'
)
->
name
(
'autocomplete'
);
Route
::
get
(
'detail/{slug}'
,
'SearchController@detail'
)
->
name
(
'detail'
);
Route
::
post
(
'reviewpaginate'
,
'SearchController@reviewpaginate'
)
->
name
(
'reviewpaginate'
);
Auth
::
routes
();
...
...
application/storage/apikey.dba
deleted
100644 → 0
View file @
ff42b581
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