@extends('master')
	@section('content')
	<div class="row">
	<div class="col-md-12">
	<h2>Daftar Buku di Perpustakaan</h2>
	</div>
	</div>


<div class="panel-body">
<a href="{{URL::to('deleteAll')}}" class="btn btn-danger">Delete All</a>
<a href="{{URL::to('getImport')}}" class="btn btn-success">Import</a>
<div class="btn-group">
	<button type="button" class="btn btn-info">Export</button>
	<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">
	<span class="caret"></span>
	<span class="sr-only">Toggle Dropdown</span>
	</button>
	<ul class="dropdown-menu" role="menu" id="export-men">
	<li id="export-to-excel"><a href="{{URL::to('getExport')}}">Export To Excel</a></li>
	<li id="export-to-pdf"><a href="{{URL::to('getPDF')}}">Export To PDF</a></li>
	<li class="divider"></li>

	</ul>
</div>
</div>



	<div class="row">
		<table class="table table-striped">
		<tr>
		<th>No.</th>
		<th>Nama Buku</th>
		<th>Penulis</th>
		<th>ISBN</th>
		<th>Actions</th>
		</tr>

		<a href="{{route('book.create')}}" class="btn btn-info pull-right">Create New Book</a><br>
		
		<a href="{{route('manager')}}">Back</a><br>
		<?php $no=1; ?>

		@foreach($books as $book)

		<tr>
		<td>{{$no++}}</td>
		<td>{{$book->nama_buku}}</td>
		<td>{{$book->penulis}}</td>
		<td>{{$book->isbn}}</td>
		<td>
		<form class="" action="{{route('book.destroy', $book->id)}}" method="post">
		<input type="hidden" name="_method" value="delete">
		<input type="hidden" name="_token" value="{{ csrf_token() }}">
		<a href="{{route('book.edit',$book->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>

		@endforeach

		</table>
		</div>



	@stop