Route::get('/landing', function () {
    return View::make('landing');
});
Route::get('/landing_with_menu', function () {
    return View::make('landing_menu');
});
//Route::get('home', 'HomeController@index');
Route::post('search/autocomplete', array('as' => 'search', 'uses' => 'SearchController@autocomplete'));
Route::post('/search', array('as' => 'search', 'uses' => 'SearchController@homeSearch'));
Route::get('/search', array('as' => 'search', 'uses' => 'SearchController@bannerSearch'));
Route::get('restaurants/request_online_order', function () {
    return View::make('search');
});
Route::post('/restaurants/request_online_order', 'RestaurantsController@request_online_order');
Route::get('/restaurants/next_reviews/{id}', function ($id) {
    $data['reviews'] = \App\Restaurant_Reviews::where('restaurant_id', '=', $id)->paginate(50);
    return View::make('next_review_box')->with('data', $data);
});
Route::post('restaurants/request_online_ordering', array('as' => 'request_online_ordering', 'uses' => function () {
    $data['avail'] = \App\User_Request_Demo::where('email', '=', Input::get('guest_email'))->where('restaurants_id', '=', Input::get('r_id'))->get();
    if (count($data['avail']) == 0) {
        $re = DB::table('user_request_demo')->insert(['restaurants_id' => Input::get('r_id'), 'first_name' => Input::get('guest_first_name'), 'last_name' => Input::get('guest_last_name'), 'email' => Input::get('guest_email'), 'request_type_id' => Input::get('r_t')]);
        \App\Restaurants::where('id', '=', Input::get('r_id'))->increment('request_order');
    } else {
        echo '<script>alert("You have already been registered with us. Thank you for your interest");</script>';
    }
    return Redirect::intended('restaurants/' . Input::get('rlink'));
}));
Route::get('10-Best/{category_name}/{city_name}', function ($category_name, $city_name) {
    DB::connection()->enableQueryLog();
    $data['locations'] = GeoIP::getLocation();