Viewing file: index.blade.php (13.54 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('multirestaurant::layouts.master')
@section('title') {{json_decode(get_settings('site_setting'))->name}} - {{trans('multirestaurant::layout.multi_restaurants_home')}} @endsection
@section('css')
@endsection
@section('content')
@php $template = json_decode(get_settings('multirestaurant_template')); @endphp
@if(isset($template->bg_image_file_name))
<div class="content-section" style="background-image: url('{{asset('uploads/'.$template->bg_image_file_name)}}')">
@else
<div class="content-section">
@endif
<div class="text-section">
<h1>{{isset($template->title)?$template->title:''}}</h1>
</div>
<div class="form-section">
<form class="form-location">
<div class="search-address">
<div class="search-input-box">
<input type="text" class="search-form-input" name="" id="pac-input"
placeholder=" Enter your full address" autocomplete="off" value="">
<small class="error-text" id="error"></small>
</div>
<div class="city-par d-none">
<ul class="city-name pt-2 pb-2" id="showCity"></ul>
</div>
</div>
<div class="btn-set">
<div class="dropdown">
<button class="btn-delivery">{{trans('multirestaurant::layout.select_order_type')}}</button>
<div class="dropdown-content">
<a type="btn" class="locationBtn" id="cash_on_delivery_btn" order-type="cash_on_delivery">{{trans('multirestaurant::layout.delivery')}}</a>
<a type="btn" class="locationBtn" id="takeaway_btn" order-type="takeaway">{{trans('multirestaurant::layout.pick_up')}}</a>
</div>
</div>
<span class="btn-separator">or</span>
<button type="button" class="btn-delivery locationBtn" id="table_booking_btn" order-type="table_booking">{{trans('multirestaurant::layout.book_a_table')}}</button>
</div>
</form>
</div>
</div>
<section class="home-section">
<h2 class="section-title">
{{isset($template->section_two_blur_title)?$template->section_two_blur_title:''}}
<span class="section-subtitle">{{isset($template->section_two_title)?$template->section_two_title:''}}</span>
</h2>
<div class="home-subsection">
<div class="back-img">
@if(isset($template->section_two_bg_image_file_name))
<img src="{{asset('uploads/'.$template->section_two_bg_image_file_name)}}" alt="">
@endif
</div>
<div class="full-contain">
<div class="home-section-content">
<p class="title">{{isset($template->section_two_description_title)?$template->section_two_description_title:''}}</p>
<p class="content">
{{isset($template->section_two_description)?$template->section_two_description:''}}
</p>
<a class="btn-section" href="{{isset($template->section_two_link)?$template->section_two_link:''}}" target="_blank">{{trans('multirestaurant::layout.get_started')}}</a>
</div>
</div>
</div>
</section>
<section class="home-section">
<h2 class="section-title">
{{isset($template->section_three_blur_title)?$template->section_three_blur_title:''}}
<span class="section-subtitle">{{isset($template->section_three_title)?$template->section_three_title:''}}</span>
</h2>
<div class="home-subsection">
<div class="back-img">
@if(isset($template->section_three_bg_image_file_name))
<img src="{{asset('uploads/'.$template->section_three_bg_image_file_name)}}" alt="">
@endif
</div>
<div class="full-contain">
<div class="home-section-content">
<p class="title">{{isset($template->section_three_description_title)?$template->section_three_description_title:''}}</p>
<p class="content">
{{isset($template->section_three_description)?$template->section_three_description:''}}
</p>
<a class="btn-section" href="{{isset($template->section_three_link)?$template->section_three_link:''}}" target="_blank">{{trans('multirestaurant::layout.get_started')}}</a>
</div>
</div>
</div>
</section>
<section class="home-section">
<h2 class="section-title">
{{trans('multirestaurant::layout.cities')}}
<span class="section-subtitle">{{trans('multirestaurant::layout.find_us_in_these_cities_and_many_more')}}</span>
</h2>
<div class="city-section">
<div class="row">
@if(isset($cities))
@foreach($cities as $city)
<div class="col-lg-3 col-md-6">
<a href="{{route('multirestaurant::find.restaurant',['city'=>$city->name])}}">
<figure class="snip0016 cityBtn">
<img alt="sample41" src="{{asset('uploads/'.$city->image)}}">
<figcaption>
<h2>{{trans('multirestaurant::layout.lets')}}
<span>{{trans('multirestaurant::layout.checkout')}} </span>{{$city->name}}
</h2>
</figcaption>
</figure>
</a>
</div>
@endforeach
@endif
</div>
</div>
</section>
<section class="home-dp">
<div class="how-wrapper">
<div class="home-offset">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<h4>
<strong>{{isset($template->section_four_description_title)?$template->section_four_description_title:''}}</strong>
</h4>
<p class="content">{{isset($template->section_four_description)?$template->section_four_description:''}}</p>
</div>
</div>
</div>
</div>
</section>
<div class="location-modal locationModal">
<div class="location-modal-content">
<span class="locationClose close">×</span>
<div id="locationMap"></div>
</div>
<form action="{{route('multirestaurant::find.restaurant')}}" method="GET">
<input type="hidden" id="modal-input" name="restaurant_location">
<input type="hidden" id="input_lat" name="location_lat">
<input type="hidden" id="input_long" name="location_long">
<input type="hidden" id="modal-input-order-type" name="order_type">
<div class="text-center ml-3">
<button type="submit" class="btn process-btn find">{{trans('multirestaurant::layout.find_restaurant')}}</button>
</div>
</form>
</div>
<div id="map"></div>
<div id="infowindow-content">
<span id="place-name" class="title"></span><br />
<span id="place-address"></span>
</div>
<input type="hidden" id="lat">
<input type="hidden" id="long">
<input type="hidden" id="address">
<input id="api_key" type="hidden" value="{{isset(json_decode(get_settings('site_setting'))->api_key)?json_decode(get_settings('site_setting'))->api_key:''}}">
@endsection
@section('js')
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<script>
$(document).on('click','#cash_on_delivery_btn', (e)=> {
e.preventDefault();
const order_type_cash_on_delivery = $('#cash_on_delivery_btn').attr('order-type');
const lat = $('#lat').val();
const long = $('#long').val();
if (lat || long){
$('#error').addClass('d-none');
const address = $('#address').val();
$('#modal-input-order-type').val(order_type_cash_on_delivery)
$('#modal-input').val(address)
$('#input_lat').val(lat)
$('#input_long').val(long)
let html_location_map =`<iframe width="100%" height="380px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=${address}&layer=tc&t=m&z=18&source=embed&output=svembed"></iframe>`
$('#locationMap').html(html_location_map)
$(".location-modal").toggle();
}else {
@if (env('APP_DEMO'))
$("#error").html('This option is not available in the demo version');
@else
$("#error").html('select a location address form the list');
@endif
}
});
$(document).on('click','#takeaway_btn', (e)=> {
e.preventDefault();
const order_type_takeaway = $('#takeaway_btn').attr('order-type');
const lat = $('#lat').val();
const long = $('#long').val();
if (lat || long){
$('#error').addClass('d-none');
const address = $('#address').val();
$('#modal-input-order-type').val(order_type_takeaway)
$('#modal-input').val(address)
$('#input_lat').val(lat)
$('#input_long').val(long)
let html_location_map =`<iframe width="100%" height="380px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=${address}&layer=tc&t=m&z=18&source=embed&output=svembed"></iframe>`
$('#locationMap').html(html_location_map)
$(".location-modal").toggle();
}else {
@if (env('APP_DEMO'))
$("#error").html('This option is not available in the demo version');
@else
$("#error").html('select a location address form the list');
@endif
}
});
$(document).on('click','#table_booking_btn', (e)=> {
e.preventDefault();
$('.city-par').addClass('d-none');
const order_type_table_booking = $('#table_booking_btn').attr('order-type');
const lat = $('#lat').val();
const long = $('#long').val();
if (lat || long){
$('#error').addClass('d-none');
const address = $('#address').val();
$('#modal-input-order-type').val(order_type_table_booking)
$('#modal-input').val(address)
$('#input_lat').val(lat)
$('#input_long').val(long)
let html_location_map =`<iframe width="100%" height="380px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=${address}&layer=tc&t=m&z=18&source=embed&output=svembed"></iframe>`
$('#locationMap').html(html_location_map)
$(".location-modal").toggle();
}else {
@if (env('APP_DEMO'))
$("#error").html('This option is not available in the demo version');
@else
$("#error").html('select a location address form the list');
@endif
}
});
$(document).on('click','.locationClose', (e)=> {
e.preventDefault();
$(".location-modal").toggle();
location.reload();
});
@if (!env('APP_DEMO'))
$(document).on('keyup or past','#pac-input', function (e) {
e.preventDefault();
const cityname = $(this).val();
const key = $('#api_key').val();
if (key){
const search_string = "https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurants+in+"+cityname+"&sensor=false&key="+key+"";
$.ajax({
url: search_string
}).done( function ( data ) {
$('.city-par').removeClass('d-none');
let html_city = '';
$.each(data['results'], function(index,value){
html_city+=`<li class="p-1 locationCity" data-lat="${value.geometry.location.lat}" data-long="${value.geometry.location.lng}" data-address="${value.formatted_address}"> ${value.formatted_address}</li>`
});
$("#showCity").html(html_city);
});
}
});
@endif
$(document).on('click','.locationCity', function (e) {
e.preventDefault();
const lat = $(this).attr('data-lat');
const long = $(this).attr('data-long');
const address = $(this).attr('data-address');
$('#lat').val(lat)
$('#long').val(long)
$('#address').val(address)
$('#pac-input').val(address)
$('.city-par').addClass('d-none');
});
</script>
@endsection
|