123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- @extends('layouts.app')
- @section('content')
- <link href="{!! env('APP_ASSETS') !!}/vendor_components/dropzone/dropzone.css" rel="stylesheet"/>
- <link href="{!! env('APP_ASSETS') !!}/vendor_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet"/>
- <link href="{!! env('APP_ASSETS') !!}/css/jquery.timepicker.min.css" rel="stylesheet"/>
- <style>
- .vtabs .tabs-vertical {
- width: 229px;
- }
- .bootstrap-tagsinput {
- min-height: 60px; width: 100%;
- }
- h4{ margin-top: 40px}
- .bootstrap-timepicker-widget table td input{ width: 46px}
- #map{
- width: 100%; height: 100vh;
- }
- .delivery-section{
- width: 400px;
- height: auto;
- background: white;
- position: absolute;
- left: 10px; top: 10px;
- z-index: 10; padding: 10px;
- }
- .input-group input[type=text]{
- border-left: 0; padding-left: 0;
- }
- </style>
- <!-- Content Wrapper. Contains page content -->
- @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);
- }
- // $resto = \Illuminate\Support\Facades\Auth::user()->restaurants;
- $address = isset($resto->places)?$resto->places->place_name:"Baghdad";
- $polygons = isset($resto->places)?$resto->places->coordinates:NULL;
- if(!empty($outlet->address))
- $address = $outlet->address.', '.$outlet->place;
- // dd($resto->places->place_name);
- @endphp
- @php
- $restuarant1 = $resto;
- $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null;
- //dump($outlet->resto_metas);
- $resto_metas = [];
- $billing = [];
- if(isset($resto_meta)){
- foreach($resto_meta as $meta){
- if($meta->outlet_id!=""){
- continue;
- }
- $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
- // dump($meta->resto_meta_defs);
- if($index_name=="BILLING_GATEWAY"){
- // dump($meta->resto_meta_defs->meta_def_name);
- // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
- $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
- }
- $resto_metas[$index_name] = $meta->meta_val;
- }
- }
- $resto_metas['BILLING_GATEWAY'] = $billing;
- $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD";
- $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants";
- $outlet_meta = isset($outlet->resto_metas)?$outlet->resto_metas:NULL;
- $outlet_metas = [];
- if(isset($outlet_meta)){
- foreach($outlet_meta as $meta){
- $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name;
- // dump($meta->resto_meta_defs);
- if($index_name=="BILLING_GATEWAY"){
- // dump($meta->resto_meta_defs->meta_def_name);
- // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val;
- $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val);
- }
- $outlet_metas[$index_name] = $meta->meta_val;
- }
- }
- $currency = isset($outlet_metas['BUSSINESS_CCY'])?$outlet_metas['BUSSINESS_CCY']:$resto_metas['BUSSINESS_CCY'];
- @endphp
- <div class="content-wrapper">
- <div class="container-full">
- <!-- Content Header (Page header) -->
- <!-- Main content -->
- <section class="content">
- <div class="row">
- <div class="col-12 col-sm-3 sidebar_div_main" style="padding-right: 0;background-color: #F5F5F5">
- @include('outlets.outlet-sidebar')
- </div>
- <div class="col-12 col-sm-9 p-15">
- <div class="row">
- <div class="col-12">
- <div class="box">
- <div class="box-header"><a href="{!! env('APP_URL') !!}new/outlet/area?o={!! $outlet->unique_key !!}" class="btn btn-primary">{{__('label.add_new_outlet_area')}}</a> </div>
- <div class="box-body">
- <div class="table-responsive rounded card-table">
- <table class="table border-no" id="dataTable">
- <thead>
- <tr class="">
- <th>{{__('label.status')}}</th>
- <th>{{__('label.name')}}</th>
- <th>{{__('label.delivery_fee')}} </th>
- <th>{{__('label.min_price')}}</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- @if(isset($areas) && $areas->count() > 0)
- @foreach($areas as $area)
- <tr>
- <td>
- <button type="button" data-on-text="Open" data-off-text="Closed" class="btn btn-toggle btn-sm btn-success @if($area->status=="1") active @endif switch-me" data-id="{!! $area->id !!}" data-bs-toggle="button" aria-pressed="@if($outlet->status=="1") true @else false @endif" autocomplete="off">
- <div class="handle"></div>
- </button> {{__('label.active')}}
- </td>
- <td>{!! $area->area_name !!}</td>
- <td>{!! $currency !!} {!! $area->delivery_fee !!}</td>
- <td>{!! $currency !!} {!! $area->min_price !!}</td>
- <td>
- <a href="{!! env('APP_URL') !!}area/edit/{!! $area->id !!}?o={!! $outlet->unique_key !!}" type="button" class="waves-effect waves-circle btn btn-circle btn-primary btn-xs mb-5"><i class="mdi mdi-check"></i></a>
- <a type="button" data-id="{!! $area->id !!}" class="waves-effect waves-circle btn btn-circle delete-area btn-danger btn-xs mb-5"><i class="mdi mdi-delete"></i></a>
- </td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- /.box -->
- </div>
- </div>
- </section>
- <!-- /.content -->
- </div>
- </div>
- <!-- /.content-wrapper -->
- @endsection
- @section('js')
- <script>
- $(function () {
- $("body").on("click",".delete-area",function () {
- var id = $(this).data('id');
- var _this = $(this);
- $.ajax({
- url:"{!! env('APP_URL') !!}area/delete/"+id,
- success:function (response) {
- $.toast({
- heading: '{{__("label.outlet_area_update")}}',
- text: "{{__('label.area_is_deleted')}}",
- position: 'top-right',
- loaderBg: '#ff6849',
- icon: 'error',
- hideAfter: 3000,
- stack: 1
- });
- _this.parents('tr').remove();
- }
- });
- });
- $("body").on("click",".switch-me",function () {
- var is_active = $(this).attr("aria-pressed");
- var id = $(this).data('id');
- is_active = $.trim(is_active);
- var status = 0;
- if(is_active=="false"){
- status = 0;
- }else{
- status = 1;
- }
- $.ajax({
- url:"{!! env('APP_URL') !!}area/update/status",
- type:"POST",
- data:{
- id:id,
- status:status,
- "_token":'{!! csrf_token() !!}'
- },
- success:function () {
- if(is_active=="false"){
- $.toast({
- heading: '{{__("label.area_status")}}',
- text: '{{__("label.area_is_deactive")}}',
- position: 'top-right',
- loaderBg: '#ff6849',
- icon: 'error',
- hideAfter: 3000,
- stack: 1
- });
- }else{
- $.toast({
- heading:'{{__("label.area_status")}}',
- text: '{{__("label.area_is_deactive")}}',
- position: 'top-right',
- loaderBg: '#ff6849',
- icon: 'success',
- hideAfter: 3000,
- stack: 1
- });
- }
- }
- });
- });
- })
- </script>
- @endsection
|