<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!-- #include file="inc/char.asp" -->
<!--#include file="inc/theme.asp"-->
<!--#include file="data.asp"-->
<STYLE type=text/css> 
.HoverBC {
	BACKGROUND-COLOR: #d1d9e2
}
.LinkGrid {
	BACKGROUND-COLOR: #f8f8f8
</STYLE>

<HTML><HEAD><TITLE>社区银行</TITLE>

<% dim mymoney,sql1,Rs1,bankmoney,bankac,deposittime,lendtime,numtime,deposit,interest,bankinterest,numtime1,loan,loaninterest,sqlstr,endtime,msg,credit
if membername="" then
  location.href = "login.asp"
else
Tabletitlecolor="#9898ba"

call nav()


sql="Select  * from user where UserName='"&membername&"'"  
set rs=conn.Execute(sql)

	mymoney=rs("userWealth")

	sql="SELECT * FROM bank WHERE UserName='银行'"
	Set Rs=conn.Execute(sql)
	bankmoney=rs("depositmoney") + rs("accrual")
	bankac=rs("ac")
	
	sql="SELECT * FROM bank WHERE UserName='"&membername&"'"
	Set Rs=conn.Execute(sql)
	if rs.bof then
    rs.close
	call headline(1)
%>


<div align="center">
<center>
<table border="0" width="470" cellspacing="1" cellpadding="0">
<tr>
<td class=p2 width="100%">
<p align="center"><br><%=membername%>，您好，欢迎进行存款业务，请您先在银行开个户头！
<p align="center">□-<a href="openaccount.asp">我要开户</a>&nbsp;&nbsp;&nbsp; □-<a href="index.asp">离开银行<br></a></p> 
</td> 
</tr> 
</table> 
</center> 
</div> 
<% 
else 

'更新用户数据和银行数据

 deposittime=rs("deposittime") 
 lendtime=rs("lendtime")
 numtime=datediff("d",deposittime,date)
 deposit=rs("depositmoney")
 interest=int(deposit*numtime*0.02)
 bankinterest=int(bankmoney*numtime*0.04)

 numtime1=datediff("d",lendtime,date)
 loan=rs("lendmoney")
 loaninterest=int(loan*numtime1*0.02)

 rs.close

 sqlstr="update bank set accrual="&interest&", loaninterest ="&loaninterest&" where username='"&membername&"'"
 conn.Execute sqlstr

 sqlstr="update bank set accrual="&bankinterest&" where username='银行'"
 conn.Execute sqlstr

 	sql="SELECT * FROM bank WHERE UserName='"&membername&"'"
	Set Rs=conn.Execute(sql)

 deposit=rs("depositmoney")
 interest=rs("accrual")
 loan=rs("lendmoney")+ rs("loaninterest")
 lendtime=rs("lendtime")
 
%>
<TABLE cellSpacing=0 cellPadding=0 width=770 align=center border=0>
  <TBODY>
  <TR>
    <TD width=19 height=70>&nbsp; </TD>
    <TD width=207 height=65></TD>
    <TD width=59 height=65>&nbsp;</TD>
    <TD width=474 height=65></TD>
    <TD width=11 height=65>&nbsp;</TD></TR>
  <TR bgColor=#1f7bbe>
    <TD colSpan=5 height=3></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=770 align=center border=0>
  <TBODY>
  <TR>
    <TD width=1 bgColor=#000000 height=11 rowSpan=6><IMG height=1 
      src="pic/spacer.gif" width=1></TD>
    <TD bgColor=#000000 colSpan=5 height=1><IMG height=1 
      src="pic/spacer.gif" width=1></TD>
    <TD width=1 bgColor=#000000 rowSpan=6><IMG height=1 
      src="pic/spacer.gif" width=1></TD></TR>
  <TR>
    <TD colSpan=5><!-- 栏目分类 -->
      <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width=5></TD>
          <TD>您好！您现在的位置：<a href=index.asp>社区</a>--&gt; 银行 </TD>
          <TD align=right><A href="bank.asp">营业厅</A> 
            | <A 
            href="deposit.asp">存款</a> | <A 
            href="withdraw.asp">取款</A> | <A 
            href="transfer.asp">转帐</A> | <A 
            href="loan.asp">贷款</A> | 偿还贷款 
			<% if master then
			    %>
				 | <A 
            href="admin_bank.asp">管理</A> 
			<% end if%> 
        </TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD background=pic/linexu.gif colSpan=5 height=1><IMG height=1 
      src="pic/spacer.gif" width=1></TD></TR>
  <TR>
    <TD class=LinkGrid vAlign=top width=170><!-- 功能列表 -->
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD vAlign=top height=18>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD class=HoverBC align=middle height=22><IMG 
                  src="pic/spacer.gif"><IMG 
                  src="pic/spacer.gif"><IMG height=16 
                  src="pic/userlist.gif" width=16 align=absMiddle> 
                我的资料</TD></TR>
              <TR>
                <TD height=1><IMG src="pic/spacer.gif"><IMG 
                  src="pic/spacer.gif"><IMG 
                src="pic/spacer.gif"></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD class=LinkGrid>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=middle colSpan=2 height=5></TD></TR>
              <TR align=middle>
                <TD colSpan=2></TD></TR>
              <TR>
                <TD align=right width="38%">姓名：</TD>
                <TD width="62%"><%=membername%></TD></TR>
              <TR>
                <TD align=right width="38%">现金：</TD>
                <TD width="62%"><%=mymoney%> 两银子</TD></TR>
              <TR>
                <TD align=right width="38%">存款：</TD>
                <TD width="62%"><%=deposit%> 两银子</TD></TR>
              <TR>
                <TD align=right width="38%">利息：</TD>
                <TD width="62%"><%=interest%> 两银子</TD></TR>
              <TR>
                <TD align=right width="38%">总资产：</TD>
                <TD width="62%"><%=mymoney+deposit+interest%> 两银子</TD>
              </TR>
              <TR>
                <TD align=right width="38%">贷款：</TD>
                <TD width="62%"><%=loan%> 两银子</TD>
              </TR>
              <TR>
                <TD align=middle colSpan=2 height=5></TD></TR></TBODY></TABLE></TD></TR>
        <TR align=left>
          <TD></TD></TR></TBODY></TABLE></TD>
    <TD width=1 background=pic/linexu.gif><IMG 
      src="pic/spacer.gif"></TD>
    <TD vAlign=top align=middle width=582><!-- 主要窗口 -->
      <TABLE cellSpacing=0 cellPadding=0 width="97%" border=0>
        <TBODY>
        <TR>
          <TD width="59%"><BR><BR>
            <TABLE cellSpacing=1 cellPadding=3 width=280 align=center 
            bgColor=#006600 border=0>
              <FORM name=form1 action=returnloan1.asp method=post>
              <TBODY>
              	<TR align=middle>
                <TD class=HoverBC colSpan=2 height=22><INPUT type=hidden 
                  value=putbank name=action><FONT size=3>偿 还 贷 款</FONT></TD></TR>
              	<TR class=LinkGrid>
                <TD align=right width="38%">金额：</TD>
                <TD width="62%"><INPUT name=returnloan value=<%=loan%>></TD></TR>
              	<TR class=LinkGrid align=middle>
                <TD colSpan=2><INPUT type=submit value=" 偿还 " name=Submit> <INPUT type=submit value=" 重填 " name=Submit2></TD></TR></TBODY></FORM>
				</TABLE><BR>
            <TABLE cellSpacing=1 cellPadding=3 width=280 align=center 
            bgColor=#000000 border=0>
              <TBODY>
              <TR align=middle bgColor=#9898ba>
                <TD align=middle width=280 bgColor=#9898ba><FONT face=黑体 
                  size=3><FONT face=宋体>论 坛 银 行</FONT></FONT></TD></TR>
              <TR align=middle bgColor=#fafbfc>
                <TD align=middle width=280>总存款： <%=bankmoney%> 两银子</TD></TR>
              <TR align=middle bgColor=#fafbfc>
                <TD align=middle width=280>存款人数：<%=bankac%>人 </TD></TR>
              <TR align=middle bgColor=#fafbfc>
                <TD align=middle width=280>银行日利息： 2% </TD></TR></TBODY></TABLE></TD>
          <TD class=p2 width="41%"><BR>　　欢迎光临，这里是 6 
            号台——偿还贷款，我将为您服务！<BR>　　您的贷款金额为<%=loan%>, 贷款时间为<%=lendtime%>, 及时偿还贷款将增加您的信用度，超过期限偿还将减少您的信用度。<BR>　　你将不会遇到本银行倒闭或无库存资金支持给你！</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=5 width=770 align=center border=0>
  <TBODY>
  <TR bgColor=#000000>
    <TD colSpan=3 height=1></TD></TR>
  <TR class=HoverBC>
    <TD align=right>&nbsp;</TD>
    <TD align=right><IMG height=15 
      src="pic/gotop.gif" width=15 border=0></TD>
  </TR>
  <TR>
    <TD align=middle colSpan=3>&nbsp;</TD>
  </TR></TBODY></TABLE></BODY></HTML>


  <%
  end if
  call endline()
  end if
  %>
   <!--#include file="footer.asp"-->


