@extends('admin.layout')
<style type="text/css">

</style>
@section('header')

@endsection

@section('content')
<div id="sg-main-container-sg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>表单设置</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <a target="_blank" href="{{ $pre_uri . 'programCode' }}" class="btn btn-sm btn-primary">获取小程序码</a>
                            </div>
                        </div>
                        <form class="form-horizontal" method="POST" action="{{ $pre_uri . 'update' }}">
                            {{ csrf_field() }}

                            <input type="hidden" name="id" value="{{ $item->id }}">
                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">模板样式选择</label>
                                <div class="col-sm-4">
                                    <img src="/images/form_template_1.jpg">
                                    <label class="radio">
                                        <input style="margin-left: 120px" type="radio" name="data[mode]" value="1" {{ $item->mode == 1 ? 'checked' : '' }}>
                                    </label>
                                </div>
                                <div class="col-sm-4">
                                    <img src="/images/form_template_2.jpg">
                                    <label class="radio">
                                        <input style="margin-left: 120px" type="radio" name="data[mode]" value="2" {{ $item->mode == 2 ? 'checked' : '' }}>
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">是否显示在首页下方</label>
                                <div class="col-sm-8">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[show_below_index]" value="1" {{ $item->show_below_index == 1 ? 'checked' : '' }}>
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">表单上方标题</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" name="data[top_title]" value="{{ $item->top_title }}">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">金额设置</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" name="data[money]" value="{{ $item->money / 100 }}">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">表单上方图片</label>
                                <div class="col-sm-8">
                                    {!!  widget('Tools.ImgUpload')->single('top-image', 'top_image', $item->top_image) !!}
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">表单上方的说明文字</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" name="data[top_desp]" value="{{ $item->top_desp }}">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">表单提交时间间隔</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[interval]" value="{{ $item->interval }}">
                                </div>
                                <div class="col-sm-4">为防止恶意重复提交，这里设置同一个客户两次提交数据的间隔时间，单位是分钟。如不需要此功能，填写0即可</div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">提交成功后的提示</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[success_info]" value="{{ $item->success_info }}">
                                </div>
                                <div class="col-sm-4">客户提交表单成功后，弹出的提示。例如：感谢提交的信息，我们会及时与您联系！</div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">一行的文本框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[text_1]" value="{{ $item->text_1 }}">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_1_status]" value="1" {{ $item->text_1_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_1_need]" value="1" {{ $item->text_1_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">一行的文本框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[text_2]" value="{{ $item->text_2 }}">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_2_status]" value="1" {{ $item->text_2_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_2_need]" value="1" {{ $item->text_2_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">一行的文本框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[text_3]" value="{{ $item->text_3 }}">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_3_status]" value="1" {{ $item->text_3_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_3_need]" value="1" {{ $item->text_3_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">一行的文本框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[text_4]" value="{{ $item->text_4 }}">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_4_status]" value="1" {{ $item->text_4_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[text_4_need]" value="1" {{ $item->text_4_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">多行的文本框</label>
                                <div class="col-sm-4">
                                    <textarea class="form-control" rows="3" name="data[multi_text]">{{ $item->multi_text }}</textarea>
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[multi_text_status]" value="1" {{ $item->multi_text_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[multi_text_need]" value="1" {{ $item->multi_text_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">单选框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[radio]" value="{{ $item->radio }}" placeholder="在这里输入单选框标题">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[radio_status]" value="1" {{ $item->radio_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[radio_need]" value="1" {{ $item->radio_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">单选框的值</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" name="data[radio_value]" value="{{ $item->radio_value }}" placeholder="每个值用英文逗号隔开，例如：高中,本科,硕士">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">复选框</label>
                                <div class="col-sm-4">
                                    <input class="form-control" type="text" name="data[checkbox]" value="{{ $item->checkbox }}" placeholder="在这里输入复选框标题">
                                </div>
                                <div class="col-sm-4">
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[checkbox_status]" value="1" {{ $item->checkbox_status == 1 ? 'checked' : '' }}>是否使用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="checkbox" name="data[checkbox_need]" value="1" {{ $item->checkbox_need == 1 ? 'checked' : '' }}>是否必填
                                    </label>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-sm-offset-1 control-label">复选框的值</label>
                                <div class="col-sm-8">
                                    <input class="form-control" type="text" name="data[checkbox_value]" value="{{ $item->checkbox_value }}" placeholder="每个值用英文逗号隔开，例如：篮球,游泳,羽毛球">
                                </div>
                            </div>

                            <div class="form-group row">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <button type="submit" class="btn btn-sm btn-primary">保存设置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('footer')
<script type="text/javascript">
$(function () {

})
</script>
@endsection