@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('Messages/Info/index'))
				    <div class="row">
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('Messages/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_site_id" name="data[site_id]" class="form-control" value="{{ $data['site_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_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">
                     {!! editor('') !!}

                     <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">发布人</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_price" name="data[price]" class="form-control" value="{{ $data['price'] 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_phone" name="data[phone]" class="form-control" value="{{ $data['phone'] 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">
                     {!! editor('') !!}

                     <script id="container" name="data[comment]" type="text/plain">{!! $data['comment'] or '' !!}</script>

                    </div>

                </div>
                <div class="form-group">

                 <label class="control-label col-sm-3">类型：0：免费；1：付费；2：收费</label>

                   <div class="col-sm-9">
                     <input id="data_type" name="data[type]" class="form-control" value="{{ $data['type'] 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 ''}}" 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