<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file=inc/char.asp-->
<!--#include file=inc/grade.asp-->
<!--#include file=chkuser.asp-->
<!--#include file=md5.asp-->
<!--#include file="inc/theme.asp"-->
<%dim mymoney,sql1,Rs1,bankmoney,bankac,deposittime,lendtime,numtime,deposit,interest,bankinterest,numtime1,loan,loaninterest,sqlstr,endtime,msg
Tabletitlecolor="#9898ba"%>
<title><%=ForumName%>--管理页面</title>
<link rel="stylesheet" type="text/css" href="forum.css">

<BODY <%=ForumBody%>>
<%stats="银行管理"
	if not master then
		Errmsg=Errmsg+"<br>"+"<li>本页面为银行行长专用，请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
		call Error()
	else
	call nav()
	call headline(1)
		call main()
		set rs=nothing
		conn.close
		set conn=nothing
	end if

	sub main()
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebackcolor%> align=center>
  <tr>
    <td>
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr bgcolor='<%=Tabletitlecolor%>'>
        <td><font color="<%=TablefontColor%>">欢迎<b><%=membername%></b>进入管理页面   </font>
		<a href=admin_bank.asp>返回</a>
        </td>
        </tr>
            <tr bgcolor=<%=tablebodycolor%>>
              <td width="100%" valign=top><font color="<%=TableContentColor%>">
<%
if request("action")="save" then
call update()
else
call userinfo()
end if
%></font>
	      </td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<%
end sub

sub userinfo()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from [bank] where username='"&trim(request("name"))&"'"
	rs.open sql,conn,1,1
	if trim(request("name")) <> "银行" then
	set rs1=server.createobject("adodb.recordset")
	sql1="Select * from [User] where username='"&trim(request("name"))&"'"
	rs1.open sql1,conn,1,1
	end if
	if rs.eof and rs.bof then
		errmsg=errmsg+"<br>"+"<li>该帐户名不存在。"
		call error()
		exit sub
	else
%>
<form method="POST" action=admin_bankac.asp?action=save>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center bordercolor=<%=aTablebackcolor%>>
<tr bgcolor=<%=aTabletitlecolor%>> 
<td height="11" colspan="2" ><font color="<%=TableContentColor%>"><b><%=htmlencode(rs("username"))%>的个人资料</b></font></td>
</tr>

<%
if trim(request("name")) <> "银行" then
%>
<tr> 
<td width="41%" height="9"><font color="<%=TableContentColor%>">帐户名</font></td>
<td width="59%" height="9"><%=rs1("username")%>
<input type="hidden" name="name" size="35" value="<%=rs1("username")%>">
</td>
</tr>
<tr> 
<td width="41%" height="9"><font color="<%=TableContentColor%>">信用度</font></td>
<td width="59%" height="9">
<input type="text" name="userCP" size="35" value="<%=rs1("userCP")%>">
</td>
</tr>

<tr> 
<td width="41%" height="18"><font color="<%=TableContentColor%>">冻结帐户</font></td>
<td width="59%" height="18"> 
<select name="lockac">
<option value="0" <%if rs("lockac")=0 then%>selected<%end if%>>否 
<option value="1" <%if rs("lockac")=1 then%>selected<%end if%>>是 
</select>
</td>
</tr>

<tr bgcolor=<%=aTabletitlecolor%>> 
<td height="23" colspan="2" > 
<input type="submit" name="Submit" value="操 作">
</td>
</tr><%end if%>
</table>
</form>
<%
	end if
	rs.close
	set rs=nothing
end sub

sub update()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from [bank] where username='"&trim(request("name"))&"'"
	rs.open sql,conn,1,3
	if trim(request("name")) <> "银行" then
	set rs1=server.createobject("adodb.recordset")
	sql1="Select * from [User] where username='"&trim(request("name"))&"'"
	rs1.open sql1,conn,1,3
	end if
	if rs.eof and rs.bof then
		errmsg=errmsg+"<br>"+"<li>该帐户名不存在。"
		call error()
		exit sub
	else 
		rs("lockac")=request.form("lockac")
		rs1("userCP")=request.form("userCP")
		rs.update
		rs1.update
        rs.close
		rs1.close
	end if
	set rs=nothing
%><center><p><b>帐户操作成功！</b>
<%
end sub
%>