public function providerTripDetail() { $id = Request::segment(3); $walker_id = Session::get('walker_id'); $request = Requests::find($id); $request_services = RequestServices::where('request_id', $request->id)->first(); if ($request->confirmed_walker == $walker_id) { $locations = WalkLocation::where('request_id', $id)->orderBy('id')->get(); $start = WalkLocation::where('request_id', $id)->orderBy('id')->first(); $end = WalkLocation::where('request_id', $id)->orderBy('id', 'desc')->first(); $map = "https://maps-api-ssl.google.com/maps/api/staticmap?size=249x249&style=feature:landscape|visibility:off&style=feature:poi|visibility:off&style=feature:transit|visibility:off&style=feature:road.highway|element:geometry|lightness:39&style=feature:road.local|element:geometry|gamma:1.45&style=feature:road|element:labels|gamma:1.22&style=feature:administrative|visibility:off&style=feature:administrative.locality|visibility:on&style=feature:landscape.natural|visibility:on&scale=2&markers=shadow:false|scale:2|icon:http://d1a3f4spazzrp4.cloudfront.net/receipt-new/marker-start@2x.png|{$start->latitude},{$start->longitude}&markers=shadow:false|scale:2|icon:http://d1a3f4spazzrp4.cloudfront.net/receipt-new/marker-finish@2x.png|{$end->latitude},{$end->longitude}&path=color:0x2dbae4ff|weight:4"; foreach ($locations as $location) { $map .= "|{$location->latitude},{$location->longitude}"; } $start_location = json_decode(file_get_contents("https://maps.googleapis.com/maps/api/geocode/json?latlng={$start->latitude},{$start->longitude}"), TRUE); $start_address = $start_location['results'][0]['formatted_address']; $end_location = json_decode(file_get_contents("https://maps.googleapis.com/maps/api/geocode/json?latlng={$end->latitude},{$end->longitude}"), TRUE); $end_address = $end_location['results'][0]['formatted_address']; $owner = Owner::find($request->owner_id); $owner_review = DogReview::where('request_id', $id)->first(); if ($owner_review) { $rating = round($owner_review->rating); } else { $rating = 0; } /* $var = Keywords::where('id', 4)->first(); */ /* $currency = Keywords::where('id', 5)->first(); */ return View::make('web.providerTripDetail')->with('title', 'My ' . Config::get('app.generic_keywords.Trip') . 's')->with('request', $request)->with('request_services', $request_services)->with('start_address', $start_address)->with('end_address', $end_address)->with('currency', Config::get('app.generic_keywords.Currency'))->with('start', $start)->with('end', $end)->with('map_url', $map)->with('owner', $owner)->with('rating', $rating); } else { echo "false"; } }
public function delete_review_owner() { $id = Request::segment(4); $walker = DogReview::where('id', $id)->delete(); return Redirect::to("/admin/reviews"); }