@php
if (Session::has("username")){
	echo "Welcome " . Session::get("username");
}else{
	echo "<meta http-equiv='REFRESH'
	content = '3; url=pagelogin'>";
	die("You need to login first");
}

if (Session::get("userlevel") != 0)
	die("Only admin can access this page");

@endphp

<h1>Manage User</h1>

<table class='table'>
@foreach ($data as $d)
	<tr>
		<td>{{$d->id}}</td>
		<td>{{$d->username}}</td>
		<td>{{$d->password}}</td>
		<td>{{$d->userlevel}}</td>
		<td>{{$d->fullname}}</td>
	</tr>
@endforeach
</table>