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
cb29aec7
Commit
cb29aec7
authored
Jul 24, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed project review point and also add 404 and 405 page
parent
b9b8d94a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
36 deletions
+52
-36
SearchController.php
application/app/Http/Controllers/SearchController.php
+48
-32
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+4
-4
No files found.
application/app/Http/Controllers/SearchController.php
View file @
cb29aec7
...
...
@@ -99,7 +99,9 @@ class SearchController extends Controller
}
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'meta'
))
->
render
();
$locality
=
$request
->
locality
;
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'meta'
,
'locality'
))
->
render
();
return
[
'status'
=>
'success'
,
'data'
=>
$html
];
}
...
...
@@ -113,22 +115,14 @@ class SearchController extends Controller
}))
->
first
();
if
(
!
empty
(
$pageData
)){
/*Fetch Locater ID*/
$locatorID
=
$pageData
->
locaterlists
->
locater_identity
;
$api_url
=
config
(
'app.api_location'
);
$locationDetailAPIdata
=
$this
->
call_api
(
$api_url
,
$locatorID
);
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.detail'
,
compact
(
'homepage'
,
'locatorID'
,
'locationDetailAPIdata'
,
'pageData'
));
}
else
{
return
view
(
'errors.404'
);
/*Fetch Locater ID*/
$locatorID
=
$pageData
->
locaterlists
->
locater_identity
;
}
$api_url
=
config
(
'app.api_location'
);
$locationDetailAPIdata
=
$this
->
call_api
(
$api_url
,
$locatorID
);
$homepage
=
Homepage
::
where
(
'homepages.status'
,
'='
,
'1'
)
->
first
();
return
view
(
'frontend.searchs.detail'
,
compact
(
'homepage'
,
'locatorID'
,
'locationDetailAPIdata'
,
'pageData'
));
}
...
...
@@ -138,19 +132,36 @@ class SearchController extends Controller
$api_url
=
config
(
'app.api_search'
);
$locationDetailAPIdata
=
$this
->
call_api_page
(
$api_url
,
$request
[
'query'
]);
$html
=
view
(
'frontend.searchs.autocomplete'
,
compact
(
'locationDetailAPIdata'
))
->
render
();
return
[
'status'
=>
'success'
,
'data'
=>
$html
];
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
]);
}
}
public
function
reviewPaginate
(
Request
$request
)
/**
* 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'
));
}
...
...
@@ -158,17 +169,22 @@ class SearchController extends Controller
public
function
getCityValue
(
Request
$request
)
{
$getCityData
=
City
::
where
(
'cities.name'
,
'!='
,
''
)
->
where
(
'cities.parent_id'
,
'='
,
$request
->
state
)
->
where
(
'cities.is_deleted'
,
'='
,
'0'
)
->
where
(
'cities.status'
,
'='
,
'1'
)
->
pluck
(
'name'
,
'id'
)
->
toarray
();
$getCityData
=
City
::
where
(
'cities.name'
,
'!='
,
''
)
->
where
(
'cities.parent_id'
,
'='
,
$request
->
state
)
->
pluck
(
'name'
,
'id'
)
->
toarray
();
$html
=
view
(
'frontend.searchs.city_dropdown'
,
compact
(
'getCityData'
))
->
render
();
return
[
'status'
=>
'success'
,
'data'
=>
$html
];
if
(
!
empty
(
$getCityData
)){
$html
=
view
(
'frontend.searchs.city_dropdown'
,
compact
(
'getCityData'
))
->
render
();
return
response
()
->
json
([
'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 @
cb29aec7
...
...
@@ -10,7 +10,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
"
value="
@
if
(
@
$locality
)
{{
$locality
}}
@
endif
"
placeholder="
--
Search
Nearby
--
">
<input type="
text
" class="
form
-
control
locality
" autocomplete="
off
" name="
locality
" placeholder="
--
Search
Nearby
--
">
<div id="
localitylist
"></div>
</div>
</div>
...
...
@@ -99,12 +99,12 @@
var
location
=
$
(
'.location'
).
val
();
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
e
.
preventDefault
();
$
.
ajax
({
type
:
'post'
,
url
:
"{{route('searchlocater')}}"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
locality
:
locality
,
location
:
location
,
state
:
state
,
city
:
city
},
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
locality
:
locality
,
location
:
location
,
state
:
state
,
city
:
city
,
ratingOrder
:
ratingOrder
},
success
:
function
(
datanew
)
{
if
(
datanew
.
status
==
'success'
)
{
//PRELOADER
...
...
@@ -147,9 +147,9 @@
url
:
"{{route('searchlocater')}}"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locality
:
locality
,
state
:
state
,
city
:
city
,
location
:
location
,
ratingOrder
:
ratingOrder
},
success
:
function
(
datanew
)
{
loader
();
$
(
'#searchlocaterid'
).
html
(
datanew
.
data
);
$
(
".locality"
).
val
(
locality
);
}
});
}
...
...
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