mivita/resources/views/user/order/delivery.blade.php
Kevin Adametz bfa3bb1df4 08 2024
2024-08-05 12:05:24 +02:00

204 lines
10 KiB
PHP
Raw 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(['url' => 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>{{ __('order.abo_delivery') }}</h4>
<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">{{ __('order.abo_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="abo-ot-member" @if($shopping_user && $for === 'abo-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.abo_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="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">
{{ __('order.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>
<hr>
@if(Session::has('custom-error'))
<div class="alert alert-dark-warning alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ Session::get('custom-error') }}</strong>
</div>
@endif
<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></p>
@include('admin.customer._customer_detail')
</div>
@endif
</div>
@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') }}</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
</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