<!DOCTYPE html>
<!--[if IE 8 ]><html dir="ltr" lang="zh-TW" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh-TW" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="zh-TW">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<title>管理後臺</title>
<meta name="robots" content="noindex, nofollow" />
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.minicolors.css" rel="stylesheet" type="text/css" />
<script src="/jquery/jquery-1.8.2.min.js"></script>
<script src="/js/jquery.minicolors.js"></script><!--顏色選擇器-->
<script>
	if('<?# alertMsg ?>' != ''){
		alert('<?# alertMsg ?>');
		if('<?# goBack ?>' == 'Y'){
			history.back();
		}
	}
	if('<?# locationHref ?>' != ''){
		location.href = '<?# locationHref ?>';
	}
</script>
</head>
<body>
	<div class="wrapper">
    	<?# header ?>
    	<div class="wrap">
        	<?# sidePage ?>
            <div class="contentMain">
            	<ul class="waylink">
                	<li><a href="index.php">後台管理</a></li>
                    <li>會員管理</li>
                    <li><a href="message_typeList.php">訊息類型列表</a></li>
                    <li><?# editTitle ?></li>
                </ul>
            	<h3 class="pagTitle"><?# editTitle ?></h3>
                <form id="form1" name="form1" action="message_typeEdit.php" method="post">
	                <div class="showBox">
                        <div class="showHeader">
                            <p>訊息類型資訊</p>
                            <font><a href="javascript:void(0);" data-action="showBtn"><i class="fa fa-chevron-up"></i> 收合</a></font>
                        </div>
                        <div class="showInfo listBox">
							<p class="col"><label>訊息類型名稱</label><input type="text" id="TypeName" name="TypeName" value="<?# TypeName ?>" /></p>
							<p class="col col-4">
								<label>啟用狀態</label>
								<font class="checkbox"><input type="checkbox" id="Visible" name="Visible" value="1" /><span></span></font>
							</p>
							<p class="col col-4">
								<label>排序</label>
								<input type="text" id="OrderNO" name="OrderNO" value="<?# OrderNO ?>" onkeypress="if(event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" />
							</p>
							<p class="col col-4">
								<label>會員可用</label>
								<font class="checkbox"><input type="checkbox" id="IsM" name="IsM" value="1" /><span></span></font>
							</p>
							<p class="col col-4">
								<label>管理者可用</label>
								<font class="checkbox"><input type="checkbox" id="IsU" name="IsU" value="1" /><span></span></font>
							</p>
                        </div>
	                </div>
                    <input type="hidden" id="id" name="id" value="<?# id ?>" />
                    <p>
                        <a id="btnOK" class="btn" href="javascript:void(0);">送出</a>
                        <a id="btnCancel" class="btn reset" href="javascript:void(0);">返回</a>
                    </p>
                </form>
            </div>
        </div>
        <?# footer ?>
    </div>
<script src="/jquery/admin-jquery.js"></script><!--後台所有jq控制-->
<script>
	$(function(){
		if('<?# Visible ?>' == '1') $('#Visible').prop('checked', true);
		if('<?# IsM ?>' == '1') $('#IsM').prop('checked', true);
		if('<?# IsU ?>' == '1') $('#IsU').prop('checked', true);

		$('#btnOK').click(function(){
			if($('#TypeName').val() == ''){
				alert('請輸入訊息類型名稱!');
				$('#TypeName').focus();
				return false;
			}
			if(!/^\d+$/.test($('#OrderNO').val())){
				alert('排序只能輸入數字!');
				$('#OrderNO').focus();
				return false;
			}
			$('#form1').submit();
		});
		$('#btnCancel').click(function(){
			location.href = 'message_typeList.php';
		});
	});
</script>
</body>
</html>