{!! Form::open(['url' => $route, 'class' => 'modal-content', 'enctype' => 'multipart/form-data']) !!}
    <div class="modal-header">
        <h5 class="modal-title">
            {{ __('Vertriebspartner') }}
            <span class="font-weight-light">zuweisen/ändern</span>
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
    </div>
    <div class="modal-body">
        <input type="hidden" name="action" value="{{$data['action']}}">
        <input type="hidden" name="id" value="{{$data['id']}}">
        <input type="hidden" name="view" value="{{$data['view']}}">

        <div class="form-row">
            <div class="form-group col">
                <label for="change_member_key" class="form-label">{{__('Passwort eingeben')}}*</label>
                <input type="text" class="form-control" name="change_member_key" id="change_member_key" placeholder="mivita" required>
            </div>
        </div>
        <div class="form-row">
            <div class="form-group col">
                <label for="change_member_id" class="form-label">{{ __('Vertriebspartner zuweisen') }}*</label>
                <select class="selectpicker" name="change_member_id" id="change_member_id"  data-style="btn-light" data-live-search="true" required>
                    {!!  HTMLHelper::getMembersOptions($value->member_id, true) !!}
                </select>
                <p class="text-muted">Es werden nur aktive Vertriebspartner mit aktiven Accounts angezeigt.</p>
            </div>
        </div>
        <input type="hidden" name="customer_set_member_for" value="0">
        @if($data['view'] === 'sales_customer')
            @if($value->member_id && $value->shopping_user && $value->shopping_user->number)
            <div class="custom-controls-stacked">
                <label class="custom-control custom-radio">
                    <input name="customer_set_member_for" value="0" type="radio" class="custom-control-input" checked="">
                    <span class="custom-control-label">Nur dieser Bestellung einen neuen Vertriebspartner zuweisen</span>
                </label>
                <label class="custom-control custom-radio">
                    <input name="customer_set_member_for" value="1"  type="radio" class="custom-control-input">
                    <span class="custom-control-label">Jeder Bestellung vom Kunden #{{$value->shopping_user->number}} einen neuen Vertriebspartner zuweisen</span>
                </label>
            </div>
            @endif
        @endif
        @if($data['view'] === 'customer')
            @if($value->member_id && $value->number)
                <div class="custom-controls-stacked">
                    <label class="custom-control custom-radio">
                        <input name="customer_set_member_for" value="0" type="radio" class="custom-control-input" checked="">
                        <span class="custom-control-label">Nur diesen Kunden Bestellung einen neuen Vertriebspartner zuweisen</span>
                    </label>
                    <label class="custom-control custom-radio">
                        <input name="customer_set_member_for" value="1"  type="radio" class="custom-control-input">
                        <span class="custom-control-label">Jeder Bestellung diesen Kunden #{{$value->number}} einen neuen Vertriebspartner zuweisen</span>
                    </label>
                </div>
            @endif
        @endif
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
        <button type="submit" class="btn btn-primary">{{__('übernehmen')}}</button>

    </div>
{!! Form::close() !!}

<script type="text/javascript">

    $( document ).ready(function() {

    });


</script>
