<!--#include file="conn.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	useflag=3
%>
<!--#include file="flag.asp"-->
<%
	Response.Expires = 0
	Response.Expiresabsolute = Now() - 1
	Response.AddHeader "pragma","no-cache"
	Response.AddHeader "cache-control","private"
	Response.CacheControl = "no-cache"

	Method=Trim(Request.QueryString("Method"))
	if Method="save" then
	
		password=Trim(Request.Form("pwd"))
		zhuangtai=ReplaceBadChar(int(Trim(Request.Form("zhuangtai"))))
		train_name=ReplaceBadChar(Trim(Request.Form("train_name")))
		email=ReplaceBadChar(Trim(Request.Form("email")))
		address=ReplaceBadChar(Trim(Request.Form("address")))
		phone=ReplaceBadChar(Trim(Request.Form("phone")))
		subject_num=ReplaceBadChar(Trim(Request.Form("subject_num")))
		lock1=ReplaceBadChar(int(Trim(Request.Form("lock"))))
		introduction=ReplaceBadChar(Trim(Request.Form("introduction")))
		
		set rs=server.createobject("adodb.recordset")
		sql="select * from train where id="&Trim(Request.Form("AdminID"))
		rs.open sql,conn,2,3
		if password<>"" then rs("pwd")=mistake(password)
		rs("zhuangtai")=zhuangtai
		rs("train_name")=train_name
		rs("email")=email
		rs("address")=address
		rs("phone")=phone
		rs("subject_num")=subject_num
		rs("lock")=lock1
		rs("introduction")=introduction
		rs.update
		rs.close
		set rs=nothing
		response.write"<SCRIPT language=JavaScript>alert('资料更新成功，系统将关闭页面!');"
		response.write"javascript:window.close();</SCRIPT>"
		response.end 
	end if

	set rs=server.createobject("adodb.recordset")
	sql="select * from train where id="&Trim(Request.QueryString("id"))
	rs.open sql,conn,1,1
	if rs.eof then
		response.Write "<div align=center><font size=12 color=red><b>没有该用户，请查询后再重试</b></font></div>"
		response.End
	else
		begintime=rs("begintime")
		endtime=rs("endtime")
		begint=datediff("d",now(),begintime)
		endt=datediff("d",now(),endtime)
		if begint<=0 and endt>=0 then grade="ture"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Include/ModeWindow.css" rel="stylesheet">
<title>用户资料修改</title>
<script language="JavaScript" src="Include/Common.js"></script>
<style>
.cssPWD{
background-color:#EBEBEB;
border-right:solid 1px #BEBEBE;
border-bottom:solid 1px #BEBEBE;
}
.cssWeak{
background-color:#FF4545;
border-right:solid 1px #BB2B2B;
border-bottom:solid 1px #BB2B2B;
}
.cssMedium{
background-color:#FFD35E;
border-right:solid 1px #E9AE10;
border-bottom:solid 1px #E9AE10;
}
.cssStrong{
background-color:#3ABB1C;
border-right:solid 1px #267A12;
border-bottom:solid 1px #267A12;
}
.cssPWT{width:132px;}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form action="?Method=save" name="AdminForm" method="post">
<input name="AdminID" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><FIELDSET align=center><LEGEND align=left>修改资料</LEGEND>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="179" height="25" align="center"><div align="center">用户名</div></td>
<td width="542" height="25"><input name="sname" Readonly value="<%= rs("tname") %>" type="text" id="sname" size="30" class="textbox">
企业用户登陆的用户名称</td>
</tr>
<tr>
<td width="179" height="25" align="center"><div align="center">密　码</div></td>
<td width="542" height="25"><input name="pwd" type="password" id="pwd" size="30" class="textbox">
  不修改请留空白</td>
</tr>
<tr>
<td width="179" height="25" align="center"><div align="center">会员级别</div></td>
<td width="542" height="25"><% If grade="ture" Then Response.Write("高级用户") else Response.Write("初级用户")%></td>
</tr>
<tr>
<td width="179" height="25" align="center"><div align="center">会 员 期</div></td>
<td width="542" height="25">开始时间：<%=rs("begintime")%>
	  到期时间：<%=rs("endtime")%>	  帐户余额：<%=rs("mmoney")%> 元</td>
</tr>
<tr>
<td height="25" align="center">审核状态</td>
<td height="25"><SELECT size="1" name="zhuangtai">
          <OPTION value="1" <%if rs("zhuangtai") =1 then Response.Write "selected"%>>已审核</OPTION>
          <OPTION value="0" <%if rs("zhuangtai") =0 then Response.Write "selected"%>>未审核</OPTION>
      </SELECT> 
      <font color="#ff0033">说明：验证后才可以发布培训课程信息</font></td>
</tr>
<tr>
<td height="25" align="center">机构名称</td>
<td height="25"><input type="text" name="train_name" size="30" value="<%=rs("train_name")%>" class="textbox"></td>
</tr>
<tr>
<td height="25" align="center">电子邮件</td>
<td height="25"><input name="email" type="text" class="textbox" value="<%= rs("email") %>" id="email" size="30"></td>
</tr>
<tr>
<td height="25" align="center">地　　址</td>
<td height="25"><input name="address" type="text" class="textbox" value="<%= rs("address") %>" id="address" size="30"></td>
</tr>
<tr>
<td height="25" align="center">电　　话</td>
<td height="25"><input name="phone" type="text" class="textbox" value="<%= rs("phone") %>" id="phone" size="30"></td>
</tr>
<tr>
<td height="25" align="center">课程数目</td>
<td height="25"><input name="subject_num" type="text" class="textbox" value="<%= rs("subject_num") %>" id="phone" size="10">
<font color="#FF0000">培训机构可发布的培训课程数量</font></td>
</tr>
<tr>
<td height="25" align="center">状　　态</td>
<td height="25">
  <input name="lock" type="radio" value="1" <% if rs("lock")=1 then Response.Write("checked")%>>
锁定
  <input type="radio" name="lock" value="0" <% if rs("lock")=0 then Response.Write("checked")%>>
正常
<font color="#FF0000">锁定的用户不能登录后台管理</font></td>
</tr>
<tr>
<td height="25" align="center">上次登陆IP</td>
<td height="25"><%=rs("ip")%></td>
</tr>
<tr>
<td height="25" align="center">上次登陆时间</td>
<td height="25"><% if rs("lastime")&"a" then Response.Write("未登陆") else Response.Write(rs("lastime"))%></td>
</tr>
<tr>
<td height="25" align="center"><div align="center">机构简介</div></td>
<td height="25"><textarea class='textbox' name="introduction" rows="7" id="introduction" style="width:80%;border-style: solid; border-width: 1"><%= rs("introduction") %></textarea></td>
</tr>
</table>
</FIELDSET>
</td>
</tr>
</table>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" align="center"><input type="submit" class='textbox' name="Submit" value=" 确 定 ">
<input type="button" class='textbox' name="Submit" onClick="window.close()" value=" 取 消 "></td>
</tr>
</table>
</form>
</body>
</html>
<%
	End If
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>