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
483cd5d2
Commit
483cd5d2
authored
Aug 08, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on feeds section, manges feed
parent
846088af
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
159 additions
and
53 deletions
+159
-53
FeedController.php
application/app/Http/Controllers/Admin/FeedController.php
+7
-0
HomepageController.php
application/app/Http/Controllers/Admin/HomepageController.php
+5
-0
CronController.php
application/app/Http/Controllers/CronController.php
+21
-5
SearchController.php
application/app/Http/Controllers/SearchController.php
+1
-0
FeedsImport.php
application/app/Imports/FeedsImport.php
+23
-19
Apitraits.php
application/app/Traits/Apitraits.php
+1
-1
adminlte.php
application/config/adminlte.php
+16
-4
feed_setting.blade.php
application/resources/views/admin/feeds/feed_setting.blade.php
+56
-0
feeds_mng.blade.php
application/resources/views/admin/feeds/feeds_mng.blade.php
+2
-0
edit.blade.php
application/resources/views/admin/homepages/edit.blade.php
+12
-7
homepages_mng.blade.php
application/resources/views/admin/homepages/homepages_mng.blade.php
+4
-10
web.php
application/routes/web.php
+7
-5
updatedquery.php
application/updatedquery.php
+4
-2
No files found.
application/app/Http/Controllers/Admin/FeedController.php
View file @
483cd5d2
...
...
@@ -227,4 +227,10 @@ class FeedController extends AdminController
return
redirect
()
->
route
(
'admin.feeds'
);
}
public
function
feedSetting
(){
return
view
(
'admin.feeds.feed_setting'
);
}
}
\ No newline at end of file
application/app/Http/Controllers/Admin/HomepageController.php
View file @
483cd5d2
...
...
@@ -106,6 +106,7 @@ class HomepageController extends AdminController
}
if
(
$request
->
all
())
{
//dd($request->all());
$show
=
trim
(
$request
->
show
);
$header_image_normal
=
trim
(
$request
->
header_image_normal
);
$header_image_mobile
=
trim
(
$request
->
header_image_mobile
);
$footer_image_normal
=
trim
(
$request
->
footer_image_normal
);
...
...
@@ -142,6 +143,10 @@ class HomepageController extends AdminController
if
(
!
empty
(
$request
->
footer_image_mobile
)){
$homepage
->
footer_image_mobile
=
$request
->
file
(
'footer_image_mobile'
)
->
store
(
'image'
);
}
if
(
$show
==
'on'
){
$homepage
->
show_feed
=
'1'
;
}
$homepage
->
meta_title
=
$meta_title
;
$homepage
->
meta_keyword
=
$meta_keyword
;
...
...
application/app/Http/Controllers/CronController.php
View file @
483cd5d2
...
...
@@ -111,12 +111,27 @@ class CronController extends Controller
]);
}
public
function
import
()
public
function
import
(
Request
$request
)
{
$file
=
Storage
::
path
(
'and-google-in.csv'
);
$data
=
Excel
::
import
(
new
FeedsImport
,
$file
);
echo
"Updated Successfully"
;
die
;
$url
=
"https://m2admin.anitadongre.com/pub/custom_script/feeds/envigo/sheet/and-google-in.csv"
;
$contents
=
file_get_contents
(
$url
);
$name
=
substr
(
$url
,
strrpos
(
$url
,
'/'
)
+
1
);
$data
=
Storage
::
put
(
$name
,
$contents
);
if
(
$data
==
true
){
$file
=
Storage
::
path
(
'and-google-in.csv'
);
$data
=
Excel
::
import
(
new
FeedsImport
,
$file
);
$msg
=
'Feeds has been updated successfully.'
;
$request
->
session
()
->
flash
(
'message'
,
$msg
);
return
redirect
()
->
route
(
'admin.feedSetting'
);
}
else
{
$msg
=
'Something went wrong!'
;
$request
->
session
()
->
flash
(
'error'
,
$msg
);
return
redirect
()
->
route
(
'admin.feedSetting'
);
}
}
}
\ No newline at end of file
application/app/Http/Controllers/SearchController.php
View file @
483cd5d2
...
...
@@ -73,6 +73,7 @@ class SearchController extends Controller
public
function
index
(
Request
$request
)
{
$final
=
$this
->
getApiData
();
if
(
$final
[
'status'
]
==
'success'
){
$finalData
=
$final
[
'data'
][
'finalData'
];
...
...
application/app/Imports/FeedsImport.php
View file @
483cd5d2
...
...
@@ -15,24 +15,27 @@ class FeedsImport implements ToModel, WithHeadingRow
*/
public
function
model
(
array
$row
)
{
return
new
LocaterFeed
([
'feeds_id'
=>
$row
[
'id'
],
'title'
=>
$row
[
'title'
],
'description'
=>
htmlentities
(
$row
[
'description'
]),
'gtin'
=>
$row
[
'gtin'
],
'brand'
=>
$row
[
'brand'
],
'color'
=>
$row
[
'color'
],
'size'
=>
trim
(
$row
[
'size'
]),
'link'
=>
$row
[
'link'
],
'image_link'
=>
$row
[
'image_link'
],
'availability'
=>
$row
[
'availability'
],
'product_condition'
=>
$row
[
'condition'
],
'item_group_id'
=>
$row
[
'item_group_id'
],
'google_product_category'
=>
$row
[
'google_product_category'
],
'product_type'
=>
$row
[
'product_type'
],
'sale_price'
=>
$row
[
'sale_price'
],
'price'
=>
$row
[
'price'
],
]);
$getLocaterFeedData
=
LocaterFeed
::
where
(
'is_deleted'
,
'='
,
'0'
)
->
pluck
(
'feeds_id'
,
'id'
)
->
toarray
();
if
(
!
in_array
(
$row
[
'id'
],
$getLocaterFeedData
)){
return
new
LocaterFeed
([
'feeds_id'
=>
$row
[
'id'
],
'title'
=>
$row
[
'title'
],
'description'
=>
htmlentities
(
$row
[
'description'
]),
'gtin'
=>
$row
[
'gtin'
],
'brand'
=>
$row
[
'brand'
],
'color'
=>
$row
[
'color'
],
'size'
=>
trim
(
$row
[
'size'
]),
'link'
=>
$row
[
'link'
],
'image_link'
=>
$row
[
'image_link'
],
'availability'
=>
$row
[
'availability'
],
'product_condition'
=>
$row
[
'condition'
],
'item_group_id'
=>
$row
[
'item_group_id'
],
'google_product_category'
=>
$row
[
'google_product_category'
],
'product_type'
=>
$row
[
'product_type'
],
'sale_price'
=>
$row
[
'sale_price'
],
'price'
=>
$row
[
'price'
],
]);
}
}
}
\ No newline at end of file
application/app/Traits/Apitraits.php
View file @
483cd5d2
...
...
@@ -35,7 +35,7 @@ Trait Apitraits
public
function
getAPiKey
(){
$file
=
Storage
::
disk
(
'public'
)
->
exists
(
'key/apikey.dba'
);
//echo $file; die;
if
(
$file
==
false
){
$api_key
=
$this
->
createFileAndPutApiKey
();
...
...
application/config/adminlte.php
View file @
483cd5d2
...
...
@@ -180,16 +180,28 @@ return [
'icon_color'
=>
'aqua'
,
],
[
'text'
=>
'Manage Feeds'
,
'url'
=>
'admin/feeds'
,
'icon_color'
=>
'aqua'
,
'text'
=>
'Feeds Setting'
,
'icon'
=>
'share'
,
'submenu'
=>
[
[
'text'
=>
'Manage Feeds'
,
'url'
=>
'admin/feeds'
,
'icon_color'
=>
'aqua'
,
],
[
'text'
=>
'Feed Update'
,
'url'
=>
'admin/feedSetting'
,
'icon_color'
=>
'red'
,
],
],
],
'SETTINGS'
,
[
'text'
=>
'Manage Home Page'
,
'url'
=>
'admin/homepages'
,
'icon_color'
=>
'red'
,
]
],
],
/*
...
...
application/resources/views/admin/feeds/feed_setting.blade.php
0 → 100644
View file @
483cd5d2
@
extends
(
'adminlte::page'
)
@
section
(
'content'
)
<
div
class
="
container
-
fluid
">
<div class="">
<div class="
col
-
sm
-
6
">
<h2>Update Feed</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
">Update Feed</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
<section class="
content
">
<div class="
container
-
fluid
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<!-- Horizontal Form -->
<div class="
box
box
-
info
">
<div class="
box
-
header
with
-
border
">
<h3 class="
box
-
title
"></h3>
<div class="
alert
alert
-
success
alert
-
dismissible
groputitle
" style="
display
:
none
">
</div>
@if(Session::has('message'))
<div class="
alert
alert
-
success
alert
-
dismissible
">
<button type="
button
" class="
close
" data-dismiss="
alert
" aria-hidden="
true
">×</button>
{!! session('message') !!}
</div>
@endif
<form id="
feeds
-
mng
" method="
get
" action="
{{
route
(
'admin.feeds'
)}}
">
{{ csrf_field() }}
<div class="
row
clearfix
">
<div class="
col
-
sm
-
2
">
<a href="
{{
route
(
'import'
)}}
" class="
btn
btn
-
block
btn
-
warning
">Updated Feed</a>
</div>
</div>
</form>
</div>
</div>
<!-- /.box -->
</div>
</div>
</div>
@endsection
application/resources/views/admin/feeds/feeds_mng.blade.php
View file @
483cd5d2
...
...
@@ -73,6 +73,7 @@
<th style="
width
:
10
px
">#</th>
<th>@sortablelink('feeds_id')</th>
<th>@sortablelink('title')</th>
<th>Feed Show</th>
<th>@sortablelink('created_at')</th>
<th style="
width
:
40
px
">Action</th>
</tr>
...
...
@@ -83,6 +84,7 @@
<td>
{
{$row->id}
}
</td>
<td>
{
{$row->feeds_id}
}
</td>
<td>
{
{$row->title}
}
</td>
<td><input type="
checkbox
" data-id=feed_data_<?php echo
$row->feeds_id
; ?> style="
width
:
20
px
;
height
:
20
px
;
" name="
show
"> </td>
<td>{{date("
F
j
,
Y
", strtotime(
$row->created_at
))}}</td>
<td style="
width
:
10
%
">
<a href="
{{
route
(
'admin.feeds.edit'
,[
'id'
=>
$row
->
id
])}}
" class="
btn
btn
-
info
btn
-
xs
action
-
btn
" title ="
Edit
"><span class="
glyphicon
glyphicon
-
pencil
" aria-hidden="
true
"></span></a>
...
...
application/resources/views/admin/homepages/edit.blade.php
View file @
483cd5d2
...
...
@@ -41,17 +41,22 @@
<!-- Custom Tabs -->
<div class="
nav
-
tabs
-
custom
">
<ul class="
nav
nav
-
tabs
">
<li class="
active
"><a href="
#other" data-toggle="tab" aria-expanded="true">
Other
</a></li>
<li class="
active
"><a href="
#other" data-toggle="tab" aria-expanded="true">
Show Feed
</a></li>
<
li
><
a
href
=
"#tab_1"
data
-
toggle
=
"tab"
aria
-
expanded
=
"false"
>
MAIN
</
a
></
li
>
<
li
class
=""><
a
href
=
"#tab_2"
data
-
toggle
=
"tab"
aria
-
expanded
=
"false"
>
SEO
</
a
></
li
>
</
ul
>
<
div
class
="
tab
-
content
">
<div class="
tab
-
pane
active
" id="
other
">
<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
" value="
{{
old
(
'other_setting'
,
@
$data
->
other_setting
)}}
">
</div>
<div class="
form
-
group
">
<div class="
form
-
line
">
<?php
if(
$data->show_feed
== 1){
$checked
= "
checked
";
} ?>
<input <?php echo
$checked
; ?> type="
checkbox
" style="
width
:
25
px
;
height
:
25
px
;
" name="
show
">
<span><b>Checked check box if you want to show feeds in detail page.</b></span>
<br>
</div>
</div>
</div>
<div class="
tab
-
pane
" id="
tab_1
">
...
...
@@ -115,7 +120,7 @@
<!-- /.box-body -->
<div class="
box
-
footer
">
<input type="
submit
" value="
Submit
" class="
btn
btn
-
info
">
<a href="
{{
route
(
'admin.pages'
)}}
" class="
btn
btn
-
default
">Cancel</a>
<a href="
{{
route
(
'admin.
home
pages'
)}}
" class="
btn
btn
-
default
">Cancel</a>
</div>
<!-- /.box-footer -->
</form>
...
...
application/resources/views/admin/homepages/homepages_mng.blade.php
View file @
483cd5d2
...
...
@@ -35,7 +35,7 @@
<form id="
homepages
-
mng
" method="
get
" action="
{{
route
(
'admin.homepages'
)}}
">
{{ csrf_field() }}
<div class="
row
clearfix
">
<div class="
col
-
sm
-
2
">
<
!--<
div class="
col
-
sm
-
2
">
<div class="
form
-
group
">
<div class="
form
-
line
">
<input class="
form
-
control
" name="
keyword
" value="
{{
old
(
'keyword'
,
$request
->
keyword
)}}
" placeholder="
Keyword
" type="
text
">
...
...
@@ -45,19 +45,13 @@
<div class="
col
-
sm
-
4
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
info
">Search<div></div></button>
<a href="
{{
route
(
'admin.homepages'
)}}
" class="
btn
btn
-
primary
btn
-
success
">Reset</a>
</div>
</div>
-->
<div class="
col
-
sm
-
2
pull
-
right
">
<a href="
{{
route
(
'admin.homepages.add'
)}}
" class="
btn
btn
-
block
btn
-
warning
">Add Homepages</a>
</div>
</div>
</form>
@if(Session::has('message'))
<div class="
alert
alert
-
success
alert
-
dismissible
">
<button type="
button
" class="
close
" data-dismiss="
alert
" aria-hidden="
true
">×</button>
{!! session('message') !!}
</div>
@endif
</div>
...
...
@@ -71,7 +65,7 @@
<table class="
table
table
-
bordered
">
<tr>
<th style="
width
:
10
px
">#</th>
<th>
@sortablelink('other_setting')
</th>
<th>
Setting
</th>
<th>@sortablelink('created_at')</th>
<th style="
width
:
40
px
">Action</th>
</tr>
...
...
@@ -80,7 +74,7 @@
@foreach(
$data['records']
as
$row
)
<tr>
<td>
{
{$row->id}
}
</td>
<td>
{
{$row->other_setting}
}
</td>
<td>
Setting
</td>
<td>{{date("
F
j
,
Y
", strtotime(
$row->created_at
))}}</td>
<td style="
width
:
10
%
">
<a href="
{{
route
(
'admin.homepages.edit'
,[
'id'
=>
$row
->
id
])}}
" class="
btn
btn
-
info
btn
-
xs
action
-
btn
" title ="
Edit
"><span class="
glyphicon
glyphicon
-
pencil
" aria-hidden="
true
"></span></a>
...
...
application/routes/web.php
View file @
483cd5d2
...
...
@@ -62,7 +62,7 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
get
(
'locaters/{id}/delete'
,
'LocaterController@deleteLocater'
)
->
name
(
'admin.locaters.delete'
);
/* For manage pages */
Route
::
any
(
'pages'
,
'PageController@pagesList'
)
->
name
(
'admin.pages'
);
Route
::
get
(
'pages'
,
'PageController@pagesList'
)
->
name
(
'admin.pages'
);
Route
::
get
(
'pages/create'
,
'PageController@createPage'
)
->
name
(
'admin.pages.add'
);
Route
::
post
(
'pages/create'
,
'PageController@savePage'
)
->
name
(
'admin.pages.save'
);
Route
::
get
(
'pages/{id}/edit'
,
'PageController@editPage'
)
->
name
(
'admin.pages.edit'
);
...
...
@@ -70,7 +70,7 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
get
(
'pages/{id}/delete'
,
'PageController@deletePage'
)
->
name
(
'admin.pages.delete'
);
/* For manage offers */
Route
::
any
(
'offers'
,
'OfferController@offersList'
)
->
name
(
'admin.offers'
);
Route
::
get
(
'offers'
,
'OfferController@offersList'
)
->
name
(
'admin.offers'
);
Route
::
get
(
'offers/create'
,
'OfferController@createOffer'
)
->
name
(
'admin.offers.add'
);
Route
::
post
(
'offers/create'
,
'OfferController@saveOffer'
)
->
name
(
'admin.offers.save'
);
Route
::
get
(
'offers/{id}/edit'
,
'OfferController@editOffer'
)
->
name
(
'admin.offers.edit'
);
...
...
@@ -78,7 +78,7 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
get
(
'offers/{id}/delete'
,
'OfferController@deleteOffer'
)
->
name
(
'admin.offers.delete'
);
/* For manage homepages */
Route
::
any
(
'homepages'
,
'HomepageController@homepagesList'
)
->
name
(
'admin.homepages'
);
Route
::
get
(
'homepages'
,
'HomepageController@homepagesList'
)
->
name
(
'admin.homepages'
);
Route
::
get
(
'homepages/create'
,
'HomepageController@createHomepage'
)
->
name
(
'admin.homepages.add'
);
Route
::
post
(
'homepages/create'
,
'HomepageController@saveHomepage'
)
->
name
(
'admin.homepages.save'
);
Route
::
get
(
'homepages/{id}/edit'
,
'HomepageController@editHomepage'
)
->
name
(
'admin.homepages.edit'
);
...
...
@@ -86,7 +86,7 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
get
(
'homepages/{id}/delete'
,
'HomepageController@deleteHomepage'
)
->
name
(
'admin.homepages.delete'
);
/* For manage Cities */
Route
::
any
(
'cities'
,
'CityController@citiesList'
)
->
name
(
'admin.cities'
);
Route
::
get
(
'cities'
,
'CityController@citiesList'
)
->
name
(
'admin.cities'
);
Route
::
get
(
'cities/create'
,
'CityController@createCity'
)
->
name
(
'admin.cities.add'
);
Route
::
post
(
'cities/create'
,
'CityController@saveCity'
)
->
name
(
'admin.cities.save'
);
Route
::
get
(
'cities/{id}/edit'
,
'CityController@editCity'
)
->
name
(
'admin.cities.edit'
);
...
...
@@ -95,11 +95,13 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
post
(
'getParentValue'
,
'CityController@getParentValue'
)
->
name
(
'getParentValue'
);
/* For manage Locater Feeds */
Route
::
any
(
'feeds'
,
'FeedController@feedsList'
)
->
name
(
'admin.feeds'
);
Route
::
get
(
'feeds'
,
'FeedController@feedsList'
)
->
name
(
'admin.feeds'
);
Route
::
get
(
'feeds/create'
,
'FeedController@createFeed'
)
->
name
(
'admin.feeds.add'
);
Route
::
post
(
'feeds/create'
,
'FeedController@saveFeed'
)
->
name
(
'admin.feeds.save'
);
Route
::
get
(
'feeds/{id}/edit'
,
'FeedController@editFeed'
)
->
name
(
'admin.feeds.edit'
);
Route
::
post
(
'feeds/{id}/edit'
,
'FeedController@updateFeed'
)
->
name
(
'admin.feeds.update'
);
Route
::
get
(
'feeds/{id}/delete'
,
'FeedController@deleteFeed'
)
->
name
(
'admin.feeds.delete'
);
Route
::
get
(
'feedSetting'
,
'FeedController@feedSetting'
)
->
name
(
'admin.feedSetting'
);
});
application/updatedquery.php
View file @
483cd5d2
...
...
@@ -2,4 +2,6 @@ For cron
RUN
on
browser
:
WWW_ROOT
./
cron
/
getLocaterListData
RUN
on
browser
:
WWW_ROOT
./
cron
/
getState
RUN
on
browser
:
WWW_ROOT
./
cron
/
getCity
\ No newline at end of file
RUN
on
browser
:
WWW_ROOT
./
cron
/
getCity
ALTER
TABLE
`homepages`
CHANGE
`other_setting`
`show_feed`
VARCHAR
(
255
)
CHARACTER
SET
latin1
COLLATE
latin1_swedish_ci
NOT
NULL
;
\ No newline at end of file
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