<%
response.End()  '使用时 注销此行
%>

<%
if request.QueryString("act")="chaku" then%>
<!--#include virtual="/inc/conn.asp"-->
<%
	uid=request.QueryString("uid")
	sql="select kamiku,aynameid from ayname where aynameid="&clng(uid)&""
	rs.open sql,conn,1,1
	response.Write trim(rs("kamiku"))
	rs.close
	response.End()
end if
%>

<%
if request.QueryString("act")="useroff" then%>
<!--#include virtual="/inc/conn.asp"-->
<%
	uid=request.QueryString("uid")
	sql="select ayusersuo,ayispay,aynameid from ayname where aynameid="&clng(uid)&""
	rs.open sql,conn,1,3
	rs("ayusersuo")=1
	rs("ayispay")=1
	response.Write "ok"
	rs.update
	rs.close
	response.End()
end if
%>

<%
if request.QueryString("act")="useron" then%>
<!--#include virtual="/inc/conn.asp"-->
<%
	uid=request.QueryString("uid")
	sql="select ayusersuo,ayispay,aynameid from ayname where aynameid="&clng(uid)&""
	rs.open sql,conn,1,3
	rs("ayusersuo")=0
	rs("ayispay")=0
	response.Write "ok"
	rs.update
	rs.close
	response.End()
end if
%>

<%
if request.QueryString("act")="chongzhi" then%>
<!--#include virtual="/inc/conn.asp"-->
<%
	if session("uid")="" then call PopErr("缺少商家ID")
	if session("tokamiku")="" then call PopErr("缺少目标卡密库")
	sql="select kamiku,aynameid from ayname where aynameid="&clng(session("uid"))&""
	rs.open sql,conn,1,3
	rs("kamiku")=session("tokamiku")
	rs.update
	session("uid")=""
	session("thiskamiku")=""
	session("tokamiku")=""
	call PopErr2("重置卡密库成功","adminuserkazy.asp")
	rs.close
	response.End()
end if
%>

<%
if request.QueryString("act")="qingli" then
	session("uid")=""
	session("thiskamiku")=""
	session("tokamiku")=""
	call PopErr2("清理session成功","adminuserkazy.asp")
	response.End()
end if
%>

<!--#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>

<%
Server.ScriptTimeOut = 999999



if SafeRequestform("act")="tozhuanyi" then

uid=SafeRequestform("uid")
tokamiku=SafeRequestform("tokamiku")

if trim(uid)="" then call PopErr("缺少商家ID")
if trim(tokamiku)="" then call PopErr("缺少目标卡密库")

sql="select kamiku,aynameid from ayname where aynameid="&clng(uid)&""
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
session("thiskamiku")=trim(rs("kamiku"))
session("tokamiku")=trim(tokamiku)
session("uid")=trim(uid)
else
response.Write "未找到商家ID"
response.End()
end if
rs.close


	sql="select ayka,aykapass,aykasuoyou,aykagoodid,aykadata,aykayesno,aykasuoyoudd,aykakai,aykatel,aydailiid from "&trim(session("thiskamiku"))&" where aykasuoyou="&clng(session("uid"))&""
	rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	'response.Write rs("ayka")&"<br>"
		conn.Execute("Insert Into "&trim(session("tokamiku"))&"(ayka,aykapass,aykasuoyou,aykagoodid,aykadata,aykayesno,aykasuoyoudd,aykakai,aykatel,aydailiid) values('"&trim(rs("ayka"))&"','"&trim(rs("aykapass"))&"','"&clng(rs("aykasuoyou"))&"','"&clng(rs("aykagoodid"))&"','"&rs("aykadata")&"','"&rs("aykayesno")&"','"&trim(rs("aykasuoyoudd"))&"','"&rs("aykakai")&"','"&rs("aykatel")&"','"&rs("aydailiid")&"')")	
	rs.delete
	rs.movenext 
	loop
	end if
	rs.close


call logadd(request.Cookies("aynameid"),"管理-卡密库转移成功",0,0)
call PopErr2("卡密库转移成功,商户重新登录即可","adminuserkazy.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>

<SCRIPT LANGUAGE="JavaScript">
var xmlhttp;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp=new XMLHttpRequest();}catch (e){}}}

function chaku()
{
   if(document.myform.uid.value=="")
   {alert("请填写商家ID");return false} 
   
	uid=document.getElementById("uid").value

	xmlhttp.open("get","adminuserkazy.asp?act=chaku&uid="+uid);
	xmlhttp.onreadystatechange=function()
	{	
		if(200==xmlhttp.status)
		{
		document.getElementById("chakamiku_text").innerHTML="<br><br>[ID:"+uid+"当前所属卡密库为"+xmlhttp.responseText+"]<br><br>";
		}
	};
xmlhttp.send(null);
}

function useroff()
{

   if(document.myform.uid.value=="")
   {alert("请填写商家ID");return false} 
   
	uid=document.getElementById("uid").value

	xmlhttp.open("get","adminuserkazy.asp?act=useroff&uid="+uid);
	xmlhttp.onreadystatechange=function()
	{	
		if(200==xmlhttp.status)
		{
			if(xmlhttp.responseText=="ok")
			{
			document.getElementById("useroff_text").innerHTML="[已关闭成功]";
			}
		}
	};
xmlhttp.send(null);
}

function useron()
{

   if(document.myform.uid.value=="")
   {alert("请填写商家ID");return false} 
   
	uid=document.getElementById("uid").value

	xmlhttp.open("get","adminuserkazy.asp?act=useron&uid="+uid);
	xmlhttp.onreadystatechange=function()
	{	
		if(200==xmlhttp.status)
		{
			if(xmlhttp.responseText=="ok")
			{
			document.getElementById("useron_text").innerHTML="[已恢复成功]";
			}
		}
	};
xmlhttp.send(null);
}
</script>

<DIV class=right_titleadmin>&nbsp;&nbsp;卡密库转移【<a href="?act=qingli">清除转移记录session</a>】</DIV>
<DIV class=main><br>

  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="" method="post" name="myform" id="myform"> 
      <tr>
        <td height="50" align="center">商家数字ID：<input name="uid" type="text" id="uid" value="<%if trim(session("uid"))<>"" then response.Write trim(session("uid"))%>"> <span style="cursor:pointer;" onClick="chaku()">(查看当前所属卡密库)</span><span id="chakamiku_text" ></span>
          </td>
        </tr>
      
      <tr>
        <td height="50" align="center">第一步： <span style="cursor:pointer;" onClick="useroff()">[点击暂停商家登陆/销售状态]</span><br><span id="useroff_text" ></span>
        </tr>
      
      <tr>
        <td align="center">
第二步： 选择目标卡密库：
         <select name="tokamiku" id="tokamiku">
        <option value="ayka" <%if session("tokamiku")="ayka" then response.Write "selected"%>>ayka</option>
        <option value="ayka01" <%if session("tokamiku")="ayka01" then response.Write "selected"%>>ayka01</option>
        <option value="ayka02" <%if session("tokamiku")="ayka02" then response.Write "selected"%>>ayka02</option>
		<option value="ayka03" <%if session("tokamiku")="ayka03" then response.Write "selected"%>>ayka03</option>
        <option value="ayka04" <%if session("tokamiku")="ayka04" then response.Write "selected"%>>ayka04</option>
        <option value="ayka05" <%if session("tokamiku")="ayka05" then response.Write "selected"%>>ayka05</option>
        <option value="ayka06" <%if session("tokamiku")="ayka06" then response.Write "selected"%>>ayka06</option>
        <option value="ayka07" <%if session("tokamiku")="ayka07" then response.Write "selected"%>>ayka07</option>
        <option value="ayka08" <%if session("tokamiku")="ayka08" then response.Write "selected"%>>ayka08</option>
        <option value="ayka09" <%if session("tokamiku")="ayka09" then response.Write "selected"%>>ayka09</option>
        <option value="ayka10" <%if session("tokamiku")="ayka10" then response.Write "selected"%>>ayka10</option>
        <option value="ayka11" <%if session("tokamiku")="ayka11" then response.Write "selected"%>>ayka11</option>
        <option value="ayka12" <%if session("tokamiku")="ayka12" then response.Write "selected"%>>ayka12</option>
        <option value="ayka13" <%if session("tokamiku")="ayka13" then response.Write "selected"%>>ayka13</option>
        <option value="ayka14" <%if session("tokamiku")="ayka14" then response.Write "selected"%>>ayka14</option>
        <option value="ayka15" <%if session("tokamiku")="ayka15" then response.Write "selected"%>>ayka15</option>
        <option value="ayka16" <%if session("tokamiku")="ayka16" then response.Write "selected"%>>ayka16</option>
        <option value="ayka17" <%if session("tokamiku")="ayka17" then response.Write "selected"%>>ayka17</option>
        <option value="ayka18" <%if session("tokamiku")="ayka18" then response.Write "selected"%>>ayka18</option>
        <option value="ayka19" <%if session("tokamiku")="ayka19" then response.Write "selected"%>>ayka19</option>
        <option value="ayka20" <%if session("tokamiku")="ayka20" then response.Write "selected"%>>ayka20</option>
        <option value="ayka21" <%if session("tokamiku")="ayka21" then response.Write "selected"%>>ayka21</option>
        <option value="ayka22" <%if session("tokamiku")="ayka22" then response.Write "selected"%>>ayka22</option>
        <option value="ayka23" <%if session("tokamiku")="ayka23" then response.Write "selected"%>>ayka23</option>
        <option value="ayka24" <%if session("tokamiku")="ayka24" then response.Write "selected"%>>ayka24</option>
        <option value="ayka25" <%if session("tokamiku")="ayka25" then response.Write "selected"%>>ayka25</option>
        <option value="ayka26" <%if session("tokamiku")="ayka26" then response.Write "selected"%>>ayka26</option>
        <option value="ayka27" <%if session("tokamiku")="ayka27" then response.Write "selected"%>>ayka27</option>
        <option value="ayka28" <%if session("tokamiku")="ayka28" then response.Write "selected"%>>ayka28</option>
        <option value="ayka29" <%if session("tokamiku")="ayka29" then response.Write "selected"%>>ayka29</option>
        <option value="ayka30" <%if session("tokamiku")="ayka30" then response.Write "selected"%>>ayka30</option>
        <option value="ayka31" <%if session("tokamiku")="ayka31" then response.Write "selected"%>>ayka31</option>
        <option value="ayka32" <%if session("tokamiku")="ayka32" then response.Write "selected"%>>ayka32</option>
        <option value="ayka33" <%if session("tokamiku")="ayka33" then response.Write "selected"%>>ayka33</option>
        <option value="ayka34" <%if session("tokamiku")="ayka34" then response.Write "selected"%>>ayka34</option>
        <option value="ayka35" <%if session("tokamiku")="ayka35" then response.Write "selected"%>>ayka35</option>
        <option value="ayka36" <%if session("tokamiku")="ayka36" then response.Write "selected"%>>ayka36</option>
        <option value="ayka37" <%if session("tokamiku")="ayka37" then response.Write "selected"%>>ayka37</option>
        <option value="ayka38" <%if session("tokamiku")="ayka38" then response.Write "selected"%>>ayka38</option>
        <option value="ayka39" <%if session("tokamiku")="ayka39" then response.Write "selected"%>>ayka39</option>
        <option value="ayka40" <%if session("tokamiku")="ayka40" then response.Write "selected"%>>ayka40</option>
      </select>
        </tr>
      
      <tr>
        <td align="center">      
         第三步：<input type="submit" name="Submit" value=" 开 始 转 移 "> </td>
        </tr>
        
      <tr>
        <td height="50" align="center">第四步： <span style="cursor:pointer;" onClick="useron()">[点击恢复商家登陆/销售状态]</span><br><span id="useron_text" ></span>
        </tr>
        
      <tr>
        <td height="50" align="center">第五步：<a href="?act=chongzhi">[点击重置商家卡密库]</a></span>
        </tr>
        
      <tr>
        <td height="50" align="center"><br>
        提示：卡密量过大时，可能需要多次提交，直到提示转移完毕，操作第四步和第五步即可
        <input name="act" type="hidden" id="act" value="tozhuanyi">
        </tr>
        
     </form>
    </table>
</DIV>



</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>



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

