<!--#include file=conn.asp --><!--#include file="char.inc"--><!--#include file=../include/config.asp --><!--#include file="chkuser.asp" -->

<%
IF request.cookies("KEY")="" THEN
response.redirect "index_face.asp"
response.end
else
usernamecookie=CheckStr(request.cookies("UserName"))
passwdcookie=replace(trim(Request.cookies("passwd")),"'","''")
KEYcookie=replace(trim(request.cookies("KEY")),"'","''")
if usernamecookie="" or passwdcookie="" then
response.redirect "login.asp"
response.end
else
'判断用户的合法性
  set rs=server.createobject("adodb.recordset")
  sql="select * from admin where username='"&usernamecookie&"'"
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
             response.redirect "login.asp"
            response.end
         end if
  IF passwdcookie<>rs("passwd") THEN
          response.redirect "login.asp"
           response.end
      END IF
   '下面判断用户级别实际在有用户级别是都应该判断
   if KEYcookie<>rs("OSKEY") then
      response.redirect "index_face.asp"
      response.end
    end if
           rs.close
           set rs=nothing
END IF
END IF
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
<title><%=copyright%><%=version%> <%=ver%> - 个人资料修改</title>
<script LANGUAGE="javascript">
<!--
function FrmAddLink_onsubmit() {
 if (document.FrmAddLink.passwd.value=="")
	{
	  alert("对不起，请您输入密码！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length < 4)
	{
	  alert("为了安全，您的密码应该长一点！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length > 16)
	{
	  alert("您的密码太长了吧！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value==document.FrmAddLink.passwd.value)
	{
	  alert("为了安全，用户名与密码不应该相同！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value=="")
	{
	  alert("对不起，请您输入验证密码！")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value !== document.FrmAddLink.passwd.value)
	{
	  alert("对不起，您两次输入的密码不一致！")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value=="")
	{
	  alert("对不起，请您输入提示问题！")
	  document.FrmAddLink.question.focus()
	  return false
	 }
else if (document.FrmAddLink.answer.value=="")
	{
	  alert("对不起，请您输入问题答案！")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value==document.FrmAddLink.answer.value)
	{
	  alert("为了安全，提示问题与问题答案不应该相同！")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.fullname.value=="")
	{
	  alert("对不起，请输入您的真实姓名！")
	  document.FrmAddLink.fullname.focus()
	  return false
	 }
else if (document.FrmAddLink.depid.value=="")
	{
	  alert("对不起，请输入您的工作单位！")
	  document.FrmAddLink.depid.focus()
	  return false
	 }
else if (document.FrmAddLink.sex.value=="")
	{
	  alert("对不起，请输入您的性别！")
	  document.FrmAddLink.sex.focus()
	  return false
	 }
else if (document.FrmAddLink.tel.value=="")
	{
	  alert("对不起，请输入您的联系电话！")
	  document.FrmAddLink.tel.focus()
	  return false
	 }
else if (document.FrmAddLink.email.value=="")
	{
	  alert("对不起，请输入您的电子邮件！")
	  document.FrmAddLink.email.focus()
	  return false
	 }
else if (document.FrmAddLink.email.value.indexOf("@",0)== -1||document.FrmAddLink.email.value.indexOf(".",0)==-1)
	  {
	  alert("对不起，您输入的电子邮件有误！")
	  document.FrmAddLink.email.focus()
	  return false
	 }
}

//-->
</script>
</head>
<body topmargin="0">
<%dim logins
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&usernamecookie&"'"
rs.open sql,conn,1,3
logins=rs("logins")
rs.close
set rs=nothing
if logins>1 then
%>
<!--#include file=top.asp--><%end if%><br>
<table border="1" width="750" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="<%=border%>" align=center>
   <%
dim sql
dim rs
 sql="select * from admin where username='"&usernamecookie&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
         
%> 
<form method="POST" name="FrmAddLink" LANGUAGE="javascript"
    onsubmit="return FrmAddLink_onsubmit()"  action="save.asp?username=<%=request.cookies("username")%>">

  <tr>
    <td width="100%" colspan="2" bgcolor="<%=m_top%>" height=20>
    <p align="center"><%if logins=1 then%><font color=red>这是您首次使用本系统，为了安全，请立即修改您的个人资料后再执行管理操作。</font><br><%end if%><%=request.cookies("fullname")%>修改资料</td>
  </tr>
  <tr>
    <td width="46%">
    <p align="right">用 户 名：</td>
    <td width="54%"><input name="username" size="30" value="<%=rs("username")%>" readonly class="smallInput" maxlength="30" style="font-family: 宋体; font-size: 9pt">
</td>
  </tr>
  <tr>
    <td width="46%">
    <p align="right">密    码：</td>
    <td width="54%"><input name="passwd" type="password" size="30" value="<%=rs("passwd")%>" class="smallInput" maxlength="50" style="font-family: 宋体; font-size: 9pt" <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>readonly<%end if%>><%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>该用户不允许修改密码<%end if%>
</td>
  </tr>
  <tr>
    <td width="46%">
    <p align="right">验证密码：</td>
    <td width="54%"><input name="passwd2" type="password" size="30" value="<%=rs("passwd")%>" class="smallInput" maxlength="50" style="font-family: 宋体; font-size: 9pt" <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>readonly<%end if%>><%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>该用户不允许修改密码<%end if%>
</td>
  </tr>
<tr>
    <td width="46%">
    <p align="right">提示问题：</td>
    <td width="54%"><input name="question" type="text" size="30" value="<%=rs("question")%>" class="smallInput"  style="font-family: 宋体; font-size: 9pt">
</td>
  </tr>
<tr>
    <td width="46%">
    <p align="right">问题答案：</td>
    <td width="54%"><input name="answer" type="text" size="30" value="<%=rs("answer")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
</td>
  </tr>
<tr>
    <td width="46%">
    <p align="right">真实姓名：</td>
    <td width="54%"><input name="fullname" type="text" size="30" value="<%=rs("fullname")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
</td>
  </tr>
  <tr>
          <td width="46%"> 
            <p align="right">工作单位：</td>
          <td width="54%"> <% 
                  set rstype=createobject("adodb.recordset")
                  sql="select * from dep order by id"
                  rstype.Open sql,conn,1,3
                  %>
<select name="depid" style="font-family: 宋体; font-size: 9pt">
<option value="">请选择工作单位</option>
                  <%do while not rstype.EOF%>
                  <option value="<%=rstype("id")%>" <%if rs("depid")=cint(rstype("id")) then%> selected <%end if%>><%=rstype("depname")%></option>
                  <%
                  rstype.MoveNext
                  loop
                  set rstype=nothing
                  %>
                  </select></td>
            </tr>
  <tr>
          <td width="46%"> 
            <p align="right">性    别：</td>
          <td width="54%"> 
            <select size="1" name="sex" style="font-family: 宋体; font-size: 9pt" >
            <option <%if rs("sex")="先生" then%>selected<%end if%> value="先生">先生</option>
            <option <%if rs("sex")="女士" then%>selected<%end if%> value="女士">女士</option>
            <option <%if rs("sex")="保密" then%>selected<%end if%> value="保密">保密</option>
            </select></td>
            </tr>
  <tr>
              <td width="46%"> 
               <p align="right">生    日：</td>
              <td width="54%" > 
                <div align="left"> 
                <select size="1" name="birthyear" style="font-family: 宋体; font-size: 9pt">
                <%for i=1950 to 2000%>
                <option <%if rs("birthyear")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option><%next%></select>年<select size="1" name="birthmonth" style="font-family: 宋体; font-size: 9pt">
                <%for i=1 to 12%>
                <option <%if rs("birthmonth")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option><%next%>
                </select>月<select size="1" name="birthday" style="font-family: 宋体; font-size: 9pt"><%for i=1 to 31%>
                <option <%if rs("birthday")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option><%next%></select>日</div>
              </td>
            </tr>
  <tr>
              <td width="46%"> 
                <p align="right">联系电话：</td>
              <td width="54%" valign="middle"> 
                <input name="tel" size="30" class="smallInput" value="<%=rs("tel")%>" maxlength="100" style="font-family: 宋体; font-size: 9pt" ></td>
            </tr>
<tr>
    <td width="46%">
    <p align="right">电子邮件：</td>
    <td width="54%"><input name="email" type="text" size="30" value="<%=rs("email")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
</td>
  </tr>
<tr>
    <td width="46%">
    <p align="right">个人照片：</td>
    <td width="54%"><iframe name="ad" frameborder=0 width=100% height=20 scrolling=no src=uploadface.asp></iframe><input name="photo" type="text" size="30" value="<%=rs("photo")%>" class="smallInput" style="font-family: 宋体; font-size: 9pt" title="个人照片。您可以上传自己的照片，也可以直接填写您的网上照片的地址。">
</td>
  </tr>
<tr>
    <td width="46%">
    <p align="right">自我介绍：</td>
    <td width="54%"><\\textarea\\ rows="5" name="content" cols="30" style="font-family: 宋体; font-size: 9pt"><%=rs("content")%></\\textarea\\>
    </td>
  </tr>

  <tr>
    <td width="100%" colspan="2">
    <p align="center"><input type="submit" value="修 改"
  name="cmdok" class="buttonface" style="font-family: 宋体; font-size: 9pt;">  
        <input type="reset" value="复 原"
  name="cmdcancel" class="buttonface" style="font-family: 宋体; font-size: 9pt;">  
        <input type="reset" value="返 回" onclick="javascript:history.go(-1)" class="buttonface" style="font-family: 宋体; font-size: 9pt;">

</td>
  </tr>
<tr>
    <td width="100%" colspan="2" align=center></td>
  </tr>
</table>
</form>
</body>

</html><% 
rs.close 
%>