<?php
	session_start();
	if($_SESSION['adm'])
	{
		$userid= $_SESSION['adm'];
	}
	else
	{
		header('location:../login.php');
	}
?>
<html>
<head>
 <style type="text/css">
 #t1{ margin: 50px; border-collapse:collapse;}
 #t1 th{background:#687388; color:white; font-size:20px; font-family:sans-serif;}
 #t1 td{background:#f3f4f5; color:black; font-size:20px; font-family:sans-serif;}
 </style>
</head>
<body>
    <?php
        include'connection.php';
        $uid=$_GET['id'];
        $strUserId=substr($uid, "0", "2");
        if($strUserId==50)
        {
            $tableName="retailer";
        }
        elseif($strUserId==20)
        {
            $tableName="distributer";
        }
        elseif($strUserId==30)
        {
            $tableName="masterdis";
        }
        elseif($strUserId==22)
        {
            $tableName="admin";
        }
        else
        {
            $tableName="MLM_Users";
        }
        
        $quGetUserProfile="select * from $tableName where Userid='$uid'";
        $reGetUserProfile=mysqli_query($con,$quGetUserProfile);
        $dataGetUserprofile=mysqli_fetch_array($reGetUserProfile);
        $Usrpwd=$dataGetUserprofile['Password'];
        $UsrName=$dataGetUserprofile['Name'];
        $UsrMobile=$dataGetUserprofile['Mobile'];
        $UsrEmail=$dataGetUserprofile['Email'];
        $Address=$dataGetUserprofile['Address'];
    ?>
    <table border="1" cellpadding="10" id="t1">
        <tr>
            <th>User Id</th>
            <td><?php echo $uid; ?></td>
        </tr>
         <tr>
            <th>Password</th>
            <td><?php echo $Usrpwd; ?></td>
        </tr>
         <tr>
            <th>User Name</th>
            <td><?php echo $UsrName; ?></td>
        </tr>
         <tr>
            <th>Mobile No.</th>
            <td><?php echo $UsrMobile; ?></td>
        </tr>
         <tr>
            <th>Email Id</th>
            <td><?php echo $UsrEmail; ?></td>
        </tr>
        <tr>
            <th>Address</th>
            <td><?php echo $Address; ?></td>
        </tr>
    </table>
</body>
</html>