<?
if (!isset($_SESSION)) //判斷是否已經開啟SESSION
{
	header("Cache-control:private");
	session_start();}//開起SESSION}
	include("../function.php");
	//check_login();
putenv("NLS_LANG=TRADITIONAL CHINESE_TAIWAN.AL32UTF8");
	include("../db.php");

	//$mId=$_POST["mId"];
	$mId=$_SESSION['mId'];
	//$mAccount=$_POST['mAccount'];
	$cellphone=$_POST['cellphone'];
	$email=$_POST['email'];

	//$mAccount=nl2br(htmlspecialchars($mAccount));
	$cellphone=nl2br(htmlspecialchars($cellphone));
	$email=nl2br(htmlspecialchars($email));

if(empty($cellphone)||empty($email))
{
	echo "<script>";
	echo "alert(\"有欄位空白!!\");";
	echo "location.href=\"history.go(-1)\";";
	echo "</script>";
}
else
{
	$upd = oci_parse($conn,"UPDATE MEMBER SET CELLPHONE='$cellphone',EMAIL='$email' where MID='$mId'") or die('Insert error');
    oci_execute($upd);

	echo "<html>
        	<head>
        	<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
        	</head>
        	<body><script>";
  	echo "alert(\"資料修改成功\");";
	   echo "location.href=\"member_data_edit.php?mId=$mId\";";
	   echo "</script></body>	</html>";
}
?>

