@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('Album/Poster/index'))
				    <div class="row">
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('Album/Poster/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">
                                <input type="hidden" name="id" value="{{ $data['id'] or ''}}"/>
                                <div class="form-group">

                                    <label class="control-label col-sm-3">海报(240*200)</label>
                                    <div class="col-sm-9">
                                        {!!  widget('Tools.ImgUpload')->multi2('/upload/posters','posters',"data[posters]", isset($data['posters'])? $data['posters'] : '',array("sizex"=>220,"sizey"=>200)) !!}
                                    </div>
                                </div>
                                <div class="form-group">

                                 <label class="control-label col-sm-3">话术1</label>

                                   <div class="col-sm-9">
                                     <input id="data_words" name="data[words][0]" class="form-control" value="{{ $data['words'][0] 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_words" name="data[words][1]" class="form-control" value="{{ $data['words'][1] 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_words" name="data[words][2]" class="form-control" value="{{ $data['words'][2] 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_introduce" name="data[introduce]" class="form-control" value="{{ $data['introduce'] or ''}}" required="" aria-required="true"  placeholder="">
                                    </div>

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

                                    <label class="control-label col-sm-3">分享画面(1920*1080)</label>
                                    <div class="col-sm-9">
                                        {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
                                        {!!  widget('Tools.ImgUpload')->single2('/upload/share','share',"share",  isset($data['share'])? $data['share'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="control-label col-sm-3">分享标题</label>

                                    <div class="col-sm-9">
                                        <input id="data_introduce" 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">海报二维码(70*70)</label>
                                    <div class="col-sm-9">
                                        {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
                                        {!!  widget('Tools.ImgUpload')->single2('/upload/qrcode','qrcode',"qrcode",  isset($data['qrcode'])? $data['qrcode'] : '',array("sizex"=>70,"sizey"=>70)) !!}
                                    </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