public function index()
 {
     if (!Auth::check()) {
         return Redirect::to('/');
     }
     $user = Auth::user();
     if (Scheduler::where('uid', '=', $user->id)->count() > 0) {
         return Redirect::to('/inline');
     }
     $count_matches = History::where('uid', '=', $user->id)->count();
     //return Scheduler::where('uid', '=', $user->id)->count();
     return View::make('sessions.index', ['count' => $count_matches]);
 }
예제 #2
0
 public function waiting()
 {
     //Remove from Scheduler for all instances for uid
     //Send both auth::user() and uid emails about them being paired
     $uid = Input::get('uid');
     $restaurant_id = Input::get('restaurant');
     while (Scheduler::where('uid', '=', $uid)->count() > 0) {
         $sch = Scheduler::where('uid', '=', $uid);
         $sch->delete();
     }
     $user = Auth::user();
     $matched_user = User::find($uid);
     $sent = static::sendMail($user->id, $uid, $restaurant_id);
     //return "Notify Both users";
     return Redirect::to('/matched');
 }