tegarkurniawan

contoh

Aug 12th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. $today = date('Y-m-d');
  2. $reservations = DB::table('reservations')
  3. ->join('client_service', 'client_service.id', '=', 'reservations.client_service_id')
  4. ->join('users', 'users.id', '=', 'reservations.user_id')
  5. ->join('clients', 'clients.id', '=', 'reservations.client_id')
  6. ->join('services', 'services.id', '=', 'client_service.service_id')
  7. ->join('branchs', 'branchs.id', '=', 'reservations.branch_id')
  8. ->where('reservations.client_id', '=' , Auth::user()->client_id)
  9. ->where('reservations.branch_id', '=' , Auth::user()->branch_id)
  10. ->where('reservations.status','=','Create')
  11. ->select('reservations.*','services.service_name','clients.brand_name','users.email','users.name', 'branchs.sub_district')
  12. ->whereRaw("date(reservations.reserved_date) = '". date('Y-m-d') . "'")
  13. ->get();
  14.  
  15. return view('client.index',compact('reservations'));
  16.  
  17.  
  18. @extends('master-client')
  19.  
  20. @section('content')
  21. @foreach($reservations as $row)
  22. <div class="alert alert-success alert-dismissable">
  23. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  24. <h4> <i class="icon fa fa-check"></i> New Reservation</h4>
  25. Nama : {{ $row->name }} <br>
  26. Jam : <?php $datetime=explode(' ',$row->reserved_date);
  27. $date=$datetime[0];
  28. $time=$datetime[1];
  29. echo $time;
  30. ?>
  31.  
  32. </div>
  33. @endforeach
  34.  
  35. @stop
Advertisement
Add Comment
Please, Sign In to add comment