<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />



<title><%=webname%>-最高权限-会员数据转移</title>
<%
call logquanxian("b7",1)
%>

<DIV>

<SCRIPT LANGUAGE="JavaScript">
var checkflag1 = "false";
function check1(field) {
if (checkflag1 == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag1 = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag1 = "false";
return "true"; }
}

function unselectall1()
{
    if(document.myform.chkAll1.checked){
	document.myform.chkAll1.checked = document.myform.chkAll1.checked&0;
	checkflag1 = "false";
    } 	
}
</script>
<%
sum=SafeRequest("sum")
cid=SafeRequest("cid")



if sum="2" then

cid=SafeRequestform("cid")
toid=SafeRequestform("toid")

if trim(cid)="" then call PopErr("请填写完整")
if trim(toid)="" then call PopErr("请填写完整")

sql="select kamiku,aynameid from ayname where aynameid="&clng(toid)&"" 
rs.open sql,conn,1,3
if rs.bof and rs.eof then
call PopErr("未找到TOID")
else
tokamiku=trim(rs("kamiku"))
end if
rs.close

'一级分类

sql="select kamiku,aynameid from ayname where aynameid="&clng(cid)&"" 
rs.open sql,conn,1,1
kamiku=trim(rs("kamiku"))
rs.close

if kamiku<>tokamiku then
call PopErr("卡密库不同无法转移"&kamiku&"-"&tokamiku&"")
response.End()
end if

sql="select * from aykafenlei where aykanamesuoyou="&clng(cid)&" and ayshangjiid=0" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
do while not rs.eof
'response.Write "1级分类 "&rs("aykafenleiname")&"<br>"

	'1级商品
	set rsg=server.CreateObject("adodb.recordset")
	sqlg="select * from aygood where aygoodsuoyouid="&clng(cid)&" and aygoodfl="&rs("aykafenleiid")&""
	rsg.open sqlg,conn,1,3
	if not(rsg.bof and rsg.eof) then
	do while not rsg.eof
	'response.Write "1级商品 "&rsg("aygoodname")&"<br>"
			'1级卡密
			set rsk=server.CreateObject("adodb.recordset")
			sqlk="select * from "&kamiku&" where aykasuoyou="&clng(cid)&" and aykagoodid="&rsg("aygoodid")&" and aykayesno=0"
			rsk.open sqlk,conn,1,3
			if not(rsk.bof and rsk.eof) then
			do while not rsk.eof
			'response.Write "1级卡密 "&rsk("ayka")&"<br>"
			rsk("aykasuoyou")=toid
			rsk.movenext 
			loop
			end if
			rsk.close
	rsg("aygoodsuoyouid")=toid
	rsg.movenext 
	loop
	end if
	rsg.close



	'二级分类
	set rsej=server.CreateObject("adodb.recordset")
	sqlej="select * from aykafenlei where aykanamesuoyou="&clng(cid)&" and ayshangjiid="&rs("aykafenleiid")&""
	rsej.open sqlej,conn,1,3
	if not(rsej.bof and rsej.eof) then
	do while not rsej.eof
	'response.Write "2级分类 "&rsej("aykafenleiname")&"<br>"
			'2级商品
			set rsg2=server.CreateObject("adodb.recordset")
			sqlg2="select * from aygood where aygoodsuoyouid="&clng(cid)&" and aygoodfl="&rsej("aykafenleiid")&""
			rsg2.open sqlg2,conn,1,3
			if not(rsg2.bof and rsg2.eof) then
			do while not rsg2.eof
			'response.Write "1级商品 "&rsg2("aygoodname")&"<br>"
					'2级卡密
					set rsk2=server.CreateObject("adodb.recordset")
					sqlk2="select * from "&kamiku&" where aykasuoyou="&clng(cid)&" and aykagoodid="&rsg2("aygoodid")&" and aykayesno=0"
					rsk2.open sqlk2,conn,1,3
					if not(rsk2.bof and rsk2.eof) then
					do while not rsk2.eof
					'response.Write "2级卡密 "&rsk2("ayka")&"<br>"
					rsk2("aykasuoyou")=toid
					rsk2.movenext 
					loop
					end if
					rsk2.close
			rsg2("aygoodsuoyouid")=toid		
			rsg2.movenext 
			loop
			end if
			rsg2.close
	rsej("aykanamesuoyou")=toid
	rsej.movenext 
	loop
	end if
	rsej.close
	
rs("aykanamesuoyou")=toid
rs.movenext 
loop
end if
rs.close
	call logadd(request.Cookies("aynameid"),"管理-会员数据转移成功"&cid&"-"&toid,0,0)
call PopErr2("会员数据转移成功","ik_adminuser.asp")

end if


%>
<DIV id=main1200> 
<%call webleft()%>

<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<DIV class=right_titleadmin>&nbsp;&nbsp;会员数据转移</DIV>
<DIV class=main><br>

  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="adminuserzy.asp?sum=2" method="post" name="myform" id="myform"> 
      <tr>
        <th align="center">将会员ID：<%=cid%> 名下数据(包括商品分类 商品 点卡) 转移至 会员ID：
          <input name="toid" type="text" id="toid" size="10">
          名下</th>
        </tr>
      
      <tr>
        <td align="center"><input name="cid" type="hidden" id="cid" value="<%=cid%>">
          <input onClick="javascript:return confirm('您确定要操作吗？');" type="submit" name="Submit" value=" 确 定 转 移 "></td>
        </tr>
     </form>
    </table>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


<!--#include virtual="/show/footadmin.asp"-->

