www.gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > cheque.asp
<%@language="VBScript"%> <!--#include file="title.asp"--> <!--#include file="sub.asp"--> <% Dim handler,cause,cheque,erryes,savecookies handler=Trim(Replace(Request.Form("username"),"'","")) cause=Trim(Request.Form("cause")) cheque=Request.Form("cheque") if IsNumeric(cheque) then cheque=Abs(Clng(cheque)) else cheque=0 end if savecookies=Request.Cookies(bbssn)("savecookies") contents=contents &"<title>社区支票-"& caption &"</title>"&_ "</head>"&_ "<body>"&_ ""&_ "<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">" if gbmaduser="" then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你还没登陆或者已经掉线。<br>请<a href=""login.asp"">登陆</a>,2秒后自动执行<Script Language=""JavaScript"">setTimeout(""location.href='login.asp'"",3000)</script>。<br><br></td></tr>" else if validate<>creatvalidate(gb+imprison,ip) then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>验证Cookies信息出错,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>" else if imprison="2" or imprison="4" or imprison="6" or imprison="7" then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你因为违反社区条例,被禁止使用道具。具体可以查看<a href=""report.asp"">异动报告</a>。<br><br></td></tr>" else if handler<>"" and cause<>"" then rs.Open "Select userpwd,gb From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,1 if Not rs.Eof then if rs("userpwd")<>userpwd then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>密码验证错误,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>" erryes="yes" end if if rs("gb")<cheque then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你的"& gbname &"只有 "& rs("gb") &",不够转让 "& cheque &" 给 "& handler &" ,<a href=""JavaScript:history.back();"">返回重新输入后再试</a>。<br><br></td></tr>" erryes="yes" end if else contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>不存在的用户,请<a href=""login.asp"">重新登陆</a>。<br>引起该错误的原因可能是因为你手动修改了Cookies。<br><br></td></tr>" erryes="yes" end if rs.Close if erryes<>"yes" then rs.Open "Select gb From gbmaduser Where gbmaduser='"& handler &"'",conn,1,1 if Not rs.Eof then if rs("gb")<1 then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>用户 "& handler &" 的"& gbname &"小于0,不能接受"& gbname &",<a href=""JavaScript:history.back();"">返回重新输入后再试</a>。<br><br></td></tr>" erryes="yes" end if else contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>用户 "& handler &" 不存在,不能接受"& gbname &",<a href=""JavaScript:history.back();"">返回重新输入后再试</a>。<br><br></td></tr>" erryes="yes" end if rs.Close end if if erryes<>"yes" then rs.Open "tools Where gbmaduser='"& gbmaduser &"' and toolname='社区支票'",conn,1,3 if Not rs.Eof then if rs("amount")=1 then rs.Delete else rs("amount")=rs("amount")-1 rs.Update end if else contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你没有社区支票,请到<a href=""market.asp"">道具市场</a>购买。<br><br></td></tr>" erryes="yes" end if rs.Close end if if erryes<>"yes" then rs.Open "Select gb From gbmaduser Where gbmaduser='"& gbmaduser &"'",conn,1,3 rs("gb")=rs("gb")-cheque rs.Update gb=rs("gb") if savecookies="yes" then Response.Cookies(bbssn).expires=Date()+365 Response.Cookies(bbssn)("gb")=gb Response.Cookies(bbssn)("validate")=creatvalidate(gb+imprison,ip) rs.Close rs.Open "Select gb From gbmaduser Where gbmaduser='"& handler &"'",conn,1,3 rs("gb")=rs("gb")+cheque rs.Update rs.Close rs.Open "report Where id=0",conn,1,3 rs.AddNew rs("gbmaduser")=handler rs("handler")=gbmaduser rs("posttime")=Now() rs("matter")="使用社区支票给予"& gbname &":"& cheque rs("cause")=cause rs.Update rs.Close contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">社区支票</td></tr>"&_ "<tr class=""tds""><td>你已成功用社区支票将 "& cheque &" "& gbname &"给 "& handler &" 。</td></tr>" end if elseif handler<>"" and cause="" then contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">出错</td></tr><tr><td><br>你没有输入给予"& gbname &"的原因,<a href=""JavaScript:history.back();"">返回重新输入后再试</a>。<br><br></td></tr>" else contents=contents &"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"">社区支票</td></tr>"&_ "<form name=""cheque"" onsubmit=""return validinput();"" method=""post"" action=""cheque.asp"">"&_ "<tr class=""tds""><td>"&_ "<script language=""JavaScript"">"&_ "function validinput()"&_ "{"&_ "if (document.cheque.username.value.length==0){"&_ "alert(""请填写要接受你给予"& gbname &"的用户名。"");"&_ "document.cheque.username.focus();"&_ "return false;"&_ "}"&_ "if (document.cheque.cause.value.length==0){"&_ "alert(""请填写你要给予"& gbname &"的原因。"");"&_ "document.cheque.cause.focus();"&_ "return false;"&_ "}"&_ "if (document.cheque.cheque.value.length==0){"&_ "alert(""请填写你要给予的"& gbname &"。"");"&_ "document.cheque.cheque.focus();"&_ "return false;"&_ "}"&_ "return true;"&_ "}"&_ "</script>"&_ "请输入接受"& gbname &"的人的用户名和给予的"& gbname &"以及给予"& gbname &"的原因。注意:接受者的"& gbname &"必须大于0,否则将转让失败。<br><br>"&_ "接受用户:<input name=""username"" type=""text"" maxlength=""20"" size=""20"" class=""iptwin""><br>"&_ "给予原因:<input name=""cause"" type=""text"" maxlength=""255"" size=""20"" class=""iptwin""><br>"&_ "给予"& gbname &":<input name=""cheque"" type=""text"" maxlength=""10"" size=""10"" class=""iptwin"">"&_ " <input name=""button"" type=""submit"" value=""提交"" onmouseover=""this.className='over';"" onmouseout=""this.className='out';"" class=""out""></td></tr>"&_ "</form>" end if end if end if end if contents=contents &"</table>"&_ "" %> <!--#include file="bottom.asp"-->