<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="../inc/msgbox.asp" -->
<%
userID= session("user_id")
if userID="" then
msgbox "您还没有登陆，系统自动返回首页","../"
response.end
end if
exec="select * from user where userID='"&userID&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="expires" content="0">
<Meta http-equiv="Pragma" Content="No-cach">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<script language=javascript>
<!--
function changeimg()
{
	var options_string = "";

	var the_select = window.document.userjoin.imgids;

	for (loop=0; loop < the_select.options.length; loop++)
	{
		if (the_select.options[loop].selected == true)

		{
			 options_string += the_select.options[loop].text + " ";
		}
	}
document.userjoin.imgs.src="face/" + options_string;
document.userjoin.face.value=(document.userjoin.imgs.src);
}
function formtest()

{
var formname=document.userjoin
if (formname.userID.value=="")
{
 formname.userID.focus();
 formname.userID.select();
alert ("请输入用户名称");
return false;
}
else if (formname.username.value=="")
{
 formname.username.focus();
 formname.username.select();
alert ("请输入您的昵称");
return false;
}
else if (formname.password.value=="")
{
 formname.password.focus();
 formname.password.select();
alert ("请输入您初始密码");
return false;
}
if (formname.password2.value=="")
{
 formname.password2.focus();
 formname.password2.select();
alert ("请确认您的密码");
return false;
}
else if (formname.password2.value!=formname.password.value)
{
 formname.password2.focus();
 formname.password2.select();
alert ("两次输入的密码不一样");
return false;
}
var emailString = document.userjoin.email.value;
var isValid = 1;
if (emailString.indexOf("@") == -1) {isValid = 0;}
if (emailString.indexOf(".") == -1) {isValid = 0;}
if (emailString.length < 7) {isValid = 0;}
if (emailString=="@"||emailString=="") {isValid = 1;}
if (isValid == 0) {
 formname.email.focus();
 formname.email.select();
alert ("邮件地址格式不正确");
return false;}
if (formname.address.value=="")
{
 formname.address.focus();
 formname.address.select();
alert ("请输入您的所在地");
return false;
}
if (formname.psqs.value=="")
{
 formname.psqs.focus();
 formname.psqs.select();
alert ("请输入密码提示问题");
return false;
}
if (formname.psas.value=="")
{
 formname.psas.focus();
 formname.psas.select();
alert ("请输入密码提示答案");
return false;
}
if (formname.zjNumber.value=="")
{
	var zjtype_string = "";

	var zjtype_select = window.document.userjoin.zjtype;

	for (loop=0; loop < zjtype_select.options.length; loop++)
	{
		if (zjtype_select.options[loop].selected == true)

		{
			 zjtype_string += zjtype_select.options[loop].text;
		}
	}
 formname.zjNumber.focus();
 formname.zjNumber.select();
alert ("请输入您的" + zjtype_string + "号码");
return false;
}
}
//-->
</script>

<form name="userjoin" method="post" action="upuser.asp" onSubmit="return formtest()">
  <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="610">
    <tr> 
      <td colspan="3" height="43" align="center"  background="user/imgages/form.gif">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="3" height="26" align="left">请如实填写下面资料，带红色标志的为必填项目。</td>
    </tr>
    <tr> 
      <td height="49" width="18%">肖像：</td>
      <td height="49" width="32%"> 
        <select name="imgids" onChange="changeimg()">
          <option selected>001.gif</option>
          <%
dim img
img=2
do until img=21
if img=cint(mid(rs("face"),len(rs("face"))-6,3)) then
selects=" selected"
else
selects=""
end if
if img<10 then
response.write "<option"+selects+">00"& img &".gif</option>"
else
response.write "<option"+selects+">0"& img &".gif</option>"
end if
img=img+1
loop
%>
        </select>
        <input type="hidden" name="face" value="<%=rs("face")%>">
      </td>
      <td height="49" width="50%">请选择您的肖像</td>
    </tr>
    <tr> 
      <td width="18%" height="102">肖像预览：</td>
      <td width="32%" height="102"><img src="<%=rs("face")%>" name="imgs" width="82" height="90"></td>
      <td width="50%" height="102">&nbsp;</td>
    </tr>
    <tr> 
      <td width="18%">昵称：</td>
      <td width="32%"> 
        <input type="text" name="username" value="<%=rs("username")%>">
      </td>
      <td width="50%"> <font color="#FF0000">*</font>请您如实填写，此为管理员验证唯一之处</td>
    </tr>
    <tr> 
      <td width="18%">登陆密码：</td>
      <td width="32%"> 
        <input type="password" name="password" disabled value="<%=rs("password")%>">
      </td>
      <td width="50%"> <font color="#FF0000">*</font>请输入您的登陆密码</td>
    </tr>
    <tr> 
      <td width="18%">确认密码：</td>
      <td width="32%"> 
        <input type="password" name="password2" disabled value="<%=rs("password")%>">
      </td>
      <td width="50%"> <font color="#FF0000">*</font>请重新输入您的密码以便确认是对的</td>
    </tr>
    <tr> 
      <td height="28" width="18%">E_MAIL：</td>
      <td height="28" width="32%"> 
        <input type="text" name="email" value="<%=rs("email")%>">
      </td>
      <td height="28" width="50%"> 请输入您的电子邮箱地址</td>
    </tr>
    <tr> 
      <td height="22" width="18%">个人主页：</td>
      <td height="22" width="32%"> 
        <input type="text" name="homeurl" value="<%=rs("homeurl")%>">
      </td>
      <td height="22" width="50%">没有个人主页可以不填</td>
    </tr>
    <tr> 
      <td height="25" width="18%">来自何方：</td>
      <td height="25" width="32%"> 
        <input type="text" name="address" value="<%=rs("address")%>">
      </td>
      <td height="25" width="50%"> <font color="#FF0000">*</font> 目前所在的地方</td>
    </tr>
    <tr> 
      <td height="24" width="18%">联系电话：</td>
      <td height="24" width="32%"> 
        <input type="text" name="tel" value="<%=rs("tel")%>">
      </td>
      <td height="24" width="50%">（如：07315581118或者0731-5581118）</td>
    </tr>
    <tr> 
      <td height="23" width="18%">QQ号码：</td>
      <td height="23" width="32%"> 
        <input type="text" name="QQ" value="<%=rs("qq")%>">
      </td>
      <td height="23" width="50%">没有可以不填写</td>
    </tr>
    <tr> 
      <td height="23" width="18%">证件类型：</td>
      <td height="23" width="32%"> 
        <select name="zjtype">
          <option>学生证</option>
          <option selected>身份证</option>
          <option>护照</option>
        </select>
      </td>
      <td height="23" width="50%"><font color="#FF0000">*</font> 请输入您的证件类型</td>
    </tr>
    <tr> 
      <td height="23" width="18%">证件号码：</td>
      <td height="23" width="32%"> 
        <input type="text" name="zjNumber" maxlength="18" value="<%=rs("zjnumber")%>">
      </td>
      <td height="23" width="50%"> <font color="#FF0000">*</font> 请输入您的证件号码</td>
    </tr>
    <tr> 
      <td height="80" width="18%" valign="top"><br>
        个人签名：</td>
      <td height="80" width="32%"> 
        <textarea name="messages" rows="5" cols="25"><%=rs("messages")%></textarea>
      </td>
      <td height="80" width="50%" valign="top"><br>
        个人签名在留言以后可以看到。</td>
    </tr>
    <tr> 
      <td height="24" valign="middle" align="center" colspan="3">&nbsp;</td>
    </tr>
    <tr> 
      <td height="33" valign="middle" align="center" colspan="3" background="images/bg001.gif"> 
        <input type="submit" name="Submit" value="修改">
        <input type="button" name="Submit2" value="重输">
        <input type="button" name="Submit2" value="取消" onClick="window.location.href='../'">
      </td>
    </tr>
  </table>
</form>
</body>
</html>
