<!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/less/datepicker.less">
<link rel="stylesheet" href="bootstrap/css/layout.css">
<link href="bootstrap/css/datepicker.css" rel="stylesheet">
<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>
	</div>
<form role="form" method="post" action="saveedituser.php">
<?php
include("connect.php");
$id = $_REQUEST['edit_id'];
$sql_show = " SELECT * FROM tb_user,tb_usertype,tb_department
where
tb_user.Usertype_id = tb_usertype.Usertype_id
AND
tb_user.Department = tb_department.Department_id
AND tb_user.User_id = '".$id."' ";
$result_show = mysql_query($sql_show) or die(mysql_error());
$row_show = mysql_fetch_array($result_show);
?>
	<div class="form-group">
        		<label for="inputEmail3" class="col-sm-2">ระดับการใช้</label>
        			<div class="col-sm-3">
            <select class="form-control" name="usertype" required>
    		<?php
		    mysql_query("SET NAMES UTF8");
           $result = mysql_query("SELECT * FROM `tb_usertype`");
           while($row = mysql_fetch_array($result)){
			   echo "<option value=\"$row[Usertype_id]\" ";
			   if($row_show['Usertype_id']==$row['Usertype_id']) { echo 'selected'; }
			   echo ">$row[Usertype]";
			   echo "</option>\n";
        ?>
          </option>
        <?php }?>
			</select>
         			</div>
   	</div>
   <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">แผนก</label>
        	<div class="col-sm-3">
               <select class="form-control" name="Department" required>
    		<?php
		    mysql_query("SET NAMES UTF8");
           $result = mysql_query("SELECT * FROM `tb_department` ORDER BY `Department_id` ASC");
           while($row01 = mysql_fetch_array($result)){
			   echo "<option value=\"$row01[Department_id]\" ";
			   if($row_show['Department_id']==$row01['Department_id']) { echo 'selected'; }
			   echo ">$row01[Department]";
			   echo "</option>\n";
        ?>
          </option>
        <?php }?>
			</select>
         	</div>
    </div>
    									<div class="row clearfix">
                                        <div class="col-md-12 column">
                                        </div>
                                    	</div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">ชื่อผู้ใช้งาน</label>
        	<div class="col-sm-3">
            <input type="text" class="form-control" placeholder="A-Z,a-z,0-9" name="username" value="<?=$row_show['Username']?>" required>
         	</div>
    </div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">รหัสผ่าน</label>
        	<div class="col-sm-3">
            <input type="text" class="form-control" placeholder="ตัวเลขหรือตัวอักษร" name="password" value="<?=$row_show['Password']?>" required>
         	</div>
    </div>
    									<div class="row clearfix">
                                        <div class="col-md-12 column">
                                        </div>
                                    	</div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">ชื่อ-นามสกุล</label>
        	<div class="col-sm-3">
            <input type="text" class="form-control"  name="nameuser"value="<?=$row_show['Name']?>" required>
         	</div>
    </div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">อีเมล์</label>
        	<div class="col-sm-3">
            <input type="Email" class="form-control"  placeholder="กรอกอีเมล์" name="email" value="<?=$row_show['Email']?>" required>
         	</div>
    </div>
    									<div class="row clearfix">
                                        <div class="col-md-12 column">
                                        </div>
                                   	 	</div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">เบอร์โทรศัพท์</label>
        	<div class="col-sm-3">
            <input type="text" class="form-control" placeholder="Tel." name="tel" value="<?=$row_show['Tel']?>" required>
         	</div>
    </div>
    <div class="form-group">
        	<label for="inputEmail3" class="col-sm-2">ตำแหน่ง</label>
        	<div class="col-sm-3">
            <input type="text" class="form-control" placeholder="ระดับการทำงาน" name="Position" value="<?=$row_show['Position']?>" required>
         	</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="row clearfix">
                                        <div class="col-md-12 column">
                                        </div>
                                    	</div>
    <div align="left">
           <button type="submit" class="btn btn-success">
           <span class="glyphicon glyphicon-plus"></span>
           บันทึก</button>
           								<div class="col-md-1">
                                        </div>
           <a href="homeuser.php?view_id=<?php echo $_GET["edit_id"];?>"><button type="button" class="btn btn-danger">
           <span class="glyphicon glyphicon-minus"></span>
           ยกเลิก</button></a>
    </div>
    <input type="hidden" name="edituser" value="<?php echo $id;?>">
</form>
<?php include("footer.php"); ?>
</div>

<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap-datepicker.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>