Example #1
0
 public function index()
 {
     $users = Order::all();
     $orders = Order::orderBy('id', 'desc')->paginate(5);
     //dd($orders);
     return view('admin.order.index', compact('orders', 'users'));
 }
Example #2
0
 public function adminIndex()
 {
     //$orders=Order::orderBy('id','DESC')->get();
     $orders = Order::orderBy('id', 'desc')->paginate(Config::get('nafisConfig.perPage'));
     //dd($orders);
     return view('admin.orderAdminIndex', compact('orders'))->with(['title' => 'لیست درخواستها']);
 }
 public function index()
 {
     $orders = Order::orderBy('id', 'desc')->paginate(8);
     //created_at
     //dd($orders);
     return view('admin.order.index', compact('orders'));
 }
Example #4
0
 public function orders(Request $request)
 {
     if ($request->search) {
         $search = $request->search;
         $this->data['search'] = $search;
         $orders = Order::where('name', 'like', '%' . $search . '%')->orWhere('email', 'like', '%' . $search . '%')->orWhere('phone', 'like', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(50);
     } else {
         $orders = Order::orderBy('created_at', 'desc')->paginate(50);
         $this->data['search'] = null;
     }
     $this->data['current_tab'] = 37;
     $this->data['orders'] = $orders;
     $this->data['last_page'] = $orders->lastPage();
     $this->data['current_page'] = $orders->currentPage();
     return view('manage.order.list', $this->data);
 }
 public function getIndex()
 {
     $now = Carbon::now('Asia/Kuala_Lumpur');
     $monthStart = $now->startOfMonth();
     $monthEnd = $now->endOfMonth();
     $tempahan = Order::orderBy('created_at', $monthStart);
     // where('created_at', '>=', Carbon::now()->startOfMonth())->get()
     $kato = Category::whereHas('transaction', function ($query) {
         $query->where('qty', '>', 0);
         $query->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfYear());
     })->get();
     $katoo = Category::whereHas('transaction', function ($query) {
         $query->where('qty', '>', 0);
         $query->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfMonth());
     })->get();
     $overall = Transaction::select('id', 'created_at', 'month', DB::raw('sum(qty) as total'))->groupBy(DB::raw('MONTH(month)'))->orderBy('created_at', 'asc')->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfYear())->get();
     $testo = Transaction::select('id', 'month')->groupBy(DB::raw('MONTH(month)'))->orderBy('month', 'asc');
     $tahun = Carbon::now('Asia/Kuala_Lumpur')->startOfYear();
     $tran = Transaction::all();
     $tops = Transaction::orderBy('qty', 'desc')->groupBy('product_id')->limit(5)->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfWeek())->get();
     return view('a.index', compact('kato', 'katoo', 'tops', 'overall', 'tahun', 'testo'))->with('tempahan', $tempahan)->with('trans', $tran)->with('args', Order::all())->with('ris', Order::sum('total_purchase'))->with('name', $kato->lists('name'))->with('namo', $katoo->lists('name'));
 }
Example #6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     // For this week's batch of items
     $requiredItems = array();
     if (isset($_GET['all'])) {
         // Want all orders for some reason, use with caution
         $orders = Order::orderBy('id', 'desc')->get();
         foreach ($orders as $order) {
             // Parse it so that the template knows how to use it
             $order->item_array = JSON_decode($order->item_array);
         }
     } else {
         // Get unpaid orders by default
         $orders = Order::where('paid', '=', 0)->orderBy('id', 'desc')->get();
         // Calculate totals for this batch
         foreach ($orders as $order) {
             $order->item_array = JSON_decode($order->item_array);
             foreach ($order->item_array as $item) {
                 if (array_key_exists($item->name, $requiredItems)) {
                     // The item was already added, just add the quantity
                     $requiredItems[$item->name] += $item->qty;
                 } else {
                     // The item isn't added yet, make a new entry
                     $requiredItems[$item->name] = $item->qty;
                 }
             }
         }
     }
     return Response::json(array('orders' => $orders, 'requiredItems' => $requiredItems));
     /*
             return view('orders.index')->with(array(
                 'orders' => $orders,
                 'requiredItems' => $requiredItems
             ));*/
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $order = Order::orderBy('transaction_id', 'asc')->paginate(5);
     return view('orders.index', compact('order'));
 }
Example #8
0
 /**
  * Method for showing a list of orders.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $orders = Order::orderBy('id', 'DESC')->paginate(10);
     return view('ecomm.admin.orders.index', compact('orders'));
 }
Example #9
0
 /**
  * Get all of the orders
  */
 public function getAll()
 {
     return Order::orderBy('created_at', 'desc')->get();
 }
 public function dashboard()
 {
     $data = ['printers' => Printer::all(), 'orders' => Order::orderBy('created_at', 'desc')->get(), 'test' => 'Test'];
     return view('dashboard', $data);
 }
Example #11
0
 public function index()
 {
     // $articles= Articles::where('user_id','=','2')->get();  izvlacenje pomocu user_id iz druge tabele
     $orders = Order::orderBy('created_at')->get();
     return View::make('articles.index', compact('orders'));
 }
Example #12
0
Route::get('/', function () {
    return view('home');
});
// Registration routes...
Route::get('auth/register', 'Auth\\AuthController@getRegister');
Route::post('auth/register', 'Auth\\AuthController@postRegister');
// Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
// Password reset link request routes...
Route::get('password/email', 'Auth\\PasswordController@getEmail');
Route::post('password/email', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset');
Route::post('password/reset', 'Auth\\PasswordController@postReset');
// Ressource REST API routes
Route::resource('order', 'OrderController', ['only' => ['store', 'index', 'create', 'show']]);
Route::resource('payment', 'PaymentController', ['only' => ['store', 'show']]);
Route::resource('customer', 'CustomerController', ['only' => ['store', 'show']]);
// Admin page
Route::get('/admin', ['middleware' => 'auth', function () {
    /*
     * Displays a table of all direct debit payments requested so far 
     */
    $orders = Order::orderBy('group', 'asc')->with('payment', 'customer')->get()->all();
    $payments = Payment::all();
    $customers = Customer::all();
    return view('admin', ['orders' => $orders, 'payments' => $payments, 'customers' => $customers]);
}]);
Route::controllers(['password' => 'Auth\\PasswordController']);
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function listOrders()
 {
     //
     $orders = \App\Order::orderBy('created_at', "desc")->paginate(15);
     return view("admin.orders.index", ['orders' => $orders]);
 }
Example #14
0
 public function getOrderList(Order $order)
 {
     $orders = $order->orderBy('created_at', 'DESC')->paginate(25);
     return view('orders.lists')->with(compact('orders'));
 }
 /**
  * find the id of the last saved order
  *
  * @return mixed
  */
 public function findLastSavedId()
 {
     return Order::orderBy('updated_at', 'desc')->first()->id;
 }
Example #16
0
 public function index()
 {
     $orders = Order::orderBy('date')->get();
     return view('order.home', compact('orders'));
 }
Example #17
0
 /**
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index()
 {
     $orders = Order::orderBy('commanded_at', 'desc')->with('customer', 'products')->paginate(10);
     return view('back.orders.index', compact('orders'));
 }
Example #18
0
 public function index()
 {
     $orders = Order::orderBy('created_at', 'DESC')->get();
     return view('admin.orders.table')->with(['items' => $orders]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $orders = Order::orderBy('created_at', 'desc')->paginate(25);
     return view('admin.orders.index', compact('orders'));
 }
 public function orders(Request $request)
 {
     if ($request->sort && $request->orderby) {
         $orders = Order::orderBy($request->sort, $request->orderby)->paginate(15);
     } else {
         $orders = Order::orderBy('created_at', 'desc')->paginate(15);
     }
     return view('admin.orders', compact('orders'));
 }
 public function history()
 {
     return view('order-history', ['navActive' => 'orderHistory', 'orders' => Auth::user()->type == 'M' ? Order::orderBy('order_at')->get() : Order::where('user_id', Auth::user()->id)->orderBy('order_at')->get()]);
 }