<?php
require ('connect.php');
session_start();
if($_SESSION['User_id'] == ""){
									header("Content-type: text/html; charset=utf-8");
 									echo"<script language='JavaScript' >";
									echo"alert('กรุณากรอกข้อมูลเพื่อเข้าสู่ระบบ');";
									echo"</script>";		
									echo "<meta http-equiv='refresh' content='0;url=index.php' />";
exit(); 
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" href="bootstrap/css/footer.css">
<link rel="stylesheet" href="bootstrap/css/base.css">
<link rel="stylesheet" href="bootstrap/css/skeleton.css">
<link rel="stylesheet" href="bootstrap/css/layout.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet"/>
<link type"text/css" rel="Stylesheet" href="bootstrap/css/bootstrap.css" />
<meta charset="UTF-8">
<title>AFM ASS</title>
<script language="JavaScript">
	function fncOpenPopup()
	{
		window.open('upimguser.php?view_id=<?php echo $_GET["view_id"];?>','popup-name','width=400,height=300,toolbar=0, menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');
	}
</script>
<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>
</head>

<body>
	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
    	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
    	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="page-header">
				<h1>
					AFM Asset Management <small>ระบบการจัดการสินทรัพย์บริษัท เอ เอฟ เอ็ม จำกัด</small>
				</h1>
			</div>
			<?php include("navbartop.php"); ?>
			<div class="col-md-12 column">
             <h3></h3>
          </div>
          <p>
              <?php
			$strSQL = " SELECT * FROM tb_user,tb_usertype where tb_user.Usertype_id = tb_usertype.Usertype_id and tb_user.User_id = '".$_GET["view_id"]."'";
			$objQuery = mysql_query ($strSQL);
			while($objResult = mysql_fetch_array($objQuery))
				{
			?>
            </p>
            <p><span class="h2">ข้อมูลผู้ใช้</span></p>
            <table width="100%" height="187" border="1" class="table table-bordered">
              <tr>
                <td height="67" colspan="4" align="center" valign="middle">
                <img src="imguser/<?php echo $objResult["Image"];?>" class="img-thumbnail" type="button" name="btnOpen" value="OpenPopup" OnClick="fncOpenPopup();">
                 </td>
              </tr>
              <tr>
                <td class="h4">ชื่อ-นามสกุล</td>
                <td><?php echo $objResult["Name"];?></td>
                <td class="h4">ชื่อผู้ใช้งาน</td>
                <td><?php echo $objResult["Username"];?></td>
              </tr>
              <tr>
                <td class="h4">อีเมล์</td>
                <td><?php echo $objResult["Email"];?></td>
                <td class="h4">เบอร์โทรศัพท์</td>
                <td><?php echo $objResult["Tel"];?></td>
              </tr>
              <tr>
                <td class="h4">ตำแหน่ง</td>
                <td><?php echo $objResult["Position"];?></td>
                <td class="h4">แผนก</td>
                <td><?php echo $objResult["Department"];?></td>
              </tr>
              <tr>
                <td colspan="4">
                 <a href="edituser.php?edit_id=<?php echo $_GET["view_id"];?>"><button class="btn btn-success">
           <span class="glyphicon glyphicon-plus"></span>
           แก้ไขข้อมูลผู้ใช้งาน</button></a>
           <a href="deluser.php?del_id=<?php echo $_GET["view_id"];?>"><button  class="btn btn-danger">
           <span class="glyphicon glyphicon-plus"></span>
           ลบผู้ใช้งาน</button>
           </a>
           </td>
              </tr>
  
            </table>
  <?php }?>
            <p>&nbsp;</p>

	  </div>
	</div>
    <?php include("footer.php"); ?>
</div>
<script src="js/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='js/jquery-1.5.1.min.js'>\x3C/script>")</script>
<script src="js/app.js"></script>
</body>
</html>