123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- @extends('layouts.app')
- @section('page-title')| {{__('label.outlet_pause_orders')}} @endsection
- @section('css')
- <link href="{!! env('APP_ASSETS') !!}css/outlets.css?v=1.3" rel="stylesheet" type="text/css">
- @endsection
- <link href="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
- @section('content')
- <style>
- .p-10{
- padding: 10px;
- }
- .ml-0{
- margin-left: 0 !important;
- }
- .flex-items{
- display: flex;
- align-items: center;
- gap: 7px;
- }
- @-webkit-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27); }
- to { background-color: inherit; }
- }
- @-moz-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- @-o-keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- @keyframes special {
- from { background-color: rgba(255, 121, 77, 0.27);; }
- to { background-color: inherit; }
- }
- .special {
- -webkit-animation: special 1s infinite; /* Safari 4+ */
- -moz-animation: special 1s infinite; /* Fx 5+ */
- -o-animation: special 1s infinite; /* Opera 12+ */
- animation: special 1s infinite; /* IE 10+ */
- }
- .btn-toggle.btn-sm,.btn-toggle.btn-sm > .handle{
- border-radius: 16px;
- }
- table.dataTable {
- clear: both;
- margin-top: 6px !important;
- margin-bottom: 6px !important;
- max-width: none !important;
- border-collapse: collapse !important;
- font-family: 'Open Sans';
- }
- .theme-primary .paging_simple_numbers .pagination .paginate_button.active a,.theme-primary .pagination li a:hover,.theme-primary .paging_simple_numbers .pagination .paginate_button:hover a{
- color: white !important;
- background: #ffa505 !important;
- }
- .search-outlet{
- width: 400px;
- background-color: white;
- }
- .search-buttom{
- top: 8px;
- right: 15px;
- font-size: 20px;
- color: #e1e1e1;
- }
- .btn-toggle.btn-sm:focus, .btn-toggle.btn-sm.focus, .btn-toggle.btn-sm:focus.active, .btn-toggle.btn-sm.focus.active{
- box-shadow: none;
- }
- .btn-outlet{
- }
- .btn-toggle.active{
- color: white !important;
- background: green;
- }
- .rdot {
- height: 10px;
- width: 10px;
- background-color: red;
- border-radius: 0%;
- display: inline-block;
- }
- .gdot {
- height: 10px;
- width: 10px;
- background-color: green;
- border-radius: 0%;
- display: inline-block;
- margin-right: 5px;
- }
- .pause-order{
- padding: 40px; background-color: #fff8ec; margin-bottom: 30px;
- }
- .ar-m-adjust
- {
- margin-left: 0 !important;
- }
- html[dir="rtl"] .ar-m-adjust
- {
- margin-right: 0 !important;
- margin-left:5px !important;
- }
- @media (max-width:641px) {
- .list-inline li{
- margin-right: 5px;
- }
- }
- @media(max-width:767px)
- {
- .order_status_div
- {
- text-align:left !important;
- margin-top:14px;
- }
- .sm-mt-0
- {
- margin-top: 0px !important;
- }
- button.switch-me
- {
- margin-left: 3px !important;
- }
- }
- </style>
- @php
- $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
- $lang = $resto->default_lang;
- app()->setLocale($lang);
- if(session('app_lang') !==null){
- $lang = session('app_lang');
- app()->setLocale($lang);
- }
- @endphp
- @php
- //$resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
- $restuarant1 = $resto;
- $resto_metas = \App\Helpers\CommonMethods::getRestoMetas($restuarant1);
- $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
- $business_type = isset($resto_metas['BUSSINESS_TYPE'])?trim($resto_metas['BUSSINESS_TYPE']):"Restaurants";
- @endphp
- <!-- Content Wrapper. Contains page content -->
- <div class="content-wrapper">
- <div class="container-full">
- <!-- Main content -->
- <section class="content">
- <div class="row ">
- <div class="col-md-6">
- <div class="page-top-title">
- <h3 class="title m-0">{{__('label.pause_orders')}}</h3>
- </div>
- </div>
- </div>
- @php
- $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID());
- @endphp
- <div class="row m-0 p-10">
- @if(isset($outlets) && $outlets->count() > 0)
- @foreach($outlets as $outlet)
- @php
- $outlet_pickup_off_date = ($outlet->outlet_pickup_off_date);
- $outlet_delivery_off_date = ($outlet->outlet_delivery_off_date);
- if(!empty($outlet_pickup_off_date) || !empty($outlet_delivery_off_date)){
- $outlet1 = \App\Models\Outlets::find($outlet->id);
- $delivery_date = \Carbon\Carbon::createFromDate($outlet_delivery_off_date)->addDays(1);
- $pickup_date = \Carbon\Carbon::createFromDate($outlet_pickup_off_date)->addDays(1);
- $today = \Carbon\Carbon::now();
- if(!empty($delivery_date) || !empty($pickup_date)){
- $result = $today->gt($delivery_date);
- if($result){
- $outlet1->outlet_delivery_off_date = null;
- $outlet1->is_delivery = 1;
- }
- $result = $today->gt($pickup_date);
- if($result){
- $outlet1->outlet_pickup_off_date = null;
- $outlet1->is_pickup = 1;
- }
- $outlet1->save();
- $outlet = $outlet1;
- $outlet_pickup_off_date = $outlet1->outlet_pickup_off_date;
- $outlet_delivery_off_date = $outlet1->outlet_delivery_off_date;
- }
- }
- @endphp
- <div class="pause-order">
- <div class="row">
- <div class="col-md-6"><p class="fw-normal m-0 ar-sm-mr-5">{!! $resto->name !!}</p>
- <h5 class="m-0 fw-bold ar-sm-mr-5">{!! $outlet->name !!}</h5>
- </div>
- <div class="col-md-6 text-{{($lang=='ar')?'start':'end'}} order_status_div">
- <ul class="list-inline">
- <li> @if($outlet->is_delivery=="1") <span class="gdot"></span>{{__('label.delivery')}} @else<span class="rdot"></span> {{__('label.delivery_pause')}} @endif
- </li>
- <li> @if($outlet->is_pickup=="1") <span class="gdot"></span> {{__('label.pickup')}} @else <span class="rdot"></span>{{__('label.pickup_pause')}} @endif</li>
- @if($business_type=="Restaurants")
- <li> @if($outlet->is_contactless_dining=="1") <span class="gdot"></span> {{__('label.dine_in')}} @else <span class="rdot"></span> {{__('label.dine_in_pause')}} @endif</li>
- @endif
- </ul>
- </div>
- </div>
- <div class="row mt-30 sm-mt-0">
- <div class="col-md-12 col-lg-4 mb-2">
- <div class="flex-items">
- <button type="button" data-on-text="Open" data-type="delivery" data-off-text="Closed" class="ar-m-adjust switch-me btn-toggle btn-sm btn-outlet @if($outlet->is_delivery=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_delivery=="1") true @else false @endif" autocomplete="off">
- <div class="handle"></div>
- </button> {{__('label.accepting_delivery_orders')}}
- @if(isset($outlet_delivery_off_date) && !empty($outlet_delivery_off_date)) <br /> <small class="text-danger">{{__('label.paused_till_to')}} {!! \Carbon\Carbon::parse($outlet_delivery_off_date)->format('d/m/Y') !!}</small> @endif
- </div>
- </div>
- <div class="col-md-12 col-lg-4">
- <div class="flex-items">
- <button type="button" data-type="pickup" data-on-text="Open" data-off-text="Closed" class="switch-me ar-mrl-adjust btn-toggle btn-sm btn-outlet @if($outlet->is_pickup=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_pickup=="1") true @else false @endif" autocomplete="off">
- <div class="handle"></div>
- </button> {{__('label.accepting_pickup_orders')}}
- @if(isset($outlet_pickup_off_date) && !empty($outlet_pickup_off_date)) <br /> <small class="text-danger">{{__('label.paused_till_to')}} {!! \Carbon\Carbon::parse($outlet_pickup_off_date)->format('d/m/Y') !!}</small> @endif
- </div>
- </div>
- @if($business_type=="Restaurants")
- <div class="col-md-12 col-lg-4">
- <div class="flex-items">
- <button type="button" data-type="dine-in" data-on-text="Open" data-off-text="Closed" class="ar-m-adjust switch-me btn-toggle btn-sm btn-outlet @if($outlet->is_contactless_dining=="1") active @endif switch-me" data-id="{!! $outlet->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->is_contactless_dining=="1") true @else false @endif" autocomplete="off">
- <div class="handle"></div>
- </button>{{__('label.accepting_dine_in')}}
- </div>
- </div>
- @endif
- </div>
- </div>
- @endforeach
- @endif
- </div>
- </section>
- <!-- /.content -->
- </div>
- </div>
- <!-- /.content-wrapper -->
- <div class="modal" tabindex="-1" id="date-model">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="report-tile"></h5>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body">
- <p>You 'll set date when you want to swithc on automatically.</p>
- <form id="get-report-data" method="POST" action="{!! env('APP_URL') !!}download/report/data" enctype="multipart/form-data">
- @csrf
- <input type="hidden" name="report_type" />
- <div class="form-group">
- <label>Date frame</label>
- <input type="text" id="rangedate" class="form-control">
- </div>
- </form>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
- <button type="button" class="btn btn-primary set-date">Set Date</button>
- </div>
- </div>
- </div>
- </div>
- @endsection
- @section('js')
- <script type="text/javascript" src="{!! env('APP_ASSETS') !!}vendor_components/bootstrap-daterangepicker/daterangepicker.min.js"></script>
- <script>
- var _outletType = "";
- var _selectedOutletID = 0;
- $(function () {
- $("body").on("click",".set-date",function(){
- var start_date = $('#rangedate').data('daterangepicker').startDate;
- var s_date = moment(start_date).format("YYYY-MM-DD");
- $.ajax({
- url:"{!! env('APP_URL') !!}outlet/feature/update/status",
- type:"POST",
- data:{
- id:_selectedOutletID,
- status:0,
- offDate:s_date,
- type:_outletType,
- "_token":'{!! csrf_token() !!}'
- },
- success:function () {
- $("#date-model").modal('hide');
- }
- });
- });
- $('#rangedate').daterangepicker({
- singleDatePicker: true,
- showDropdowns: true,
- minDate: new Date(),
- }, function(start, end, label) {
- });
- $("body").on("click",".switch-me",function () {
- var is_active = $(this).attr("aria-pressed");
- var id = $(this).data('id');
- _selectedOutletID = id;
- var type = $(this).data('type');
- is_active = $.trim(is_active);
- var _this = $(this);
- var status = 0;
- _outletType = type;
- if(is_active=="false"){
- status = 0;
- _this.parents('tr').addClass('inactive');
- $("#date-model").modal('show');
- }else{
- status = 1;
- _this.parents('tr').removeClass('inactive');
- $.ajax({
- url:"{!! env('APP_URL') !!}outlet/feature/update/status",
- type:"POST",
- data:{
- id:id,
- status:status,
- type:type,
- "_token":'{!! csrf_token() !!}'
- },
- success:function () {
- if(is_active=="false"){
- $.toast({
- heading: 'Outlet '+type+' Status',
- text: 'Outlet '+type+' is deactive',
- position: 'top-right',
- loaderBg: '#ff6849',
- icon: 'error',
- hideAfter: 3000,
- stack: 1
- });
- }else{
- $.toast({
- heading: 'Outlet '+type+' Status',
- text: 'Outlet '+type+' is active.',
- position: 'top-right',
- loaderBg: '#ff6849',
- icon: 'success',
- hideAfter: 3000,
- stack: 1
- });
- }
- }
- });
- }
- });
- })
- </script>
- @endsection
|