📄 hbsend.asp
字号:
<%@ LANGUAGE=VBScript.Encode codepage ="936" %>
<%Response.Buffer = True
Response.Expires = 0
Response.CacheControl = "Private"
Sub Msg (v)
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('" & v & "');window.close();</script></body></html>"
Response.End
End Sub
nickname=Session("hxf_u_nickname")
cess=Application("wsaxhxf_c_cess")
If nickname = "" Then Msg "不在聊天室中,不能货币流通。"
If Session("hxf_u_inthechat")<>"1" Then Msg "不在聊天室中,不能货币流通。"
id = Trim(Request.QueryString("id"))
If id = "" Then Msg "指定的用户名不能为空!"
If Server.HTMLEncode(id)<>id Or InStr(id, "|")<>0 Or InStr(id, "'")<>0 Or InStr(id, Chr(34))<>0 Then Msg "指定的用户名不存在!"
If nickname = id Then Msg "不能在自己的帐号中流通。"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("wsaxhg_connstr")
conn.open connstr
sql = "SELECT username,hb FROM reginfo WHERE kill = '0' AND grade>0 AND username = '" & id & "'"
rs.Open sql, conn, 1, 1
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "指定的用户名不存在!"
End If
id = rs("username")
idhb = Int(rs("hb"))
rs.Close
sql = "SELECT username, hb FROM reginfo WHERE kill = '0' AND grade>0 AND username = '" & nickname & "'"
rs.Open sql, conn, 1, 1
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "你的帐号不存在或被禁用,请重新登录!"
End If
yhb = rs("hb")
rs.Close
Session("hxf_u_hb")=yhb
conn.Close
Set rs = Nothing
Set conn = Nothing%>
<html>
<head>
<title>货币流通</title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<style type=text/css>
body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}
td{font-family:宋体;font-size:9pt;}
input{font-family:宋体;font-size:9pt;}
textarea{font-family:宋体;font-size:9pt;}
a{font-family:'宋体';color:blue;text-decoration:none}
a:hover{font-family:'宋体';color:blue;text-decoration:underline}
</style>
<script language=Javascript>
var toid = "<%=id%>";
var toidhb = <%=idhb%>;
var myn = "<%=nickname%>";
var cess = "<%=cess%>"
var myhb = <%=yhb%>;
var automanname = "<%=Application("wsaxhxf_c_automanname")%>";
function preview(){
f5v = document.send.sendhb.value;
if(f5v == ""){
alert("请输入要流通的货币金额。");
document.send.sendhb.focus();
return false;
}
if(isNaN(f5v)){
alert("流通金额必须为大于 100 的整数!");
document.send.sendhb.focus();
return false;
}
if(Math.round(f5v) != f5v || f5v < 100){
alert("流通金额必须为大于 100 的整数!");
document.send.sendhb.focus();
return false;
}
if(toid == myn){
alert("不能在自己的帐号中流通!");
return false;
}
if(toidhb >= myhb){
alert("对方的货币比你多,不能流通给对方。");
return false;
}
if(myhb < 100){
alert("你的货币只有 " + myhb + "¥,不能流通。");
return false;
}
if(myhb < f5v){
alert("你的货币只有 " + myhb + "¥,不足 " + f5v + "¥,不能透支。");
return false;
}
if(myhb - toidhb < 100){
alert("你的货币只比对方多 " + (myhb - toidhb) + "¥,不能流通。");
return false;
}
x = Math.round((myhb - toidhb)/((200 - cess)/100))
if(x > myhb){x = myhb}
if(f5v > x){
alert("你最多只能流通 " + x + "¥ 给对方。")
return false;
}
y = Math.round(f5v * ((100 - cess) / 100))
z = Math.round(f5v * (cess / 100))
document.send.sendhb.focus();
alert("■ 结果预览 ■\n\n你最多可以流通:" + x + "¥ 给对方。\n\n你准备流通:" + f5v + "¥。剩余金额:" + (myhb - f5v) + "¥。\n\n对方可得到:" + y + "¥。总金额为:" + (toidhb + y) + "¥。");
}
function check(){
f5v = document.send.sendhb.value;
if(f5v == ""){
alert("请输入要流通的货币金额。");
document.send.sendhb.focus();
return false;
}
if(isNaN(f5v)){
alert("流通金额必须为大于 100 的整数!");
document.send.sendhb.focus();
return false;
}
if(Math.round(f5v) != f5v || f5v < 100){
alert("流通金额必须为大于 100 的整数!");
document.send.sendhb.focus();
return false;
}
if(toid == myn){
alert("不能在自己的帐号中流通!");
return false;
}
if(toidhb >= myhb){
alert("对方的货币比你多,不能流通给对方。");
return false;
}
if(myhb < 100){
alert("你的货币只有 " + myhb + "¥,不能流通。");
return false;
}
if(myhb < f5v){
alert("你的货币只有 " + myhb + "¥,不足 " + f5v + "¥,不能透支。");
return false;
}
if(myhb - toidhb < 100){
alert("你的货币只比对方多 " + (myhb - toidhb) + "¥,不能流通。");
return false;
}
x = Math.round((myhb - toidhb)/((200 - cess)/100))
if(x > myhb){x = myhb}
if(f5v > x){
alert("你最多只能流通 " + x + "¥ 给对方。")
return false;
}
if(confirm("真的要进行货币流通吗?")){
document.send.ok.disabled = 1;
return true;
}
else{
return false;
}
}
</script>
</head>
<body>
<form name="send" action="hbsendok.asp" onsubmit="return(check())" method="post">
<table border="0" align="center" cellpadding="0" cellspacing="0" width="295">
<tr>
<td colspan="2" align="center" bgcolor="#009900" height="20"><font color="#FFFFFF">
对 方 状 态 值</font></td>
<td height="20" align="center" colspan="3" bgcolor="#0099FF"><font color="#FFFFFF">
己 方 状 态 值</font></td>
</tr>
<tr>
<td width="68">用 户 名:</td>
<td width="82">
<input type="text" name="acname" size="12" value="<%=id%>" readonly style="background-color:buttonface">
</td>
<td width="63">用 户 名:</td>
<td width="82">
<input type="text" name="nickname" size="12" value="<%=nickname%>" readonly style="background-color:buttonface">
</td>
</tr>
<tr>
<td width="68">货 币 值:</td>
<td width="82">
<input type="text" name="idhb" size="12" value="<%=idhb%>¥" readonly style="background-color:buttonface">
</td>
<td width="63">货 币 值:</td>
<td colspan="2" width="82">
<input type="text" name="hb" size="12" value="<%=yhb%>¥" readonly style="background-color:buttonface">
</td>
</tr>
</table>
<table border="0" align="center" width="312" cellspacing="5" height="75">
<tr>
<td align="center" bgcolor="#FF0000" height="1"></td>
</tr>
<tr>
<td align="center">流通税率<font color=red><%=Application("wsaxhxf_c_cess")%>%</font>;金额:
<input type="text" name="sendhb" maxlength="4" size="5" value="100">¥(大于 100 的整数)</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="ok" value="正式流通(S)" accesskey="s">
<input type="reset" name="reset" value="重设(R)" accesskey="r" onclick="document.send.sendhb.focus()">
<input type="button" name="prev" value="预览结果(P)" accesskey="p" onclick="preview()">
</td>
</tr>
<tr>
<td align="center" bgcolor="#FF0000" height="1"></td>
</tr>
</table>
</form>
<script Language=JavaScript>
document.send.sendhb.focus();
</script>
<div id='dh' style="position:absolute; left:-800px; top:-800px; width:0px; height:0px; z-index:1">
<input type=button value='-' name='goppp' onclick='Javascript:window.close();' accesskey='q'>
</div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -