/**
  * All Products
  */
 public function getIndex()
 {
     // Page Title
     $this->_data['page_title'] = "Products";
     // Get All products
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     return View::make('admin.products.index', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
 public function display()
 {
     $products = Product::all();
     $products = Product::orderBy('p_id', 'desc')->paginate(3);
     $users = User::all();
     $users = User::orderBy('id', 'desc')->paginate(3);
     $suppliers = Product::lists('supplier', 'supplier');
     $metals = Product::lists('metal', 'metal');
     return View::make('products.list')->with('products', $products)->with('suppliers', $suppliers)->with('metals', $metals)->with('users', $users);
 }
 /**
  * Dashboard / All Transactions
  */
 public function getIndex()
 {
     // Page Title
     $this->_data['page_title'] = "Transactions";
     $this->_data['affiliates'] = Affiliate::orderBy('name', 'ASC')->get();
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     $transactions = new Transaction();
     $this->_data['transactions'] = $transactions->search();
     $this->_data['searchParams'] = $transactions->getSearchParams();
     $this->_data['revenue'] = $transactions->totalRevenue();
     $this->_data['paidAffliates'] = $transactions->paidToAffiliates();
     $this->_data['refundQueue'] = $transactions->refundQueueCount();
     return View::make('admin.transactions.index', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
 /**
  * View: Video Index
  * @return Respanse
  */
 public function getVideoIndex()
 {
     $articles = Article::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(6);
     $travel = Travel::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(4);
     $product = Product::orderBy('created_at', 'desc')->where('post_status', 'open')->where('quantity', '>', '0')->paginate(12);
     $productCategories = ProductCategories::orderBy('sort_order')->where('cat_status', 'open')->get();
     $job = Job::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(4);
     $categories = Category::orderBy('sort_order')->where('cat_status', 'open')->get();
     if (Auth::check()) {
         $timeline = Timeline::orderBy('created_at', 'desc')->where('user_id', Auth::user()->id)->paginate(6);
     } else {
         $timeline = Timeline::orderBy('created_at', 'desc');
     }
     return View::make('home.videoindex')->with(compact('articles', 'categories', 'travel', 'product', 'productCategories', 'job', 'timeline'));
 }
 public function get($id = null)
 {
     $search = Input::get('search');
     if (!is_null($search)) {
         $suppliers = Supplier::withTrashed()->where('name', 'like', '%' . $search . '%')->orWhere('ruc', 'like', '%' . $search . '%')->orderBy('name')->paginate(15);
     } else {
         $suppliers = Supplier::withTrashed()->orderBy('name')->paginate(15);
     }
     $selectedSupplier = self::__checkExistence($id);
     if (!$selectedSupplier) {
         $selectedSupplier = new Supplier();
     }
     $allProducts = Product::orderBy('name')->get()->lists('name', 'id');
     $selectedSupplierProducts = $selectedSupplier->products()->orderBy('name')->get()->toArray();
     return View::make('suppliers.main')->with('id', $id)->with('allProducts', $allProducts)->with('selectedSupplierProducts', array_fetch($selectedSupplierProducts, 'id'))->with('selectedSupplier', $selectedSupplier)->with('search', $search)->with('suppliers', $suppliers);
 }
Example #6
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     set_time_limit(0);
     if (is_null($obj)) {
         $product = new Product();
     } else {
         switch ($obj) {
             case 'product':
                 $product = new Product();
                 break;
             case 'page':
                 $product = new Page();
                 break;
             case 'post':
                 $product = new Posts();
                 break;
             default:
                 $product = new Product();
                 break;
         }
     }
     $props = $product->orderBy('_id', 'desc')->get();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $items = Product::orderBy('name', 'ASC')->paginate(10);
     return View::make('product.view_product', compact('items'));
 }
 /**
  * Card Update URL
  */
 public function getCardUpdateUrl()
 {
     $this->_data['page_title'] = "Generate Card Update URL";
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     return View::make('admin.utilities.card-update-url', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
Example #9
0
 public function products()
 {
     $catagory = Catagory::all();
     $product = Product::orderBy('created_at', 'desc')->paginate(12);
     return View::make('Products.Shop', array('catagories' => $catagory, 'products' => $product));
 }
Example #10
0
 public function shop()
 {
     $catagory = Catagory::all();
     $product = Product::orderBy('created_at', 'desc')->get();
     return View::make('users.shop', array('query' => $catagory, 'products' => $product));
 }
 public function search()
 {
     $search_year_ind = Utility::nvl(Input::get('search_year_ind'), 'All');
     $input = urldecode(Input::get('search'));
     if (!empty($input)) {
         $searchTerms = explode(',', $input);
         $query = Product::orderBy('workshop_year', 'desc')->orderBy('id', 'asc');
         // Assign index 0 search terms directly...
         $query->where('speaker_last_name', 'LIKE', '%' . $searchTerms[0] . '%')->orWhere('speaker_first_name', 'LIKE', '%' . $searchTerms[0] . '%')->orWhere('session_title', 'LIKE', '%' . $searchTerms[0] . '%');
         foreach ($searchTerms as $key => $value) {
             if ($key > 0) {
                 $query->orWhere('speaker_last_name', 'LIKE', '%' . $searchTerms[$key] . '%')->orWhere('speaker_first_name', 'LIKE', '%' . $searchTerms[$key] . '%')->orWhere('session_title', 'LIKE', '%' . $searchTerms[$key] . '%');
             }
         }
         $current_workshop_year = Config::get('workshop.current_workshop_year');
         if ($search_year_ind == 'Current') {
             $query->where('workshop_year', '=', $current_workshop_year);
         }
         $results = $query->remember(5)->get();
         //->paginate(20);
         $message = "Search results for search criteria '" . $input . "'.";
         ProductsController::makeIndexView($results, array('search_criteria' => $input, 'search_year_ind' => $search_year_ind, 'message' => $message));
     }
 }
Example #12
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     set_time_limit(0);
     $obj = $this->argument('object');
     if (is_null($obj)) {
         $product = new Product();
     } else {
         switch ($obj) {
             case 'product':
                 $product = new Product();
                 break;
             case 'page':
                 $product = new Page();
                 break;
             case 'post':
                 $product = new Posts();
                 break;
             default:
                 $product = new Product();
                 break;
         }
     }
     $props = $product->orderBy('_id', 'desc')->get();
     //$seq = new Sequence();
     $sizes = Config::get('picture.sizes');
     $cnt = 1;
     foreach ($props as $p) {
         echo $cnt . "\n";
         $cnt++;
         echo $p->_id . "\n";
         if (isset($p->files)) {
             $files = $p->files;
             foreach ($files as $folder => $files) {
                 $dir = public_path() . '/storage/media/' . $folder;
                 if (is_dir($dir) && file_exists($dir)) {
                     if ($dh = opendir($dir)) {
                         while (($file = readdir($dh)) !== false) {
                             if ($file != '.' && $file != '..') {
                                 if (!preg_match('/^lrg_|med_|th_|full_|blob/', $file)) {
                                     echo $dir . '/' . $file . "\n";
                                     $destinationPath = $dir;
                                     $filename = $file;
                                     $urls = array();
                                     foreach ($sizes as $k => $v) {
                                         echo $destinationPath . '/' . $v['prefix'] . $filename . "\n";
                                         if (file_exists($destinationPath . '/' . $v['prefix'] . $filename)) {
                                             unlink($destinationPath . '/' . $v['prefix'] . $filename);
                                         } else {
                                             echo "file does not exist\n";
                                         }
                                         $thumbnail = Image::make($destinationPath . '/' . $filename)->fit($v['width'], $v['height'])->save($destinationPath . '/' . $v['prefix'] . $filename);
                                         //print_r($thumbnail);
                                     }
                                     /*
                                     $thumbnail = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['thumbnail']['width'] ,$sizes['thumbnail']['height'])
                                         ->save($destinationPath.'/th_'.$filename);
                                     
                                     $medium = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['medium']['width'] ,$sizes['medium']['height'])
                                         ->save($destinationPath.'/med_'.$filename);
                                     
                                     $large = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['large']['width'] ,$sizes['large']['height'])
                                         ->save($destinationPath.'/lrg_'.$filename);
                                     
                                     $full = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['full']['width'] ,$sizes['full']['height'])
                                         ->save($destinationPath.'/full_'.$filename);
                                     */
                                 }
                             }
                         }
                         closedir($dh);
                     }
                 }
             }
         }
     }
 }
 public function getIndex()
 {
     $products = Product::orderBy('created_at', 'DESC')->paginate(4);
     return View::make('store.index')->with('products', $products);
 }
 public function getIndex()
 {
     $data = array('products' => Product::orderBy('id', 'DESC')->paginate(5));
     return View::make('admin.product.index', $data);
 }
 public function listProducts()
 {
     $products = Product::orderBy('code')->get();
     return View::make("product", array("products" => $products));
 }
 public function getShop()
 {
     $products = Product::orderBy('created_at', 'DESC')->get();
     return View::make('store.all')->with('products', $products);
 }
Example #17
0
 public function create()
 {
     $products = Product::orderBy('id', 'ASC')->get();
     $data = ['productos' => $products];
     return View::make('precios.create', $data);
 }
Example #18
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $products = Product::orderBy('created_at', 'desc')->paginate(BaseHelper::getItemPerPage());
     return View::make('backend.product.index')->with('products', $products);
 }
 public function listProducts($column_to_order_by, $direction)
 {
     return Product::orderBy($column_to_order_by, $direction)->get();
 }