@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('type_name.name') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="name"   id="name"  required  lay-verify="" 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('type_name.sort') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="sort"   id="sort"  required  lay-verify="" placeholder="" autocomplete="off" value="@isset($admin) {{ $admin['sort'] }} @endisset" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
        <label class="layui-form-label">{{ trans('type_name.type_id') }}:</label>
        <div class="layui-input-block" style="width: 90%;">
            @foreach (trans('type_name.typed') as $k=>$v)
              <input type="checkbox" name="type[]" value="{{$k}}" autocomplete="off" class="layui-input" title="{{$v}}">
            @endforeach
        </div>
      </div>

        <!--<div class="layui-form-item">
            <label class="layui-form-label">{{ trans('type_name.type_id') }}:</label>
            <div class="layui-input-block">
                <select name="type_id" id="type_id" class="Selects" lay-filter="testSelect">
                    <option value="">请选择</option>
                    @foreach(trans('type_name.typed') as $k=>$v):
                        <option value="{{$k}}">{{$v}}</option>
                    @endforeach
                     <option value="1">新闻</option>
                    <option value="2">公告</option>
                    <option value="3">优惠活动</option>
                    <option value="11" >新手指南</option>
                    <option value="10" >常见问题</option>
                    <option value="20" >彩金活动</option> 
                </select>
            </div>
        </div>-->

        <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('type_name.remark') }}:</label>
            <div class="layui-input-block">
                <input type="text" name="remark"   id="remark"  required  lay-verify="" placeholder="" autocomplete="off" value="@isset($admin) {{ $admin['remark'] }} @endisset" class="layui-input">
            </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;
            });
        });
        function cbFormSuccess(data){
            layer.msg(data.msg);
            setTimeout(function(){
                window.history.go(-1);//返回上一页
            },2500);
        }
    </script>
@endsection














