コード例 #1
0
 public static function getOngoing()
 {
     $result = array();
     foreach (Reservation::all() as $reservation) {
         if ($reservation->status == 1) {
             $result[] = $reservation;
         }
     }
     return $result;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $reservations = $this->reservation->all();
     return View::make('admin.reservations.index', compact('reservations'));
 }
コード例 #3
0
 public function check()
 {
     $day = Input::get('day');
     $month = Input::get('month');
     $year = Input::get('year');
     $time = explode(':', Input::get('time'));
     $hour = $time[0];
     $minute = $time[1];
     $date = Carbon::create($year, $month, $day, $hour, $minute, 0);
     $reservations = Reservation::all();
     $reservedTables = [];
     foreach ($reservations as $reservation) {
         if ($date->between($reservation->reservation_start, $reservation->reservation_start->addHours(3))) {
             $reservedTables[] = $reservation->table_id;
         }
     }
     return Response::json(['data' => $reservedTables]);
 }