📄 yhlib.asp
字号:
<!--#include file="..\..\tools.asp"-->
<%
Dim Database
function Fun400(cmd)
Dim Query,sql,jq,dkcs,sj,lx
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Fun400 = "1|对不起,您未注册!"
exit function
end if
Database.Execute("update ZXRY set WZ='社区银行' where ID="&Request.Cookies("ID"))
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ,DKCS,SJ from YHZH where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
if Query.Bof then
Query.Close
set Query = nothing
Database.Execute("insert into YHZH (ID,JQ,SJ,DKCS) values ("&Request.Cookies("ID")&",0,'"&ConvertDateTime(now())&"',0)")
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ from HY where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
Fun400 = "0|"&Query("JQ")&"|0|0|"
else
jq = Query("JQ")
dkcs = Query("DKCS")
sj = Query("SJ")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='利息'"
Query.Open sql,Database,1,1
lx = Query("VAL")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='贷款'"
Query.Open sql,Database,1,1
dk = Query("VAL")
Query.Close
set Query = nothing
if Round(Int(jq)*DateDiff("d",sj,now())*Int(lx)/1000) >= 1 then
Database.Execute("update YHZH set JQ=JQ+"&Round(Int(jq)*DateDiff("d",sj,now())*Int(lx)/1000)&",SJ='"&ConvertDateTime(now())&"' where ID="&Request.Cookies("ID"))
end if
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ from HY where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
Fun400 = "0"&"|"&Query("JQ")&"|"&(Int(jq)+Round(Int(jq)*DateDiff("d",sj,now())*Int(lx)/1000))&"|"&Int(dkcs)*Int(dk)
end if
Query.Close
set Query = nothing
end function
function Fun401(cmd)
Dim Query,sql
if Int(GetPart(cmd,1)) <= 0 then
Fun401 = "1|对不起,您没钱可存!"
exit function
end if
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ from HY where NC='"&Request.Cookies("NC")&"'"
Query.Open sql,Database,1,1
if Int(Query("JQ")) < Int(GetPart(cmd,1)) then
Fun401 = "1|对不起,你的资金不足!"
Query.Close
set Query = nothing
exit function
end if
Query.Close
set Query = nothing
Database.Execute("update YHZH set JQ=JQ+"&GetPart(cmd,1)&",SJ='"&ConvertDateTime(now())&"' where ID="&Request.Cookies("ID"))
Database.Execute("update HY set JQ=JQ-"&GetPart(cmd,1)&" where ID="&Request.Cookies("ID"))
Fun401 = "0"
end function
function Fun402(cmd)
Dim Query,sql
if Int(GetPart(cmd,1)) <= 0 then
Fun402 = "1|非法操作!"
exit function
end if
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ from YHZH where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
if Int(Query("JQ")) < Int(GetPart(cmd,1)) then
Fun402 = "1|对不起,您的存款余额不足!"
else
Database.Execute("update YHZH set JQ=JQ-"&GetPart(cmd,1)&",SJ='"&ConvertDateTime(now())&"' where ID="&Request.Cookies("ID"))
Database.Execute("update HY set JQ=JQ+"&GetPart(cmd,1)&" where ID="&Request.Cookies("ID"))
Fun402 = "0"
end if
Query.Close
set Query = nothing
end function
function Fun403(cmd)
Dim Query,sql
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 ML from HY where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
if Int(Query("ML")) < 0 then
Fun403 = "1|对不起,您的魅力太低,不能贷款!"
else
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 DKCS from YHZH where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
if Int(Query("DKCS")) > 3 then
Fun403 = "1|对不起,您已不能再贷款了!"
else
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='贷款'"
Query.Open sql,Database,1,1
Database.Execute("update YHZH set DKCS=DKCS+1 where ID="&Request.Cookies("ID"))
Database.Execute("update HY set JQ=JQ+"&Query("VAL")&",ML=ML-100 where ID="&Request.Cookies("ID"))
Fun403 = "0"
end if
end if
Query.Close
set Query = nothing
end function
function Fun404(cmd)
Dim Query,sql,jq,dkcs
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 HY.JQ,DKCS from HY,YHZH where HY.ID=YHZH.ID and HY.ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
jq = Query("JQ")
dkcs = Query("DKCS")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='贷款'"
Query.Open sql,Database,1,1
if Int(jq) < Int(dkcs)*Int(Query("VAL")) then
Fun404 = "1|对不起,您目前还没有能力还贷!"
else
Database.Execute("update YHZH set DKCS=0 where ID="&Request.Cookies("ID"))
Database.Execute("update HY set JQ=JQ-"&(Int(dkcs)*Int(Query("VAL")))&",ML=ML+"&(Int(dkcs)*100)&" where ID="&Request.Cookies("ID"))
Fun404 = "0"
end if
Query.Close
set Query = nothing
end function
function Fun405(cmd)
Dim Query,sql,zzjy
if Request.Cookies("NC")="" or Request.Cookies("NC")="访客" then
Fun405 = "1|对不起,您不是注册会员!"
exit function
end if
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='转帐经验'"
Query.Open sql,Database,1,1
zzjy = Query("VAL")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JYZ from HY where NC='"&Request.Cookies("NC")&"'"
Query.Open sql,Database,1,1
if Int(Query("JYZ")) < Int(zzjy) then
Fun405 = "1|对不起,您的等级不够无法转帐!"
Query.Close
set Query = nothing
exit function
end if
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 NC from HY where NC='"&GetPart(cmd,1)&"'"
Query.Open sql,Database,1,1
if Query.Bof then
Fun405 = "1|对不起,该会员不存在!"
Query.Close
set Query = nothing
exit function
end if
Query.Close
set Query = nothing
if Int(GetPart(cmd,2)) <= 0 then
Fun405 = "1|非法操作!"
exit function
end if
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 JQ from YHZH where ID="&Request.Cookies("ID")
Query.Open sql,Database,1,1
if Int(Query("JQ")) < Int(GetPart(cmd,2)) then
Fun405 = "1|对不起,您的资金不足!"
Query.Close
set Query = nothing
exit function
end if
Query.Close
set Query = nothing
Database.Execute("update YHZH set JQ=JQ-"&GetPart(cmd,2)&" where ID="&Request.Cookies("ID"))
Database.Execute("update HY set JQ=JQ+"&GetPart(cmd,2)&" where NC='"&GetPart(cmd,1)&"'")
Fun405 = "0"
end function
function Fun406(cmd)
Dim Query,sql
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='利息'"
Query.Open sql,Database,1,1
Fun406 = "0"&"|"&Query("VAL")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='贷款'"
Query.Open sql,Database,1,1
Fun406 = Fun406&"|"&Query("VAL")
Query.Close
set Query = nothing
set Query = Server.CreateObject("ADODB.Recordset")
sql = "select top 1 VAL from INI where TYPE='银行' and NAME='转帐经验'"
Query.Open sql,Database,1,1
Fun406 = Fun406&"|"&Query("VAL")
Query.Close
set Query = nothing
end function
function Fun407(cmd)
if UCase(Request.Cookies("NC")) <> UCase(Application("NC")) then
Fun407 = "1|对不起,您无此权限!"
exit function
end if
Database.Execute("update INI set VAL='"&GetPart(cmd,1)&"' where TYPE='银行' and NAME='利息'")
Database.Execute("update INI set VAL='"&GetPart(cmd,2)&"' where TYPE='银行' and NAME='贷款'")
Database.Execute("update INI set VAL='"&GetPart(cmd,3)&"' where TYPE='银行' and NAME='转帐经验'")
Fun407 = "0"
end function
function Command(cmd)
set Database = Server.CreateObject("ADODB.Connection")
Database.Open ConnectionString,UserName,Password
strlen = len(cmd)-(len(GetPart(cmd,1))+1)
select case GetPart(cmd,1)
case "400"
Command = Fun400(Right(cmd,strlen))
case "401"
Command = Fun401(Right(cmd,strlen))
case "402"
Command = Fun402(Right(cmd,strlen))
case "403"
Command = Fun403(Right(cmd,strlen))
case "404"
Command = Fun404(Right(cmd,strlen))
case "405"
Command = Fun405(Right(cmd,strlen))
case "406"
Command = Fun406(Right(cmd,strlen))
case "407"
Command = Fun407(Right(cmd,strlen))
case else
Command = "1|无效的命令调用!"
end select
Database.Close
set Database = nothing
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -