<div class="container">
    <div class="card">
        <div class="card-body">
            <form action="" id="search">
                <div class="row">
                    <div class="col-sm">
                        <div class="form-group">
                            <label>Select Manager</label>
                            <select name="reseller" id="reseller" class="form-control form-control-sm select2">
                                <option value="null">Select Manager</option>
                                <option value="all">All</option>
                                @foreach (userResellers() as $r)
                                    <option value="{{ $r->id }}">{{ $r->name }}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="col-sm">
                        <label> Select POP </label>
                        <select name="pop" id="pop" class="form-control form-control-sm select2">
                            <option value="all"> Select One</option>
                        </select>
                    </div>
                    @if (request()->path() == 'admin/newJoin' || request()->path() == 'admin/list/new-join')
                        <div class="col-sm">
                            <div class="form-group">
                                <label>Select Marketed By</label>
                                @if (auth()->user()->hasPermissionTo('select_any_marketer'))
                                    <select name="marketed_by" id="marketed_by"
                                        class="select2 form-control form-control-sm">
                                        <option value="null">Select Marketed By</option>
                                        @foreach (marketedBy() as $r)
                                            <option value="{{ $r->id }}">{{ $r->firstname }} {{ $r->lastname }}
                                            </option>
                                        @endforeach
                                    </select>
                                @else
                                    <select name="marketed_by" id="marketed_by"
                                        class="select2 form-control form-control-sm">
                                        <option value="null">Select Marketed By</option>
                                        @foreach (marketedBy() as $r)
                                            @if (auth()->user()->name == $r->firstname . ' ' . $r->lastname)
                                                <option value="{{ $r->id }}">{{ $r->firstname }}
                                                    {{ $r->lastname }}
                                                </option>
                                            @endif
                                        @endforeach
                                    </select>
                                @endif
                            </div>
                        </div>
                        @if (auth()->user()->hasPermissionTo('source_mrc_hide'))
                        <input type="hidden" name="source_name" value="null">
                        @else
                            <div class="col-sm">
                                <div class="form-group">
                                    <label>Select Source</label>
                                    <select name="source_name" id="source_name"
                                        class="select2 form-control form-control-sm">
                                        <option value="null">Select One</option>
                                        @foreach (clientSource() as $r)
                                            <option value="{{ $r->id }}">{{ $r->name }}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        @endif

                    @endif
                    @if (request()->path() == 'admin/newJoin' ||
                            request()->path() == 'admin/list/new-join' ||
                            request()->path() == 'admin/list/expired-Clients' ||
                            request()->path() == 'admin/list/close-list')
                        <div class="col-sm">
                            <div class="form-group">
                                <label class="block text-gray-700 text-sm font-bold mb-2" for="from_date">
                                    From Date
                                </label>
                                <div class="input-group date" id="searchFrom" data-target-input="nearest">
                                    <input type="text" name="from_date" value=""
                                        class="form-control datetimepicker-input input-group-append form-control-sm"
                                        data-toggle="datetimepicker" data-target="#searchFrom" autocomplete="off">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm">
                            <div class="form-group">
                                <label class="block text-gray-700 text-sm font-bold mb-2" for="to_date">
                                    To Date
                                </label>
                                <div class="input-group date" id="searchTo" data-target-input="nearest">
                                    <input type="text" name="to_date" value=""
                                        class="form-control datetimepicker-input input-group-append form-control-sm"
                                        data-toggle="datetimepicker" data-target="#searchTo" autocomplete="off">
                                </div>
                            </div>
                        </div>
                        @if (request()->path() == 'admin/list/close-list')
                            <div class="col-sm">
                                <div class="form-group">
                                    <label class="block text-gray-700 text-sm font-bold mb-2">
                                        CID
                                    </label>
                                    <div>
                                        <input type="text" name="cid" class="form-control form-control-sm" id="" placeholder="123"
                                            value="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm">
                                <div class="form-group">
                                    <label class="block text-gray-700 text-sm font-bold mb-2">
                                        Username
                                    </label>
                                    <div>
                                        <input type="text" name="username" class="form-control form-control-sm" id="" placeholder="Username"
                                            value="">
                                    </div>
                                </div>
                            </div>
                            @if (checkSettings('customer_code') == 'enable')
                                <div class="col-sm">
                                    <div class="form-group">
                                        <label class="block text-gray-700 text-sm font-bold mb-2">Code</label>
                                        <div>
                                            <input type="text" name="code" class="form-control form-control-sm" id="" placeholder="Code" value="">
                                        </div>
                                    </div>
                                </div>
                            @endif
                            <div class="col-sm">
                                <div class="form-group">
                                    <label class="block text-gray-700 text-sm font-bold mb-2">
                                        Contact Number
                                    </label>
                                    <div>
                                        <input type="text" name="contact" class="form-control form-control-sm" id="" placeholder="01234567891"
                                            value="">
                                    </div>
                                </div>
                            </div>
                        @endif
                    @endif
                    @if (request()->path() == 'admin/pending-customer' || request()->path() == 'admin/pending-customer-search')
                        <div class="col-sm-3">
                            <div class="form-group">
                                <label>Select Package</label>
                                <select name="package" id="package" class="form-control form-control-sm select2">
                                    <option value="null">Select One</option>
                                    @forelse (userPackages() as $r)
                                        <option value="{{ $r->id }}">{{ $r->package_name }}</option>
                                    @empty
                                    @endforelse
                                </select>
                            </div>
                        </div>
                    @endif

                     @if ((request()->path() == 'admin/list/disable-customer' || request()->path() == 'admin/disable-customer-search') && checkSettings('disable_limit_over_user')=='enable')
                        <div class="col-sm-3">
                            <div class="form-group mt-4">
                                <div class="form-check">
                                    <input type="checkbox" value="1" id="include_temp_disable"
                                        name="include_temp_disable" class="form-check-input">
                                    <label class="form-check-label" for="include_temp_disable">
                                        Limit over disable customers
                                    </label>
                                </div>
                            </div>
                        </div>
                    @endif

                    <div class="col-md-12">
                        <div class="form-group float-right mt-1">
                            <button class="btn btn-primary" type="submit" id="searchBtn"><i class="fa fa-search"></i>
                                Search</button>
                            <a href="{{ url(request()->path()) }}" class="btn btn-info">Reset</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
