{!! Form::model($model, [
	'route' => $model->exists ? ['banner.update', $model->id] : 'banner.store',
	'method' => $model->exists ? 'PUT' : 'POST',
	'enctype' => 'multipart/form-data',
  'id' => 'formSubmit'
]) !!}
<input type="hidden" name="_token" id="_token" value="{{csrf_token()}}">
<div class="form-group">
	<label for="" class="label-control">Name</label>
	{!! Form::text('name', null, ['class' => 'form-control', 'id' => 'name', 'placeholder' => 'Inputkan nama halaman...']) !!}
</div>

<div class="form-group">
	<label for="" class="label-control">Description</label>
	{!! Form::textarea('description', null, ['class' => 'form-control', 'id' => 'description', 'placeholder' => 'Isi konten disini...']) !!}
</div>

{!! Form::close() !!}

@if($model->exists)
<a href="#" onclick="document.getElementById('picture-{{$model->id}}').click()" title="Klik untuk ganti gambar"><img src="<?php if($model->picture != NULL){ echo url('assets/files/banner').'/'.$model->picture; }else{ echo url('assets/frontend/img/no-picture.png'); } ?>" width="100px"></a>
<input type="hidden" name="_token" id="_token" value="{{csrf_token()}}">
<input type="hidden" name="id" value="{{ $model->id }}">
<input style="display: none;" type="file" name="picture" id="picture-{{$model->id}}" data-id="{{$model->id}}" class="uploadgambar" accept="image/*">
<br>
@if($model->picture != NULL)
<button class="btn btn-xs btn-warning" id="hapusGambar" data-id="{{$model->id}}"><i class="fa fa-close"> Hapus Gambar</i></button>
@endif
@endif
