<!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" />
<script src="/jquery/jquery-1.8.2.min.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>訊息類型列表</li>
                </ul>
            	<h3 class="pagTitle">訊息類型列表</h3>
                <div id="addBox"><a class="btn green" href="message_typeEdit.php"><i class="fa fa-plus"></i> 新增訊息類型</a></div>
				<form id="form1" name="form1" method="get" action="message_typeList.php">
					<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 serch">
                            <font>狀態： </font>
                            <font>
                                <select id="vv" name="vv">
                                    <option value="">全部</option>
                                    <option value="1">啟用</option>
                                    <option value="0">停用</option>
                                </select>
                            </font>
                            <font>會員： </font>
                            <font>
                                <select id="im" name="im">
                                    <option value="">全部</option>
                                    <option value="1">可用</option>
                                    <option value="0">不可用</option>
                                </select>
                            </font>
                            <font>管理者： </font>
                            <font>
                                <select id="iu" name="iu">
                                    <option value="">全部</option>
                                    <option value="1">可用</option>
                                    <option value="0">不可用</option>
                                </select>
                            </font>
                            <font><a id="btnOK" class="btn" href="javascript:void(0);">搜尋</a></font>
                        </div>
                    </div>
					<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">
							<ul>
								<php:repeater id="list">
								<template>
								<li>
									<p><label>名稱</label><font><?# TypeName ?></font></p>
									<p><label>排序</label><font><?# OrderNO ?></font></p>
									<p class="sBox"><label>狀態</label><font><?# txtV ?></font></p>
									<p class="sBox"><label>會員</label><font><?# txtM ?></font></p>
									<p class="sBox"><label>管理者</label><font><?# txtU ?></font></p>
									<p>
										<label>操作</label>
										<font>
											<a class="btn" href="message_typeEdit.php?id=<?# TypeID ?>">修改</a>
											<a class="btn red" data-action="del" data-id="<?# TypeID ?>" href="javascript:void(0);">刪除</a>
										</font>
									</p>
								</li>
								</template>
								</php:repeater>
							</ul>
						</div>
					</div>
				</form>
            </div>
        </div>
        <?# footer ?>
    </div>
<script src="/jquery/admin-jquery.js"></script><!--後台所有jq控制-->
<script>
	$(function(){
		$('#vv').val('<?# vv ?>');
		$('#im').val('<?# im ?>');
		$('#iu').val('<?# iu ?>');
		$('#btnOK').click(function(){
			$('#form1').submit();
		});
		$('a[data-action="del"]').click(function(){
			if(!confirm('類型刪除後將無法恢復!是否確定要刪除?')){
				return false;
			}
			$.ajax({
				'url': 'ajax/message_type.php',
				'async': false,
				'type': 'POST',
				'data': {'do': 'del', 'id': $(this).data('id')},
				'dataType': 'json',
				'context': $(this).parent().parent().parent(),
				'success': function(obj){
					if(obj.error == '0'){
						$(this).remove();
					}else{
						alert(obj.msg);
					}
				},
				'error': function(){
					alert('系統異常!請重新整理頁面再試一次!');
				}
			});
		});
	});
</script>
</body>
</html>