@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/gallery/'.$model->picture.'?time='.time()); }else{ echo url('assets/frontend/img/no-picture.png?time='.time()); } ?>" width="500px"></a>
<form method="post" action="" enctype="multipart/form-data">
  <input type="hidden" name="id" value="{{ $model->id }}">
  <input type="hidden" name="_token" id="_token" value="{{csrf_token()}}">
  <input style="display: none;" type="file" name="picture" id="picture-{{$model->id}}" data-id="{{$model->id}}" class="uploadfoto" accept="image/*">
</form>
<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
<p style="font-size: 14px; color:red;">Size gambar max: 500kb!</p>
@else
<a href="#" onclick="document.getElementById('picture').click()" title="Klik untuk ganti gambar"><img src="{{ url('assets/frontend/img/no-picture.png') }}" width="500px"></a>
<input type="hidden" name="_token" id="_token" value="{{csrf_token()}}">
<input style="display: none;" type="file" name="picture" id="picture" class="tambahfoto" accept="image/*">
<p style="font-size: 14px; color:red;">Size gambar max: 500kb!</p>
@endif
