@extends('adminlte::layouts.app')

@section('htmlheader_title')
	User
@endsection

@section('main-content')
	<div class="container-fluid spark-screen">
		<div class="row">
			<div class="col-md-12">
				<h2 class="page-header">Users</h2>

					<div class="panel panel-default">
					    <div class="panel-heading">
					        List of Users
					        <a href="{{url('user/create')}}" class="btn btn-primary" role="button">Add User</a>
					    </div>

					    <div class="panel-body">
					        <div class="">
					            <table class="table table-striped" id="thegrid">
					                <thead>
					                    <tr>
					                        <th>NIM</th>
					                        <th>Name</th>
					                        <th>Username</th>
					                        <th>Email</th>
					                        <th>Role</th>
					                        <th style="width:150px">Action</th>
					                        <!-- <th style="width:50px"></th> -->
					                    </tr>
					                </thead>
					                <tbody>
					                    @foreach ($users as $user)
					                        <tr>
					                            <td>{{ $user->id }}</td>
					                            <td>{{ $user->name }}</td>
					                            <td>{{ $user->username }}</td>
					                            <td>{{ $user->email }}</td>
					                            <td>{{ $user->role }}</td>
					                            <td> 
					                                <a href="{{ url('user/') }}/edit/{{$user->id}}" class="btn btn-primary"> Edit </a>
					                                <a href="{{ url('user/delete') }}/{{$user->id}} " class="btn btn-danger" onclick="return confirm('Are you sure to delete this data?')"> Delete </a>
					                            </td>
					                        <tr>
					                    @endforeach
					                </tbody>
					            </table>
					            {{ $users->render() }}
					        </div>
					    </div>
					</div>
			</div>
		</div>
	</div>
@endsection
