Viewing file: 6598f28d05904e9d90c6328adfa3f5e040246f1c.php (35.57 KB) -rwxrwxrwx Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $__env->startSection('title'); ?> <?php echo e(json_decode(get_settings('site_setting'))->name); ?> - <?php echo e(trans('multirestaurant::layout.multi_restaurants')); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('css'); ?> <style> .restaurants-container { padding-top: .5rem; }
.restaurant-filter { position: relative; display: flex; justify-content: center; align-items: center; }
.restaurant-filter h4 { font-size: 20px; line-height: 1.75rem; margin: 0; font-weight: 600; }
.restaurant-filter-content-item { display: flex; align-items: center; margin-top: 1rem; padding: 1rem .75rem; }
.restaurant-filter-content-item .icons { user-select: none; width: 1em; height: 1em; overflow: hidden; display: inline-block; text-align: center; flex-shrink: 0; font-size: 30px; color: #401B60; margin-right: 15px; }
.restaurant-filter-content-item input { font: inherit; letter-spacing: inherit; color: currentColor; padding: 4px 0 5px; border: 0; box-sizing: content-box; background: none; height: 1.4375em; margin: 0; display: block; min-width: 0; width: 100%; }
.restaurant-filter-content-item input::placeholder { color: gray; opacity: 1; transition: color 0.3s ease; }
.restaurant-filter-content-item input:focus { outline: 0; }
.event-dates { line-height: 1; }
.event-dates p { margin: 0; font-size: 16px; font-weight: 600; }
.event-dates span { margin: 0; font-size: 12px; color: gray; font-weight: 600; }
.restaurant-filter-content-price { letter-spacing: -.1em !important; font-weight: 700; margin: 1rem 0; }
.restaurant-filter-content-price .restaurant-filter-content-price-box { position: relative; display: flex; align-items: stretch; justify-items: flex-start; width: 100%; }
.restaurant-filter-content-price-box-item { position: relative; text-align: center; cursor: pointer; background: #f5f5f5; padding: 2px 2px; }
.restaurant-filter-content-price-box-link.active { background: #FFF; padding: 2px 5px; border-radius: 4px; }
.restaurant-filter-content-price-box-link { min-height: 30px; line-height: 30px; padding: 2px 8px; }
.restaurant-filter-content-cuisines { margin: 0; padding: 0; color: rgba(0, 0, 0, 0.88); font-size: 14px; margin: .5rem; }
.restaurant-filter-content-cuisines-list { font-size: 14px; }
.restaurant-filter-content-cuisines-item { position: relative; }
.restaurant-filter-content-cuisines-link { display: flex; align-items: center; gap: .5rem; }
.restaurant-filter-content-cuisines-link label { margin: 0; font-weight: 600; }
.restaurants-details { border-left: 2px solid #e2e8f0; height: 100%; }
.restaurants-details-header { padding: .5rem 1rem; border-bottom: 2px solid #e2e8f0; }
.restaurants-details-header h6 { font-weight: 600; font-size: 20px; }
.restaurants-details-body { padding: 1rem 1rem; }
.restaurants-details-body-content { padding: .25rem; margin: .5rem 0; display: flex; gap: 1rem; align-items: center; }
.restaurants-details-body-content img { width: 100px; height: 100px; border-radius: 5px; box-shadow: 0 0 5px #333; }
.restaurants-details-body-content-info { padding: .25rem; line-height: 20px; }
.restaurants-details-body-content-info .h5 { font-size: .875rem; color: #000; font-weight: 600; }
.restaurant-rate { display: flex; gap: .25rem; align-content: center; }
.restaurant-rate .stars i { color: #faaf00; font-size: 14px; }
.restaurant-rate .reviews span { font-size: 11px; color: #64748b; }
.restaurant-location { display: flex; align-items: center; gap: .5rem; font-size: 12px; color: #64748b; }
.restaurant-location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 500px; }
.restaurants-details-footer { display: flex; justify-content: end; align-items: center; margin-top: 10px; }
.restaurants-details-body-list { display: flex; justify-content: center; align-items: center; gap: 8px; }
.restaurants-details-body-list-btn { display: block; width: 100%; height: 100%; padding: 0; font-size: 12px; text-align: center; background-color: transparent; border: 1px solid transparent; border-radius: 4px; outline: none; transition: border 0.2s; }
.restaurants-details-body-list-left .btn.not-allowed { color: rgba(0, 0, 0, 0.25); cursor: not-allowed; }
.footer { padding-top: 30px !important; }
.restaurants-details-body-item { display: inline-block; min-width: 32px; height: 32px; margin-inline-end: 8px; font-family: Ubuntu, Noto Sans Bengali, sans-serif; line-height: 30px; text-align: center; vertical-align: middle; list-style: none; background-color: transparent; border: 1px solid transparent; border-radius: 4px; outline: 0; cursor: pointer; user-select: none; }
.restaurants-details-body-item.active { font-weight: 600; background-color: #ffffff; border-color: #401b60; }
.restaurants-details-header { display: none; }
.side-bars.restaurants-side-bar { max-width: 100% !important; width: 100% !important; }
@media (max-width: 991.98px) { .restaurant-location span { max-width: 250px; } }
@media (max-width: 575.98px) { .restaurant-location span { max-width: 140px; }
.restaurants-details { border: none; }
.restaurants-details-body { padding: 1rem 0; }
.restaurants-details-header { padding: .5rem 0rem; border-bottom: 2px solid #e2e8f0; display: flex; align-items: center; }
.restaurants-details-header h6 { font-weight: 600; font-size: 18px; margin: 0; word-break: break-word; white-space: normal; }
.restaurant-filter { display: none; }
.restaurants-details-header .btn { display: block; }
.side-bars-body .restaurant-filter { display: block; }
.restaurants-side-bar .side-bars-body { height: 490px; overflow-y: scroll; }
}
p { margin: 0; }
a:hover { text-decoration: none } </style> <style> #ui-datepicker-div{ top: 50% !important; } </style> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <main class="main"> <input type="hidden" value="<?php echo e($location ?? ''); ?>" id="location"> <section class="mt-4 restaurants-container"> <div class="row"> <div class="col-lg-4 col-md-4"> <div class="restaurant-filter"> <div class="restaurant-filter-content"> <h4> <i class="fa fa-filter"></i> <?php echo e(trans("multirestaurant::layout.filters")); ?>
</h4> <div class="restaurant-filter-content-item"> <span class="icons"> <i class="fa fa-cutlery"></i> </span> <input type="text" id="dynamicInput" name="name" class="dynamicInput" value="<?php echo e($name ?? ''); ?>"> </div> <div class="restaurant-filter-content-item" id="checkin-date"> <span class="icons"> <i class="fa fa-calendar"></i> </span> <div class="event-dates"> <p><?php echo e(trans("multirestaurant::layout.check_in")); ?></p> <span id="checkin-label"><?php echo e($date ?? trans("multirestaurant::layout.pick_date")); ?></span> </div> <input type="text" value="<?php echo e($date ?? ''); ?>" id="checkin-datepicker" style="position: absolute; visibility: hidden;" /> </div> <div class="restaurant-filter-content-item" id="checkin-time"> <span class="icons"> <i class="fa fa-clock-o"></i> </span> <div class="event-dates"> <p><?php echo e(trans("multirestaurant::layout.time")); ?></p> <span id="checkin-time-label"><?php echo e($time ?? trans("multirestaurant::layout.pick_time")); ?></span> </div> <input type="text" value="<?php echo e($time ?? ''); ?>" id="checkin-timepicker" style="position: absolute; visibility: hidden;" /> </div> <h4 class="mt-3"> <i class="fa fa-money"></i> <?php echo e(trans('multirestaurant::layout.price_range')); ?>
</h4> <div class="restaurant-filter-content-price">
<input type="range" id="priceRange" class="priceRange" name="priceRange" min="0" max="50000" step="1" value="0"> <span id="priceValue" class="priceValue">0</span> </div>
<h4 class="mt-4"> <i class="fa fa-cutlery"></i> <?php echo e(trans('multirestaurant::layout.cuisines')); ?>
</h4> <div class="restaurant-filter-content-cuisines"> <?php $selectedCategories = (array) request()->input('categories', []); ?> <input type="hidden" name="selected_categories" id="selected_categories" value="<?php echo e(implode(',', $selectedCategories)); ?>"> <div class="restaurant-filter-content-cuisines-list"> <?php $__currentLoopData = $categorys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="restaurant-filter-content-cuisines-item"> <div class="restaurant-filter-content-cuisines-link"> <input type="checkbox" value="<?php echo e($category->id); ?>" name="checkbox" id="buffet-<?php echo e($category->name); ?>" class="checkbox" <?php echo e(in_array($category->id, $selectedCategories) ? 'checked' : ''); ?>> <label for="buffet-<?php echo e($category->name); ?>"><?php echo e($category->name); ?></label> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> </div> </div> </div> </div> <div class="col-lg-8 col-md-8" id="restaurants-details"> <div class="restaurants-details"> <div class="restaurants-details-header"> <h6 id='totalrestaurants'> </h6> <button class="btn" id="open"> <i class="fa fa-filter"></i> Filters </button> </div> <div class="restaurants-details-body"> </div> <div class="restaurants-details-footer"> </div> </div> </div> </div> </section> </main> <div id="restaurants-side-bars" class="side-bars restaurants-side-bar"> <div class="side-bars-header"> <i class="fa fa-times" id="close"></i> </div> <div class="side-bars-body"> <div class="restaurant-filter"> <div class="restaurant-filter-content"> <h4> <i class="fa fa-filter"></i> Filters </h4> <div class="restaurant-filter-content-item"> <span class="icons"> <i class="fa fa-cutlery"></i> </span> <input type="text" id="dynamicInput2" class="dynamicInput"> </div> <div class="restaurant-filter-content-item" id="checkin-date2"> <span class="icons"> <i class="fa fa-calendar"></i> </span> <div class="event-dates"> <p><?php echo e(trans("multirestaurant::layout.check_in")); ?></p> <span id="checkin-label2"><?php echo e($date ?? trans("multirestaurant::layout.pick_date")); ?></span> <input type="text" value="<?php echo e($date ?? ''); ?>" id="checkin-datepicker2" style="position: absolute; visibility: hidden;" /> </div> </div> <div class="restaurant-filter-content-item" id="checkin-time2"> <span class="icons"> <i class="fa fa-clock-o"></i> </span> <div class="event-dates"> <p><?php echo e(trans("multirestaurant::layout.time")); ?></p> <span id="checkin-time-label2"><?php echo e($time ?? trans("multirestaurant::layout.pick_time")); ?></span> <input type="text" value="<?php echo e($time ?? ''); ?>" id="checkin-timepicker2" style="position: absolute; visibility: hidden;" /> </div> </div>
<h4 class="mt-3"> <i class="fa fa-money"></i> Price Range </h4> <div class="restaurant-filter-content-price"> <input type="range" id="priceRange" class="priceRange" name="priceRange" min="0" max="50000" step="1" value="0"> <span id="priceValue" class="priceValue">0</span> </div>
<h4 class="mt-4"> <i class="fa fa-cutlery"></i> Cuisines </h4> <div class="restaurant-filter-content-cuisines"> <div class="restaurant-filter-content-cuisines-list"> <?php $__currentLoopData = $categorys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="restaurant-filter-content-cuisines-item"> <div class="restaurant-filter-content-cuisines-link"> <input type="checkbox" value="<?php echo e($category->id); ?>" name="checkbox" id="buffet2-<?php echo e($category->name); ?>" class="checkbox"> <label for="buffet2-<?php echo e($category->name); ?>"><?php echo e($category->name); ?></label> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?> <script> $(document).on('click', '.restaurant-card', function(e) { e.preventDefault(); const restaurant_id = $(this).attr('restaurant_id'); const url = $(this).attr('data-order-url'); if (url) { window.location.href = url; return; } const tables = <?php echo json_encode(isset($tables) ? $tables : '', 15, 512) ?>; let html_tables = ''; $.each(tables, function(index, value) { if (value.restaurant_id == restaurant_id) { html_tables += ` <option value='${value.id}'>${value.name} (Sitting capacity ${value.no_of_capacity} and table position ${value.position})</option>`; }
}); $('#restaurant_table_id').val(restaurant_id); $('#restauran_tables').html(html_tables); $(".tableBookingModal").toggle(); })
$(document).on('click', '.tableBookingClose', (e) => { e.preventDefault(); $(".tableBookingModal").toggle(); }); </script> <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script> <script> const restaurant_id = $('#restaurant_id').attr('restaurant_id'); const city_restaurant_id = $('#city-data-id').attr('data-id'); if (restaurant_id || city_restaurant_id) { $('#multirestaurant-notification').addClass('d-none'); } </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 { <?php if(env('APP_DEMO')): ?> $("#error").html('This option is not available in the demo version'); <?php else: ?> $("#error").html('select a location address form the list'); <?php 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 { <?php if(env('APP_DEMO')): ?> $("#error").html('This option is not available in the demo version'); <?php else: ?> $("#error").html('select a location address form the list'); <?php 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 { <?php if(env('APP_DEMO')): ?> $("#error").html('This option is not available in the demo version'); <?php else: ?> $("#error").html('select a location address form the list'); <?php endif; ?> } }); $(document).on('click', '.locationClose', (e) => { e.preventDefault(); $(".location-modal").toggle(); location.reload(); }); <?php 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); }); }
}); <?php 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> <script> const input = document.getElementById('dynamicInput'); const input2 = document.getElementById('dynamicInput2');
const messages = [ "Restaurant", "Area", "Cuisine", ]; let msgIndex = 0; let charIndex = 0; let isDeleting = false; const prefix = "Search ";
function typeEffect() { const currentWord = messages[msgIndex]; const fullText = prefix + currentWord; const currentPlaceholder = prefix + currentWord.substring(0, charIndex);
input.placeholder = currentPlaceholder; input2.placeholder = currentPlaceholder;
if (!isDeleting) { if (charIndex < currentWord.length) { charIndex++; setTimeout(typeEffect, 200); } else { setTimeout(() => { isDeleting = true; typeEffect(); }, 3000); } } else { if (charIndex > 0) { charIndex--; setTimeout(typeEffect, 150); } else { isDeleting = false; msgIndex = (msgIndex + 1) % messages.length; setTimeout(typeEffect, 500); } } }
typeEffect(); </script> <script> $(document).on('click', '#close', function(e) { e.preventDefault(); $('#restaurants-side-bars').removeClass('active'); }); $(document).on('click', '#open', function(e) { e.preventDefault(); $('#restaurants-side-bars').addClass('active'); }); </script> <script> $(document).ready(function() {
$('.dynamicInput').keyup(function(e){ ajax(); });
$('.checkbox').on('change', function() { var selectedValues = [];
$('.checkbox:checked').each(function() { selectedValues.push($(this).val()); });
$('#selected_categories').val(selectedValues); ajax(); });
$('.priceRange').on('change', function() { ajax(); });
$("#checkin-datepicker").datepicker({ dateFormat: "D, M d yy", minDate: 0, onSelect: function (dateText) { $("#checkin-label").text(dateText); ajax(); } });
$("#checkin-date").on("click", function () { $("#checkin-datepicker").datepicker("show"); }); $("#checkin-datepicker2").datepicker({ dateFormat: "D, M d yy", minDate: 0, onSelect: function (dateText) { $("#checkin-label2").text(dateText); ajax(); } });
$("#checkin-date2").on("click", function () { $("#checkin-datepicker2").datepicker("show"); });
$("#checkin-timepicker").timepicker({ timeFormat: 'h:mm TT', onSelect: function (timeText) { $("#checkin-time-label").text(timeText); ajax(); } });
$("#checkin-time").on("click", function () { $("#checkin-timepicker").timepicker("show"); });
$("#checkin-timepicker2").timepicker({ timeFormat: 'h:mm TT', onSelect: function (timeText) { $("#checkin-time-label2").text(timeText); ajax(); } });
$("#checkin-time2").on("click", function () { $("#checkin-timepicker2").timepicker("show"); });
function ajax(){ let name = ''; if ($('#dynamicInput').val()) { name = $('#dynamicInput').val(); }else{ name = $('#dynamicInput2').val(); } let categories = $('#selected_categories').val(); let price_range = $('.priceRange').val();
let datepicker = $('#checkin-datepicker').val(); let timepicker = $('#checkin-timepicker').val();
let location = $('#location').val();
$.ajax({ url: '<?php echo e(route('multirestaurant::get.all.restaurants')); ?>', method: "GET", data: { name: name, categories: categories, price_range : price_range, date:datepicker, time:timepicker, location:location, }, success: function(res) { if (res.data && Array.isArray(res.data)) { var restaurantsHtml = ''; res.data.forEach(function(restaurant) {
var totalRating = 0; var reviews = restaurant.reviews || []; reviews.forEach(function(review) { totalRating += review.rating; }); var averageRating = reviews.length ? totalRating / reviews.length : 0; var fullStars = Math.floor(averageRating); var halfStar = (averageRating - fullStars) > 0 ? 1 : 0; var emptyStars = 5 - fullStars - halfStar;
var starsHtml = ''; for (var i = 0; i < fullStars; i++) { starsHtml += '<i class="fa fa-star" ></i>'; } if (halfStar) { starsHtml += '<i class="fa fa-star-half-o" ></i>'; } for (var i = 0; i < emptyStars; i++) { starsHtml += '<i class="fa fa-star-o" ></i>'; } restaurantsHtml += ` <div class="restaurants-details-body-content"> <a href="<?php echo e(route('multirestaurant::restaurant', '')); ?>/${restaurant.id}"> <img src="/uploads/${restaurant.profile_image}" alt=""> </a> <div class="restaurants-details-body-content-info"> <a href="<?php echo e(route('multirestaurant::restaurant', '')); ?>/${restaurant.id}" class="h5">${restaurant.name}</a> <div class="restaurant-rate"> <div class="stars"> ${starsHtml} </div> <div class="reviews"> <span>${reviews.length} Reviews</span> </div> </div> <div class="restaurant-location"> <b> ${restaurant.currency_symbol}</b> <span>${restaurant.description}</span> </div> <div class="restaurant-location"> <i class="fa fa-map-marker"></i> <span>${restaurant.location}</span> </div> </div> </div> `; });
$('.restaurants-details-body').html(restaurantsHtml); } $('#totalrestaurants').text(res.data.length + ' Restaurant Available ');
}, error: function(err) { console.error('Error fetching restaurants:', err); } }); }
function getPriceLevel(currencySymbol, maxPrice) { var priceLevel = ''; if (maxPrice < 100) { priceLevel = currencySymbol.repeat(2); } else if (maxPrice < 1000) { priceLevel = currencySymbol.repeat(3); } else if (maxPrice < 10000) { priceLevel = currencySymbol.repeat(4); } else { priceLevel = currencySymbol.repeat(5); } return priceLevel; }
ajax();
}); </script> <script> document.querySelectorAll('.priceRange').forEach(function(slider) { slider.addEventListener('input', function() { const priceValue = slider.nextElementSibling; priceValue.textContent = slider.value; }); }); </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('multirestaurant::layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/picotech/domains/test.qr.picotech.app/public_html/Modules/MultiRestaurant/Resources/views/multiRestaurant.blade.php ENDPATH**/ ?>
|