@extends('vip.layouts')
@section('content')

    <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post" eventType="eventAjaxForm">
        {!! csrf_field() !!}

        <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('grade.name') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="name"  id="name"  required  lay-verify="required" placeholder="" autocomplete="off" value="@isset($admin) {{ $admin['name'] }} @endisset" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('grade.grade') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="grade" id="grade"  required  lay-verify="required" placeholder="" autocomplete="off" value="@isset($admin) {{ $admin['grade'] }} @endisset" class="layui-input">
            </div>
        </div>
        <!-- <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('grade.rule') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="rule"   id="rule"  required  lay-verify="required" placeholder="请输入英文规则(不可重复)" autocomplete="off" value="@isset($admin) {{ $admin['rule'] }} @endisset" class="layui-input">
            </div>
        </div> -->
        @isset($admin['grade']) 
        @if($admin['grade']=='0')
        <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('grade.time_type') }}</label>
            <div class="layui-input-inline" style="width: 200px;">
                <select name="time_type"  id="time_type"  lay-filter="time_type" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query>
                    <option value="">{{ trans('grade.time_type1') }}</option>
                    {{--<option value="year" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='year') selected @endif @endisset>年份</option>--}}
                    <option value="month" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='month') selected @endif @endisset>月份</option>
                    <option value="week" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='week') selected @endif @endisset>周份</option>
                    <option value="day" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='day') selected @endif @endisset>日份</option>
                    <option value="all" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='all') selected @endif @endisset>全部</option>
                    <option value="ymd" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='ymd') selected @endif @endisset>年月日</option>
                    {{--<option value="day" @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='quarter') selected @endif @endisset>季度</option>--}}
                </select>
            </div>
            <div class="layui-input-inline" style="width: 200px; @isset($admin['rule_details'][0]) @if($admin['rule_details'][0]=='day' || $admin['rule_details'][0]=='ymd') display: block; @else display: none; @endif @else display: none; @endisset " id="day">
                <input type="text" name="day"   lay-verify="" placeholder="请输入天数或年月日" autocomplete="off" value="@isset($admin['rule_details'][3]) {{ $admin['rule_details'][3] }} @endisset" class="layui-input">如：天数:2---年月日:2018-09-18
            </div>
        </div>
        @endif @endisset
        <div class="layui-form-item">
            <label class="layui-form-label">充值{{ trans('grade.money') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="rechargemoney"  id="rechargemoney"  required  lay-verify="" placeholder="请输入充值金额" autocomplete="off" value="@isset($admin['rule_details'][1]) {{ $admin['rule_details'][1] }} @endisset" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">投注{{ trans('grade.money') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="bettingmoney"  id="bettingmoney"  required  lay-verify="" placeholder="请输入投注金额" autocomplete="off" value="@isset($admin['rule_details'][2]) {{ $admin['rule_details'][2] }} @endisset" class="layui-input">
            </div>
        </div>
        
        <!-- <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('grade.is_water') }}:</label>
            <div class="layui-input-block">
                <input type="radio" name="is_water"  lay-verify="" placeholder="" autocomplete="off" @if(isset($admin['is_water'] )&&$admin['is_water']!=2)  checked @endif  value="1" title="反水">
                 <input type="radio" name="is_water"  lay-verify="" placeholder="" autocomplete="off" @if(isset($admin['is_water'] )&&$admin['is_water']==2)  checked @endif value="1" title="不反水">
            </div>
        </div> -->

        @if(S('ACTION')!='view')
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        @endif
    </form>

    <script>
        //Demo
        layui.use(['form'], function(){
            var form = layui.form;

            //监听提交
            form.on('submit(submitForm)', function(data){
                return true;
            });
            //时间类型筛选时间
            form.on('select(time_type)', function (data) {
                if(data.value =='day' || data.value =='ymd'){
                    $("#day").show();
                }else{
                    $("#day").hide();
                }
            });
        });
        function cbFormSuccess(data){
            layer.msg(data.msg);
            setTimeout(function(){
                window.history.go(-1);//返回上一页
            },2500);
        }


    </script>
@endsection














