Exemplo n.º 1
0
 function proceed(Request $request)
 {
     $id = Session::get('id', array());
     $ordered_item = $request['id'];
     $item = array();
     foreach ($id as $value) {
         $value = item::find($value);
         array_push($item, $value);
     }
     if (Session::get('loginfo', 1)) {
         return view('checkout', ['lable' => 0, 'loginfo' => 0, 'id' => Session::get('id', array()), 'item' => $item, 'placelogin' => 1]);
     } else {
         $productid = md5(Session::get('uid') . rand());
         foreach ($ordered_item as $value) {
             $order = new order();
             $order->u_id = Session::get('uid');
             $order->item_id = $value;
             $order->order_id = $productid;
             $order->save();
         }
         return view('placeorderform', ['loginfo' => 0, 'placelogin' => 0, 'user' => user::all(), 'productid' => $productid]);
     }
 }
Exemplo n.º 2
0
 /**
  * @param Request $request
  * store order details
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function store1(Request $request)
 {
     $order = new order();
     $order->ordDate = date("Y-m-d h:i:sa");
     $order->DLineDate = Input::get('deliverydate');
     $order->Quantity = Input::get('quantit');
     $order->delMethod = Input::get('delivery');
     if ($order->delMethod == "normal") {
         $deliveryCharge = 0;
     } else {
         $deliveryCharge = 400;
     }
     $order->delCharge = $deliveryCharge;
     $id = DB::table('customerdetails')->orderBy('cusID', 'desc')->value('cusID');
     $order->delID = $id;
     $order->custID = "*****@*****.**";
     $order->save();
     $addresss1 = Input::get('addresses1');
     $addresss2 = Input::get('addresses2');
     $data = $request->session()->get('items');
     return view('pages.Cart.checkout3', compact('data', 'deliveryCharge', 'addresss1', 'addresss2'));
 }
Exemplo n.º 3
0
 public function checkout4(Request $request)
 {
     $order = new order();
     $order->status = Input::get('delivery');
     $order->save();
     $data = $request->session()->get('products');
     //        return "successfully saved to DB" ;
     return view('pages.checkout4', compact('data'));
     // return view('pages.checkout4');
 }
Exemplo n.º 4
0
 function sucess($token)
 {
     $product_token = product_token::where('order_token', $token)->get();
     //dd($product_token);
     $order_id = "";
     foreach ($product_token as $orders) {
         $order_id = $orders->order_id;
         $orders->order_info = 1;
         $orders->save();
     }
     $item_id = array();
     $items = order::where('order_id', $order_id)->get();
     foreach ($items as $item) {
         array_push($item_id, $item->item_id);
     }
     $order_address = order_address::where('order_id', $order_id)->get();
     Mail::send(['text' => 'mailse'], ['address' => $order_address, 'item' => $item_id], function ($m) {
         $m->to('*****@*****.**', 'schoolboy')->subject('Your Reminder!');
     });
     Mail::send(['text' => 'mailse'], ['address' => $order_address, 'item' => $item_id], function ($m) {
         $m->to('*****@*****.**', 'schoolboy')->subject('Your Reminder!');
     });
     return view('sucess');
     //$loginfo=Session::put('loginfo');
 }