Esempio n. 1
0
 public function add_Product()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     $categories = category::get();
     // get all product
     return view('backoffice.cart_add_Products', compact('categories'));
 }
Esempio n. 2
0
 public function allcategory()
 {
     $products = product::get();
     // get all product
     $category = category::get();
     $id = "All Products";
     return view('Pages.products', compact('products', 'category', 'id'));
     // return products to index page
 }
Esempio n. 3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($name)
 {
     $categories = ['' => ''] + App\category::lists('name', 'id')->all();
     $category = App\category::where('name', $name)->lists('id');
     $data = array();
     //array_unshift($categories, "scegli la categoria");
     $data['categories'] = $categories;
     //$categories_options;
     if (isset($category[0]) && !empty($category[0]) && $category[0] != 0) {
         $brandsSelected = ['' => ''] + App\brand::where('category_id', $category[0])->lists('name', 'id')->all();
         $brands = Form::select('brand', $brandsSelected, null, ['class' => 'form-control']);
         $data['selected_category'] = $category[0];
     } else {
         $brands = "<select class = \"form-control\"></select>";
         $data['selected_category'] = null;
     }
     $data['brands'] = $brands;
     return view('search', compact(array('data', $data)));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     category::find($id)->delete();
     return redirect('admin/category/');
 }
Esempio n. 5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     category::create(['name' => 'Restaurant']);
     category::create(['name' => 'Bar / Antro']);
     category::create(['name' => 'Tatoo']);
 }
 public function article()
 {
     $data = array('m_article' => 'highlight', 'category' => category::all());
     return View('backend.article', $data);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $cat_id = new category();
     $category = $cat_id->all();
     $color = Color::all();
     $size = Size::all();
     $product = Product::find($id);
     return view('backend.pages.product.edit2', array('category' => $category, 'product' => $product, 'color' => $color, 'size' => $size));
 }
Esempio n. 8
0
 public function load_main_category()
 {
     $main_category = App\category::where('level', '1')->where('deleted', '0')->get();
     return View::make('sale.admin.main_category_load', compact('main_category'));
 }
 public function recommend_analyze()
 {
     $data = Input::all();
     spl_autoload_register(function ($class_name) {
         $file_name = str_replace('\\', '/', $class_name);
         $file_name = str_replace('_', '/', $file_name);
         $file = dirname(__FILE__) . "/src/{$file_name}.php";
         if (is_file($file)) {
             include $file;
         }
     });
     $tokenizer = new Recommend();
     $classifier = new Classifier($tokenizer);
     $train = Recommend::all();
     // training file here
     foreach ($train as $key) {
         # code...
         $classifier->train($key['label'], $key['context']);
     }
     // $classifier->train('Hot', 'It is so hot');
     // $classifier->train('Cold', 'it is very cold');
     $groups = $classifier->classify($data['content']);
     $rec = classification::find($groups);
     $content = $data['content'];
     $nav = new category();
     $menu_top = $nav->menu_top($nav->all()->toArray());
     $pro = new Product();
     $product = $pro->getRecommend($groups);
     return view('frontend.pages.result', array('groups' => $groups, 'content' => $content, 'menu_top' => $menu_top, 'rec' => $rec, 'product' => $product));
     //return $groups;
 }
Esempio n. 10
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $category = new category();
     $category->category_name = 'page';
     $category->save();
 }