mivita/resources/views/user/order/delivery.blade.php
2026-02-20 17:55:06 +01:00

218 lines
11 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ __('navigation.my_orders') }}
</h4>
{!! Form::open(['action' => route('user_order_my_delivery', [$for, $delivery_id]), 'class' => 'form-horizontal']) !!}
<div class="card">
<div class="card-body p-2 p-md-4">
<div class="switchers-stacked">
<h4>{{ __('navigation.do_order') }}</h4>
<label class="switcher switcher-secondary">
<input type="radio" class="switcher-input" name="switchers-radio-is-for" value="me" @if(!$shopping_user && $for === 'me') checked="checked" @endif >
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label">{{ __('order.goods_are_for_me_and_shipped') }}</span>
</label>
<label class="switcher switcher-secondary mt-3">
<input type="radio" class="switcher-input" name="switchers-radio-is-for" value="ot-member" @if($shopping_user && $for === 'ot-member') checked="checked" @endif>
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label">
{{ __('order.goods_are_for_customer_and_shipped') }}
<span class="badge badge-secondary" data-toggle="tooltip" data-placement="top" title="{{ __('order.ipay_text') }}"><strong>({{ __('order.ipay') }})</strong></span>
</span>
</label>
<label class="switcher switcher-secondary mt-3">
<input type="radio" class="switcher-input" name="switchers-radio-is-for" value="ot-customer" @if($shopping_user && $for === 'ot-customer') checked="checked" @endif>
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label">
{{ __('order.goods_are_for_customer_and_shipped') }}
<span class="badge badge-secondary" data-toggle="tooltip" data-placement="top" title="{{ __('order.cpay_text') }}"><strong>({{ __('order.cpay') }})</strong></span>
</span>
</label>
<hr>
<h4>{{ __('abo.abo_delivery') }}
</h4>
<div class="">
@if(\App\Services\AboHelper::userHasAbo(Auth::user()))
<p><a class="btn btn-sm btn-default" href="{{ route('user_abos', ['me']) }}">{{ __('navigation.myabo') }} {{ __('edit') }}</a> </p>
@else
<label class="switcher switcher-secondary">
<input type="radio" class="switcher-input" name="switchers-radio-is-for" value="abo-me" @if(!$shopping_user && $for === 'abo-me') checked="checked" @endif>
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label">{{ __('abo.abo_are_for_me_and_shipped') }}</span>
</label>
@endif
<label class="switcher switcher-secondary mt-3 mb-2">
<input type="radio" class="switcher-input" name="switchers-radio-is-for" value="abo-ot-customer" @if($shopping_user && $for === 'abo-ot-customer') checked="checked" @endif>
<span class="switcher-indicator">
<span class="switcher-yes"></span>
<span class="switcher-no"></span>
</span>
<span class="switcher-label">
{{ __('abo.abo_are_for_customer_and_shipped') }}
<span class="badge badge-secondary" data-toggle="tooltip" data-placement="top" title="{{ __('order.cpay_text') }}"><strong>({{ __('order.cpay') }})</strong></span>
</span>
</label>
</div>
<div class="mt-3">
<h6 class="card-header bg-light text-primary px-2 py-2">
<a href="#" class="" data-toggle="collapse" data-target="#collapseFilter" aria-expanded="false" aria-controls="collapseFilter">
<i class="fa fa-caret-expand"></i> {{ __('abo.pros_hl') }}
</a>
</h6>
<div class="collapse" id="collapseFilter">
<div class="form-row pb-1 pt-1">
<ul class="list-padding-top">
{!! __('abo.pros_list', ['abo-min-duration' => \App\Models\Setting::getContentBySlug('abo-min-duration')]) !!}
</ul>
</div>
</div>
</div>
</div>
<hr>
<div id="show-is-for-customer" @if(!$shopping_user) style="display: none" @endif >
<div class="form-row">
<div class="form-group col-sm-6">
<button type="button" class="btn btn-sm btn-secondary" id="button-user-order-my-delivery-show" data-toggle="modal" data-target="#modals-load-content"
data-id="show"
data-action="user-order-my-delivery-show"
data-back="{{route('user_order_my_delivery', [$for])}}"
data-isfor="{{ $for }}"
data-modal="modal-xl"
data-route="{{route('modal_load')}}"><span class="fa fa-shopping-cart"></span> {{ __('order.ship_to_existing_customer_select_customer') }}</button>
</div>
<div class="form-group col-sm-6">
<a href="{{route('user_customer_add', ['new'])}}" class="btn btn-sm btn-primary">{{ __('order.ship_to_new_customer') }} | <i class="ion ion-md-person-add"></i> {{ __('order.add_customer') }}</a>
</div>
</div>
<hr>
@if($shopping_user)
<div class="show-is-for-customer">
<h4>{{ __('order.ship_to_this_customer') }}</h4>
<p>{{ __('order.ship_to_this_customer_info') }}:
<a href="{{route('user_customers')}}">{{ __('navigation.my_clients') }} -> {{ __('navigation.overview') }}</a> -> <a href="{{route('user_customer_detail', $shopping_user->id)}}"><i class="fa fa-edit"></i> {{ __('navigation.clients') }}</a></a><br>
<em><i class="fa fa-info-circle"></i> {{ __('order.ship_to_this_customer_info_2') }}</em></p>
@include('admin.customer._customer_detail')
</div>
@endif
</div>
@if(Session::has('custom-error'))
<div class="alert alert-dark-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ Session::get('custom-error') }}</strong>
</div>
@else
@if($shopping_user)
<div class="" id="hide_for_me">
<hr>
<div class="form-group">
<label class="custom-control custom-checkbox m-2 ">
<input type="checkbox" class="custom-control-input" name="check_for_ot" id="checkbox_for_me" required>
<span class="custom-control-label secondary">{{ __('order.ship_to_this_customer_check') }}
@if($for === 'ot-customer' || $for === 'abo-ot-customer')
<br>{{ __('order.ship_to_this_email_info') }} <strong>{{ $shopping_user->billing_email }}</strong>
@endif
</span>
</label>
</div>
</div>
<div class="float-rights">
<button type="submit" class="btn btn-secondary" name="action" value="next">{{ __('order.confirm_and_proceed_to_order') }}</button>
</div>
@else
<div class="float-rights" id="hide_for_ot">
<button type="submit" class="btn btn-secondary" name="action" value="next">{{ __('order.confirm_and_proceed_to_order') }}</button>
</div>
@endif
@endif
</div>
</div>
{!! Form::close() !!}
<script>
$( document ).ready(function() {
function showHideCustomer($val) {
switch($val){
case 'me':
$('#show-is-for-customer').hide('slow');
$('#hide_for_ot').show('slow');
$('#hide_for_me').hide('slow');
$('#checkbox_for_me').attr('required', false);
break;
case 'abo-me':
$('#show-is-for-customer').hide('slow');
$('#hide_for_ot').show('slow');
$('#hide_for_me').hide('slow');
$('#checkbox_for_me').attr('required', false);
break;
case 'ot-member':
$('#show-is-for-customer').show('slow');
$('#hide_for_ot').hide('slow');
$('#hide_for_me').show('slow');
$('#button-user-order-my-delivery-show').data('isfor', 'ot-member');
$('#checkbox_for_me').attr('required', true);
break;
case 'ot-customer':
$('#show-is-for-customer').show('slow');
$('#hide_for_ot').hide('slow');
$('#hide_for_me').show('slow');
$('#button-user-order-my-delivery-show').data('isfor', 'ot-customer');
$('#checkbox_for_me').attr('required', true);
break;
case 'abo-ot-member':
$('#show-is-for-customer').show('slow');
$('#hide_for_ot').hide('slow');
$('#hide_for_me').show('slow');
$('#button-user-order-my-delivery-show').data('isfor', 'abo-ot-member');
$('#checkbox_for_me').attr('required', true);
break;
case 'abo-ot-customer':
$('#show-is-for-customer').show('slow');
$('#hide_for_ot').hide('slow');
$('#hide_for_me').show('slow');
$('#button-user-order-my-delivery-show').data('isfor', 'abo-ot-customer');
$('#checkbox_for_me').attr('required', true);
break;
}
}
$('input[name="switchers-radio-is-for"]').on('change', function (){
showHideCustomer($(this).val());
});
showHideCustomer($('input[name="switchers-radio-is-for"]:checked').val());
});
</script>
@endsection