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

<script>document.getElementById('o_1').setAttribute("class", "ed"); document.getElementById("t_1").style.display="";document.getElementById('s_1_3').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-绑定密保卡</title>

<%
'已停用
response.End()

act=SafeRequestform("act")


if act="add" then
xuliehao=SafeRequestform("xuliehao")
con1=SafeRequestform("con1")
con2=SafeRequestform("con2")
con3=SafeRequestform("con3")
id1=SafeRequestform("id1")
id2=SafeRequestform("id2")
id3=SafeRequestform("id3")

if xuliehao="" or con1="" or con2="" or con3="" or id1="" or id2="" or id3="" then call PopErr("请填写完整")  

sql="select * from aymibao where aymibaoka='"&trim(xuliehao)&"'" 
rs.open sql,conn,1,3
if rs.bof and rs.eof then
rs.close
call PopErr("未找到该序列号信息")  
else
	if cint(rs("aymibaoyiyong"))=1 then call PopErr("该密保卡已经使用过了")  
	if md5(trim(con1))<>trim(rs(id1)) then call PopErr("密保卡填写有误")  
	if md5(trim(con2))<>trim(rs(id2)) then call PopErr("密保卡填写有误") 
	if md5(trim(con3))<>trim(rs(id3)) then call PopErr("密保卡填写有误") 
	rs("aymibaoyiyong")=1
	rs.update
	rs.close
		sql="select aynameid,aymibaoka from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
		rs.open sql,conn,1,3
		rs("aymibaoka")=xuliehao
		rs.update
		rs.close
		Set fso=CreateObject("Scripting.FileSystemObject") 

		if fso.FileExists(server.mappath("\updata\mibao\"&trim(xuliehao)&".jpg")) then 
		fso.DeleteFile(server.mappath("\updata\mibao\"&trim(xuliehao)&".jpg"))
		end if
		call logadd(request.Cookies("aynameid"),"密保卡绑定成功"&xuliehao,0,0)
		call PopErr2("密保卡绑定成功","anquan")  
end if




end if



%>

<style>
table{font-size:14px; font-weight:normal;line-height:27px;}
.regts{width:440px; height:36px; border:#CCC solid 1px; background:#f1f1f1; color:#666666; line-height:36px; padding-left:10px}
.reginput{width:290px; height:36px; border:#CCC solid 1px; color:#949494; text-indent:10px; line-height:36px}
.gexian20{float:left;width:100%;height:20px;}
.mzsmbox2{width:90%; height:auto; overflow:hidden; background:#fcf8e2; border-left:#edd28a solid 5px; color:#956825; line-height:22px; padding:20px;margin-left:40px; margin-bottom:60px; font-size:13px;padding-top:20px;}
.neitable table{border: 1px solid #E8E8E8;width: 100%;}
.neitable table tr{border-bottom: 1px solid #E8E8E8;}
.neitable table tr td{line-height: 42px;text-align: center;color: #1b1b1b;font-size: 14px;}
.neitable table tr.hd td{line-height: 35px;background-color: #F7F7F7;}
.btnFn1 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; }
.btnFn2 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; font-weight:bold; }
</style>

<br>
<DIV id=main2> 

<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>绑定密保卡</SPAN></H2>
<DIV class=main4>
     <form action="" method="post" name="form" id="form"> 
                        <table class="neitableanquan">
           		  		<tr>
                            <td align="center" width="110">密保卡序列号：</td>
                            <td width="300"><input name="xuliehao" class="reginput" type="text" id="xuliehao" size="30" maxlength="20"></td>
                          <td><div class="regtd" > 请输入密保卡序列号</div></td>
                        </tr>
						<%
                        sql="select aynameid,aymibaoka from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
                        rs.open sql,conn,1,1
                        if trim(rs("aymibaoka"))<>"0" then call PopErr2("该用户已经绑定了密保卡","anquan") 
                        rs.close
                        
                        Function RndNumber(Min,Max) 
                        Randomize 
                        RndNumber=Int((Max - Min + 1) * Rnd() + Min) 
                        End Function 
                        
                        Const stringmodarr1 = "ABCDEFG"
                        dim randarr1,strlength1
                        strlength1 = Len(stringmodarr1)
                        Randomize
                        For i = 1 To 1 
                        randarr1 = randarr1&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
                        randarr2 = randarr2&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
                        randarr3 = randarr3&Mid(stringmodarr1,Int(Rnd * strlength1 + 1),1) 
                        Next 
                         
                        id1=randarr1&RndNumber(1,7)
                        id2=randarr2&RndNumber(1,7)
                        id3=randarr3&RndNumber(1,7)
                        %>
                 		<tr>
                            <td align="center">密保卡数字：</td>
                            <td>
                   			  <span style="font-weight: bold"><%=id1%></span>&nbsp;
                              <input name="con1" type="text" class="reginputmb" id="con1" size="5" maxlength="2">
                              &nbsp;
                              <span style="font-weight: bold"><%=id2%></span>&nbsp;<input name="con2" type="text" class="reginputmb" id="con2" size="5" maxlength="2">
                              &nbsp;&nbsp;
                              <span style="font-weight: bold"><%=id3%></span>&nbsp;<input name="con3" type="text" class="reginputmb" id="con3" size="5" maxlength="2">
                            </td>
                            <td><div class="regtd" > 请输入密保卡相对应的数字</div></td>
                        </tr>
                 		<tr>
                            <td>
                            <input name="act" type="hidden" id="act" value="add">
                            <input name="id1" type="hidden" value="<%=id1%>">
                            <input name="id2" type="hidden" value="<%=id2%>">
                            <input name="id3" type="hidden" value="<%=id3%>">
                            </td>
                            <td height="60"><input style="cursor:pointer"  class="logindlreg" type="submit" name="Submit" value=" 绑 定 密 保 卡 "></td>
                        </tr>
                    </table>
                    </form>
</DIV>


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

<br>

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

