<!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="less/page.less" rel="stylesheet/less">
<link href="css/main.css" rel="stylesheet">
<link href="css/page.css" rel="stylesheet">
<script src="/jquery/jquery-1.10.js"></script>
<script>
	if('<?# alertMsg ?>' != ''){
		alert('<?# alertMsg ?>');
		if('<?# goBack ?>' == 'Y') history.back();
	}
	if('<?# locationHref ?>' != '') location.href = '<?# locationHref ?>';
</script>
</head>
<body>
	<?# sidePage ?>
	<div class="pos_rel" id="content">
		<?# header ?>
		<div class="row mt_10 mb_5 h3 page_title"><?# page_name ?></div>
        <div class="card">
			<div class="pos_rel bg_g_100 tabs_warp" id="tabs_warp">
                <div class="tabs_list">
					<a class="tabs_item" href="index.php">控制台</a>
                    <a class="tabs_item" data-action="true" href="javascript:void(0);"><?# page_name ?></a>
                </div>
            </div>
			<div class="mall_5"><a class="btn btn_success" href="userAdd.php">新增管理人員</a></div>
            <ul class="list_box">
                <php:repeater id="list">
                <template>
                <li class="d_lg_flex">
                    <p class="col_lg_1"><label>狀態</label><font><?# txtV ?></font></p>
                    <p class="col_lg_1"><label>Line</label><font><?# isLine ?></font></p>
                    <p class="col_lg_1"><label>Gmail</label><font><?# isGmail ?></font></p>
                    <p class="col_lg_1"><label>臉書</label><font><?# isFb ?></font></p>
                    <p class="col_lg_2"><label>帳號</label><font><?# LoginName ?></font></p>
                    <p class="col_lg_2"><label>名稱</label><font><?# UserName ?></font></p>
                    <p class="col_lg_2">
						<label>操作</label>
						<font>
							<a class="mr_2 btn btn_primary" href="userView.php?id=<?# UserID ?>&pUrl=<?# encodeUrl ?>">修改</a>
							<a class="btn btn_danger" data-action="delItem" data-id="<?# UserID ?>" href="javascript:void(0);">刪除</a>
						</font>
					</p>
                </li>
                </template>
                </php:repeater>
            </ul>
        </div>
		<?# footer ?>
	</div>
</body>
</html>
<script>
	$(function(){
		$('a[data-action="delItem"]').click(function(){
			if(!confirm('刪除資料後將無法恢復!是否確定要刪除管理人員資料?')){
				return false;
			}else{
				$.ajax({
					url: 'ajax/user2.php',
					async: false,
					type: 'POST',
					data: {'do':'del','id':$(this).data('id')},
					dataType: "json",
					context: $(this).parents('li'),
					success: function(obj){
						if(obj.err == '0'){
							$(this).remove();
						}else{
							alert(obj.msg);
						}
					},
					error: function(){
						alert('系統異常!請重新整理頁面再試一次!');
					}
				});
			}
		});
	});
</script>