<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_UserList.aspx.vb"
    Inherits="TourEx.Web.Admin_UserList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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>
<title>无标题页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="Css/Style.css" />
<script type="text/javascript" language="javascript" src="../Sys/Js/jquery.js"></script>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="tools">
	<li class="save" p="1"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="3"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
	<li class="search"><asp:TextBox ID="Key" runat="server" CssClass="searchTitle"></asp:TextBox>
		<input type="button" value="" onclick="location='?Key='+$('#Key').val();" class="searchInput"/></li>
</ul>
</form>
<form id="BatchSubmit" name="BatchSubmit" method="post" action="?act=save" style="display: none">
</form>
<asp:Repeater ID="Repeater" runat="server">
	<HeaderTemplate>
		<div class="mainBox">
			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabBox">
				<tr class="tabTitleMain">
					<td width="35" class="selectAll">
						<a href="javascript:void(0);" onclick="$('input[name=\'ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">
							全选</a>
					</td>
					<td width="50">编号</td>
					<td>会员帐号/邮箱/手机</td>
					<td width="160">订单</td>
					<td width="40">奖金</td>
					<td width="40">状态</td>
					<td width="140">操作</td>
				</tr>
	</HeaderTemplate>
	<ItemTemplate>
		<tr class="tabTextMain" id="From_<%#Eval("U_ID")%>" onmouseout="this.style.background='#FFFFFF';"
			onmouseover="this.style.background='#F4F7FA';">
			<td><input name="U_ID" id="U_ID_<%#Eval("U_ID")%>" type="checkbox" value="<%#Eval("U_ID")%>" /></td>
			<td><%#Eval("U_ID")%></td>
			<td><a href="Admin_UserLogin.aspx?id=<%#Eval("U_ID")%>" target="_blank"><%#Eval("U_Name")%></a> / 邮箱：<%#Eval("U_Email").ToString()%> / 手机：<%#Eval("U_Mobile").ToString()%></td>
			<td><a href="Admin_HotelOrder.aspx?uid=<%#Eval("U_ID")%>">酒店</a> <a href="Admin_SceneryOrder.aspx?uid=<%#Eval("U_ID")%>">景点</a> <a href="Admin_LineOrder.aspx?uid=<%#Eval("U_ID")%>">度假</a></td>
			<td><a href="Admin_UserDetails.aspx?uid=<%#Eval("U_ID")%>"><%#Eval("U_Bonus")%>元</a></td>
			<td>
				<input id="U_Mark_<%#Eval("U_ID")%>" name="U_Mark_<%#Eval("U_ID")%>" type="checkbox"
					value="1" ovalue="<%#Eval("U_Mark")%>" <%#IIf(Eval("U_Mark")=1,"checked","")%> />
			</td>
			<td>
				<a href="Admin_Message.aspx?Userid=<%#Eval("U_ID")%>" p="63">发送短信</a> <a href="javascript:void(0);" onclick="Save(<%#Eval("U_ID")%>);return false;" p="1">保存</a> <a href="Admin_User.aspx?id=<%#Eval("U_ID")%>" p="2">编辑</a> <a href="javascript:void(0);" onclick="Del(<%#Eval("U_ID")%>);return false;" p="3">删除</a>
			</td>
		</tr>
	</ItemTemplate>
	<FooterTemplate>
		</table> </div>
		<asp:Label ID="lblEmpty" Text="暂无" runat="server" Visible="<%#Boolean.Parse((Repeater.Items.Count = 0).ToString())%>"
			Width="100%" Style="text-align: center">     
		</asp:Label>
	</FooterTemplate>
</asp:Repeater>
<webdiyer:AspNetPager ID="TourExPage" runat="server" UrlPaging="true" ShowPageIndexBox="Never"
    PageIndexBoxType="DropDownList" TextBeforePageIndexBox=""
    PageSize="20" OnPageChanged="BindData" EnableTheming="true" FirstPageText="首页"
    LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" CssClass="page" 
        PagingButtonSpacing="" CurrentPageButtonClass="current" 
    CurrentPageButtonStyle="">
</webdiyer:AspNetPager>
<script type="text/javascript">
<!--//
 var AP='<%=TourEx.BLL.GetSession("AdminPermissions") %>';
 if(AP!='')
 {
    if(AP.indexOf(',1,')==-1)$('*[p="1"]').remove();
    if(AP.indexOf(',2,')==-1)$('*[p="2"]').remove();
    if(AP.indexOf(',3,')==-1)$('*[p="3"]').remove();
    if(AP.indexOf(',63,')==-1)$('*[p="63"]').remove();
 }
 function Save(ID)
 {
	var U_IDs=ID==0?$('input[name="U_ID"]'):$('#U_ID_'+ID);
	var U_Title,U_O;
	$('#BatchSubmit').html('');
	for(var i=0;i<U_IDs.length;i++)
	{
		var U_Mark = $('#U_Mark_'+U_IDs[i].value+':checked').length
		if(U_Mark!=$('#U_Mark_'+U_IDs[i].value).attr('ovalue'))
		{
			U_IDs[i].checked=true;
			$('#From_'+U_IDs[i].value).clone().prependTo("#BatchSubmit");
			$('#U_Mark_'+U_IDs[i].value,'#BatchSubmit').attr('checked',U_Mark==0?false:true);
		}
	}
	if($('#BatchSubmit').html()==''){alert('数据没有改动过，无需保存！');return;}
	$('input[name="U_ID"]','#BatchSubmit').attr('checked',true);
	$('#BatchSubmit').submit();
 }
 function Del(ID)
 {
	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
		Url +='U_ID='+ID;
	}else{
		IDs = $("input[name='U_ID']").serialize().replace(/&U_ID=/g,',');
		if(IDs==''){alert('请选择您要删除的会员！');return;}
		Url +=IDs;
	}
	if(confirm('您确定删除吗！')){location=Url;}
 }
//-->
</script>
</body>
</html>