
@if($travel_user_booking_fewo->id > 0)
    <div class="card mb-2  border-primary">
        <h6 class="card-header  bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseBookingSMail" aria-expanded="false" aria-controls="collapseBookingSMail">
            <strong style="line-height: 1.6em">Dienstleister Mail</strong>
            <span class="badge badge-secondary">{{my_count($travel_user_booking_fewo->send_service_mail)}}</span>
        </h6>
        <div class="collapse" id="collapseBookingSMail">
        <div class="card-body">
            @if($travel_user_booking_fewo->send_service_mail)
                <table class="table table-striped border-bottom">
                    <tbody>
                    @foreach($travel_user_booking_fewo->send_service_mail as $send_service_mail)
                        <tr>
                            <td  style="width: 25%"><strong>{!! $send_service_mail['d'] !!}</strong><br>{{$send_service_mail['m']}}</td>
                            <td>{{$send_service_mail['s']}}<br>
                                <span class="small">{!! nl2br($send_service_mail['c']) !!}</span></td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @endif
            <div class="form-row">
                <div class="form-group col-md-6">
                    <label class="form-label" for="send_mail_service_mail">{{ __('E-Mail Adresse Dienstleister') }}</label>
                    {{ Form::text('send_mail_service_mail', 'langosch.birgit@web.de',  array('class'=>'form-control')) }}
                </div>
                <div class="form-group col-md-6">
                    <label class="form-label" for="send_mail_service_subject">{{ __('Betreff E-Mail ') }}</label>
                    {{ Form::text('send_mail_service_subject', $travel_user_booking_fewo->getServiceMailSubject(), ['class' => 'form-control']) }}
                </div>
                <div class="form-group col-md-12">
                    <label class="form-label" for="send_mail_service_content">{{ __('Inhalt E-Mail ') }}</label>
                    {{ Form::textarea('send_mail_service_content', $travel_user_booking_fewo->getServiceMailContent(), ['class' => 'form-control autoExpand', 'rows'=>1]) }}
                    <em class="small">(Änderungen gelten nur für das senden der aktuellen E-Mail, werden nicht gespeichert.)</em>
                </div>
            </div>
            <div class="text-right mt-2">
                <button type="submit" name="action" value="sendMailtoService" class="btn btn-primary btn-sm" onclick="return confirm('{{__('Mail an Dienstleister vor Ort versenden?')}}');">{{ __('E-Mail an Dienstleister vor Ort 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="#collapseBookingMMail" aria-expanded="false" aria-controls="collapseBookingMMail">
            <strong style="line-height: 1.6em">Mitarbeiter Mail</strong>
            <span class="badge badge-secondary">{{my_count($travel_user_booking_fewo->send_employee_mail)}}</span>
        </h6>
        <div class="collapse" id="collapseBookingMMail">
        <div class="card-body">
            @if($travel_user_booking_fewo->send_employee_mail)
                <table class="table table-striped border-bottom">
                    <tbody>
                    @foreach($travel_user_booking_fewo->send_employee_mail as $send_employee_mail)
                        <tr>
                            <td style="width: 25%"><strong>{!! $send_employee_mail['d'] !!}</strong><br>
                            @if(is_array($send_employee_mail['m']))
                                {!! implode(",", $send_employee_mail['m']) !!}
                            @else
                                {{$send_employee_mail['m']}}
                            @endif</td>
                            <td>{{$send_employee_mail['s']}}<br>
                                <span class="small">{!! nl2br($send_employee_mail['c']) !!}</span></td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @endif
            <div class="form-row">
                <div class="form-group col-md-6">
                    <label class="form-label" for="send_mail_employee_mail">{{ __('E-Mail Adresse Mitarbeiter') }}</label>
                    {{ Form::text('send_mail_employee_mail', $send_mail_employee_mail,  array('class'=>'form-control')) }}
                </div>
                <div class="form-group col-md-6">
                    <label class="form-label" for="send_mail_employee_subject">{{ __('Betreff E-Mail ') }}</label>
                    {{ Form::text('send_mail_employee_subject', $travel_user_booking_fewo->getEmployeeMailSubject(), ['class' => 'form-control']) }}
                </div>
                <div class="form-group col-md-12">
                    <label class="form-label" for="send_mail_employee_content">{{ __('Inhalt E-Mail ') }}</label>
                    {{ Form::textarea('send_mail_employee_content', $travel_user_booking_fewo->getEmployeeMailContent(), ['class' => 'form-control autoExpand', 'rows'=>1]) }}
                    <em class="small">(Änderungen gelten nur für das senden der aktuellen E-Mail, werden nicht gespeichert.)</em>
                </div>
            </div>
            <div class="text-right mt-2">
                <button type="submit" name="action" value="sendMailtoEmployee" class="btn btn-primary btn-sm" onclick="return confirm('{{__('Mail an Mitarbeiter versenden?')}}');">{{ __('E-Mail an Mitarbeiter versenden') }}</button>&nbsp;
            </div>
        </div>
        </div>
    </div>
@endif

