/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $product = Product::find($id);
     $type = ProductType::all();
     $brand = Brand::all();
     return View::make('product.edit')->withProduct($product)->withBrand($brand)->withType($type);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $product = Product::find($id);
     $departments = Department::all()->lists('name', 'id');
     $categories = Category::all()->lists('name', 'id');
     $brands = Brand::all()->lists('name', 'id');
     $sizes = Size::all()->lists('name', 'id');
     $colors = Color::all()->lists('name', 'id');
     return View::make('admin::products.edit', compact('product', 'departments', 'categories', 'brands', 'sizes', 'colors'));
 }
 public function showBrands()
 {
     Larasset::start('footer')->js('dataTables-min', 'dataTables-bootstrap', 'bootstrap_editable');
     Larasset::start('header')->css('bootstrap_editable');
     $ids = Brand::all()->lists('id');
     if (!empty($ids)) {
         $this->_monitorChildrenStatus($ids);
     }
     $data['brands'] = Brand::all();
     $this->layout->title = "Active Brands of products";
     $this->layout->content = View::make('admin.liststock.stocks', $data);
 }
示例#4
0
 public static function index()
 {
     return function ($req, $res) {
         $res->header('Content-Type', 'application/json');
         $models = Brand::all();
         $all = array();
         foreach ($models as $model) {
             # code...
             $all[] = $model->as_array();
         }
         echo json_encode($all);
     };
 }
示例#5
0
 public function GetAllBrand()
 {
     return Brand::all();
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $brand = Brand::all();
     View::share('selected_option', 'Agregar Marca');
     return View::make('brand.add')->with('brand', $brand);
 }
 public function edit_product()
 {
     $id = Request::segment(4) ? Request::segment(4) : 0;
     $sub_title = Request::segment(4) ? "Edit Product" : "Add Product";
     $product = Product::find($id);
     $brands = Brand::all();
     $stores = Store::all();
     $selected_store_id = 0;
     $selected_department_id = 0;
     $selected_shelf_id = 0;
     foreach ($stores as $store) {
         $selected_store_id = $store->id;
         break;
     }
     if ($product && $product->store_id) {
         $selected_store_id = $product->store_id;
     }
     $departments = Department::where('store_id', $selected_store_id)->get();
     foreach ($departments as $department) {
         $selected_department_id = $department->id;
         break;
     }
     if ($product && $product->department_id) {
         $selected_department_id = $product->department_id;
     }
     $shelves = Shelf::where('department_id', $selected_department_id)->get();
     foreach ($shelves as $shelf) {
         $selected_shelf_id = $shelf->id;
         break;
     }
     return View::make('admin.product_form')->with('title', 'Product')->with('sub_title', $sub_title)->with('product', $product)->with('brands', $brands)->with('stores', $stores)->with('departments', $departments)->with('shelves', $shelves)->with('selected_store_id', $selected_store_id)->with('selected_department_id', $selected_department_id)->with('selected_shelf_id', $selected_shelf_id);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     return View::make('main.brands')->with('brands', Brand::all());
 }
示例#9
0
 public function get_product_add()
 {
     $categories = Category::where('top', '=', '1')->get();
     $products = Product::all();
     $brands = Brand::all();
     $tags = DB::table("product_descriptions")->get('tag');
     $_tmpholder = array();
     $_strholder = '';
     foreach ($tags as $tag) {
         $_instance = explode(',', $tag->tag);
         foreach ($_instance as $item) {
             array_push($_tmpholder, $item);
         }
     }
     $_tmpholder = array_unique($_tmpholder);
     $numItems = count($_tmpholder);
     $i = 0;
     foreach ($_tmpholder as $item) {
         $_strholder .= '"' . $item . '"';
         if (++$i !== $numItems) {
             $_strholder .= ',';
         }
     }
     $attributes = AttributeGroup::with('getChildrenGroup')->where('top', '=', 1)->get();
     $taxes = Tax::all();
     return View::make('administrator.product_add')->with('categories', $categories)->with('products', $products)->with('brands', $brands)->with('tags', $_strholder)->with('attributes', $attributes)->with('taxes', $taxes);
 }
示例#10
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('brand', function () {
    $categories = Category::all();
    $brands = Brand::all();
    return View::make('index')->with('categories', $categories)->with('brands', $brands);
});
示例#11
0
 public function companyCounterStat()
 {
     $this->widgetData = array('count' => count(Brand::all()));
     $this->setupWidgetLayout(__METHOD__);
 }
 public function getAll()
 {
     $categories = Category::all();
     $brands = Brand::all();
     return View::make('Attch/index')->with('categories', $categories)->with('brands', $brands);
 }