<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p20")
'''''''''''''''''''''''''''''''''''''''''''''''
dim id
id=Clng(request.QueryString("id"))
%>
<html>
<head>
<title>会员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	font-size:12px;
}
.td_row{ padding:2px 5px; line-height:20px;}
form{margin:0;}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function CheckForm(obj){
	if(obj.UserId.value==""){
		alert("登录帐号不能为空！");
		obj.UserId.focus();
		obj.UserId.select();
		return false;
	}
	if(obj.UserName.value==""){
		alert("请输入中介名称！");
		obj.UserName.focus();
		obj.UserName.select();
		return false;
	}
	if(obj.PassWord.value==""){
		alert("请输入密码！");
		obj.PassWord.focus();
		obj.PassWord.select();
		return false;
	}	
	if(obj.Email.value==""){
		alert("请输入邮箱！");
		obj.Email.focus();
		obj.Email.select();
		return false;
	}
}
</script>
<script language="JavaScript" src="../js/PublicJS.js"></script>
<style type="text/css">
<!--
.style2 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top">
	<%
dim act
act=request.querystring("act")
if(act="do") then
	call mod_personalinfook()
	response.write("<div align=""center"">成功修改中介信息</p>")
	response.write("<p align=""center""><a href=""javascript:history.go(-2);"">返回</a></p>")
else
	call mod_personalinfo()
end if
%>    </td>
  </tr>
</table>
<%
sub mod_personalinfook
	dim rs,UserId,UserName,PassWord,RePassWord,Area,Email,Tel,Fax,QQ,Address,Content,CheckCode,Photo
	UserId=request.form("UserId")
	UserName=request.Form("UserName")
	PassWord=trim(request.Form("PassWord"))
	RePassWord=trim(request.Form("RePassWord"))
	Area=request.Form("Area")
	Email=request.Form("Email")
	Tel=request.Form("Tel")
	Fax=request.Form("Fax")
	QQ=request.form("QQ")
	Address=request.form("Address")
	Content=request.form("content1")
	Photo=request.Form("Photo")
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_agent where id="&id,conn,3,3
	if not rs.eof then
		rs("UserId")=UserId
		rs("UserName")=UserName
		rs("UserPass")=PassWord
		rs("Area")=Area
		rs("Email")=Email
		rs("Tel")=Tel
		rs("Fax")=Fax
		rs("QQ")=QQ
		rs("Address")=Address
		rs("Content")=Content
		rs("Photo")=Photo
		rs.update
	end if
	rs.close
	set rs=nothing
end sub
sub mod_personalinfo
	dim rs,userinfo,sql
	sql="select * from t_agent where id="&id
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,3,1
	if not rs.eof then		
%>
<form id="PostForm" name="PostForm" method="post" action="?act=do&id=<%=id%>" onSubmit="return CheckForm(this)">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#f5f5f5" class="border">
  <tr>
    <td height="28" colspan="2" bgcolor="#FF6600" class="th_title"><div align="center" class="style2">中介信息</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">门面图：</div></td>
    <td bgcolor="#FFFFFF" class="pformleft"><input name="Photo" type="text" id="Photo" size="30" value="<%=rs("Photo")%>">
      <input type="button" name="Button" value="上传->" onClick="javascript:document.PostForm.Photo.value=window.showModalDialog('upimg.htm','','dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')"></td>
  </tr>
  <tr>
      <td width="25%" bgcolor="#FFFFFF" class="pad_5"><div align="right">登录帐号：</div></td>
      <td width="75%" bgcolor="#FFFFFF" class="pformleft"><input name="UserId" id="UserId" value="<%=rs("UserId")%>" size="30" maxlength="20" />        
        <span id="userMsg"></span></td>
    </tr>    
    <tr>
      <td bgcolor="#FFFFFF" class="pad_5"><div align="right">中介名称：</div></td>
    <td bgcolor="#FFFFFF" class="pformleft"><input name="UserName" id="UserName" value="<%=rs("UserName")%>" size="30" maxlength="50" /></td>
    </tr>   
    <tr>
      <td width="25%" bgcolor="#FFFFFF" class="pad_5"><div align="right">帐号密码：</div></td>
      <td width="75%" bgcolor="#FFFFFF" class="pformleft"><input name="PassWord" type="text" id="PassWord" value="<%=rs("UserPass")%>" size="24" maxlength="30" /></td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF" class="pad_5"><div align="right">所在地区：</div></td>
      <td bgcolor="#FFFFFF" class="pformleft"><input name="Area" type="text" id="Area" value="<%=rs("Area")%>"></td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF" class="pad_5"><div align="right">Email地址：</div></td>
      <td bgcolor="#FFFFFF" class="pformleft"><input name="Email" id="Email" value="<%=rs("Email")%>" size="30" maxlength="50" /></td>
    </tr>
	  <tr>
	    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">联系电话：</div></td>
	    <td bgcolor="#FFFFFF" class="pformleft"><input name="Tel" id="Tel" value="<%=rs("Tel")%>" size="30" maxlength="50" /></td>
    </tr>
	  <tr>
	    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">传真：</div></td>
	    <td bgcolor="#FFFFFF" class="pformleft"><input name="Fax" id="Fax" value="<%=rs("Fax")%>" size="30" maxlength="50" /></td>
    </tr>
	  <tr>
	    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">QQ：</div></td>
	    <td bgcolor="#FFFFFF" class="pformleft"><input name="QQ" id="QQ" value="<%=rs("QQ")%>" size="30" maxlength="50" /></td>
    </tr>
	  <tr>
	    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">地址：</div></td>
	    <td bgcolor="#FFFFFF" class="pformleft"><input name="Address" id="Address" value="<%=rs("Address")%>" size="30" maxlength="50" /></td>
    </tr>
	  <tr>
	    <td bgcolor="#FFFFFF" class="pad_5"><div align="right">详细介绍：</div></td>
	    <td bgcolor="#FFFFFF" class="pformleft">
      <textarea name="content1" style="display:none; "><%=rs("Content")%></textarea>
	    <IFRAME ID="eWebEditor1" src="webedit/editor.html" frameborder="0" scrolling="no" width="98%" height="350"></IFRAME>      </td>
    </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="td_row">&nbsp;</td>
    <td bgcolor="#FFFFFF" class="td_row"><input type="submit" name="Submit" value="确 定" />
      <input type="reset" name="Submit2" value="取 消" /></td>
  </tr>
</table>
</form>
<%
	end if
	rs.close
	set rs=nothing
end sub
%>
</body>
</html>
<%
call connclose()
%>