示例#1
0
 public function show_gig($id)
 {
     //
     $dycrypt = Crypt::decrypt($id);
     //$profile=profiles::where('id',$user->id)->first();
     $gig_user = Gig::where('id', $dycrypt)->first();
     $profile = profiles::where('user_id', $gig_user->user_id)->first();
     $user = User::where('id', $gig_user->user_id)->first();
     return view('prac.gigg', compact('gig_user', 'user', 'profile'));
 }
示例#2
0
 public function display_cart(Request $request)
 {
     $user = Auth::user();
     $carts = carts::where('user_id', $user->id)->get();
     $gigs = array();
     $quan_array = array();
     $quantity = 0;
     $cart_total = 0;
     $counter = 0;
     foreach ($carts as $key) {
         $temp = Gig::where('id', $key->gig_id)->first();
         $quantity = $key->gig_quantity;
         $gigs[] = $temp;
         $quan_array[] = $quantity;
         $cart_total = ($cart_total + $temp->amount) * $quantity;
         /*if($counter===1){
         			return $cart_total." ".$quantity;
         		}
         		$counter++;*/
     }
     //have to fix the money calculation thing here
     return view('prac.shoppingCart', compact('gigs', 'cart_total', 'quan_array'));
     //return $cart_total;
 }
示例#3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $dycrypt = Crypt::decrypt($id);
     $profile = profiles::where('id', $dycrypt)->first();
     $user = User::where('id', $profile->user_id)->first();
     $gig = Gig::where('user_id', $user->id)->get();
     return view('prac.profile', compact('user', 'profile', 'gig'));
     // return $profile;
 }