<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理後臺</title>
<meta name="keywords" content="管理後臺" />
<meta name="description" content="管理後臺" />
<script src="/jquery/jquery-1.8.2.min.js"></script>
</head>
<body>
	<div class="wrapper">
    	<?# header ?>
    	<div class="wrap">
        	<?# sidePage ?>
            <div class="contentMain">
		    	<h3>修改管理人員資料</h3>
                <div class="article">
                    <form id="form1" name="form1" action="userView.php" method="post">
                    	<fieldset>
                            <p>
                                <label>管理帳號</label>
                                <?# LoginName ?>
                            </p>
                            <p>
                            	<label>管理密碼</label>
                                <input type="text" id="Password" name="Password" value="<?# Password ?>" maxlength="64" style="width: 300px;"/>
                            </p>
                            <p>
                            	<label>管理人名稱</label>
                                <input type="text" id="UserName" name="UserName" value="<?# UserName ?>" maxlength="64" style="width: 300px;" />
                            </p>
                            <p>
                            	<label>管理人信箱</label>
                                <input type="text" id="Email" name="Email" value="<?# Email ?>" maxlength="64" style="width: 300px;" />
                            </p>
                            <p>
                            	<label>狀態</label>
                                <input type="radio" name="Visible" value="1" />使用
                                <input type="radio" name="Visible" value="0" />不使用
                            </p>
                            <div class="competence">
                            	<p>管理權限</p>
                                <ul class="menuList"><?# menuList ?></ul>
                            </div>
                            <p>
                                <input type="button" id="btnOK" name="btnOK" value="確 定" />
                                <input type="button" id="btnCancel" value="返 回" />
                            </p>
                            <input type="hidden" id="id" name="id" value="<?# id ?>" />
                            <input type="hidden" id="pUrl" name="pUrl" value="<?# pUrl ?>" />
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
        <?# footer ?>
    </div>
<script>
<!--
	$(function(){
		$('input:radio[name="Visible"][value="<?# Visible ?>"]').attr('checked',true);
		$('#btnOK').click(function(){
			if($('#Password').val() == ''){
				alert('管理密碼不可空白!');
				$('#Password').focus();
				return false;
			}
			if($('#UserName').val() == ''){
				alert('管理人名稱不可空白!');
				$('#UserName').focus();
				return false;
			}
			if($('input:checkbox[name="MenuID[]"]:checked').size() == 0){
				if(!confirm('此帳號完全沒有勾選權限!是否確定要送出儲存?')){
					return false;
				}
			}
			$('#form1').submit();
		});
		$('#btnCancel').click(function(){
			if($('#pUrl').val() == ''){
				location.href = 'userList.php';
			}else{
				location.href = $('#pUrl').val();
			}
		});
	});
//-->
</script>
</body>
</html>