<?php 
	session_start();
	
	$usercode = $_POST['pf1'];
	$usernameth = $_POST['pf2'];
	$userlnameth = $_POST['pf3'];
	$usernameen = $_POST['pf4'];
	$userlnameen = $_POST['pf5'];
	$usersex = $_POST['pf67']; //เพศ
	$userposition = $_POST['pf8'];
	$userdepartment = $_POST['pf9'];
	$usercompany = $_POST['pf10'];
	$userbranch = $_POST['pf11'];
	$userloginname = $_POST['pf12'];
	$userpassword = $_POST['pf13'];
	
	$userlogin = $_SESSION['userloginname'];
	$userid_epf = $_GET['edid'];
	
	//echo "{$usercode},{$userlnameth},{$userposition},{$userbranch},{$userpassword}";

	include "../../../Connections/connect_mysql.php";
	//mysql_query("set names utf8");

    //$sql_s = "SELECT * FROM user_tb where usercode='{$usercode}' ";
	//$result_s = mysql_query($sql_s) or die(mysql_error());
	//if (mysql_num_rows($result_s)==0){
	$sqlED = "UPDATE user_tb SET usercode = '{$usercode}' , usernameth = '{$usernameth}', userlnameth = '{$userlnameth}', usernameen = '{$usernameen}', userlnameen = '{$userlnameen}' , usersex = '{$usersex}', userposition={$userposition}, userdepartment={$userdepartment},  usercompany ={$usercompany}, userbranch={$userbranch} , userloginname='{$userloginname}', userpassword='{$userpassword}', updateby='{$userlogin}', updatetime=NOW() WHERE userid = {$userid_epf} ";
	$resultED = mysql_query($sqlED) or die(mysql_error());
	
		if($resultED){
			echo "Y";
		}else{
			echo "N";
		}
		
	//}else{
		//echo "N";	
	//}
	
	mysql_close($c);

 ?>
