<?php
include("CheckSession.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description" content="馬戲團" />
	<title>馬戲團</title>
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<?php

require_once "class/DBConfig.php";
require_once "class/DBOperation.php";

$EX_EMAIL1 = "";
$EX_EMAIL2 = "";
$EX_EMAIL3 = "";

$db = new DBOperation();


$id = "EX_EMAIL1";
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$db->query("SELECT * FROM SysConfig  where SName = '" . $db->mysql_real_escape_string($id) . "'");
$row = $db->fetch_row();
$EX_EMAIL1 = $row[1];
$db->close_db();

$id = "EX_EMAIL2";
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$db->query("SELECT * FROM SysConfig  where SName = '" . $db->mysql_real_escape_string($id) . "'");
$row = $db->fetch_row();
$EX_EMAIL2 = $row[1];
$db->close_db();

$id = "EX_EMAIL3";
$db->connect_db($_DB['host'], $_DB['username'], $_DB['password'], $_DB['dbname']);
$db->query("SELECT * FROM SysConfig  where SName = '" . $db->mysql_real_escape_string($id) . "'");
$row = $db->fetch_row();
$EX_EMAIL3 = $row[1];
$db->close_db();

?>
<SCRIPT language="JavaScript">
	function validateForm(objThisUi) {
		if (objThisUi.EX_EMAIL1.value.length == 0) {
			alert("請輸入電子信箱一!!");
			objThisUi.EX_EMAIL1.focus();
			return false;
		}

		if (objThisUi.EX_EMAIL1.value.length == 0) {
			alert("請輸入電子信箱一!!");
			objThisUi.EX_EMAIL1.focus();
			return false;
		}
		/*
		if (objThisUi.EX_EMAIL2.value.length == 0) {
			alert("請輸入電子信箱二!!");
			objThisUi.EX_EMAIL2.focus();
			return false;
		}
		if (objThisUi.EX_EMAIL3.value.length == 0) {
			alert("請輸入電子信箱三!!");
			objThisUi.EX_EMAIL2.focus();
			return false;
		}
			*/
		return true;
	}
</SCRIPT>

<body>
	<form name="ChangePassForm" method="post" action="MailSetUpdateDeal.php" id="ChangePassForm" onSubmit="return validateForm(this);">
		<input type="hidden" name="action" id="action" value="<?php echo $action ?>" />
		<input type="hidden" name="id" id="id" value="<?php echo $id ?>" />
		<table border="0" cellspacing="0" cellspadding="0" width="90%">
			<!--
<tr>
<td align="center" colspan="2">
<span class="title"><b>變更密碼</b></span>
</td>
</tr>
-->
			<tr>
				<td align="left" colspan="2">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td align="left" colspan="2">
					<table border="3" cellspacing="2" cellspadding="2" width="100%">
						<tr>
							<td align="left" width="20%">
								<span class="t12">電子信箱一</span>
							</td>
							<td align="left" width="80%">
								<input type="text" name="EX_EMAIL1" id="EX_EMAIL1" value="<?php echo $EX_EMAIL1; ?>" size="100" maxlength="200" style="font-size: 12.0pt;font-family: 微軟正黑體;" />
							</td>
						</tr>
						<tr>
							<td align="left" width="20%">
								<span class="t12">電子信箱二</span>
							</td>
							<td align="left" width="80%">
								<input type="text" name="EX_EMAIL2" id="EX_EMAIL2" value="<?php echo $EX_EMAIL2; ?>" size="100" maxlength="200" style="font-size: 12.0pt;font-family: 微軟正黑體;" />
							</td>
						</tr>
						<tr>
							<td align="left" width="20%">
								<span class="t12">電子信箱三</span>
							</td>
							<td align="left" width="80%">
								<input type="text" name="EX_EMAIL3" id="EX_EMAIL3" value="<?php echo $EX_EMAIL3; ?>" size="100" maxlength="200" style="font-size: 12.0pt;font-family: 微軟正黑體;" />
							</td>
						</tr>
						<tr>
							<td align="center" colspan="2">
								<input type="submit" name="btnSub" id="btnSub" value="確認變更" class="t12" />
							</td>
						</tr>
					</table>

				</td>
			</tr>
		</table>
	</form>
</body>

</html>