예제 #1
0
파일: RoomInfo.php 프로젝트: sanketar/sepro
 public static function getRoomsGreaterThanCapacity($cap)
 {
     $mincap = RoomInfo::where('capacity', '>=', $cap)->min('capacity');
     //        dd($mincap);
     if (!$mincap) {
         $lsofrooms = ["msg" => "No rooms of this capacity available"];
     } else {
         $lsofrooms = RoomInfo::whereIn('capacity', [$mincap])->lists('room_no');
     }
     return $lsofrooms;
 }
예제 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request $request
  * @return Response
  */
 public function store(Request $request)
 {
     $roomno = $request->get('room_no');
     $roomexists = RoomInfo::where('room_no', $roomno)->value('room_no');
     if ($roomexists) {
         $retstatus = 0;
     } else {
         $retstatus = RoomInfo::saveFormData($request->except(array('_token')));
     }
     if (is_null($retstatus)) {
         $msg = "New Room Added";
     } else {
         $msg = "There was some problem with adding this room";
     }
     //        dd($msg);
     //        return view('addroom')->with('statusmsg',$msg);
     return redirect('addroom')->with('statusmsg', $msg);
 }