
    <div class="card mb-4">
        <h5 class="card-header">
            <div class="row">
                <div class="col-12">
                    Vertriebspartner
                    @if(!$m_data_load)
                    <div class="float-right">
                        <button type="button" class="btn btn-sm btn-secondary" data-toggle="modal" data-target="#modals-edit-m-data">
                            <span class="far fa-edit"></span> Vertriebspartner Daten bearbeiten
                        </button>
                    </div>
                    @endif
                </div>
          
            </div>
        </h5>
            @if($m_data_load)
                @include('admin.lead.m_data_form_edit')
            @endif
            @if(!$m_data_load)
                @include('admin.lead.m_data_form')
            @endif
            <div class="card mb-4" style="border: none;">
                <h5 class="card-header">
                    {{--  <a href="#" class="@if($show !== 'check_lead' || !$m_data_load) collapsed @endif" data-toggle="collapse" data-target="#collapseMRegister" aria-expanded="@if($show !== 'check_lead' || !$m_data_load) false @else true @endif" aria-controls="collapseMRegister"> --}}
                    <a href="#" class="collapsed" data-toggle="collapse" data-target="#collapseMRegister" aria-expanded="false" aria-controls="collapseMRegister"> 
                        <i class="fa fa-caret-expand"></i> {{__('Vertriebspartner Infos') }}
                    </a>
                </h5>
                {{--  <div class="collapse @if($show === 'check_lead' || $m_data_load) show @endif" id="collapseMRegister"> --}} 
                <div class="collapse" id="collapseMRegister"> 
                    <div class="card-body mb-2 pb-1 no-border">
                    <div class="row">
                        <div class="col-sm-6">

                            @if($user->payment_account )
                                <p><span class="ion ion-md-checkmark-circle-outline text-primary"></span>
                                    <strong>{{__('Vertriebspartner-Account aktiv')}}</strong> {{__('bis zum:')}} {{ $user->getPaymentAccountDateFormat() }}</p>
                            @else
                                <p><span class="ion ion-md-close-circle-outline text-danger"></span>
                                    <strong>{{__('Vertriebspartner-Account inaktiv')}}</strong></p>
                            @endif

                            @if($user->active == 1)
                                <p><span class="ion ion-md-checkmark-circle-outline text-primary"></span>
                                    <strong>{{__('Daten vollständig, freigeschaltet')}}</strong>: {{ $user->getActiveDateFormat() }}</p>
                                    {{--  
                                    @if($user->files->count())
                                        @foreach($user->files()->whereIdentifier('contract')->get() as $file)
                                            <a class="btn btn-secondary" href="{{ route('storage_file', [$file->id, 'user']) }}" target="_blank">Vertriebspartnervertrag.pdf</a>
                                        @endforeach
                                    @endif
                                    --}}
                            @else
                                <p><span class="ion ion-md-close-circle-outline text-danger"></span>
                                    <strong>{{__('Daten nicht vollständigt, inaktiv')}}</strong></p>
                            @endif
                        </div>
                        <div class="col-sm-6">
                            @if($user->account_id)
                                @if($user->agreement)
                                    <p><span class="ion ion-md-checkmark-circle-outline text-primary"></span>
                                        <strong>{{__('Einverständniserklärung')}}</strong>: {{ $user->getAgreementFormat() }}
                                    </p>
                                @else
                                    <p><span class="ion ion-md-close-circle-outline text-danger"></span>
                                        <strong>{{__('Einverständniserklärung')}}</strong> {{ __('nicht akzeptiert') }}</p>
                                @endif
                                @if($user->account->data_protection)
                                    <p><span class="ion ion-md-checkmark-circle-outline text-primary"></span>
                                        <strong>{{__('Privacy policy approved')}}</strong>: {{ $user->account->getDataProtectionFormat() }}
                                    </p>
                                @endif
                            @endif
                                @if($user->confirmed == 1)
                                    <p><span class="ion ion-md-checkmark-circle-outline text-primary"></span>
                                        <strong>{{__('E-Mail verified')}}</strong>: {{ $user->getConfirmationDateFormat() }}</p>
                                @else
                                    <p><span class="ion ion-md-close-circle-outline text-danger"></span>
                                        <strong>{{__('E-Mail not verified')}}</strong></p>
                                    <a class="btn btn-warning btn-sm" href="{{route('admin_lead_new_mail_verified', $user->id)}}">Neue E-Mail für die Registrierung zusenden</a>
                                @endif
                        </div>
                        <div class="col-sm-12">
                            @if(!$user->active)
                                <hr>
                                @if($user->release_account)
                                    <strong>Registrierung abgeschlossen {{ $user->getReleaseAccountFormat() }}</strong>
                                    <a href="{{route('admin_lead_released', ['completed', $user->id])}}" class="btn btn-success" onclick="return confirm('Alle Daten vollständig und Vertriebspartner freischalten?');">Die Daten sind vollständigt => Vertriebspartner freischalten</a>
                                    <button type="button" class="btn btn-sm btn-danger float-right" data-toggle="modal" data-target="#modals-register-m-data">
                                    Vertriebspartner eine E-Mail senden => Daten nicht vollständigt
                                    </button>
                                @else
                                <strong><span class="text-danger">Vertriebspartner muss Registrierung noch abschließen</span></strong>
                                @endif
                            @endif
                            
                            
                            @if($user->wizard !== 100)
                            <hr>
                            <div class="row">
                                <div class="col-sm-6">
                                    <h5>Registrierungsprozess</h5>
                                    @if($user->wizard === 0)
                                        <strong>Vertrag zustimmen</strong>
                                    @endif
                                    @if($user->wizard === 1)
                                        <strong>Daten anpassen</strong>
                                    @endif
                                    @if($user->wizard === 2)
                                        <strong>Ausweis hochladen</strong>
                                    @endif
                                    @if($user->wizard === 3)
                                        <strong>Gewerbeschein hochladen</strong>
                                    @endif
                                    @if($user->wizard === 4)
                                        <strong>Paket Auswählen</strong>
                                    @endif
                                    @if($user->wizard === 5)
                                        <strong>Wartet auf Überprüfung</strong><br>
                                        <a href="{{route('admin_lead_released', ['reset_switch', $user->id])}}" class="btn btn-danger btn-sm" onclick="return confirm('Wirklich zurücksetzen?');">Vertriebspartner zurücksetzen / Paket auswählen</a>

                                    @endif
                                    @if($user->wizard === 20)
                                        <strong>Registrierung abschließen / Paket Zahlung</strong><br>
                                        <a href="{{route('admin_lead_released', ['reset_switch', $user->id])}}" class="btn btn-danger btn-sm" onclick="return confirm('Wirklich zurücksetzen?');">Vertriebspartner zurücksetzen / Paket auswählen</a>

                                    @endif
                                </div>
                                <div class="col-sm-6">
                                    @if($user->active && $user->wizard < 20)
                                        <h5>Account ist aktiv</h5>
                                        <a href="{{route('admin_lead_released', ['unlock', $user->id])}}" class="btn btn-warning btn-sm" onclick="return confirm('Alle Daten vollständig und Vertriebspartner freischalten?');">Vertriebspartner erneut freischalten</a>
                                    @endif
                                </div>
                            </div>
                            @endif
                        </div>
                    </div>
                    <hr>
                </div>
                    @if($user->files->count())
                        <div class="card-body mb-4 pb-1">
                            <div class="table-responsive">
                                <table class="table card-table m-0">
                                    <tbody>
                                    <tr>
                                        <th>Ausweisdaten</th>
                                        <th>Name</th>
                                        <th>Größe</th>
                                        <th class="text-right">löschen</th>
                                    </tr>
                                    @foreach($user->files()->whereIdentifier('id_card')->get() as $file)
                                        <tr>
                                            <td><a target="_blank" href="{{ route('storage_file', [$file->id, 'user']) }}">
                                                    @if(strtolower($file->ext ) === 'pdf')
                                                        <object data="{{ route('storage_file', [$file->id, 'user']) }}" type="application/pdf" width="160"></object>
                                                    @else
                                                        <img src="{{ route('storage_file', [$file->id, 'user']) }}" alt="" width="160">
                                                    @endif
                                                </a>
                                            </td>
                                            <td><a target="_blank" href="{{ route('storage_file', [$file->id, 'user']) }}">{{ $file->original_name }}</a></td>
                                            <td>{{ $file->formatBytes() }}</td>
                                            <td class="text-right">
                                                <a href="{{ route('admin_lead_delete_file', [$user->id, $file->id, 'upload']) }}" class="btn btn-sm" onclick="return confirm('Datei wirklich löschen?');">
                                                    <span class="ion ion-md-trash text-danger"></span>
                                                </a>
                                            </td>
                                        </tr>
                                    @endforeach
                                    </tbody>
                                </table>
                            </div>
                            <hr>
                        @if($user->account_id)

                                @if($user->account->getNotice('business_license') === 'later')
                                    <div class="row">
                                        <div class="col-12">
                                            <div class="bg-warning rounded py-2 px-3">
                                            {{__('register.business_license_later')}}
                                            </div>
                                        </div>
                                    </div>
                                @endif
                                @if($user->account->getNotice('business_license') === 'non')
                                        <div class="row">
                                            <div class="col-12">
                                                <div class="bg-warning rounded py-2 px-3">
                                                    <div class="font-weight-semibold mb-1">{{__('register.business_license_non')}}</div>
                                                    <em>{{$user->account->getNotice('business_license_reason')}}</em>
                                                </div>
                                            </div>
                                        </div>
                                @endif
                            @endif

                            <div class="table-responsive">
                                <table class="table card-table m-0">
                                    <tbody>
                                    <tr>
                                        <th>Gewerbenachweis</th>
                                        <th>Name</th>
                                        <th>Größe</th>
                                        <th class="text-right">löschen</th>
                                    </tr>
                                    @foreach($user->files()->whereIdentifier('business_license')->get() as $file)
                                        <tr>
                                            <td>
                                                <a target="_blank" href="{{ route('storage_file', [$file->id, 'user']) }}">
                                                @if(strtolower($file->ext ) == 'pdf')
                                                    <object data="{{ route('storage_file', [$file->id, 'user']) }}" type="application/pdf" width="160"></object>
                                                @else
                                                    <img src="{{ route('storage_file', [$file->id, 'user']) }}" alt="" width="160">
                                                @endif
                                                </a>
                                            </td>
                                            <td><a target="_blank" href="{{ route('storage_file', [$file->id, 'user']) }}">{{ $file->original_name }}</a></td>
                                            <td>{{ $file->formatBytes() }}</td>
                                            <td class="text-right">
                                                <a href="{{ route('admin_lead_delete_file', [$user->id, $file->id, 'upload']) }}" class="btn btn-sm" onclick="return confirm('Datei wirklich löschen?');">
                                                    <span class="ion ion-md-trash text-danger"></span>
                                                </a>
                                            </td>
                                        </tr>
                                    @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>

                    @endif
                </div>
             </div>
    </div>
        


