/**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $input = Input::all();
     $products = Products::filter($input, 25);
     $types = Types::dropdownList();
     return View::make('sales.create', compact('products', 'types', 'input'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $limit = Input::get('limit', 24);
     $input = Input::all();
     $products = Products::filter(Input::all(), $limit);
     $types = Types::dropdownList();
     $units = Units::dropdownList();
     if (Request::ajax()) {
         return Response::json($products->lists('nameprice'))->setCallback(Input::get('callback'));
     } else {
         $index = $products->getPerPage() * ($products->getCurrentPage() - 1) + 1;
         return View::make('products.index', compact('products', 'index', 'input', 'types', 'units'));
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $distribution = Distributions::find($id);
     $input = Input::all();
     $products = Products::filter($input, 25);
     $types = Types::dropdownList();
     $outlets = SalesOutlets::dropdownList();
     return View::make('distributions.edit', compact('products', 'types', 'input', 'outlets'));
 }