public function requestAllotment()
 {
     $st_date = Session::get('st_date');
     $ed_date = Session::get('ed_date');
     if (Input::has('room_refer_id')) {
         $room_identity = Input::get('room_refer_id');
         $room_identity_array = explode("_", $room_identity);
         $hotel_id = $room_identity_array[0];
         $room_type = $room_identity_array[1];
         $room_count = Session::get('room_count');
     }
     if (Auth::check()) {
         $user_id = Auth::user()->id;
     }
     if (Session::has('market')) {
         $market = Session::get('market');
     }
     //dd($room_count);
     $request_allotment = array('hotel_id' => $hotel_id, 'user_id' => $user_id, 'from' => $st_date, 'to' => $ed_date, 'room_type_id' => $room_type, 'room_count' => $room_count, 'market_id' => $market);
     $request_allotment_id = AllotmentInquiry::create($request_allotment);
     return Response::json(true);
 }
Example #2
0
 public function getConfirmedInquiries()
 {
     $allotment_inquiries = null;
     $rate_inquiries = null;
     $rInq = RateInquiry::where('status', 1)->where('viewed', 0)->where('user_id', Auth::id())->get();
     $aInq = AllotmentInquiry::where('status', 1)->where('viewed', 0)->where('user_id', Auth::id())->get();
     $inquiry_count = $rInq->count() + $aInq->count();
     //        dd($rInq);
     if ($rInq->count()) {
         $rate_inquiries = [];
         foreach ($rInq as $inq) {
             $rate_inquiries[] = ['id' => $inq->id, 'hotel' => $inq->hotel->name, 'room_type' => $inq->roomType->room_type, 'meal_basis' => $inq->mealBasis->meal_basis, 'room_specification' => $inq->roomSpecification->room_specification, 'from' => $inq->from, 'to' => $inq->to, 'rateinquiries_url' => URL::to('inquiries/rate-inquiries')];
         }
     }
     if ($aInq->count()) {
         $allotment_inquiries = [];
         foreach ($rInq as $inq) {
             $inq[] = ['id' => $aInq->id, 'hotel' => $aInq->hotel->name, 'room_type' => $aInq->roomType->room_type, 'from' => $aInq->from, 'to' => $aInq->to];
         }
     }
     $inquiries = ['rate_inquiries' => $rate_inquiries, 'allotment_inquiries' => $allotment_inquiries, 'inquiry_count' => $a = $inquiry_count == 0 ? null : $inquiry_count];
     return Response::json($inquiries);
 }
 /**
  * Remove the specified allotmentinquiry from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     AllotmentInquiry::destroy($id);
     return Redirect::route('inquiries.allotment-inquiries.index');
 }