<?php
	session_start();
	if($_SESSION['UserID'] == "")
	{
		echo "Please Login!";
		exit();
	}

	if($_SESSION['Status'] != "ADMIN")
	{
		echo "This page for Admin only!";
		exit();
	}	
	
	/*$serverName = "localhost";
	$userName = "root";
	$userPassword = "root";
	$dbName = "mydatabase";

	$objCon = mysqli_connect($serverName,$userName,$userPassword,$dbName);*/
	include("../functions/dblink.php");
	$sql = "SELECT * FROM member WHERE UserID = '".$_SESSION['UserID']."' ";
	$query = mysqli_query($con,$sql);
	$result = mysqli_fetch_array($query,MYSQLI_ASSOC);
?>
<html>
<head>
<title>Admin Page</title>
</head>
<body>
  Welcome to Admin Page! <br>
  <table border="1" style="width: 300px">
    <tbody>
      <tr>
        <td width="87"> &nbsp;Username</td>
        <td width="197"><?php echo $result["Username"];?>
        </td>
      </tr>
      <tr>
        <td> &nbsp;Name</td>
        <td><?php echo $result["Name"];?></td>
      </tr>
    </tbody>
  </table>
  <br>
  <a href="../edit_profile.php">Edit</a><br>
  <br>
  <a href="../logout.php">Logout</a>
</body>
</html>
<?php
	mysqli_close($con);
?>