日期:2014-05-17  浏览次数:21077 次

if嵌套问题
<%
session.Timeout=1000
if   not   session( "key ")= "wygly "   then
%>
<script>
parent.window.location.href= "../index.asp " </script>  
<%
Response.End  
end   if

dim   num,submit,money,thisid

num=replace(trim(request.form( "number ")), " ' ", " ' ' ")
submit   =   trim(request( "submit "))

'判断sumbit的操作为不成功
if   submit   =   "不成功 "   then
if   num= " "   then   '如果冲值号码为空,提示输入充值卡号
response.write   " <script   langeuage=javascript> "
response.write   "alert( '如充值不成功,则必须输入所用的充值卡号! '); "
response.write   "history.back(-1); "
response.write   " </script> "
response.End()
else   '修改khdjy成功为2,修改冲值不成功时间,插入管理员id
set   rs=server.CreateObject( "adodb.recordset ")
rs.source= "select   *   from   khdjy   where   id= "&   request.form( "id ")
rs.open   rs.source,conn,3,3
rs( "chenggong ")=2
rs( "chongzhitime ")=now()
rs( "glyid ")=session( "glyid ")
rs.update
rs.close
set   rs=nothing
end   if
end   if
'判断sumbit的操作为成功
if   submit= "成功 "   then   '将获得冲值金额,客户端id;修改khdjy成功为2,修改冲值不成功时间,插入管理员id
set   rs=server.CreateObject( "adodb.recordset ")
rs.source= "select   *   from   khdjy   where   id= "&   request.form( "id ")
rs.open   rs.source,conn,3,3
money   =   rs( "money ")
thisid=rs( "userid ")
rs( "chenggong ")=1
rs( "chongzhitime ")=now()
rs( "glyid ")=session( "glyid ")
rs.update
rs.close
set   rs=nothing
'从预付金额中减去充值金额
set   rs3=server.CreateObject( "adodb.recordset ")
rs3.source= "select   *   from   admin   where   id= "&   thisid
rs3.open   rs3.source,conn,1,3
if   request( "submit ")= "成功 "   then
rs3( "yifu ")=rs3( "yifu ")+money
end   if
rs3.update
rs3.close
set   rs3=nothing
end   if

if   not   Request.Form( "number ")= " "   then
num=trim(Request.Form( "number "))
set   rs=server.CreateObject( "adodb.recordset ")
rs.source= "select   *   from   card "
rs.open   rs.source,conn,1,3
rs.addnew
i=1
do
i=InStr(1,num,chr(13)&chr(10))
if   i=0   then   i=len(num)
tmp=mid(num,1,i)
num=Replace(num,tmp, " ",1,1)
if   not   instr(len(tmp),tmp,chr(13))=0   then   tmp=mid(tmp,1,len(tmp)-1) 'num=replace(num,chr(13)&chr(10), " ",1,1)
rs.addnew
rs( "khdid ")=request.form( "id ")
rs( "number ")=tmp
rs( "updatetime ")=now()
rs.update
loop   Until   num= " "
rs.update
set   rs=nothing
end   if

conn.close
set   conn=nothing

Response.Write   " &l