
    <div class="card mb-4">
    <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">
           <i class="fa fa-caret-expand"></i> {{__('Vertriebspartner Status') }}
        </a>
    </h5>
    <div class="collapse @if($show === 'check_lead' || $m_data_load) show @endif" id="collapseMRegister">
        @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-body  mb-2 pb-1">
        <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><br>
                        <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
            </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>

