@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="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">
                    @if(role('Furniture/Newgoods/Info/index'))
				    <div class="row">
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('Furniture/Newgoods/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">标题</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_title" name="data[title]" class="form-control" value="{{ $data['title'] 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">
                        {!!  widget('Tools.ImgUpload')->single('thumb',"data[thumb]", isset($data['thumb'])? $data['thumb'] : "") !!}

                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">详情</label>
                                    
                   <div class="col-sm-9">
                     {!! ueditor('') !!}
                                       
                     <script id="container" name="data[content]" type="text/plain">{!! $data['content'] or '' !!}</script>
                                            
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">评价题目1</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_comments_field_1" name="data[comments_field_1]" class="form-control" value="{{ $data['comments_field_1'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">评价题目2</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_comments_field_2" name="data[comments_field_2]" class="form-control" value="{{ $data['comments_field_2'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">评价题目3</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_comments_field_3" name="data[comments_field_3]" class="form-control" value="{{ $data['comments_field_3'] or ''}}" required="" aria-required="true"  placeholder=""> 
                    </div>
                                
                </div>    
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">评价题目4</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_comments_field_4" name="data[comments_field_4]" class="form-control" value="{{ $data['comments_field_4'] 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_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or 0}}" required="" aria-required="true"  placeholder="">
                       <span class="help-block m-b-none">数值越大越靠前</span>
                    </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>
</div>

@endsection