一个asp的投资理财程序程序登入处理页面有两个功能 自动分红和返还本金功能 返还本金不能使用 求大神帮忙看下
数据库文件密码:2509775
数据库.rar
(202.46 KB, 下载次数: 76)
- <%@LANGUAGE="VBScript.Encode" CODEPAGE="936"%>
- <%Response.AddHeader "P3P", "CP=CAO PSA OUR"%>
- <!--#include file="inc/db_conn.asp"-->
- <!--#include file="inc/func.asp"-->
- <!--#include file="inc/md5.asp"-->
- <%
- username=ReplaceBadChar(Trim(request.form("username")))
- password=ReplaceBadChar(Trim(request.form("password")))
- sqlStr="select * from zy_user where user_username='"&username&"' and user_password='"&md5(password)&"'"
- set rs = server.createobject("ADODB.RecordSet")
- rs.open sqlStr,conn,1,3
- If rs.eof Then
- Call AlertUrl("登入失败,用户名或密码错误!","",3,3)
- ElseIf rs("user_lock")=1 Then
- Call AlertUrl("登入失败,账户异常,联系管理员解锁。","",3,3)
- Else
- rs("user_lasttime")=now()
- rs("user_ip")=RegIP()
- rs("user_count")=rs("user_count")+1
- rs("isonline")=1
- rs.update
- session("user")=rs("user_username")
- session("id")=rs("user_id")
- session("vtime")=Now()
- 'Application.Lock
- ' Application("vtime")=Now()
- ' Application.UnLock
- 'response.redirect("mynotice.asp")
- num=FormatNumber(siteticheng,2)
- num=num*100
- %>
-
-
- <%
- user=session("id")
- huserid=session("id")
- set itrs=server.CreateObject("adodb.recordset")
- itsql="select * from [zy_useritem] where useritem_user="&session("id")
- itrs.open itsql,conn,1,1
- if not itrs.eof then
- do while not itrs.eof
-
- item_id=itrs("useritem_item")
-
- sql10000="select * from zy_item where item_id="&item_id&" order by item_id desc"
- set rs10000 = server.createobject("ADODB.RecordSet")
- rs10000.open sql10000,conn,1,3
- if not rs10000.eof then
-
- if isvipdz=1 then
- returnmoney=rs10000("useritem_money")'2013-11-8
- returnmoneyb=rs10000("useritem_money")
- else
- returnmoney=rs10000("item_money")'2013-11-8
- returnmoneyb=rs10000("item_money")
- end if
- '2013-11-14
- money=rs10000("item_fanhuan")
- pget=rs10000("pget")'2013-11-11
- dtmoney=returnmoney*pget/100'2013-11-11
- cishu=rs10000("item_cishu")
- zhouqi=rs10000("item_shijian")
-
- end if
-
- sqlStrb="select * from zy_useritem where useritem_user="&user&" and useritem_item="&item_id&" and useritem_id="&itrs("useritem_id")&""
- set rsb = server.createobject("ADODB.RecordSet")
- rsb.open sqlStrb,conn,1,3
- useritem_timeb=rsb("useritem_time")
- useritem_time2b=rsb("useritem_time2")
- useritem_time4b=now()
- useritem_itemb=rsb("useritem_item")'2013-4-8
- returnb=rsb("return")'2013-11-8
- useritemidb=brsb("useritem_id")'2013-11-8
- dingtoub=rsb("dingtou")'2013-11-11
- ppgetb=rsb("ppget")'2013-11-11
- gmfeb=rsb("gmfe")'2013-11-11
- nowcishub=rsb("useritem_count")
- treturnmoneyb=Int(returnmoney*gmfeb)
- tmoneyb=Int(dtmoney*gmfe)
- rsb.close
- set rsb=nothing
-
-
-
- '判断返还时间和次数
-
-
-
-
- for k=nowcishub to (cint(cishu)-1)
-
-
-
- '返回分红
-
- sqlStr="select * from zy_useritem where useritem_user="&user&" and useritem_item="&item_id&" and useritem_id="&itrs("useritem_id")&""
- set rs = server.createobject("ADODB.RecordSet")
- rs.open sqlStr,conn,1,3
- useritem_time=rs("useritem_time")
- useritem_time2=rs("useritem_time2")
- useritem_time4=now()
- useritem_item=rs("useritem_item")'2013-4-8
- return=rs("return")'2013-11-8
- useritemid=rs("useritem_id")'2013-11-8
- dingtou=rs("dingtou")'2013-11-11
- ppget=rs("ppget")'2013-11-11
- gmfe=rs("gmfe")'2013-11-11
- nowcishu=rs("useritem_count")
- treturnmoney=Int(returnmoney*gmfe)
- tmoney=Int(dtmoney*gmfe)
- rs.close
- set rs=nothing
-
- if cdate(useritem_time4)>=cdate(useritem_time2) and nowcishub<=cishu then
-
- sqlStr1="select * from zy_useritem where useritem_user="&user&" and useritem_item="&item_id&" and useritem_id="&itrs("useritem_id")&""
- set rs = server.createobject("ADODB.RecordSet")
- rs.open sqlStr1,conn,1,3
- 'response.write sqlStr1
- rs("useritem_time1")=useritem_time2
-
- rs("useritem_time2")=DateAdd("d",zhouqi,rs("useritem_time2"))
- response.write rs("useritem_time2")&"kk"
- 'response.end()
- rs("useritem_count")=rs("useritem_count")+1
- rs.update
- rs.close
- set rs=nothing
-
-
-
-
-
- sqlStr2="select * from zy_moneylog"
- set rs = server.createobject("ADODB.RecordSet")
- rs.open sqlStr2,conn,1,3
- rs.addnew
- rs("moneylog_user")=user
- rs("moneylog_time")=now()
- rs("moneylog_ip")=request.ServerVariables("REMOTE_ADDR")
- If dingtou=true Then '2013-11-11
- rs("moneylog_money")=tmoney '2013-11-11
- rs("moneylog_notice")="定投项目返款(+)"
- else '2013-11-11
- rs("moneylog_money")=money
- rs("moneylog_notice")="项目返款(+)"
- end if '2013-11-11
- rs("moneylog_xm")=item_id
- rs.update
- rs.close
- Set rs=Nothing
-
- set rs101 = server.createobject("ADODB.RecordSet")
- sql101="select * from [zy_user] where user_id="&user
- rs101.open sql101,conn,1,3
- 'response.write sql101&"<br/>"
- 'response.write dingtou&"KK"
- 'response.End()
- If dingtou=true Then'2013-11-11
- rs101("user_money")=rs101("user_money")+tmoney'2013-11-11
- else
- 'response.write rs101("user_money")&"LLL"
- 'response.write "JJJ"
- 'response.End()
- rs101("user_money")=rs101("user_money")+money'2013-11-11
- end if'2013-11-11
- rs101.update
- rs101.close
- Set rs101=Nothing
-
- 'response.end()
-
- if fsMessage="yes" then
-
- sqlStr11="select * from zy_item where item_id="&item_id&""
- set rs11 = server.createobject("ADODB.RecordSet")
- rs11.open sqlStr11,conn,1,3
- item_title=rs11("item_title")
- set rs11=nothing
- title="项目分红通知!"
- bodyMessage="<font color=""#FF0000"">尊敬的会员,您好!您投资的项目〖"&item_title&"〗已经分红到您账户,请查收!〖"&siteName&"〗</font>"
- sql="insert into zy_message(message_sender,message_user,message_title,message_content,message_data) values('『"&siteName&"』','"&huserid&"','"&title&"','"&bodyMessage&"','"&now()&"')"
- conn.execute(sql)
-
- end if
-
-
- end if
-
- next
-
-
- '本金返还
- sqlStrb="select * from zy_useritem where useritem_user="&user&" and useritem_item="&item_id&" and useritem_id="&itrs("useritem_id")&""
- set rsb = server.createobject("ADODB.RecordSet")
- rsb.open sqlStrb,conn,1,3
- useritem_timeb=rsb("useritem_time")
- useritem_time2b=rsb("useritem_time1")
- useritem_time4b=now()
- useritem_itemb=rsb("useritem_item")'2013-4-8
- returnc=rsb("return")'2013-11-8
- useritemidb=brsb("useritem_id")'2013-11-8
- dingtoub=rsb("dingtou")'2013-11-11
- ppgetb=rsb("ppget")'2013-11-11
- gmfeb=rsb("gmfe")'2013-11-11
- nowcishub=rsb("useritem_count")
- treturnmoneyb=Int(returnmoney*gmfeb)
- tmoneyb=Int(dtmoney*gmfe)
- rsb.close
- set rsb=nothing
-
- if cint(nowcishub)=cint(cishu) then
-
-
- '判断是否返还本金
- if cdate(useritem_time4b)>=cdate(useritem_time2b) and cint(nowcishub)>=cint(cishu) then
-
- If isreturn=1 Then
- If returnc=false Then
- sqlStrrt="select * from zy_moneylog"
- set rsrt = server.createobject("ADODB.RecordSet")
- rsrt.open sqlStrrt,conn,1,3
- rsrt.addnew
- rsrt("moneylog_user")=huserid
- rsrt("moneylog_time")=now()
- rsrt("moneylog_ip")=request.ServerVariables("REMOTE_ADDR")
- If dingtou=true Then'2013-11-11
- rsrt("moneylog_money")=treturnmoneyb
- rsrt("moneylog_notice")="返还定投本金(+)"
- else
- rsrt("moneylog_money")=returnmoney
- rsrt("moneylog_notice")="返还本金(+)"
- end if'2013-11-11
- rsrt("moneylog_xm")=item_id
- rsrt.update
- rsrt.close
- Set rsrt=Nothing
- 'response.write "select * from [zy_useritem] where useritem_id="&itrs("useritem_id")
- 'response.end()
- sqlf="update [zy_useritem] set return=true where useritem_id="&itrs("useritem_id")&""
- conn.execute(sqlf)
-
- 'rs100("user_money")=rs100("user_money")+returnmoney
- set rs100=server.CreateObject("adodb.recordset")
- sql100="select * from [zy_user] where user_id="&user
- rs100.open sql100,conn,1,3
- If dingtou=true Then'2013-11-11
- rs100("user_money")=rs100("user_money")+treturnmoneyb
- else
- rs100("user_money")=rs100("user_money")+returnmoneyb
- end if'2013-11-11
- rs100.update
- rs100.close
- set rs=nothing
-
-
- end if
- end if
-
- end if
-
-
- end if
-
-
- itrs.movenext
- loop
- end if
-
- %>
-
-
-
- <%
- 'response.End()
- Call AlertUrl("尊敬的会员您好,欢迎登录!您可自己投资赚钱,也可推荐会员注册赚钱:只要是通过您推荐链接注册成功会员的,您可以得到人民币"&sitefriendmoney&"元的奖励。而且通过您的推广链接注册成功的会员只要充值了您还可以得到"&num&"%的奖励。!",""&webPath&"mynotice.asp",5,5)
- ' Call AlertUrl("尊敬的会员您好,欢迎登录!您可自己投资赚钱,也可推荐会员注册赚钱:只要是通过您推荐链接注册成功会员的,您可以得到人民币"&sitefriendmoney&"元的奖励。而且通过您的推广链接注册成功的会员只要充值了您还可以得到"&num&"%的奖励。!",""&webPath&"mynotice.asp",5,5)
- End If
- rs.close
- Set rs=Nothing
- Set conn=nothing
- %>
复制代码 |