@extends('admin.layouts.app')
@section('header')
    <style type="text/css">
        .chosen-choices input {
            width: 50px !important;
        }

        .bootstrap-tagsinput {
            width: 100%;
        }

        .ibox-content, body.gray-bg {
            background-color: #f5f9fc;
        }

        .ibox-content > div {
            margin: auto;
            margin-top: 80px;
            padding: 30px;
            background-color: #ffffff
        }

        h1 {
            padding: 20px 0;
            text-align: center;
            font-weight: 700;
        }

        .ibox-content h3::before {
            background-color: #0e9aef;
            content: '-';
            color: #0e9aef;
            margin-right: 5px;
            padding-right: 2px;
        }

        .ibox-content h3 {
            border-bottom: 1px solid #eee;
            padding: 20px 0 10px 0;
            margin-bottom: 10px;
            font-weight: 400;
        }

        .ibox-content label {
            color: #bbb;
            font-size: 14px
        }
    </style>
@endsection

@section('content')
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>挖掘线索</h5>

                    <div class="ibox-tools">
                        <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>

                <form method="GET" action="{{ U('Company/Info/index') }}" accept-charset="UTF-8" id="filter_form">
                    <div class="ibox-content">

                        <div class="col-md-8">
                            <h1>挖掘线索</h1>
                            <div class="row">
                                <div class="col-sm-12">
                                    <input class="tagsinput form-control" type="text"
                                           name="company_name" value="" style="display: none;width: 100%"
                                           placeholder="请输入企业名称关键字">
                                </div>
                            </div>

                            <h3>更多筛选条件</h3>

                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label class="font-normal">注册资本（单选）</label>
                                        <div>
                                            <select data-placeholder="全部" class="chosen-select"
                                                    style="width: 350px; display: none;" tabindex="-1"
                                                    name="reg_capital">
                                                <option value="">全部</option>
                                                @foreach($fields['reg_capital'] as $reg_capital)
                                                    <option value="{{$reg_capital['value']}}"
                                                            @if($reg_capital['value']== Request::get('reg_capital')) selected @endif>{{$reg_capital['name']}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label class="font-normal">所属行业（多选）</label>
                                        <div>
                                            <select data-placeholder="全部" class="chosen-select" multiple=""
                                                    style="width: 350px; display: none;" tabindex="-1"
                                                    name="industry[]">
                                                <option value="">全部</option>
                                                @foreach($fields['industry'] as $industry)
                                                    <option value="{{$industry['value']}}"
                                                            @if($industry['value'] == Request::get('industry')) selected @endif>{{$industry['name']}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                </div>

                            </div>


                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label class="font-normal">企业类型（多选）</label>
                                        <div>
                                            <select data-placeholder="全部" class="chosen-select" multiple=""
                                                    style="width: 350px; display: none;" tabindex="-1"
                                                    name="ent_type[]">
                                                <option value="">全部</option>
                                                @foreach($fields['ent_type'] as $ent_type)
                                                    <option value="{{$ent_type['value']}}"
                                                            @if($ent_type['value']== Request::get('ent_type')) selected @endif>{{$ent_type['name']}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label class="font-normal">所在地区（多选）</label>
                                        <div>
                                            <select data-placeholder="全部" class="chosen-select" multiple=""
                                                    style="width: 350px; display: none;" tabindex="-1"
                                                    name="district[]">
                                                <option value="">全部</option>
                                                @foreach($fields['district'] as $district)
                                                    <option value="{{$district['value']}}">{{$district['name']}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                </div>

                            </div>


                            <div class="form-group">
                                <div class="row">
                                    <div class="col-sm-12" style="text-align: right">
                                        <span class="btn btn-outline-primary" onclick="formsubmit()">筛选
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection

@section('js')
    <script type="text/javascript">
        function formsubmit() {
            $('#filter_form').submit()
        }
    </script>
@endsection