<?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");

?>

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


<h1>EDIT USER</h1>
<form method='POST' action='updateuser'>
<?php echo csrf_field(); ?>
<input type='hidden' name='id' value='<?php echo e($id); ?>'><br>
Username: <input type='text' name='username' value='<?php echo e($data->username); ?>'><br>
Password: <input type='password' name='password' value='<?php echo e($data->password); ?>'><br>
Fullname: <input type='text' name='fullname' value='<?php echo e($data->fullname); ?>'><br>
Userlevel (0=admin, 1=user): <input type='number' name='userlevel' value='<?php echo e($data->userlevel); ?>'><br>
<input type='submit' name='btnSubmit' value='Update'><br>
</form><?php /**PATH C:\xampp\htdocs\laravel8\resources\views/manageuser/edituser.blade.php ENDPATH**/ ?>