<!--#include file="conn.asp"-->
<!--#include file="conn1.asp"-->
<!--#include file="const.asp"-->
<!--#include file="chkuser.asp"-->

<% 
dim menu,savem,rsbank,rssql,towho
menu=request.querystring("menu")

%>


<html>
<head>
<title><%dim dtitle
dtitle="社区银行"%><%=dtitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Forum.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--
function cform(){
 if(!confirm("你是否确认删除该项目？"))
 return false;

}

//-->
</SCRIPT>

</head>
<BODY <%=Forumbody%>>
<!--#include file="theme.asp"-->


<% if lockuser=0 then
if menu="" then
    call main()
elseif menu=1 then
    call top20()
elseif menu=2 then
    call top10()
elseif menu=3 then
    call savemoney()
elseif menu=4 then
    call qumoney()
elseif menu=5 then
dim server_v1,server_v2
 server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style='font:9pt Verdana'>"
response.write "你提交的路径有误，禁止从站点外部提交数据请不要乱该参数！"
response.write "</td></tr></table></center>"
else
 call zmoney()
end if
   
elseif menu=6 then
    call daimoney()
elseif menu=7 then
    call hmoney()
elseif menu=8 then
    call admin()
elseif menu=9 then
    call admin1()
elseif menu=10 then
    call hmoney2()
elseif menu=11 then
    call jiangli()
	elseif menu=12 then
    call modi()
elseif menu=13 then
    call saveone()
elseif menu=14 then
    call down10()
elseif menu=15 then
    call del()
end if
%>

<%sub del()'删除用户
dim id
id=request("id")
sql= "delete from bank where id="&id
set rs=conn1.execute(sql)         
Response.Redirect("bank.asp?menu=8")
response.end
end sub
%>
<%'管理用户资料
sub modi()
towho=request("towho")
 set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username like'%"&trim(towho)&"%' order by savemoney desc" 
    rs.open sql,conn1,1,3
%>
<br><table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>">
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=5 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><b>共有<font color=red><%=rs.recordcount%></font>个符合条件的会员,请您选择整理</b></td></tr>

<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="23%">帐户</td>
<td align=center width="23%">存款</td>
<td align=center width="23%">贷款</td>
<td align=center width="13%">状态</td>
<td align=center width="18%">操作</td>

</tr>
<%do while not rs.eof %>
<form action="bank.asp?menu=13" name="form13" method="post" >

<tr bgcolor=<%=TableBodyColor%>>
 <td align=center width="23%"><%=rs("username")%></td>
  <td align=center width="23%"><input value=<%=rs("savemoney")%> type=text name=savemoney size=15></td>
<td align=center width="23%"><input value=<%=rs("daikuang")%> type=text size=15 name=daikuang></td>
<td align=center width="13%">
   <select name="lock" size=1 >
<option value="<%=rs("lock")%>" selected><%if rs("lock")=1 then%>锁定<%else%>未锁<%end if%></option>
 
<option value="<%=1-rs("lock")%>"><%if rs("lock")=1 then%>不锁<%else%>锁定<%end if%></option>

 	</select></td><td width="18%" ><INPUT type=hidden value="<%=rs("username")%>" name=towho>
 <INPUT type=submit value=修改  > &nbsp;<a href='bank.asp?menu=15&id=<%=rs("id")%>' onclick="return cform();"><font color=red>删除</font></a></td>
</tr>

 </form>
 <%rs.movenext
 loop
 rs.close
 
 %>
 <tr bgcolor=<%=TableBodyColor%>><td align=center colspan=5><a href="javascript:history.back()">返回</a></td></tr>

</table>
 
<%end sub
%>
<%'储存用户资料
sub saveone()
dim  savemoney,daikuan,towho,lock
savemoney=request.form("savemoney")
daikuan=request.form("daikuang")
towho=request.form("towho")
lock=request.form("lock")
set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username='"&towho&"'"
    rs.open sql,conn1,1,3
	rs("savemoney")=savemoney
	rs("daikuang")=daikuan
	rs("lock")=lock
	rs.update
	rs.close
	call endinfo("该用户管理已经完成")
	end sub

%>
<%
'--------------------------------强制还款-------------------------------
sub hmoney2()
    dim name
    if request.querystring("username")<>"" then
    name=request.querystring("username")
    else
    name=membername
    end if
    dim loan
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username='"&name&"' "
    rs.open sql,conn1,1,3
        loan=clng((daikuang*(formatnumber(culi)/100))*daiday)+rs("daikuang")
           rs("daikuang")=0
           rs.update
                   set rs=server.createobject("adodb.recordset")
                   sql="select * from info"
                   rs.open sql,conn1,1,3
                   rs("chubei")=rs("chubei")+loan
                   rs.update
                   rs.close
           set rs=server.createobject("adodb.recordset")
           sql="select * from [user] where username='"&membername&"' "
           rs.open sql,conn,1,3
           rs("userwealth")=rs("userwealth")-loan
           rs.update
           rs.close
%>
<% if request.querystring("username")<>"" then
call endinfo("强制还款手续已办理！")
end if %>
<% end sub %>

<%
'--------------------------------还贷程序-------------------------------
sub hmoney()
    dim loan
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username='"&membername&"' "
    rs.open sql,conn1,1,3
    set rsbank=server.createobject("adodb.recordset")
    rssql="select * from [user] where username='"&membername&"'"
    rsbank.open rssql,conn,1,3
    loan=clng((daikuang*(formatnumber(culi)/100))*daiday)+rs("daikuang")
        if rs("daikuang")=0 then
      elseif loan>rsbank("userwealth") then
rsbank.close
call err("您没有那么多的钱还贷款！")
       else
           rsbank.close
           rs("daikuang")=0
           rs.update
                   set rs=server.createobject("adodb.recordset")
                   sql="select * from info"
                   rs.open sql,conn1,1,3
                   rs("chubei")=rs("chubei")+loan
                   rs.update
                   rs.close
           set rs=server.createobject("adodb.recordset")
           sql="select * from [user] where username='"&membername&"' "
           rs.open sql,conn,1,3
           rs("userwealth")=rs("userwealth")-loan
           rs.update
           rs.close
		   call endinfo("您已经办理好了还款手续")
 
end if
end sub
%>




<%
'--------------------------------贷款程序--------------------------------
sub daimoney()
    if request.form("loan")="" then
    call err("请填写您要操作的数额！")
    else
    dim loan
    loan=clng(request.form("loan"))
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username='"&membername&"' "
    rs.open sql,conn1,1,3
        if loan>dkdu then
		call err("您贷款的金额超出了您的贷款信用额度")
 elseif loan<0 then

call err("想送钱给银行吗？早说嘛！") 
else 
        rs("daikuang")=rs("daikuang")+loan
        rs("dkdate")=date()
        rs.update
        rs.close
               set rs=server.createobject("adodb.recordset")
               sql="select * from info"
               rs.open sql,conn1,1,3
               rs("chubei")=rs("chubei")-loan
               rs.update
               rs.close
           set rs=server.createobject("adodb.recordset")
           sql="select * from [user] where username='"&membername&"' "
           rs.open sql,conn,1,3
           rs("userwealth")=rs("userwealth")+loan
           rs.update
           rs.close
          call endinfo("您已经办理好了贷款手续")     
 end if
end if
end sub
%>




<%

'--------------------------------转帐程序------------------------------
sub zmoney()
    if request.form("trans")="" then
    call err("请填写您要操作的数额！")
    else
   dim trans,transto
   trans=clng(request.form("trans"))
   transto=request.form("transto")
   set rs=server.createobject("adodb.recordset")
   sql="select * from bank where username='"&membername&"' "
   rs.open sql,conn1,1,3

if rs("savemoney") < trans then

call err("您在银行中没有那么多的存款") 
elseif rs("savemoney")-trans<1 then
call err("您的银行账户里至少保留一元钱！")
elseif  trans<0 then
call err("你想抢别人的钱吗？倒，不够朋友！")
elseif  trans>10000 then
call err("银行一次业务只能处理10000元款额！")
  
 else
        rs("savemoney")=rs("savemoney")-int(trans*1.025)
        rs.update
        rs.close
  set rs=server.createobject("adodb.recordset")
           sql = "select * from bank where username='"&transto&"' "
           rs.open sql,conn1,1,3
           if rs.eof then
              rs.addnew
              rs("username")=transto
              rs("savemoney")=1
			  rs("lock")=0
              rs.update
              rs.close
			  set rs=nothing
			  end if
   set rs=server.createobject("adodb.recordset")
   sql="select * from bank where username='"&transto&"' "
   rs.open sql,conn1,1,3    
        rs("savemoney")=rs("savemoney")+trans
        rs.update
  		rs.close
   set rs=server.createobject("adodb.recordset")
   sql="select * from message"
    rs.open sql,conn,1,3
	rs.addnew
	rs("title")="天下掉馅饼啦"
	rs("incept")=transto
	rs("sender")=membername
	rs("content")=membername&"从银行转到您帐户"&trans&"两银子，您的利息已全部转为本金，请注意查收。"
	rs("sendtime")=now()
	rs("flag")=0
	rs("issend")=1
 		 rs.update
		 rs.close
                  
				   set rs=server.createobject("adodb.recordset")
                   sql="select * from info"
                   rs.open sql,conn1,1,3
                   rs("chubei")=rs("chubei")+int(trans*0.025)
                   rs.update
                   rs.close
call endinfo("您已经办理好了转帐手续")
 end if
end if
end sub

	  
%>




<%
'--------------------------------取款程序--------------------------------
sub qumoney()
    if request.form("draw")="" then
    call err("请填写您要操作的数额！")
    else
    dim drawm,saveli
    drawm=clng(request.form("draw"))
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank where username='"&membername&"' "
    rs.open sql,conn1,1,3
        if drawm>rs("savemoney") then
 elseif rs("savemoney")-drawm<1 then
call err("银行账号里至少得保留一块钱！")
 elseif drawm<0 then
call err("看，想抢银行，不怕死呀你？")
elseif  drawm>10000 then
call err("银行一次业务只能处理10000元款额！")
else
                 if saveday<10 then
                 saveli=0
                 else
                 saveli=clng((smoney*(formatnumber(culi)/100))*saveday)
                 end if
        rs("savemoney")=rs("savemoney")-drawm+saveli
        rs("date")=date()
        rs.update
        rs.close
           set rs=server.createobject("adodb.recordset")
           sql="select * from [user] where username='"&membername&"' "
           rs.open sql,conn,1,3
           rs("userwealth")=rs("userwealth")+drawm
           rs.update
           rs.close
                   set rs=server.createobject("adodb.recordset")
                   sql="select * from info"
                   rs.open sql,conn1,1,3
                   rs("chubei")=rs("chubei")-drawm
                   rs.update
                   rs.close 
				   call endinfo("您已经办理好了取款手续")
				   end if%>
<%
end if
end sub
%>




<%
'--------------------------------------存款程序------------------------------------
sub savemoney()
    if request.form("saving")="" then
    call err("请填写您要操作的数额！")
    else
    savem=int(request.form("saving"))
    set rs=server.createobject("adodb.recordset")
    sql="select * from [user] where username='"&membername&"' "
    rs.open sql,conn,1,3
       if savem>rs("userwealth") then
	   call err("您没有那么多的现金")
       elseif  savem<0 then
		call err("存负钱？？晕，傻了吧你！") 
		
		
		
		else %>
        <% set rsbank=server.createobject("adodb.recordset")
           rssql = "select * from bank where username='"&membername&"' "
           rsbank.open rssql,conn1,1,3
           if rsbank.eof then
              rsbank.addnew
              rsbank("username")=membername
              rsbank("savemoney")=savem
			  rsbank("lock")=0
              rsbank.update
              rsbank.close
                set rsbank=server.createobject("adodb.recordset")
                rssql = "select * from info"
                rsbank.open rssql,conn1,1,3
                rsbank("chubei")=rsbank("chubei")+savem
                rsbank.update
                rsbank.close
              rs("userwealth")=rs("userwealth")-savem
              rs.update
              rs.close
           else
                dim saveli
                 if saveday<10 then
                 saveli=0
                 else
                 saveli=clng((smoney*(formatnumber(culi)/100))*saveday)
                 end if
              rsbank("savemoney")=rsbank("savemoney")+savem+saveli
              rsbank("date")=date()
              rsbank.update
              rsbank.close
                set rsbank=server.createobject("adodb.recordset")
                rssql = "select * from info"
                rsbank.open rssql,conn1,1,3            
                rsbank("chubei")=rsbank("chubei")+savem
                rsbank.update
                rsbank.close
              rs("userwealth")=rs("userwealth")-savem
              rs.update
              rs.close
           end if
call endinfo("您的钱成功的存入银行")
         
end if
end if
end sub
%>



<%
'-------------------------------------------主程序-----------------------------------
sub main()
      if daiday>daitian and daikuang>0 then
         call hmoney2()
%>
<table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>"><tr bgcolor="<%=Tabletitlecolor%>" ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><b>银行保安</b></td></tr><tr height=200><td align=center height=26 bgcolor="<%=aTabletitlecolor%>" >由于你的贷款超过了尝还期限现在强制执行！<br><br><a href="bank.asp">返回</a></td></tr><tr><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"></td></tr></table>
<%    else  %>
<br><table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>">
<tr bgcolor="<%=Tabletitlecolor%>" ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><b>欢迎来到社区银行管理你的财产</b></td></tr>
<tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=26 bgcolor="<%=aTabletitlecolor%>"><a href=bank.asp?menu=1>社区二十大富翁</a>　　<a href=bank.asp?menu=2>银行十大储户</a>　　<a href=bank.asp?menu=14>银行十大穷鬼</a>　（你可以想办法让这些富翁转账给你钱^0^）<br>银行目前的日利率是 <%=culi%>%，贷款利率是 <%=daili%>%，存款利率从第 10 天起计算，当前银行储备资金为 <%=chubei%><br>贷款最长期限为 <%=daitian%> 天（到期将强制执行）   银行存款、取款、转账一次操作最多实现10000元的流量</td></tr>

<form name="form1" method="post" action="bank.asp?menu=3"><tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=30 bgcolor="<%=aTabletitlecolor%>">　　　　存款： 
  <INPUT name=saving size="20"> <INPUT type=submit value=存入 name=submit> 你现有的现金为：<%=money%>　存款利率为：<%=culi%>% </td></tr></form>

<form name="form2" method="post" action="bank.asp?menu=4"><tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=30 bgcolor="<%=aTabletitlecolor%>">　　　　取款： 
  <INPUT name=draw size="20"> <INPUT type=submit value=取出 name=submit> 你现在的存款为：<%=smoney%>　你的利息为：<% if saveday<10 then%>0<%else%><%=clng((formatnumber(smoney)*(formatnumber(culi)/100))*saveday)%><%end if%> </td></tr></form>

<form name="form3" method="post" action="bank.asp?menu=5"><tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=30 bgcolor="<%=aTabletitlecolor%>">　　　　转账： 
  <INPUT name=trans size="20"> 给 
            <INPUT name=transTo size="20"> <INPUT type=submit value=转入 name=submit> 
            转账手续费：<%=zhuangli%>% </td></tr></form>

<form name="form4" method="post" action="bank.asp?menu=6"><tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=30 bgcolor="<%=aTabletitlecolor%>">　　　　贷款： 
  <INPUT name=loan size="20"> <INPUT type=submit value=贷款 name=submit> 你的贷款额度为：<%=dkdu%>　贷款利率为：<%=daili%>% 
          </td></tr></form>

<form name="form5" method="post" action="bank.asp?menu=7"><tr bgcolor="<%=aTabletitlecolor%>" ><td align=left height=30 bgcolor="<%=aTabletitlecolor%>">　　　　还清贷款： <INPUT type=submit value=还款 name=submit> 你现在的贷款额为：<%=daikuang%>　你贷款的利息为：<%if daikuang=0 then %>0<%else%><%=clng((daikuang*(formatnumber(culi)/100))*daiday)%><%end if%> </td></tr></form>

<tr bgcolor="<%=Tabletitlecolor%>" height=30 ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><%if membername=adminname then%><a href="bank.asp?menu=8">银行管理中心</a><%end if%></td></tr>
</table>
<%
end if
end sub
 
'-------------------------------------------TOP20 排行-------------------------------------
sub top20()
    set rs=server.createobject("adodb.recordset")
    sql="select * from [user] order by userWealth desc"
    rs.open sql,conn,1,3
            response.write "<br><table width="&TableWidth&" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="&Tablebackcolor&">"
            response.write "<tr bgcolor="&Tabletitlecolor&" height=22><td align=center colspan=9 align=left height=26 bgcolor="&Tabletitlecolor&">社区20大富翁排行 </td></tr>"
%>
<tr bgcolor=<%=TabletitleColor%> style=color:<%=TableFontColor%>> 
<td align=center><font color="<%=TableFontColor%>"><b>用户名</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>Email</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>OICQ</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>主页</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>短消息</font></td>
<td align=center><font color="<%=TableFontColor%>"><b>注册时间</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>等级状态</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>发贴总数</b></font></td>
<td align=center><font color="<%=TableFontColor%>"><b>现金
<%
dim i
       for i=1 to 20
%>
<tr bgcolor=<%=TableBodyColor%>> 
<td>&nbsp;<a href="..\dispuser.asp?name=<%=rs("username")%>" target=_blank><%=rs("username")%></a></td>
<td align=center><a href=mailto:<%=rs("useremail")%>><img border=0 src="..\<%=picurl&P_Email%>"></a></td>
<td align=center> 
<%if rs("oicq")="" or isnull(rs("oicq")) then%>
没有 
<%else%>
<a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("oicq")%> target=_blank><img src="..\<%=picurl&P_oicq%>" alt="查看 OICQ:<%=rs("oicq")%> 的资料" border=0 width=16 height=16></a> 
<%end if%>
</td>
<td align=center> 
<%if rs("homepage")="" or isnull(rs("homepage")) then%>
没有 
<%else%>
<a href=<%=rs("homepage")%> target=_blank><img border=0 src=..\<%=picurl&P_homepage%>></a> 
<%end if%>
</td>
<td align=center><a href=usersms.asp?action=new&touser=<%=rs("username")%> target=_blank><img src="..\<%=picurl&P_sms%>" border=0></a></td>
<td align=center><font color="<%=TableContentColor%>"><%=rs("addDate")%></font></td>
<td align=center> <font color="<%=TableContentColor%>"><%=rs("userclass")%></font><br>
</td>
<td align=center><font color="<%=TableContentColor%>"><%=rs("article")%></font></td>
<td align=center><font color="<%=TableContentColor%>"><%=rs("userwealth")%></font></td>
</tr>
<%
           rs.movenext
         if rs.eof then
             exit for
         end if
       next
%>
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=9 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><a href="javascript:history.go(-1)">返回</a></td></tr></table>
<%
end sub 
%>

<%
'---------------------------------十大储户排行-----------------------------------
sub top10()
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank order by savemoney desc"
    rs.open sql,conn1,1,3
%>
<br><table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>">
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=3 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><b>银行十大储户排行</b></td></tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="33%">帐户</td>
<td align=center>存款</td>
<td align=center width="33%">贷款</td>
</tr>
<%
dim i
       for i=1 to 20
%>
<tr bgcolor=<%=TableBodyColor%>>
<% if membername<>adminname then%>
<td align=center width="33%"><%=rs("username")%></td>
<%else%>
<td align=center width="33%"><a href='bank.asp?menu=12&towho=<%=rs("username")%>'><%=rs("username")%></a></td>
<%end if%>
<td align=center><%=rs("savemoney")%></td>
<td align=center width="33%"><%=rs("daikuang")%></td>
</tr>
<%
           rs.movenext
         if rs.eof then
             exit for
         end if
       next
%>
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=3 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><a href="javascript:history.go(-1)">返回</a></td></tr></table>
<%
end sub %>
<%
'---------------------------------十大穷鬼排行-----------------------------------
sub down10()
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank order by savemoney "
    rs.open sql,conn1,1,3
%>
<br><table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>">
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=3 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><b>银行十大穷人排行</b></td></tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="33%">帐户</td>
<td align=center>存款</td>
<td align=center width="33%">贷款</td>
</tr>
<%
dim i
       for i=1 to 10
%>
<tr bgcolor=<%=TableBodyColor%>>
<% if membername<>adminname then%>
<td align=center width="33%"><%=rs("username")%></td>
<%else%>
<td align=center width="33%"><a href='bank.asp?menu=12&towho=<%=rs("username")%>'><%=rs("username")%></a></td>
<%end if%>
<td align=center><%=rs("savemoney")%></td>
<td align=center width="33%"><%=rs("daikuang")%></td>
</tr>
<%
           rs.movenext
         if rs.eof then
             exit for
         end if
       next
%>
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=3 align=left height=26 bgcolor="<%=Tabletitlecolor%>"><a href="javascript:history.go(-1)">返回</a></td></tr></table>
<%
end sub %>

<% sub admin() 
'----------------------------银行基本设置--------------------------
if membername<>adminname then
  call err("非管理员莫入！")
else
%>
<br><table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>">
<tr bgcolor="<%=Tabletitlecolor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=Tabletitlecolor%>"><b>银行管理中心</b></td></tr>
<tr bgcolor="<%=TableBodyColor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=aTabletitlecolor%>"><b>银行基本设置</b></td></tr>
<form name="form2" method="post" action="bank.asp?menu=9">
<tr bgcolor=<%=TableBodyColor%>>
<td align=right width="35%">存款的利息：</td>
<td align=left width="65%" colspan=2>
<INPUT name=saveli value="<%=culi%>" size="20"> %</td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right width="35%">贷款的利息：</td>
<td align=left width="65%" colspan=2>
<INPUT name=daili value="<%=daili%>" size="20"> %</td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right width="35%">银行的储备资金：</td>
<td align=left width="65%" colspan=2>
<INPUT name=chubei value="<%=chubei%>" size="20"> $</td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right width="35%">转帐的手续费：</td>
<td align=left width="65%" colspan=2>
<INPUT name=zhuangli value="<%=zhuangli%>" size="20"> %</td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right width="35%">最长贷款天数：</td>
<td align=left width="65%" colspan=2>
<INPUT name=daitian value="<%=daitian%>" size="20"> 天</td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center colspan=3 ><INPUT type=submit value=修改 name=submit></td>
</tr>
</form>
<form name="form12" method="post" action="bank.asp?menu=12">
 
<tr bgcolor="<%=TableBodyColor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=aTabletitlecolor%>"><b>银行用户管理</b><br></td></tr>

<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="33%">帐户名</td>
<td align=center><input type=text name=towho size=20></td>
<td align=center width="33%"><input type=submit value="查 找"></td>
</tr>
</form>
<tr bgcolor="<%=TableBodyColor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=aTabletitlecolor%>"><b>银行贷款管理</b><br>(只有超过还款日期的帐户才列出)</td>
</tr>
<%
    set rs=server.createobject("adodb.recordset")
    sql="select * from bank where datediff('d',dkdate,date())>200"
    rs.open sql,conn1,1,3
%>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="33%">帐户名</td>
<td align=center>贷款数额</td>
<td align=center width="33%">操   作</td>
</tr>
<%
do while not rs.eof
%>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center width="33%"><%=rs("username")%></td>
<td align=center><%=rs("daikuang")%></td>
<td align=center width="33%"><a href="bank.asp?menu=10&username=<%=rs("username")%>">强制还款</a></td>
</tr>
<% 
rs.movenext
loop %>
<tr bgcolor="<%=TableBodyColor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=aTabletitlecolor%>"><b>银行奖励管理</b></td></tr>
<form name="form1" method="post" action="bank.asp?menu=11">
<tr bgcolor=<%=TableBodyColor%>>
<td align=right >奖励对象：</td>
<td align=left colspan=2><select name="name">
    <option value="20" selected>所有管理员</option>
    <option value="18">所有贵宾</option>
    <option value="19">所有版主</option>
    <option value="17">管理员/版主/贵宾</option>
    <option value="1">所有会员</option>
  </select>  奖励单个会员请填写：<INPUT name=username size="20"></td></tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right >奖励金额：</td>
<td align=left colspan=2><INPUT name=money size="20"></td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=right >奖励理由：</td>
<td align=left colspan=2><INPUT name=liyou size="50"></td>
</tr>
<tr bgcolor=<%=TableBodyColor%>>
<td align=center colspan=3><INPUT type=submit value=奖励 name=submit></td>
</tr>
</form>
<tr bgcolor="<%=TableBodyColor%>" height=22><td align=center colspan=3  height=26 bgcolor="<%=Tabletitlecolor%>"><b><a href="bank.asp">返回银行首页</a></b></td></tr>
</table>
<% 
end if
end sub %>

<% sub admin1() %>
<%
dim saveli
if request.form("saveli")<>"" then
saveli=formatnumber(request.form("saveli"))
daili=formatnumber(request.form("daili"))
chubei=int(request.form("chubei"))
zhuangli=formatnumber(request.form("zhuangli"))
daitian=int(request.form("daitian"))
    set rs=server.createobject("adodb.recordset")
    sql="select * from [info]"
    rs.open sql,conn1,1,3
     rs("savedayli")=saveli
     rs("ddayli")=daili
     rs("chubei")=chubei
     rs("zzli")=zhuangli
     rs("dkday")=daitian
     rs.update
     rs.close
	 call endinfo("银行基本信息修改完成 ")

 else 
call err("请填写您要操作的数额！")
end if
end sub %>

<% sub jiangli() 
'-----------------------------奖励-------------------------------
dim money,liyou,classid,rs2,sql2
money=int(request.form("money"))
liyou=request.form("liyou")
if request.form("username") ="" then
    classid=int(request.form("name"))
       if classid>17 then
            set rs=server.createobject("adodb.recordset")
            sql="select * from [user] where userclass="&classid&" "
            rs.open sql,conn,1,3
            do while not rs.eof
                rs("userwealth")=rs("userwealth")+money
                rs.update
                                    set rs2=server.createobject("adodb.recordset")
                                    sql2="select * from [message]"
                                    rs2.open sql2,conn,1,3
                                    rs2.addnew
                                    rs2("sender")="社区银行"
									rs2("sendtime")=now()
                                    rs2("incept")=rs("username")
                                    rs2("title")="社区银行给您奖励"+cstr(money)+"元"
                                    rs2("content")="事由："+liyou+"，所以社区很行给于您"+cstr(money)+"元奖励"
                                    rs2("flag")=0
                                    rs2("issend")=1
                                    rs2.update
                                    rs2.close
                rs.movenext   
            loop
         elseif classid=17 then
                     set rs=server.createobject("adodb.recordset")
            sql="select * from [user] where userclass>17 "
            rs.open sql,conn,1,3
            do while not rs.eof
                rs("userwealth")=rs("userwealth")+money
                rs.update
                                    set rs2=server.createobject("adodb.recordset")
                                    sql2="select * from [message]"
                                    rs2.open sql2,conn,1,3
                                    rs2.addnew
                                    rs2("sender")="社区银行"
									rs2("sendtime")=now()
                                    rs2("incept")=rs("username")
                                    rs2("title")="社区银行给您奖励"+cstr(money)+"元"
                                    rs2("content")="事由："+liyou+"，所以社区很行给于您"+cstr(money)+"元奖励"
                                    rs2("flag")=0
                                    rs2("issend")=1
                                    rs2.update
                                    rs2.close
                rs.movenext
            loop
             elseif classid=1 then
                     set rs=server.createobject("adodb.recordset")
            sql="select * from [user]"
            rs.open sql,conn,1,3
            do while not rs.eof
                rs("userwealth")=rs("userwealth")+money
                rs.update
                                    set rs2=server.createobject("adodb.recordset")
                                    sql2="select * from [message]"
                                    rs2.open sql2,conn,1,3
                                    rs2.addnew
                                    rs2("sender")="社区银行"
									rs2("sendtime")=now()
                                    rs2("incept")=rs("username")
                                    rs2("title")="社区银行给您奖励"+cstr(money)+"元"
                                    rs2("content")="事由："+liyou+"，所以社区很行给于您"+cstr(money)+"元奖励"
                                    rs2("flag")=0
                                    rs2("issend")=1
                                    rs2.update
                                    rs2.close
                rs.movenext
            loop
             end if
else
        classid=request.form("username") 
        set rs=server.createobject("adodb.recordset")
     sql="select * from [user] where username='"&classid&"' "
     rs.open sql,conn,1,3
        rs("userwealth")=rs("userwealth")+money
        rs.update
                                    set rs2=server.createobject("adodb.recordset")
                                    sql2="select * from [message]"
                                    rs2.open sql2,conn,1,3
                                    rs2.addnew
                                    rs2("sender")="社区银行"
									rs2("sendtime")=now()
                                    rs2("incept")=rs("username")
                                    rs2("title")="社区银行给您奖励"+cstr(money)+"元"
                                    rs2("content")="事由："+liyou+"，所以社区很行给于您"+cstr(money)+"元奖励"
                                    rs2("flag")=0
                                    rs2("issend")=1
                                    rs2.update
                                    rs2.close
end if
rs.close
        set rs=server.createobject("adodb.recordset")
     sql="select * from [bbsnews]"
     rs.open sql,conn,1,3
        rs.addnew
        rs("boardid")=0
		if request.form("username") <>"" then
         rs("title")="银行奖励"&request.form("username")
		 else
        if  classid=20 then
        rs("title")="银行奖励所有管理员"
     elseif classid=19 then
        rs("title")="银行奖励所有版主"
         elseif classid=18 then
        rs("title")="银行奖励所有贵宾"
         elseif classid=17 then
        rs("title")="银行奖励所有管理员、版主、贵宾"
         elseif classid=1 then
        rs("title")="银行奖励所有会员"
         end if
		 end if
        rs("content")="奖励理由："+liyou
        rs("username")="银行行长"
		rs("addtime")=now()
		
        rs.update
        rs.close
call endinfo("您已经完成了操作请返回 ")
end sub %>


<%sub err(message) 
'-------------------------------出错信息-------------------------------
%>
<table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>"><tr bgcolor="<%=Tabletitlecolor%>" ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><b>出错提示</b></td></tr><tr><td align=center height=70 bgcolor="<%=aTabletitlecolor%>"><font color=black><b><%=message%></b></font><br></td></tr><tr><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><a href="javascript:history.go(-1)">返回</a></td></tr></table>
<%end sub%>
<%sub endinfo(message) 
'-------------------------------信息提示-------------------------------
%>
<table width="<%=TableWidth%>" border=0 cellspacing=1 cellpadding=3 align=center bgcolor="<%=Tablebackcolor%>"><tr bgcolor="<%=Tabletitlecolor%>" ><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><b>信息提示</b></td></tr><tr><td align=center height=70 bgcolor="<%=aTabletitlecolor%>"><%=message%><br></td></tr><tr><td align=center height=26 bgcolor="<%=Tabletitlecolor%>"><a href="javascript:history.go(-1)">返回</a></td></tr></table>
<%end sub
else
call err("您的银行账号被冻结，您暂时无法管理您的财务")
end if
%>
<!--#include file="footer.asp"-->
<HTML>
<BODY onload="">
<script language=vbscript>

</script>
</BODY>
</HTML>