@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('Dream/Info/index'))
				    <div class="row">
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('Dream/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">用户ID</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_user_id" name="data[user_id]" class="form-control" value="{{ $data['user_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_name" name="data[name]" class="form-control" value="{{ $data['name'] 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">
                     <textarea name="data[about]" id="editorabout" required="" aria-required="true" class="form-control" rows="10">{{ $data['about'] or ''}}</textarea>
                                       
                     {!! editor('editorabout', ['position' => 'ali', 'folder' => 'upload/common'], ['themeType' => 'simple', 'height' => '300px']) !!}
                                            
                    </div>
                                
                </div>
                <div class="form-group">

                    <label class="control-label col-sm-3">梦想图片</label>

                    <div class="col-sm-9">
                        {!!  widget('Tools.ImgUpload')->multi2('/upload/dream','pic',"pic", isset($data->imgs) ? $data->imgs : "") !!}
                    </div>

                </div>
                <div class="form-group">
                                    
                 <label class="control-label col-sm-3">所需梦想币</label>
                                    
                   <div class="col-sm-9">
                     <input id="data_coin" name="data[coin]" class="form-control" value="{{ $data['coin'] 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_time" name="data[time]" class="form-control" value="{{ $data['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_get_coin" name="data[get_coin]" class="form-control" value="{{ $data['get_coin'] 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_mark" name="data[mark]" class="form-control" value="{{ $data['mark'] 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_status" name="data[status]" class="form-control" value="{{ $data['status'] 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_video" name="data[video]" class="form-control" value="{{ $data['video'] 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_score" name="data[score]" class="form-control" value="{{ $data['score'] 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">
                       <select name="data[sign]" id="data_sign" class="form-control">
                           @foreach($signs as $sign)
                               <option value="{{$sign->value}}" @if(isset($data['sign']) && $sign->value == $data['sign']) selected  @endif>{{$sign->value}}</option>
                           @endforeach
                       </select>
                    </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