<?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>
</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><a href="adduser.php"><button type="button" class="btn btn-success">เพิ่มผู้ใช้งาน</button></a></h3>
          </div>
            <?php
			$strSQL = " SELECT * FROM tb_user,tb_usertype where tb_user.Usertype_id = tb_usertype.Usertype_id";
			$objQuery = mysql_query ($strSQL);
			?>
			<table class="table table-bordered">
				<thead>
					<tr class="active">
						<th>#</th>
                        <th>ชื่อผู้ใช้งาน</th>
						<th>ชื่อ-นามสกุล</th>
                        <th align="center">อีเมล์</th>
						<th>เบอร์โทรศัพท์</th>
                        <th>ตำแหน่ง</th>
                        <th>แผนก</th>
                        <th align="center">ระดับใช้งาน</th>
                        <th align="center" valign="middle">ข้อมูล</th>
					</tr>
				</thead>
				<tbody>
                <?php
				$i = 1 ;
				while($objResult = mysql_fetch_array($objQuery))
				{
				?>
                <tr>
                <td><?php echo $i ;?></td>
                <td><?php echo $objResult["Username"];?></td>
                <td><?php echo $objResult["Name"];?></td>
                <td><?php echo $objResult["Email"];?></td>
                <td><?php echo $objResult["Tel"];?></td>
                <td><?php echo $objResult["Position"];?></td>
                <td><?php echo $objResult["Department"];?></td>
                <td><?php echo $objResult["Usertype"];?></td>
                <td><a href="homeuser.php?view_id=<?php echo $objResult['User_id'];?>">
                <button type="button" class="btn btn btn-info">
  				<span class="glyphicon glyphicon-search"></span>
				</button></a></td>
                </tr>
                <?php }?>
				</tbody>
			</table> 
		</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>