<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Work.User.UI_List" intPageSize="15" CodePage="65001" PathLevel="1" PageFileFlag="AdminUser_List" PageFileTitle="前台会员管理" DataBindingType="1" PageFlagId="1"  %>


<%@ Register TagPrefix="Site" TagName="Menu" Src="../WUC/Site_Menu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<%
if(IsBaseType==1) PageFileTitle="前台会员管理 - 机器人会员";
else PageFileTitle="前台会员管理 - 会员";
%>

<Site:Menu id="menu_headtitle" runat="server" Flag="HeadTitle" CurrentPageTitle = "后台管理 - 前台会员管理" />
<Site:Menu id="menu_headjs" runat="server" Flag="HeadJs" PathLevel="1" />
<Site:Menu id="menu_headcss" runat="server" Flag="HeadCss" PathLevel="1" />


<script>

var commonUrlParam = "&Email="+ $("#serach_Email").val() 
					+ "&Phone="+  $("#serach_Phone").val()+ "&NickName="+ ($("#serach_NickName").val())+"&IsBaseType=<%=IsBaseType%>";
//2010-10-19
function Edit_Info(Uid,uNickName){//[\"+ uNickName +\"]

	//访问类型,AJAX路径,数据JSON,弹出框ID,弹出框标题,等执行的函数名;
	var _url="User_Update.aspx?IsAdd=1"+commonUrlParam;
	var _data = {"id":Uid,"IsBaseType":<%=IsBaseType%>};	
	Common.EditFunction("POST",_url,_data,"<%=PageFileFlag%>","<%=(IsBaseType==1?"机器人会员":"会员")%>["+ uNickName +"]资料编辑","SaveSub");	
	//将本行设置为选中颜色
	SetActive(Uid);
	return false;
}

function Edit_Pass(Uid,uNickName){
//访问类型,AJAX路径,数据JSON,弹出框ID,弹出框标题,等执行的函数名;
var _url="User_UpdatePass.aspx?IsAdd=1"+commonUrlParam;
var _data = {"id":Uid,"IsBaseType":<%=IsBaseType%>};	
Common.EditFunction("POST",_url,_data,"<%=PageFileFlag%>","重设<%=(IsBaseType==1?"机器人会员":"会员")%>["+ uNickName +"]的密码","SaveSub");	
//将本行设置为选中颜色
SetActive(Uid);
return false;
}



//删除
function Del_Info_WebUser(id,Uid,uNickName){
//提交方式，目标地址，数据表，弹出框ID，标题，内容
var _url =  "User_Update.aspx?IsAdd=30";
var _data ={"id":id};
var _title ="<%=(IsBaseType==1?"机器人会员":"会员")%>["+ uNickName +"]-删除确认";
Common.ConfirmDelete2 ("POST",_url,_data,"<%=PageFileFlag%>",_title,"");
SetActive(id);
}
//21:03 2010-11-02
function SearchInfo(){
	var _url =  "User_UI_List.ASPX?Email="+ $("#serach_Email").val() + "&Phone="+  $("#serach_Phone").val()+ "&NickName="+  encodeURI ($("#serach_NickName").val()) + "&<%=GetQueryString("Email,Phone,NickName")%>" ;
	Common.GoTo(_url);
	
}

//11:43 2010-9-29
$(document).ready(function(){
	//client_SetPageNo(<%=intPageNo%>);//记录页码
});

//子层换页
function SimpleAjax2(ToUrl,uid)
{
	//SimpleAjax(ToUrl,"Admin_Edit_Info .dialogboxContent",null,null,{'uid':uid});

}

//收货地址
function ShowAddressManage(UserId,uNickName)
{

//访问类型,AJAX路径,数据JSON,弹出框ID,弹出框标题,等执行的函数名;
var _url="../Dialog/UserAddress.aspx";
var _data = {"uid":UserId};	
Common.EditFunction("POST",_url,_data,"<%=PageFileFlag%>","查看<%=(IsBaseType==1?"机器人会员":"会员")%>["+ uNickName +"]的订单","");	
//将本行设置为选中颜色
SetActive(UserId);
return false;

}
//-------------------------------------------------
function LoadWebUserOrderFormList(id,Uid,uNickName){

//访问类型,AJAX路径,数据JSON,弹出框ID,弹出框标题,等执行的函数名;
var _url="User_OrderForm_UI_List.aspx?IsAdd=1&p=1";
var _data = {"uid":Uid};	
Common.EditFunction("POST",_url,_data,"<%=PageFileFlag%>_UserOrderFormList","查看<%=(IsBaseType==1?"机器人会员":"会员")%>["+ uNickName +"]的订单","");	
//将本行设置为选中颜色
//Common.EditDialg("<%=PageFileFlag%>_UserOrderFormList","查看<%=(IsBaseType==1?"机器人":"会员")%>["+ uNickName +"]的订单","","");
//LoadCurrentWebUserOrderFormList(Uid,1);
SetActive(id);
return false;
}
//订单列表翻页时用
function LoadCurrentWebUserOrderFormList(Uid,p)
{
//		//url:"/Admin/Work/User_OrderForm_UI_List.aspx",
//if(!Uid || Uid<1) Uid=<1%=Uid%1>;
if(!p || p<1)p=1;
	var _url="User_OrderForm_UI_List.aspx?IsAdd=1&p="+p;
	$.ajax({
	async:false,//同步访问
		type:"POST",
		url: _url,
		data:{"uid":Uid},
		cache: false,
		success: function(msg){
		//	Common.ShowText("xxx","内容显示",msg,600);
			//art.dialog.list['AdminUser_List_UserOrderFormList'].content(msg);
			Common.EditDialogSetContent("AdminUser_List_UserOrderFormList",msg);
		}
	});
}


function SetOperateState(id,Uid)
{

//弹出框ID，标题，显示内容，OK操作，取消操作
var msg="状态更新为单向处理,处理后将不能恢复!<br><br>你确认更新该订单的处理状态吗?"
Common.Confirm ("User_OrderForm_UI_List","订单处理",msg
,function(){LoadCurrentWebUserOrderFormList(Uid,1);}
)
return ;
/*
	//function addDialogbox(objId,title,zIndex,objWidth,ScreenMaskId,zIndex_Sub)
	addDialogbox("#Admin_SetOperateState_Info","你确认更新该订单的处理状态吗?",10005,252,"Sub",10003);
	msg='状态更新为单向处理,处理后将不能恢复!<br><br>	'+
			'<div class="paragraph">'+
					'<button type="button" class="f12" onclick="Set_State_Yes('+id+')">确认更新</button>'+
					'<button type="button" class="f12" onclick="Del_Info_No()">返回</button>'+
			'</div>';
	$("#Admin_SetOperateState_Info .dialogboxContent").html(msg);*/
}

//删除订单
function Del_OrderForm_Info(id)
{
	
//弹出框ID,标题，内容，删除程序执行路径，参数表
var _url =  "../index.aspx?s=/Admin/Work_Order_Delete";
var _data ={"id":id};
Common.ConfirmDelete2 ("POST",_url,_data,"<%=PageFileFlag%>","删除确认","",0);
SetActive(id);		
}

//OperateType:0-state,1-del
function Set_State_Yes(id,Uid){
	$.ajax({
		type: "POST",
		url: "../index.aspx?s=/Admin/Work_Order_Set_State",
		data:{"Oid":id,"OperateType":0},
		cache: false,
		success: function(msg){
			LoadCurrentWebUserOrderFormList(Uid,1);

		}
	});

}



function Del_UserOrderForm_Info_Yes(id,Uid){
	$.ajax({
		type: "POST",
		url: "../index.aspx?s=/Admin/Work_Order_Delete",
		data:{"Oid":id,"OperateType":1},
		cache: false,
		success: function(msg){
			//alert(msg)
			LoadCurrentWebUserOrderFormList(Uid,1);
		
		}
	});

}

//-------------------------------------------------

</script>

</head>
<body>

<Site:Menu id="menu_topmenu" runat="server" Flag="TopMenu"  />
<div class1="wrap" id="wrap">
	<Site:Menu id="Wuc_LeftMenu" runat="server" Flag="LeftMenu" PageFileFlag="Menu_A_800_801" PathLevel="1" />	
	<div class1="mainbox" class="MainBox W1100 ">

		<div class="PGTitle LH30 ">
			<div class="W200 FL MGL10 FWB FS12"><%=PageFileTitle%></div>
			<div class="ChileMenu1 FL FS12">


<%=(IsBaseType==1?"机器人":"")%>会员昵称:<input type="text" id="serach_NickName" style="height:20px"  value="<%=UrlParam_NickName%>" />
邮箱:<input type="text" id="serach_Email" style="height:20px" value="<%=UrlParam_Email%>"  />
电话:<input type="text" id="serach_Phone" style="height:20px"  value="<%=UrlParam_Phone%>" />
<input type="button" class="button" value="搜索..." onclick="SearchInfo()" style="margin-bottom:-4px">
(不使用的查询条件请置空)


			</div>
			<div class="Clear"></div>
		</div>

		<div class="ContBox MGT10 " >

<table class="Table FS12 ">


<tr style="height:30px;	font-weight: bold;">
<TH style="width:50px"><font color="#3333CC">编号</font></TH>
<TH style="width:120px">昵称</TH>

<TH style="width:30px">性别</TH>
<TH style="width:60px">电话</TH>
<TH style="width:60px">收货地址</TH>
<TH style="width:30px">状态</TH>
<TH style="width:120px">注册时间</TH>
<TH style="width:120px">上次在线时间</TH>
<TH style="width:160px"><%=WinLibClass.Config.Global.WebSiteConfig.PointName_1%>/<%=WinLibClass.Config.Global.WebSiteConfig.PointName_2%>/<%=WinLibClass.Config.Global.WebSiteConfig.PointName_3%>/积分</TH>
<!--
<TH style="width:50px">产品总数</TH>
-->
<TH style="width:100px">操作</TH>
</tr>

<asp:Repeater id="rpList" runat="server">
<ItemTemplate>

<tr STYLE="height:25px;	" id="tr_<%#Eval("id")%>">
		<td><font color="#3333CC"><%#Eval("id")%></font></td>
		<td title="会员编号:<%#Eval("id")%>;邮箱:<%# Eval("UserEmail")%>;真实姓名:<%#Eval("UserRealName")%>;"><%#Eval("UserNickName")%></TD>

		<td><%# WinLibClass.Form.FormCommon.Utils.GetSexName((Eval("UserSex"))) %></td>
		<td><%# Eval("Activation").Equals(1)?"<font color='green' title='手机号码已通过系统验证'>验</font>":""%> <%# Eval("UserMobile")%></td>	
		<td><a href="javascript:" onclick="ShowAddressManage(<%#Eval("id")%>,'<%#Eval("UserNickName")%>')">管理</a></td>
		<TD><%# (Eval("IsChecked").Equals(1)?"<font color='green'>启用</font>":"<font color='red'>停用</font>")%></td>
		<td><%#Eval("RegTime","{0:yyyy-MM-dd HH:mm}")%></td>	
		<td><%#Eval("LastOnLineTime","{0:yyyy-MM-dd HH:mm}")%></td>	
		<td><font color="green"><%#WinLibClass.Common.Utils.StrToInt(Eval("point1").ToString(),0) - WinLibClass.Common.Utils.StrToInt(Eval("UsedPoint1").ToString(),0) %></font> 
		/ <font color="#663355"><%#WinLibClass.Common.Utils.StrToInt(Eval("point2").ToString(),0) - WinLibClass.Common.Utils.StrToInt(Eval("UsedPoint2").ToString(),0) %></font> 
		<font color="#ff44dd"><%#WinLibClass.Common.Utils.StrToInt(Eval("point3").ToString(),0) - WinLibClass.Common.Utils.StrToInt(Eval("UsedPoint3").ToString(),0) %></font> 
		/ <font color="#ff44dd"><%#WinLibClass.Common.Utils.StrToInt(Eval("UserPoints").ToString(),0) - WinLibClass.Common.Utils.StrToInt(Eval("UsedUserPoints").ToString(),0) %></font> 
		</td>
		<!--	
		<td><%//#GetUserOrderFormCount( Eval("id"))%></td>	-->
		<td>
			<a onclick="LoadWebUserOrderFormList(<%#Eval("id")%>,<%#Eval("id")%>,'<%#Eval("UserNickName")%>')" >订单</a>

			<a onclick="Edit_Info(<%#Eval("id")%>,'<%#Eval("UserNickName")%>')" >编辑</a>

			<a onclick="Edit_Pass(<%#Eval("id")%>,'<%#Eval("UserNickName")%>')" >密码</a>			
			
			<a onclick="Del_Info_WebUser(<%#Eval("id")%>,<%#Eval("id")%>,'<%#Eval("UserNickName")%>')" >删除</a>
		</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>



		</div>
		<div class="ContBox" >
			<div class="page" style="margin-left:-13px;"><%=strPageInfo%>  -  <a href="#"onclick="Edit_Info();return false;"  class="A_Add">添加</a> </div>		
			
		</div>

	</div>
</div>


<div class="clear"></div>
<Site:Menu id="menu_foot" runat="server" Flag="Foot"   />
</body>
</html>


