@extends('admin/layout')
@section('header')
    <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
    <style>
        .btn-danger, .btn-primary, .btn-info {
            background: #2a94e0 !important;
            border-color: #2a94e0 !important;
        }

        .table-striped > tbody > tr:nth-of-type(odd) {
            background: #f8f8f8 !important;
        }

        .table-striped > tbody > tr .btn {
            background: none !important;
        }

        .table-striped > tbody > tr td {
            font-size: 14px !important;
        }

        .table-striped > tbody > tr:hover {
            background: #ffebd8 !important;
        }

        .table-striped > tbody > tr:hover .btn {
            background: #2a94e0 !important;
            color: #fff !important;
        }

        .table-striped > tbody > tr:hover .btn .glyphicon {
            color: #fff !important;
        }
    </style>
@endsection

@section('content')
    @php   $authUser=auth()->user() @endphp
    <body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <form id="searchForm">
                            <div class="input-group">
                                <select name="status" id="status" title="" class="form-control"
                                        style="width: 150px;float: right" onchange="tips.selectPage();">
                                    <option value="">请选择项目状态</option>
                                    @foreach(\App\Http\Models\Site::STATUS_MAP as $key=>$item)
                                        @if(!in_array($key,[5,6]))
                                            <option value="{{$key}}">{{$item}}</option>
                                        @endif
                                    @endforeach
                                </select>
                                <input type="text" placeholder="请输入域名或项目名称" class="input-md form-control"
                                       name="keyword"
                                       id="keyword" style="width: 240px;float: right">
                                <span class="input-group-btn">
                                     <button type="button" class="btn btn-md btn-primary"
                                             onclick="units.search()"> 搜索</button>
                                    <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px"
                                            name="btnReset"> 重置</button>
                                </span>
                            </div>
                        </form>
                        <hr>
                        <div class="table-responsive">
                            <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
    </body>
@endsection
@section('footer')
    <script>
        var config = {};
        config.url = '/admin/bid/online';
        config.pageSize = 20;
        config.columns = [ //字段
            {
                title: '序号', align: 'center', formatter: function (value, item, index) {
                    return index + 1;
                },
                width: '10px'
            },
            {title: '公司', field: 'cn_title', align: 'center'},
            {title: '网站', field: 'domain', align: 'center', width: '240px'},
            {title: '竞价人员', field: 'bidder_title', align: 'center', width: '160px'},
            {title: '上线日期', field: 'bid_account_online_time', align: 'center', width: '160px'},
            {title: '赠送费用', field: 'bid_give_fee', align: 'center', width: '160px'},
            {
                title: '操作', field: 'id', align: 'center',
                formatter: function (value, row) {
                    return '<button onclick="units.openDetail(' + value + ',\'' + row.cn_title + '\')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button><br>';
                }
            }
        ];
        tips.bootstrapTable(config);

        var units = {
            openDetail: function (id, title) {
                tips.page('/admin/sites/' + id + '/overview', title);
            },
            search: function () {
                tips.selectPage();
            },
        };

    </script>
@endsection