@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

@php
$id = decrypt($idEncrypt);
$data = DB::table("user")
->where("id",$id)
->first();
@endphp


<h1>EDIT USER</h1>
<form method='POST' action='updateuser'>
@csrf
<input type='hidden' name='id' value='{{$id}}'><br>
Username: <input type='text' name='username' value='{{$data->username}}'><br>
Password: <input type='password' name='password' value='{{$data->password}}'><br>
Fullname: <input type='text' name='fullname' value='{{$data->fullname}}'><br>
Userlevel (0=admin, 1=user): <input type='number' name='userlevel' value='{{$data->userlevel}}'><br>
<input type='submit' name='btnSubmit' value='Update'><br>
</form>