	@extends('layouts.app')
	@extends('master')
	@section('content')
	<div class="row">
		<div class="col-md-12">
			<center><h1>List Client</h1></center>
		</div>
	</div>
	<div class="row">
	<form class="navbar-form navbar-left" role="search" >
		<div class="form-group">
			<input type="text" class="form-control" placeholder="Search">
		</div>
		<button type="submit" class="btn btn-default">Search</button>
	</form>	
	   <table class="table table-striped">
		<tr>
		  <th>ID</th>
		  <th>image</th>
		  <th>Full Names</th>
		  <th>Sex</th>
		  <th>Identity Card</th>
		  <th>Birth Date</th>
		  <th>Province</th>
		  <th>District</th>
		  <th>Sector</th>
		  <th>Cellar</th>
		  <th>Action</th>
		</tr>
		<a href="{{route('person.create')}}" class="btn btn-info pull-right">Add New Client</a>		
		<?php $id=1;?>
	@foreach($persons as $person)
		<tr>
		  <td>{{$id}}</td>
		  <td><img width="50" height="50" src="{{"image/".$person->image}}"></td>
		  <td>{{$person->fullnames}}</td>
		  <td>{{$person->sex}}</td>
		  <td>{{$person->identitycard}}</td>
		  <td>{{$person->birthdate}}</td>
		  <td>{{$person->province}}</td>
		  <td>{{$person->district}}</td>
		  <td>{{$person->sector}}</td>
		  <td>{{$person->cellar}}</td>
		  <td>
		  	<form class="" action="{{route('person.destroy', $person->id)}}" method="post">
		  	  <input type="hidden" name="_method" value="delete">
		  	  <input type="hidden" name="_token" value="{{csrf_token()}}">
		  	  <a href="{{route('person.edit', $person->id)}}" class="btn btn-primary">Edit</a>
		  	  <input type="submit" class="btn btn-danger" onclick="return confirm('Are you sure to delete this data?');" name="name" value="Delete">
		  	</form>
		  </td>
		</tr>
		<?php $id++; ?>
		@endforeach
		</table>
	</div>
	@stop