<?php
if(!isset($System)){
	exit("No direct script access allowed!");
}

if(isset($_GET['id']) && ($id = trim($_GET['id'])) && strlen($id) > 0){
	if($System->loadClass("%CLASS_NAME%")){
		if((!$data = $%CLASS_NAME%->info($id)) || !is_array($data) || count($data) <= 0){ // info function can take a username or an account ID
			$System->redirect("./?" . strtolower(FEATURE) . "=view-all"); // feature not found
		} // use $data array for info about user on this page\
		if(!$System->hasViewPermission(FEATURE, $id)){
			exit($System->error);
		}
	} else {
		die($System->error);
	}
} else {
	$System->redirect("./?" . strtolower(FEATURE) . "=view-all"); // username not set in URL
}
?>


<h1>
	<i class="fa fa-%FA_ICON%"></i> 
	%LANG_SINGULAR% Information
	<?php if($System->hasFeaturePermission(FEATURE, "VIEW-ALL")){ ?>
		<a href="./?<?php echo FEATURE ?>=view-all" class="btn btn-md btn-default">View All</a>
	<?php } ?>
</h1>



<strong>ID</strong>: <?php echo $data[0]['id'] ?> <br />
%INFORMATION_VIEW_DETAILS%	
				

<?php if($System->hasFeaturePermission(FEATURE, "EDIT")){ ?>
	<a href="./?<?php echo FEATURE ?>=edit&id=<?php echo $data[0]['id'] ?>" class="btn btn-md btn-primary">Edit</a>
<?php } ?>

<?php if($System->hasFeaturePermission(FEATURE, "DELETE")){ ?>
	<a href="./?<?php echo FEATURE ?>=delete&id=<?php echo $data[0]['id'] ?>" class="btn btn-md btn-danger">Delete</a>
<?php } ?>

