@extends('layouts.layout-2')

@section('content')

    @if ($errors->any())
        <div class="row">
            <div class="col-sm-12">
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            </div>
        </div>
    @endif

    <h4 class="font-weight-bold py-2 mb-2">
        {{ __('Registrierung abschließen') }}
    </h4>

    <div id="smartwizard-3" class="smartwizard-register">
        <ul class="card px-4 pt-3 mb-3">
            <li>
                <a href="#smartwizard-3-step-1" class="mb-3">
                    <span class="sw-done-icon ion ion-md-checkmark"></span>
                    <span class="sw-number">1</span>
                    Paket
                    <div class="text-muted small">auswählen</div>
                </a>
            </li>
        </ul>

        <div class="mb-3">
            <div id="smartwizard-3-step-1" class="card animated fadeIn">
                <div class="card-body">
                    @if($userHistoryWizardPayment && $userHistoryWizardPayment->status > 2)
                        <h6 class="alert badge-{{$userHistoryWizardPayment->getStatusColor()}}">Eine Zahlung wurde ausgeführt. Status: {{ trans('payment.status.'.$userHistoryWizardPayment->getStatusType())}}</h6>


                        @if($userHistoryWizardPayment->shopping_order && $userHistoryWizardPayment->shopping_order->shopping_payment_last)
                            @if($userHistoryWizardPayment->shopping_order->shopping_payment_last->clearingtype === 'vor')
                                <h4>Bezahlung per Vorkasse:</h4>
                                <p style="line-height: 1.4em">Bitte überweise {{ number_format(($userHistoryWizardPayment->shopping_order->shopping_payment_last->amount/100), 2, ",", ".") }} EUR auf die folgende Kontoverbindung, um den Kauf abzuschließen.
                                    <br>
                                    <strong>{{__('email.checkout_mail_bank_holder')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-account-owner') !!}<br>
                                    <strong>{{__('email.checkout_mail_bank_iban')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-iban') !!} <br>
                                    <strong>{{__('email.checkout_mail_bank_bic')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-bic') !!} <br>
                                    <strong>{{__('email.checkout_mail_bank_name')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-bank') !!} <br>
                                    <strong>Gesamtbetrag:</strong> {{ number_format( ($userHistoryWizardPayment->shopping_order->shopping_payment_last->amount/100), 2, ",", ".") }} EUR<br>
                                    <strong>Verwendungszweck:</strong> {{ $userHistoryWizardPayment->shopping_order->shopping_payment_last->reference }}
                                </p>
                                <hr />
                            @endif
                        @endif
                        <h5 class="card-header bg-light">
                            <a href="#" class=""  data-toggle="collapse" data-target="#collapsePaymentForm" aria-expanded="false" aria-controls="collapsePaymentForm">
                                <i class="fa fa-caret-expand"></i>  {{ __('Zahlungsoptionen öffnen') }}
                            </a>
                        </h5>
                        <div class="collapse" id="collapsePaymentForm">
                            @include('user.wizard._payment')
                        </div>
                    @else
                        @include('user.wizard._payment')
                    @endif
                </div>
            </div>
        </div>
    </div>

    <link rel="stylesheet" href="{{ mix('/vendor/libs/smartwizard/smartwizard.css') }}">
    <script src="{{ mix('/vendor/libs/smartwizard/smartwizard.js') }}"></script>
    <script type="text/javascript">
        $(document).ready(function() {

            $('.smartwizard-register').smartWizard({
                autoAdjustHeight: true,
                backButtonSupport: true,
                useURLhash: false,
                showStepURLhash: false,
                selected: '{{$step}}',
                toolbarSettings: {
                    showNextButton: false,
                    showPreviousButton: false,
                }
            });
        });
    </script>

@endsection
