Beispiel #1
0
 public function billHouse($id)
 {
     $properties = Property::findOrFail($id);
     $houses = House::where('propertyID', '=', $id)->get();
     $records = House::where('status', '=', 'booked')->get();
     return View::make('backend.code.billing.housepro', compact('houses', 'properties', 'records'));
 }
 /**
  * Display the specified resource.
  * GET /properties/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if (Input::has('workorders')) {
         return Property::with('workorders.user')->with('workorders.property')->findOrFail($id);
     } else {
         return Property::findOrFail($id);
     }
 }
 /**
  * Update the specified property in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function postUpdate($id)
 {
     $property = Property::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Property::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $property->update($data);
     return Redirect::action('PropertiesController@getIndex');
 }
 /**
  * Display the specified resource.
  * GET /properties/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $properties = Property::findOrFail($id);
     return View::make('backend.code.property.show', compact('properties'));
 }
Beispiel #5
0
 /**
  * Remove the specified kin from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $property = Property::findOrFail($id);
     Property::destroy($id);
     Audit::logaudit('Properties', 'delete', 'deleted: ' . $property->name);
     return Redirect::route('Properties.index')->withDeleteMessage('Company Property successfully deleted!');
 }
 /**
  * Show the form for editing the specified resource.
  * GET /branch/{id}/edit
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $property = Property::findOrFail($id);
     return View::make('backend.landings.edit', compact('property'));
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $reservation = $this->reservation->findOrFail($id);
     $property = Property::findOrFail($reservation->property_id);
     return View::make('admin.reservations.show', compact('reservation', 'property'));
 }
 public function postUpdateRates()
 {
     $rules = ['from_date' => 'required|date_format:Y-m-d|after:' . date('Y-m-d', strtotime('yesterday')), 'to_date' => 'required|date_format:Y-m-d|after:' . date('Y-m-d', strtotime('yesterday')), 'week_day' => 'required', 'rooms' => 'required', 'rate' => 'required|numeric|min:0', 'single_rate' => 'numeric|min:0'];
     $validator = Validator::make($data = Input::all(), $rules);
     if ($validator->fails()) {
         return Response::json(['success' => false, 'errors' => $validator->getMessageBag()->toArray()], 400);
         //400 - http error code
     }
     //all ok so get rooms and plans mapping
     $weekDays = $data['week_day'];
     $errors = [];
     $property = Property::findOrFail(Property::getLoggedId());
     foreach ($data['rooms'] as $roomId) {
         //get room data
         $room = Room::findOrFail($roomId);
         $depth = 0;
         $this->updateChannelRate($room, $property, $data, $data['rate'], $weekDays, $errors, $depth);
     }
     if (!empty($errors)) {
         return Response::json(['success' => false, 'errors' => $errors], 400);
         //400 - http error code
     }
     return Response::json(['success' => true], 200);
     //200 - http success code
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $property = $this->property->findOrFail($id);
     return View::make('admin.properties.show', compact('property'));
 }