@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">序号</label>
            <div class="layui-input-block">
                <input type="text" name="id" required  lay-verify="id" autocomplete="off" value="{{ isset($id)?$id:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单号/时间</label>
            <div class="layui-input-block">
                <input type="text" name="order_time" required  lay-verify="id" autocomplete="off" value="{{ isset($order_time)?$order_time:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">游戏名称</label>
            <div class="layui-input-block">
                <input type="text" name="game" required  lay-verify="id" autocomplete="off" value="{{ isset($game)?$game:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">游戏期号</label>
            <div class="layui-input-block">
                <input type="text" name="game_no" required  lay-verify="id" autocomplete="off" value="{{ isset($game_no)?$game_no:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">投注金额</label>
            <div class="layui-input-block">
                <input type="text" name="money" required  lay-verify="id" autocomplete="off" value="{{ isset($money)?$money:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">中奖金额</label>
            <div class="layui-input-block">
                <input type="text" name="prize_money" required  lay-verify="id" autocomplete="off" value="{{ isset($prize_money)?$prize_money:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">投注用户</label>
            <div class="layui-input-block">
                <input type="text" name="account_name" required  lay-verify="id" autocomplete="off" value="{{ isset($account_name)?$account_name:'' }}" class="layui-input" readonly="readonly">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">回水</label>
            <div class="layui-input-block">
                @if(isset($water_status))
                    <input type="radio" name="water_status" value="1" title="未回水" @if($water_status=='1') checked @endif>
                    <input type="radio" name="water_status" value="2" title="已回水" @if($water_status=='2') checked @endif>
                @else
                    <input type="radio" name="water_status" value="1" title="未回水" checked>
                    <input type="radio" name="water_status" value="2" title="未回水">
                @endif
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">结算</label>
            <div class="layui-input-block">
                @if(isset($settle_status))
                    <input type="radio" name="settle_status" value="1" title="未结算" @if($settle_status=='1') checked @endif>
                    <input type="radio" name="settle_status" value="2" title="已结算" @if($settle_status=='2') checked @endif>
                @else
                    <input type="radio" name="settle_status" value="1" title="未结算" checked>
                    <input type="radio" name="settle_status" value="2" title="已结算">
                @endif
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">开奖</label>
            <div class="layui-input-block">
                @if(isset($game_status))
                    <input type="radio" name="game_status" value="0" title="待开奖" @if($game_status=='0') checked @endif >
                    <input type="radio" name="game_status" value="1" title="开奖" @if($game_status=='1') checked @endif>
                    <input type="radio" name="game_status" value="2" title="未中奖" @if($game_status=='2') checked @endif>
                @else
                    <input type="radio" name="game_status" value="0" title="待开奖" checked >
                    <input type="radio" name="game_status" value="1" title="开奖">
                    <input type="radio" name="game_status" value="2" title="未中奖">
                @endif
            </div>
        </div>

        @if(S('ACTION')!='view')
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <a class="layui-btn layui-btn-sm lay-btn-diy" href="javascript:history.go(-1)" style="background-color:#1E9FFF;width: 92px; height: 38px;line-height: 38px;font-size: 14px;">返回</a>
                    <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>
        function func(){

            alert(1);
        }
        function funcc(){

            alert(1);
        }
        //Demo
        function cbFormSuccess(data){
            layer.msg(data.msg);
            setTimeout(function(){
                parent.window.location.reload();
            },2500);
        }
    </script>

    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script>
        var lgid;
        var aa;
        layui.use(['form'], function(){
            var form = layui.form;
            form.on('select(sect)',function(data){
                lgid = data.value;
                //console.log(lgid);
                $.ajax({
                    type:'get',
                    url:'/admin/SportsSoccer/getoddscode',
                    data:{pcode:lgid},
                    dataType:'json',
                    success:function(data){  //请求成功回调函数
                        var option = '';
                        var dd = '';
                        option += '<option value></option>';
                        //dd += '<dd lay-value class="layui-select-tips">请选择</dd>';
                        for(var i=0;i<data.length;i++){  //循环获取返回值，并组装成html代码
                            option += "<option value="+data[i]["odds_code"]+">"+data[i]["odds_name"]+"</option>";
                        }
                        $("#code").html(option);
                        //重新渲染select
                        form.render('select');
                    },
                });
            })
            //监听提交
            form.on('submit(submitForm)', function(data){
                return true;
            });
        });
    </script>
@endsection
