Commit c57c32de by Ajay Barthwal

Merge branch 'develop' into 'master'

Develop

See merge request !7
parents abae957f f25b9b14
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Admin\AdminController;
use App\LocaterFeed;
use DB;
use Validator;
use Illuminate\Support\Facades\Hash;
class FeedController extends AdminController
{
const RECORD_PER_PAGE = 10;
public function __construct()
{
$this->middleware('auth');
}
public function feedsList(Request $request) {
$admin_id = $request->session()->get('id');
$pageNo = trim($request->input('page', 1));
DB::enableQueryLog();
$keyword = strtolower(trim($request->input('keyword')));
$feedList = LocaterFeed::where('locater_feeds.is_deleted', '=', '0');
$count = LocaterFeed::where('locater_feeds.is_deleted', '=', '0')->count();
if($keyword)
{
$feedList = $feedList->where(function ($query) use ($keyword) {
$query->orwhere('locater_feeds.title', 'like', '%'.$keyword);
});
}
$this->data['records'] = $feedList->sortable(['id'=>'desc'])->paginate(Self::RECORD_PER_PAGE);
$queries = DB::getQueryLog();
return view('admin.feeds.feeds_mng', ['data' => $this->data,'pageNo' => @$pageNo, 'record_per_page' => Self::RECORD_PER_PAGE,'request'=>$request]);
}
public function createFeed(){
return view('admin.feeds.add');
}
public function saveFeed(Request $request) {
$user_id = auth()->user('id');
if ($request->all()) {
$feeds_id = trim($request->feeds_id);
$title = trim($request->title);
$description = trim($request->description);
$gtin = trim($request->gtin);
$brand = trim($request->brand);
$color = trim($request->color);
$size = trim($request->size);
$link = trim($request->link);
$image_link = trim($request->image_link);
$availability = trim($request->availability);
$product_condition = trim($request->product_condition);
$item_group_id = trim($request->item_group_id);
$google_product_category = trim($request->google_product_category);
$product_type = trim($request->product_type);
$sale_price = trim($request->sale_price);
$price = trim($request->price);
$status = trim($request->status);
$validator = Validator::make($request->all(), [
'feeds_id' => 'required',
'title' => 'required',
'description' => 'required',
'gtin' => 'required',
'brand' => 'required',
'color' => 'required',
'size' => 'required',
'link' => 'required',
'image_link' => 'required',
'availability' => 'required',
'product_condition' => 'required',
'item_group_id' => 'required',
'google_product_category' => 'required',
'product_type' => 'required',
'sale_price' => 'required',
'price' => 'required',
'status' => 'required',
]);
if ($validator->fails())
{
return redirect()->route('admin.feeds.add')
->withErrors($validator)
->withInput();
}
else
{
$feed = new LocaterFeed;
$feed->feeds_id = $feeds_id;
$feed->title = $title;
$feed->description = $description;
$feed->gtin = $gtin;
$feed->brand = $brand;
$feed->color = $color;
$feed->size = $size;
$feed->link = $link;
$feed->image_link = $image_link;
$feed->availability = $availability;
$feed->product_condition = $product_condition;
$feed->item_group_id = $item_group_id;
$feed->google_product_category = $google_product_category;
$feed->product_type = $product_type;
$feed->sale_price = $sale_price;
$feed->price = $price;
$feed->status = $status;
$feed->save();
$msg = 'Feed has been added successfully.';
$request->session()->flash('add_message', $msg);
return redirect()->route('admin.feeds');
}
}
}
public function editFeed(Request $request, $id){
if(!empty($id)){
$data = LocaterFeed::find($id);
}
return view('admin.feeds.edit', compact(array('data')));
}
public function updateFeed(Request $request, $id) {
$user_id = auth()->user('id');
$data = array();
if(!empty($id)){
$data = LocaterFeed::find($id);
}
if ($request->all()) {
$feeds_id = trim($request->feeds_id);
$title = trim($request->title);
$description = trim($request->description);
$gtin = trim($request->gtin);
$brand = trim($request->brand);
$color = trim($request->color);
$size = trim($request->size);
$link = trim($request->link);
$image_link = trim($request->image_link);
$availability = trim($request->availability);
$product_condition = trim($request->product_condition);
$item_group_id = trim($request->item_group_id);
$google_product_category = trim($request->google_product_category);
$product_type = trim($request->product_type);
$sale_price = trim($request->sale_price);
$price = trim($request->price);
$status = trim($request->status);
$validator = Validator::make($request->all(), [
'feeds_id' => 'required',
'title' => 'required',
'description' => 'required',
'gtin' => 'required',
'brand' => 'required',
'color' => 'required',
'size' => 'required',
'link' => 'required',
'image_link' => 'required',
'availability' => 'required',
'product_condition' => 'required',
'item_group_id' => 'required',
'google_product_category' => 'required',
'product_type' => 'required',
'sale_price' => 'required',
'price' => 'required',
'status' => 'required',
]);
if ($validator->fails()) {
return redirect()->route('admin.feeds.edit',['id'=>$id])
->withErrors($validator)
->withInput();
} else {
$feed = LocaterFeed::find($id);
$feed->feeds_id = $feeds_id;
$feed->title = $title;
$feed->description = $description;
$feed->gtin = $gtin;
$feed->brand = $brand;
$feed->color = $color;
$feed->size = $size;
$feed->link = $link;
$feed->image_link = $image_link;
$feed->availability = $availability;
$feed->product_condition = $product_condition;
$feed->item_group_id = $item_group_id;
$feed->google_product_category = $google_product_category;
$feed->product_type = $product_type;
$feed->sale_price = $sale_price;
$feed->price = $price;
$feed->status = $status;
$feed->save();
$msg = 'Feed has been updated successfully.';
$request->session()->flash('add_message', $msg);
return redirect()->route('admin.feeds');
}
}
else {
return view('admin.feeds.add', ['data' => $data, 'request' => $request]);
}
}
public function deleteFeed($id, Request $request) {
if ($id) {
$feed = LocaterFeed::find($id);
$feed->is_deleted = '1';
if($feed->save()){
$msg = 'Feed has been deleted successfully.';
$request->session()->flash('message', $msg);
}
}
return redirect()->route('admin.feeds');
}
public function feedSetting(){
return view('admin.feeds.feed_setting');
}
public function updateShowFeed(Request $request){
if($request->showFeed == 'true'){
$show_feed = '1';
}else{
$show_feed = '0';
}
$updateShowFeed = LocaterFeed::where('locater_feeds.id', '=', $request->id)
->update(['show_feed' => $show_feed]);
return [
'status' => 'success',
'data' => 'done'
];
}
}
\ No newline at end of file
......@@ -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,12 @@ 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';
}else{
$homepage->show_feed = '0';
}
$homepage->meta_title = $meta_title;
$homepage->meta_keyword = $meta_keyword;
......
......@@ -11,6 +11,9 @@ use App\Page;
use App\City;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Storage;
//use App\Exports\UsersExport;
use App\Imports\FeedsImport;
use Maatwebsite\Excel\Facades\Excel;
......@@ -108,4 +111,27 @@ class CronController extends Controller
]);
}
public function import(Request $request)
{
$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
......@@ -8,6 +8,7 @@ use App\Traits\Apitraits;
use App\Locater;
use App\Page;
use App\City;
use App\LocaterFeed;
use DB;
use Validator;
use Illuminate\Support\Facades\Hash;
......@@ -31,7 +32,7 @@ class SearchController extends Controller
$api_url = config('app.api_list');
$apiLocaterData = $this->call_api_page($api_url, $locality, $state, $city, $location, $ratingOrder, $page);
if ( count($apiLocaterData['data']) < 1 )
return ['status' => 'error', 'data' => 'No data found!'];
......@@ -120,8 +121,10 @@ class SearchController extends Controller
$api_url = config('app.api_location');
$locationDetailAPIdata = $this->call_api($api_url,$locatorID);
$feedDetail = LocaterFeed::where('locater_feeds.status', '=', '1')->take(6)->get();
return view('frontend.searchs.detail', compact('locatorID','locationDetailAPIdata','pageData'));
return view('frontend.searchs.detail', compact('locatorID', 'locationDetailAPIdata', 'pageData', 'feedDetail'));
}
......
<?php
namespace App\Imports;
use App\LocaterFeed;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
class FeedsImport implements ToModel, WithHeadingRow
{
/**
* @param array $row
*
* @return \Illuminate\Database\Eloquent\Model|null
*/
public function model(array $row)
{
$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
<?php
namespace App\Exports;
use App\User;
use Maatwebsite\Excel\Concerns\FromCollection;
class UsersExport implements FromCollection
{
/**
* @return \Illuminate\Support\Collection
*/
public function collection()
{
return User::all();
}
}
\ No newline at end of file
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;
use Kyslik\ColumnSortable\Sortable;
class LocaterFeed extends Model
{
use Notifiable;
use Sortable;
protected $table = 'locater_feeds';
protected $fillable = ['feeds_id','title','description','gtin','brand','color','size','link','image_link','availability','product_condition','item_group_id','google_product_category','product_type','sale_price','price'];
}
......@@ -30,5 +30,9 @@ class AppServiceProvider extends ServiceProvider
view()->composer('layouts.footer', function ($view) {
$view->with('homepage', \App\Homepage::homepage());
});
view()->composer('frontend.searchs.detail', function ($view) {
$view->with('homepage', \App\Homepage::homepage());
});
}
}
......@@ -35,7 +35,7 @@ Trait Apitraits
public function getAPiKey(){
$file = Storage::disk('public')->exists('key/apikey.dba');
if($file == false){
$api_key = $this->createFileAndPutApiKey();
......@@ -47,8 +47,9 @@ Trait Apitraits
$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)){
if(strtotime($currentDate) >= strtotime($expieryUpdationDate)){
$file = Storage::disk('public')->exists('key/apikey.dba');
$api_key_url = config('app.api_key_url');
......@@ -105,7 +106,7 @@ Trait Apitraits
public function call_api_page($api_url, $locatorID=null, $state=null, $city=null, $location=null, $ratingOrder=null, $page=1)
{
$apiKey = $this->getAPiKey();
if(!empty($locatorID)){
$locatorID = $locatorID;
}else{
......
......@@ -16,6 +16,7 @@
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.8",
"maatwebsite/excel": "^3.1",
"unisharp/laravel-ckeditor": "^4.7"
},
"require-dev": {
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1f18c88ad17dd9b340133e3777d7ad74",
"content-hash": "9aa5ff5eb3d0ea007715a55d547c5b93",
"packages": [
{
"name": "dnoegel/php-xdg-base-dir",
......@@ -1125,6 +1125,239 @@
"time": "2019-06-18T20:09:29+00:00"
},
{
"name": "maatwebsite/excel",
"version": "3.1.15",
"source": {
"type": "git",
"url": "https://github.com/Maatwebsite/Laravel-Excel.git",
"reference": "7d47c7af2ddcf93b4fee4f167e10702e918f69f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/7d47c7af2ddcf93b4fee4f167e10702e918f69f1",
"reference": "7d47c7af2ddcf93b4fee4f167e10702e918f69f1",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*",
"opis/closure": "^3.1",
"php": "^7.0",
"phpoffice/phpspreadsheet": "^1.6"
},
"require-dev": {
"mockery/mockery": "^1.1",
"orchestra/database": "^3.8",
"orchestra/testbench": "^3.8",
"phpunit/phpunit": "^8.0",
"predis/predis": "^1.1"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
],
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
}
}
},
"autoload": {
"psr-4": {
"Maatwebsite\\Excel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@maatwebsite.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"keywords": [
"PHPExcel",
"batch",
"csv",
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
],
"time": "2019-07-16T08:40:48+00:00"
},
{
"name": "markbaker/complex",
"version": "1.4.7",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"phpcompatibility/php-compatibility": "^8.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
},
"files": [
"classes/src/functions/abs.php",
"classes/src/functions/acos.php",
"classes/src/functions/acosh.php",
"classes/src/functions/acot.php",
"classes/src/functions/acoth.php",
"classes/src/functions/acsc.php",
"classes/src/functions/acsch.php",
"classes/src/functions/argument.php",
"classes/src/functions/asec.php",
"classes/src/functions/asech.php",
"classes/src/functions/asin.php",
"classes/src/functions/asinh.php",
"classes/src/functions/atan.php",
"classes/src/functions/atanh.php",
"classes/src/functions/conjugate.php",
"classes/src/functions/cos.php",
"classes/src/functions/cosh.php",
"classes/src/functions/cot.php",
"classes/src/functions/coth.php",
"classes/src/functions/csc.php",
"classes/src/functions/csch.php",
"classes/src/functions/exp.php",
"classes/src/functions/inverse.php",
"classes/src/functions/ln.php",
"classes/src/functions/log2.php",
"classes/src/functions/log10.php",
"classes/src/functions/negative.php",
"classes/src/functions/pow.php",
"classes/src/functions/rho.php",
"classes/src/functions/sec.php",
"classes/src/functions/sech.php",
"classes/src/functions/sin.php",
"classes/src/functions/sinh.php",
"classes/src/functions/sqrt.php",
"classes/src/functions/tan.php",
"classes/src/functions/tanh.php",
"classes/src/functions/theta.php",
"classes/src/operations/add.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"time": "2018-10-13T23:28:42+00:00"
},
{
"name": "markbaker/matrix",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "6ea97472b5baf12119b4f31f802835b820dd6d64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/6ea97472b5baf12119b4f31f802835b820dd6d64",
"reference": "6ea97472b5baf12119b4f31f802835b820dd6d64",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"phpcompatibility/php-compatibility": "^8.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
},
"files": [
"classes/src/functions/adjoint.php",
"classes/src/functions/antidiagonal.php",
"classes/src/functions/cofactors.php",
"classes/src/functions/determinant.php",
"classes/src/functions/diagonal.php",
"classes/src/functions/identity.php",
"classes/src/functions/inverse.php",
"classes/src/functions/minors.php",
"classes/src/functions/trace.php",
"classes/src/functions/transpose.php",
"classes/src/operations/add.php",
"classes/src/operations/directsum.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"time": "2018-11-04T22:12:12+00:00"
},
{
"name": "monolog/monolog",
"version": "1.24.0",
"source": {
......@@ -1420,6 +1653,100 @@
"time": "2018-07-02T15:55:56+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "0c1346a1956347590b7db09533966307d20cb7cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/0c1346a1956347590b7db09533966307d20cb7cc",
"reference": "0c1346a1956347590b7db09533966307d20cb7cc",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"markbaker/complex": "^1.4",
"markbaker/matrix": "^1.1",
"php": "^5.6|^7.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"doctrine/instantiator": "^1.0.0",
"dompdf/dompdf": "^0.8.0",
"friendsofphp/php-cs-fixer": "@stable",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "^7.0.0",
"phpcompatibility/php-compatibility": "^8.0",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.3",
"tecnickcom/tcpdf": "^6.2"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
},
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"time": "2019-07-08T21:21:25+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.5.0",
"source": {
......
......@@ -179,12 +179,29 @@ return [
'url' => 'admin/offers',
'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',
]
],
],
/*
......
......@@ -170,6 +170,9 @@ return [
Illuminate\View\ViewServiceProvider::class,
JeroenNoten\LaravelAdminLte\ServiceProvider::class,
Kyslik\ColumnSortable\ColumnSortableServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class,
/*
* Package Service Providers...
......@@ -239,6 +242,7 @@ return [
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\FormFacade::class,
'Apihelpers' => App\Helpers\Apihelpers::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
],
......
@extends('adminlte::page')
@section('content')
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Locater</h1>
</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">Create 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('add_message'))
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{!! session('add_message') !!}
</div>
@endif
<form class="form-horizontal" id="add-feedform" action="{{route('admin.feeds.save')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="box-body">
<div class="form-group @if($errors->first('feeds_id')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Feed ID<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="feeds_id" class="form-control" placeholder="Feed ID">
<?php if(@$errors->first('feeds_id')) { ?> <span class="help-block">{{@$errors->first('feeds_id')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('title')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Title<em>*</em></label>
<div class="col-sm-6">
<input type="text" name="title" class="form-control" placeholder="Title">
<?php if(@$errors->first('title')) { ?> <span class="help-block">{{@$errors->first('title')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('description')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Description</label>
<div class="col-sm-10">
<textarea class="form-control" id="description" name="description">
<?php if(isset($data->description) && !empty($data->description)){ ?>
{{$data->description}}
<?php } ?>
</textarea>
</div>
</div>
<div class="form-group @if($errors->first('gtin')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Gtin<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="gtin" class="form-control" placeholder="gtin">
<?php if(@$errors->first('gtin')) { ?> <span class="help-block">{{@$errors->first('gtin')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('brand')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Brand<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="brand" class="form-control" placeholder="brand">
<?php if(@$errors->first('brand')) { ?> <span class="help-block">{{@$errors->first('brand')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('color')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Color<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="color" class="form-control" placeholder="color">
<?php if(@$errors->first('color')) { ?> <span class="help-block">{{@$errors->first('color')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('size')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Size<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="size" class="form-control" placeholder="size">
<?php if(@$errors->first('size')) { ?> <span class="help-block">{{@$errors->first('size')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('link')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Link<em>*</em></label>
<div class="col-sm-6">
<input type="textarea" name="link" class="form-control" placeholder="link">
<?php if(@$errors->first('link')) { ?> <span class="help-block">{{@$errors->first('link')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('image_link')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Image Link<em>*</em></label>
<div class="col-sm-6">
<input type="textarea" name="image_link" class="form-control" placeholder="image_link">
<?php if(@$errors->first('image_link')) { ?> <span class="help-block">{{@$errors->first('image_link')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('availability')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Availability<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('in stock'=>'In stock'); ?>
<select name="availability" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
@endforeach
</select>
</div>
</div>
<div class="form-group @if($errors->first('product_condition')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Product Condition<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('NEW'=>'NEW'); ?>
<select name="product_condition" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
@endforeach
</select>
</div>
</div>
<div class="form-group @if($errors->first('item_group_id')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Item Group Id<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="item_group_id" class="form-control" placeholder="item_group_id">
<?php if(@$errors->first('item_group_id')) { ?> <span class="help-block">{{@$errors->first('item_group_id')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('google_product_category')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Google Product Category<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="google_product_category" class="form-control" placeholder="google_product_category">
<?php if(@$errors->first('google_product_category')) { ?> <span class="help-block">{{@$errors->first('google_product_category')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('product_type')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Product Type<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="product_type" class="form-control" placeholder="product_type">
<?php if(@$errors->first('product_type')) { ?> <span class="help-block">{{@$errors->first('product_type')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('sale_price')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Sale Price<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="sale_price" class="form-control" placeholder="sale_price">
<?php if(@$errors->first('sale_price')) { ?> <span class="help-block">{{@$errors->first('sale_price')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('price')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Price<em>*</em></label>
<div class="col-sm-4">
<input type="textarea" name="price" class="form-control" placeholder="price">
<?php if(@$errors->first('price')) { ?> <span class="help-block">{{@$errors->first('price')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('status')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Status<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('1'=>'Active','0'=>'In Active'); ?>
<select name="status" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
@endforeach
</select>
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<input type="submit" value="Submit" class="btn btn-info">
<a href="{{route('admin.feeds')}}" class="btn btn-default">Cancel</a>
</div>
<!-- /.box-footer -->
</form>
</div>
</div>
<!--/.col (right) -->
</div>
</div>
</div>
<style>
.help-block{
color:red;
}
.error{
color:red;
}
</style>
<script type="text/javascript">
$( document ).ready(function() {
$.validator.addMethod('filesize', function(value, element, param) {
return this.optional(element) || (element.files[0].size <= param)
});
$.validator.addMethod("alphanumspecial", function (value, element) {
return this.optional(element) || /^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{6,})/i.test(value);
}, "Combination of alphabets,special characters & numeric values required.");
$('#add-feedform').validate({
ignore: ".ignore",
rules: {
feeds_id: "required",
title: "required",
description: "required",
gtin: "required",
brand: "required",
color: "required",
size: "required",
link: "required",
image_link: "required",
availability: "required",
product_condition: "required",
item_group_id: "required",
google_product_category: "required",
product_type: "required",
sale_price: "required",
price: "required",
status: "required",
},
// Specify validation error messages
messages: {
feeds_id:"Please enter Feed ID.",
title:"Please enter Titale.",
description: "Please enter Description.",
gtin: "Please enter Gtin.",
brand: "Please enter Brand.",
color: "Please enter Color",
size: "Please enter Size.",
link: "Please enter Link.",
image_link: "Please enter Image Link.",
availability: "Please select availabilty.",
product_condition: "Please select Product Condition.",
item_group_id: "Please enter Item Group Id.",
google_product_category: "Please enter Google Product Category.",
product_type: "Please enter Product Type",
sale_price: "Please enter Sale Price.",
price: "Please enter Price.",
status: "Please select status."
},
});
});
</script>
<script src="{{ asset('/vendor/unisharp/laravel-ckeditor/ckeditor.js') }}"></script>
<script>
CKEDITOR.replace( 'description' );
</script>
@endsection
\ No newline at end of file
@extends('adminlte::page')
@section('content')
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Feed</h1>
</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('add_message'))
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{!! session('add_message') !!}
</div>
@endif
<form class="form-horizontal" id="add-feedform" action="{{route('admin.feeds.update',['id'=>@$data->id])}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="box-body">
<input type="hidden" name="id" value="{{old('id',@$data->id)}}">
<div class="form-group @if($errors->first('feeds_id')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Feed ID<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="feeds_id" class="form-control" placeholder="Locater ID" value="{{old('feeds_id',@$data->feeds_id)}}">
<?php if(@$errors->first('feeds_id')) { ?> <span class="help-block">{{@$errors->first('feeds_id')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('title')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Title<em>*</em></label>
<div class="col-sm-6">
<input type="text" name="title" class="form-control" placeholder="Locater ID" value="{{old('title',@$data->title)}}">
<?php if(@$errors->first('title')) { ?> <span class="help-block">{{@$errors->first('title')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('description')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Description</label>
<div class="col-sm-10">
<textarea class="form-control" id="description" name="description">
<?php if(isset($data->description) && !empty($data->description)){ ?>
{{$data->description}}
<?php } ?>
</textarea>
</div>
</div>
<div class="form-group @if($errors->first('gtin')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Gtin<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="gtin" class="form-control" placeholder="Gtin" value="{{old('gtin',@$data->gtin)}}">
<?php if(@$errors->first('gtin')) { ?> <span class="help-block">{{@$errors->first('gtin')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('brand')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Brand<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="brand" class="form-control" placeholder="Brand" value="{{old('brand',@$data->brand)}}">
<?php if(@$errors->first('brand')) { ?> <span class="help-block">{{@$errors->first('brand')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('color')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Color<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="color" class="form-control" placeholder="Color" value="{{old('color',@$data->color)}}">
<?php if(@$errors->first('color')) { ?> <span class="help-block">{{@$errors->first('color')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('size')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Size<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="size" class="form-control" placeholder="Size" value="{{old('size',@$data->size)}}">
<?php if(@$errors->first('size')) { ?> <span class="help-block">{{@$errors->first('size')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('link')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Link<em>*</em></label>
<div class="col-sm-6">
<input type="text" name="link" class="form-control" placeholder="Link" value="{{old('link',@$data->link)}}">
<?php if(@$errors->first('link')) { ?> <span class="help-block">{{@$errors->first('link')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('image_link')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Image Link<em>*</em></label>
<div class="col-sm-6">
<input type="text" name="image_link" class="form-control" placeholder="Image Link" value="{{old('image_link',@$data->image_link)}}">
<?php if(@$errors->first('image_link')) { ?> <span class="help-block">{{@$errors->first('image_link')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('availability')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Availability<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('in stock'=>'In Stock'); ?>
<select name="availability" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<?php if(isset($data->availability) && !empty($data->availability)){ ?>
<option @if($key == $data->availability) {{'selected'}} @endif value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php }else{ ?>
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php } ?>
@endforeach
</select>
</div>
</div>
<div class="form-group @if($errors->first('product_condition')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Product Condition<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('NEW'=>'NEW'); ?>
<select name="product_condition" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<?php if(isset($data->product_condition) && !empty($data->product_condition)){ ?>
<option @if($key == $data->product_condition) {{'selected'}} @endif value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php }else{ ?>
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php } ?>
@endforeach
</select>
</div>
</div>
<div class="form-group @if($errors->first('item_group_id')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Item Group Id<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="item_group_id" class="form-control" placeholder="Item Group Id" value="{{old('item_group_id',@$data->item_group_id)}}">
<?php if(@$errors->first('item_group_id')) { ?> <span class="help-block">{{@$errors->first('item_group_id')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('google_product_category')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Google Product Category<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="google_product_category" class="form-control" placeholder="Google Product Category" value="{{old('google_product_category',@$data->google_product_category)}}">
<?php if(@$errors->first('google_product_category')) { ?> <span class="help-block">{{@$errors->first('google_product_category')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('product_type')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Product Type<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="product_type" class="form-control" placeholder="Product Type" value="{{old('product_type',@$data->product_type)}}">
<?php if(@$errors->first('product_type')) { ?> <span class="help-block">{{@$errors->first('product_type')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('sale_price')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Sale Price<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="sale_price" class="form-control" placeholder="Sale Price" value="{{old('sale_price',@$data->sale_price)}}">
<?php if(@$errors->first('sale_price')) { ?> <span class="help-block">{{@$errors->first('sale_price')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('price')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Price<em>*</em></label>
<div class="col-sm-4">
<input type="text" name="price" class="form-control" placeholder="Price" value="{{old('price',@$data->price)}}">
<?php if(@$errors->first('price')) { ?> <span class="help-block">{{@$errors->first('price')}}</span> <?php } ?>
</div>
</div>
<div class="form-group @if($errors->first('status')) {{' has-error has-feedback'}} @endif ">
<label for="inputError" class="col-sm-2 control-label">Status<em>*</em></label>
<div class="col-sm-4">
<?php $options = array('1'=>'Active','0'=>'InActive'); ?>
<select name="status" class="form-control">
<option value="">Select</option>
@foreach($options as $key => $option)
<?php if(isset($data->status) && !empty($data->status)){ ?>
<option @if($key == $data->status) {{'selected'}} @endif value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php }else{ ?>
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
<?php } ?>
@endforeach
</select>
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<input type="submit" value="Submit" class="btn btn-info">
<a href="{{route('admin.feeds')}}" class="btn btn-default">Cancel</a>
</div>
<!-- /.box-footer -->
</form>
</div>
</div>
<!--/.col (right) -->
</div>
</div>
</div>
<style>
.help-block{
color:red;
}
.error{
color:red;
}
</style>
<script type="text/javascript">
$( document ).ready(function() {
$.validator.addMethod('filesize', function(value, element, param) {
return this.optional(element) || (element.files[0].size <= param)
});
$.validator.addMethod("alphanumspecial", function (value, element) {
return this.optional(element) || /^(?=.*[a-z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{6,})/i.test(value);
}, "Combination of alphabets,special characters & numeric values required.");
$('#add-feedform').validate({
ignore: ".ignore",
rules: {
feeds_id: "required",
title: "required",
description: "required",
gtin: "required",
brand: "required",
color: "required",
size: "required",
link: "required",
image_link: "required",
availability: "required",
product_condition: "required",
item_group_id: "required",
google_product_category: "required",
product_type: "required",
sale_price: "required",
price: "required",
status: "required",
},
// Specify validation error messages
messages: {
feeds_id:"Please enter Feed ID.",
title:"Please enter Titale.",
description: "Please enter Description.",
gtin: "Please enter Gtin.",
brand: "Please enter Brand.",
color: "Please enter Color",
size: "Please enter Size.",
link: "Please enter Link.",
image_link: "Please enter Image Link.",
availability: "Please select availabilty.",
product_condition: "Please select Product Condition.",
item_group_id: "Please enter Item Group Id.",
google_product_category: "Please enter Google Product Category.",
product_type: "Please enter Product Type",
sale_price: "Please enter Sale Price.",
price: "Please enter Price.",
status: "Please select status."
},
});
});
</script>
<script src="{{ asset('/vendor/unisharp/laravel-ckeditor/ckeditor.js') }}"></script>
<script>
CKEDITOR.replace( 'description' );
</script>
@endsection
\ No newline at end of file
@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
@extends('adminlte::page')
@section('content')
<div class="container-fluid">
<div class="">
<div class="col-sm-6">
<h2>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">Feed Tables</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('add_message'))
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{!! session('add_message') !!}
</div>
@endif
<form id="feeds-mng" method="get" action="{{route('admin.feeds')}}">
{{ csrf_field() }}
<div class="row clearfix">
<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">
</div>
</div>
</div>
<div class="col-sm-4">
<button type="submit" class="btn btn-primary btn-info">Search<div></div></button>
<a href="{{route('admin.feeds')}}" class="btn btn-primary btn-success">Reset</a>
</div>
<div class="col-sm-2 pull-right">
<a href="{{route('admin.feeds.add')}}" class="btn btn-block btn-warning">Add Feed</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>
<!-- /.box-header -->
<form id="feeds-add" method="get" action="">
<div class="card">
<!-- /.card-header -->
<div class="card-body">
<table class="table table-bordered">
<tr>
<th style="width: 10px">#</th>
<th>@sortablelink('feeds_id')</th>
<th>@sortablelink('title')</th>
<th>Feed Show</th>
<th>@sortablelink('created_at')</th>
<th style="width: 40px">Action</th>
</tr>
@if(count($data['records'])>0)
<?php $k = ($pageNo == 1) ? $pageNo : (($pageNo - 1) * $record_per_page) + 1; ?>
@foreach($data['records'] as $row)
<tr>
<td>{{$row->id}}</td>
<td>{{$row->feeds_id}}</td>
<td>{{$row->title}}</td>
<td>
<?php
if($row->show_feed == 1){
$checked = "checked";
}else{
$checked = "";
} ?>
<input <?php echo $checked; ?> type="checkbox" class="showFeed" data-id=<?php echo $row->id; ?> style="width: 20px;height: 20px;" 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>
<a href="{{route('admin.feeds.delete',['id'=>$row->id])}}" class="btn btn-danger btn-xs action-btn" onclick="return confirm('Are you sure you want to delete ?');" title ="Delete"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
</td>
</tr>
<?php $k++; ?>
@endforeach
@else
<tr class="bg-info">
<td colspan="4">Record(s) not found.</td>
</tr>
@endif
</table>
</div>
<!-- /.card-body -->
<div class="card-footer clearfix">
<ul class="pagination pagination-sm m-0 float-right">
{!! $data['records']->links() !!}
</ul>
</div>
<!-- /.card -->
</div>
</form>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
</div>
<script type="text/javascript">
$(".showFeed").on('click', function () {
var id = $(this).data('id');
var showFeed = $(this).is(":checked");
showFeedData(id,showFeed);
});
function showFeedData(id,showFeed){
$.ajax({
type: 'POST',
url: "{{route('admin.feeds.updateShowFeed')}}",
data: {"_token": "{{ csrf_token() }}",id:id,showFeed:showFeed},
success: function (datanew) {
}
});
}
</script>
@endsection
......@@ -41,17 +41,24 @@
<!-- 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";
}else{
$checked = "";
} ?>
<input <?php echo $checked; ?> type="checkbox" style="width: 25px;height: 25px;" 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 +122,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.homepages')}}" class="btn btn-default">Cancel</a>
</div>
<!-- /.box-footer -->
</form>
......
......@@ -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: 10px">#</th>
<th>@sortablelink('other_setting')</th>
<th>Setting</th>
<th>@sortablelink('created_at')</th>
<th style="width: 40px">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>
......
......@@ -104,6 +104,32 @@
</div>
</section>
@endif
<?php if($homepage->show_feed == 1){ ?>
<section class="container promotion-wrapper">
<div class="row">
<div class="col-12">
<section class="promotion-wrapper-items">
<?php foreach($feedDetail as $feed){ ?>
<div class="item">
<figure><img src="{{ $feed->image_link }}"> </figure>
<p class="name">{{ $feed->title }}</p>
<p class="currency bold">{{ $feed->price }}</p>
<p class="publisher">{{ $feed->brand }}</p>
<p class="grey-txt">Price drop: {{ $feed->sale_price }}</p>
</div>
<?php } ?>
</section>
</div>
</div>
</section>
<?php } ?>
<section class="container location_reviews_outer">
<div class="row ">
<div class="col-md-8 col-12">
......
......@@ -26,6 +26,8 @@ Route::post('getCityValue', 'SearchController@getCityValue')->name('getCityValue
Route::get('cron/getLocaterListData', 'CronController@getLocaterListData')->name('getLocaterListData');
Route::get('cron/getState', 'CronController@getState')->name('getState');
Route::get('cron/getCity', 'CronController@getCity')->name('getCity');
Route::get('cron/import', 'CronController@import')->name('import');
Route::get('404',['as'=>'404','uses'=>'ErrorHandlerController@errorCode404']);
......@@ -60,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');
......@@ -68,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');
......@@ -76,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');
......@@ -84,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');
......@@ -92,4 +94,16 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route::get('cities/{id}/delete', 'CityController@deleteCity')->name('admin.cities.delete');
Route::post('getParentValue', 'CityController@getParentValue')->name('getParentValue');
/* For manage Locater 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.feeds.feedSetting');
Route::post('updateShowFeed', 'FeedController@updateShowFeed')->name('admin.feeds.updateShowFeed');
});
......@@ -2,4 +2,8 @@ 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;
ALTER TABLE `locater_feeds` ADD `show_feed` TINYINT(4) NOT NULL DEFAULT '0' AFTER `id`;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment