<div class="card mb-2  border-primary">
    <h6 class="card-header  bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingInvoice" aria-expanded="false" aria-controls="collapseBookingInvoice">
        @if($travel_user_booking_fewo->isInvoice())
            <span class="badge badge-outline-secondary"><i class="fa fa-check-circle"></i></span>
        @endif
        <strong style="line-height: 1.6em">Mietbestätigung / Rechnung</strong>
        <span class="badge badge-secondary">{{my_count($travel_user_booking_fewo->send_user_mail)}}</span>
    </h6>
    <div class="collapse" id="collapseBookingInvoice">
    <div class="card-body">
        @if($travel_user_booking_fewo->isInvoice())
            <h4><em style="font-size:60%">bei Preis-/Änderungen überschreiben</em>
                <div class="text-right float-right mb-2">
                    <button type="submit" name="action" value="createInvoice" class="btn btn-primary btn-sm" onclick="return confirm('{{__('Rechnung überschreiben?')}}');">{{ __('Mietbestätigung / Rechnung PDF überschreiben') }}</button>&nbsp;
                </div>
            </h4>
            <p><a class="btn btn-secondary btn-sm" target="_blank" href="{{$travel_user_booking_fewo->getInvoiceUrlFile()}}/file?t={{time()}}"><i class="fa fa-file-pdf"></i> Mietbestätigung / Rechnung:  {{$travel_user_booking_fewo->getInvoiceFileName()}}</a>
            <span class="p-1 bage @if($travel_user_booking_fewo->isChangeLowerInvoiceCreate()) badge-success @else badge-danger @endif">
                Erstellt: <strong>{{$travel_user_booking_fewo->getInvoiceLastModified()}}</strong>
            </span>
            </p>

        @else
            <h4>
                <div class="text-right float-right mb-2">
                    <button type="submit" name="action" value="createInvoice" class="btn btn-primary btn-sm">{{ __('Mietbestätigung / Rechnung PDF erstellen') }}</button>&nbsp;
                </div>
            </h4>
        @endif
        @if($travel_user_booking_fewo->send_user_mail)
            <table class="table table-striped border-bottom mt-4">
                <tbody>
                @foreach($travel_user_booking_fewo->send_user_mail as $send_user_mail)
                    <tr>
                        <td style="width: 25%"><strong>{!! key($send_user_mail) !!}</strong><br>E-Mail versendet.</td>
                        <td><span class="small">{!! nl2br(current($send_user_mail)) !!}</span></td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        @endif
        <div class="form-row">
            <div class="form-group col-sm-12 mt-2">
                {{ Form::textarea('send_mail_user_notice', '', ['placeholder'=>'Wichtige Hinweise in E-Mail, werden nur in die aktuelle E-Mail übernommen', 'class' => 'form-control autoExpand', 'rows'=>1]) }}
            </div>
        </div>
        <div class="text-right mt-0">
            <button type="submit" name="action" value="sendMailtoUser" class="btn btn-primary btn-sm" onclick="return confirm('{{__('E-Mail Mietbestätigung an Mieter versenden?')}}');">{{ __('E-Mail mit Mietbestätigung / Rechnung und Mietbedingungen an Kunden versenden') }}</button>&nbsp;
        </div>
    </div>
    </div>
</div>

    <div class="card mb-2  border-primary">
        <h6 class="card-header  bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingTravelInfo" aria-expanded="false" aria-controls="collapseBookingTravelInfo">
            @if($travel_user_booking_fewo->isTravelInfo())
                <span class="badge badge-outline-secondary"><i class="fa fa-check-circle"></i></span>
            @endif
            <strong style="line-height: 1.6em">Anreiseinfo</strong>
            <span class="badge badge-secondary">{{my_count($travel_user_booking_fewo->send_info_mail)}}</span>
        </h6>
        <div class="collapse" id="collapseBookingTravelInfo">
        <div class="card-body">
            @if($travel_user_booking_fewo->isTravelInfo())
                <h4> <em style="font-size:60%">bei Änderungen überschreiben</em>
                    <div class="text-right float-right">
                        <button type="submit" name="action" value="createTravelInfo" class="btn btn-primary btn-sm" onclick="return confirm('{{__('Anreiseinfo überschreiben?')}}');">{{ __('Anreiseinfo speichern und PDF überschreiben') }}</button>&nbsp;
                    </div>
                </h4>
                <p><a class="btn btn-secondary btn-sm" target="_blank" href="{{$travel_user_booking_fewo->getTravelInfoUrlFile()}}/file?t={{time()}}"><i class="fa fa-file-pdf"></i> {{$travel_user_booking_fewo->getTravelInfoFileName()}}</a>
                <span class="p-1 bage @if($travel_user_booking_fewo->isChangeLowerTravelInfoCreate()) badge-success @else badge-danger @endif">
                    Erstellt: <strong>{{$travel_user_booking_fewo->getTravelInfoLastModified()}}</strong>
                </span></p>
            @else
                <h4>Anreiseinfo
                    <div class="text-right float-right">
                        <button type="submit" name="action" value="createTravelInfo" class="btn btn-primary btn-sm">{{ __('Anreiseinfo speichern und PDF erstellen') }}</button>&nbsp;
                    </div>
                </h4>
            @endif
            <div class="form-row">
                <div class="form-group col-sm-12">
                    <button class="btn btn-default btn-sm " type="button" data-toggle="collapse" data-target="#collapseTravelInfo" aria-expanded="false" aria-controls="collapseTravelInfo">
                        {{ __('Inhalt für das PDF / Mail') }} <i class="fa fa-angle-down"></i>
                    </button>
                    <div class="collapse mt-2" id="collapseTravelInfo">
                        {{ Form::textarea('info_mail_text', $travel_user_booking_fewo->info_mail_text, ['class' => 'form-control autoExpand', 'rows'=>1, 'id'=>'travel_info_user_text']) }}
                        <em>Grundtext in ADMIN CMS > <a href="{{route('cms_content_all')}}">Inhalte</a> > PDF Vorlage Anreiseinfo FeWo</em>
                        <em class="small">(Änderungen werden hier gespeichert.)</em>

                    </div>
                </div>
            </div>
            @if($travel_user_booking_fewo->send_info_mail)
                <table class="table table-striped border-bottom">
                    <tbody>
                    @foreach($travel_user_booking_fewo->send_info_mail as $send_info_mail)
                        <tr>
                            <td style="width: 25%"><strong>{!! key($send_info_mail) !!}</strong><br>E-Mail versendet.</td>
                            <td><span class="small">{!! nl2br(current($send_info_mail)) !!}</span></td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @endif
            <div class="text-right mt-0">
                <button type="submit" name="action" value="sendInfosMailtoUser" class="btn btn-primary btn-sm" onclick="return confirm('{{__('Mail an Mieter versenden?')}}');">{{ __('E-Mail mit Anreiseinfo an Kunden versenden') }}</button>&nbsp;
            </div>
        </div>
        </div>
    </div>


