@extends('admin.layout')

@section('content')

<?php
    if(!isset($data)) $data = array();
    if(!$data && session("data")){
        $data = session("data");
    }
    if(!$data && session('_old_input')){
        $data = session("_old_input");
    }
?>
	<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">
                    @if(role('Setting/Info/index'))
				    <div class="row">
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('Setting/Info/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
    					</div>
					</div>
                    @endif

		            <div class="row">
                        <div class="col-lg-10">
                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">

                                    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">小程序appid</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_app_id" name="data[app_id]" class="form-control" value="{{ $data['app_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">小程序secret</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_app_secret" name="data[app_secret]" class="form-control" value="{{ $data['app_secret'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">支付商户号</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_mch_id" name="data[mch_id]" class="form-control" value="{{ $data['mch_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">支付密钥</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_api_key" name="data[api_key]" class="form-control" value="{{ $data['api_key'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">支付cart路径</label>
                                    
                   <div class="col-sm-9">
                       {!!  widget('Tools.FileUpload')->single('/upload/wechat','cert_path',"data[cert_path]", isset($data['cert_path']) ? $data['cert_path'] : "") !!}
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">支付key路径</label>
                                    
                   <div class="col-sm-9">
                       {!!  widget('Tools.FileUpload')->single('/upload/wechat','key_path',"data[key_path]", isset($data['key_path']) ? $data['key_path'] : "") !!}

                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">免手续费退款时间,小时</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_free_refund_time" name="data[free_refund_time]" class="form-control" value="{{ $data['free_refund_time'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">未到期退款手续费，百分比</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_refund_poundage_in" name="data[refund_poundage_in]" class="form-control" value="{{ $data['refund_poundage_in'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">到期退款手续费，百分比</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_refund_poundage_out" name="data[refund_poundage_out]" class="form-control" value="{{ $data['refund_poundage_out'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>
                                
                                <div class="form-group">
                                    <label class="control-label col-sm-3">&nbsp;</label>
                                    <div class="col-sm-9">
                                        <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
                                        <input type="reset" class="btn btn-default" >
                                    </div>
                                </div>
        
                            </form>
                        </div>
                        <!-- /.col-lg-10 -->
                    </div>
                    <!-- /.row -->
				</div>
			</div>
		</div>
	</div>

@endsection