@extends('admin.master')

@section('content')
    <div class="row">
        <div class="col-lg-12">
            <div class="contentpanel">
                <form id="listForm" method="post">
                    <!-- 功能按鈕(新增/批量處理等等) -->
                    <div class="row" style="margin-bottom: 5px;">
                        <div class="col-lg-12">
                            <ol class="headermenu">
                                <li>
                                    <button class="btn btn-darkblue btn-xs" onclick="window.print(); return false;">列印此頁</button>
                                    <a class="btn btn-darkblue btn-xs" id="GV_round_nav" href="#GV_round_anc"><strong>回合</strong></a>
                                    <a class="btn btn-darkblue btn-xs" id="GV_game_nav" href="#GV_game_anc"><strong>遊戲機率</strong></a>
                                    <a class="btn btn-darkblue btn-xs" id="GV_checkin_nav" href="#GV_checkin_anc"><strong>簽到贈點</strong></a>
                                    <a class="btn btn-darkblue btn-xs" id="GV_good_nav" href="#GV_good_anc"><strong>獎項</strong></a>
                                </li>
                            </ol>
                        </div>
                    </div>
                    <!-- 搜尋段 -->
                    <div class="panel panel-default">
                        <div class="panel-heading" data-toggle="collapse" data-target="#search_content">
                            <h3 class="panel-title">遊戲參數審核</h3>
                        </div>
                        <div id="search_content" class="collapse in">
                            <div class="panel-body">
                            </div>
                        </div>
                    </div>
                    <hr class="search-hr"/>
                    <!-- 列表段 -->
                    <div class="row">
                        <div class="col-lg-12">
                            相同一筆設定，若有分上下兩部分:<br>
                            上排代表目前修改中的最新設定，在審核通過前都不會生效。<br>
                            下排代表目前經審核通過的線上設定。
                        </div>
                        <div class="col-lg-12">
                            <div id="GV_round_anc">
                                <h3>回合</h3>
                            </div>
                            <table id="GV_round" class="table table-striped table-bordered" cellspacing="0">
                                <thead>
                                <tr>
                                    <th>審核</th>
                                    <th>ID</th>
                                    <th>回合名稱</th>
                                    <th>起日</th>
                                    <th>迄日</th>
                                    <th>兌獎延長天數</th>
                                    <th>有效否</th>
                                    <th>建立時間</th>
                                    <th>修改時間</th>
                                    <th>修改人</th>
                                </tr>
                                </thead>
                            </table>
                            <hr>
                            <div id="GV_game_anc">
                                <h3>遊戲機率</h3>
                            </div>
                            <table id="GV_game" class="table table-striped table-bordered" cellspacing="0">
                                <thead>
                                <tr>
                                    <th>審核</th>
                                    <th>ID</th>
                                    <th>機率</th>
                                    <th>吉點</th>
                                    <th>建立時間</th>
                                    <th>修改時間</th>
                                    <th>修改人</th>
                                </tr>
                                </thead>
                            </table>
                            <hr>
                            <div id="GV_checkin_anc">
                                <h3>簽到贈點</h3>
                            </div>
                            <table id="GV_checkin" class="table table-striped table-bordered" cellspacing="0">
                                <thead>
                                <tr>
                                    <th>審核</th>
                                    <th>ID</th>
                                    <th>第幾天</th>
                                    <th>吉點</th>
                                    <th>建立時間</th>
                                    <th>修改時間</th>
                                    <th>修改人</th>
                                </tr>
                                </thead>
                            </table>
                            <hr>
                            <div id="GV_good_anc">
                                <h3>獎項</h3>
                            </div>
                            <table id="GV_good" class="table table-striped table-bordered" cellspacing="0">
                                <thead>
                                <tr>
                                    <th>審核</th>
                                    <th>ID</th>
                                    <th>LINE POINT</th>
                                    <th>吉點</th>
                                    <th>有效否</th>
                                    <th>共可發數量</th>
                                    <th>已發數量</th>
                                    <th>建立時間</th>
                                    <th>修改時間</th>
                                    <th>修改人</th>
                                </tr>
                                </thead>
                            </table>
                            <hr>
                        </div>
                    </div>
                </form>
                <!-- row -->
            </div>
        </div>
    </div>
@endsection

@section('extjs')
    <script>
        $(document).ready(function () {
            $('#GV_round').dataTable({
                "scrollX": true,
                "processing": true,
                "serverSide": true,
                "ajax": "auditManagement/grid/round",
                "paging": true,
                "ordering": true,
                "info": true,
                "order": [[1, "desc"]],
                "stateSave": true,
                "pagingType": "full",
                "bFilter": true,
                "aoColumnDefs": [{
                    'bSortable': false,
                    'aTargets': [0] //不想參加排序的欄位，可指定多個，逗號分隔
                }]
            });
            $('#GV_game').dataTable({
                "scrollX": true,
                "processing": true,
                "serverSide": true,
                "ajax": "auditManagement/grid/game",
                "paging": true,
                "ordering": true,
                "info": true,
                "order": [[1, "desc"]],
                "stateSave": true,
                "pagingType": "full",
                "bFilter": true,
                "aoColumnDefs": [{
                    'bSortable': false,
                    'aTargets': [0] //不想參加排序的欄位，可指定多個，逗號分隔
                }]
            });
            $('#GV_checkin').dataTable({
                "scrollX": true,
                "processing": true,
                "serverSide": true,
                "ajax": "auditManagement/grid/checkin",
                "paging": true,
                "ordering": true,
                "info": true,
                "order": [[1, "desc"]],
                "stateSave": true,
                "pagingType": "full",
                "bFilter": true,
                "aoColumnDefs": [{
                    'bSortable': false,
                    'aTargets': [0] //不想參加排序的欄位，可指定多個，逗號分隔
                }]
            });
            $('#GV_good').dataTable({
                "scrollX": true,
                "processing": true,
                "serverSide": true,
                "ajax": "auditManagement/grid/good",
                "paging": true,
                "ordering": true,
                "info": true,
                "order": [[1, "desc"]],
                "stateSave": true,
                "pagingType": "full",
                "bFilter": true,
                "aoColumnDefs": [{
                    'bSortable': false,
                    'aTargets': [0] //不想參加排序的欄位，可指定多個，逗號分隔
                }]
            });
            // 從網址參觸發搜尋
            custom_search();
            $('#GV_round_filter').hide();
            $('#GV_game_filter').hide();
            $('#GV_checkin_filter').hide();
            $('#GV_good_filter').hide();
        });

        //客製化搜尋欄位
        function custom_search() {
            $('#GV_round').DataTable();
            $('#GV_round').dataTable().fnDraw(true);
            $('#GV_game').DataTable();
            $('#GV_game').dataTable().fnDraw(true);
            $('#GV_checkin').DataTable();
            $('#GV_checkin').dataTable().fnDraw(true);
            $('#GV_good').DataTable();
            $('#GV_good').dataTable().fnDraw(true);
        }

    </script>
@endsection
