<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/publicfun.php");
include_once("conn.php");
include_once("ftbbs_nav.php");
include_once("inc/ftcode.php");
include_once("checkuser.php");
include_once("bbsuser.php");
include_once("pro_city.php");

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);

$getcodeoff=$ftbbsmb[30];
$regoff=$ftbbsmb[17];
$usernamelng=$ftbbsmb[22];
$pswlng=$ftbbsmb[23];
$jmailoff=$ftbbsmb[24];
$defaulthome=$ftbbsmb[31];

$pwdarr=explode("-",$pswlng);
$pswlng1=$pwdarr[0];
$pswlng2=$pwdarr[1];
$username=get_cookie('username');
include_once("homeurl.php");
$sql="select * from {$tablepre}clubuser where clubuser_name='".$username."'";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
//$numrows = mysql_num_rows($rs);
?>
<script language=javascript src="inc/cookies.js"></script>
<script>
var stylecook = getCookie("STYLESHOW");
var style;
var strstyle;
if(stylecook=="")
{
 stylecook=1;
}
else
{
 stylecook++;
}
style="main0"+stylecook+".css";
strstyle="<link href=\"css/"+style+"\"  rel=\"stylesheet\" type=\"text/css\"> ";
document.write(strstyle);
</script>
<script language="javascript">
<!--
	function check(form)
	{
    if (form.oldpwd.value=="")
    	{
    		alert("请填写旧密码！");
    		form.oldpwd.focus();
    		return false;
  	}
    //if (form.password.value.length<<?=$pswlng1?> || form.password.value.length><?=$pswlng2?>)
    //	{
    //		alert("密码长度为:<?=$pswlng?>个字符");
    //		form.password.focus();
    //		return false;
    //}
    if (form.pwdsub.value!=form.password.value)
    	{
    		alert("密码和密码确认不一致！");
    		form.pwdsub.focus();
    		return false;
  	}
    if (form.question.value=="")
    	{
    		alert("请填写忘记密码时的问题！");
    		form.question.focus();
    		return false;
  	}
    if (form.answer.value=="")
    	{
    		alert("请填写问题的答案！");
    		form.answer.focus();
    		return false;
  	}
	if (form.email.value!="")
	{
    if ((form.email.value.indexOf("@")==-1)||(form.email.value.indexOf(".")==-1))
    	{
    		alert("email格式有错！(例如：master@xmwuye.com)");
    		form.email.focus();
    		return false;
  	    }
	}
    if (form.signname.value.toLowerCase().indexOf("[/img]")!=-1||form.signname.value.toLowerCase().indexOf("[/mp]")!=-1||form.signname.value.toLowerCase().indexOf("[/rm]")!=-1||form.signname.value.toLowerCase().indexOf("[/flv]")!=-1)
    	{
    		alert("系统禁止签名档中插入img,rm,mp,flash,flv这些UBB代码");
    		form.signname.focus();
    		return false;
  	}
   return true;
}
//-->
</script>
<META content="text/html; charset=utf-8" http-equiv="Content-Type">
<body topmargin="0">
<?
if (get_cookie('ftbbstype')==1){
include_once("pbhead.php");
}
?> 
<table width="99%" border="0" align="center" class="maintbbg" cellspacing="1" cellpadding="2">
    <tr> 
       <td height="25" class="f12bg" colspan="2">&nbsp;<?=$userinfo?></td>
    </tr>
	<tr class="maintbtr1"> 
      <td height="25" colspan="2"> <div align="left">&nbsp;<a href="<?=$homepage?>">论坛首页</a> 
          >> 修改资料:</div></td>
    </tr>
</table>
<table cellspacing=0 cellpadding=0 width="99%" align=center border=0>
  <tbody>
    <tr> 
      <td height=6></td>
    </tr>
  </tbody>
</table>
<table width="99%" border="0" align="center" class="listborder" cellspacing="1" cellpadding="0">
  <form name="form1" method="post" action="moduseract.php" onsubmit="return check(this)">
    <tr> 
      <td height="27" colspan="2" class="f12bg"> 
        <div align="center">个人资料修改</div></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">用户名：</div></td>
      <td width="77%" class="loopborder1"> <input type="text" name="name" size="15" value="<?=$myrow["clubuser_name"]?>" maxlength="10" class="inputpage" disabled> 
        <font color="#CC0000">*<font color="#000000">用户名不允许修改</font></font></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">旧密码：</div></td>
      <td width="77%" class="loopborder1"> <input name="oldpwd" type="password" id="oldpwd" value="<?=$myrow["clubuser_password"]?>" size="35" maxlength="8" class="inputpage"> 
        <font color="#CC0000">*<font color="#000000"></font></font>请输入原来的密码</td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">新密码：</div></td>
      <td width="77%" class="loopborder1"> <input type="password" name="password" size="35" value="" class="inputpage"> 
        <font color="#CC0000">*(密码长度为<?=$pswlng?>位)</font></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">新密码确认：</div></td>
      <td width="77%" class="loopborder1"> <input type="password" name="pwdsub" size="35" value="" class="inputpage"> 
        <font color="#CC0000">*</font></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">忘记密码时的问题：</div></td>
      <td width="77%" class="loopborder1"> <input type="text" name="question" size="35" value="<?=$myrow["clubuser_question"]?>" class="inputpage"> 
        <font color="#CC0000">*</font></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">问题的答案：</div></td>
      <td width="77%" class="loopborder1"> <input type="text" name="answer" size="35" value="<?=$myrow["clubuser_answer"]?>" class="inputpage"> 
        <font color="#CC0000">*</font></td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">您的性别：</div></td>
      <td width="77%" class="loopborder1"> <input type="radio" name="sex" value="男" <? if ($myrow["clubuser_sex"]=="男"){?> checked <? }?>>
        男 
        <input type="radio" name="sex" value="女" <? if ($myrow["clubuser_sex"]=="女"){?> checked <? }?>>
        女</td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">你的E-mail信箱：</div></td>
      <td width="77%" class="loopborder1"> <input type="text" name="email" size="35" value="<?=$myrow["clubuser_email"]?>" class="inputpage"> 
      </td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">婚姻状况：</div></td>
      <td width="77%" class="loopborder1"> <input type="radio" name="clubuser_marriage" value="YES" <? if ($myrow["clubuser_marriage"]=="YES"){?>checked<? }?>>
        已婚　
        <input type="radio" name="clubuser_marriage" value="NO" <? if ($myrow["clubuser_marriage"]=="NO"){?>checked<? }?>>
        未婚</td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">来 自：</div></td>
      <td width="77%" class="loopborder1"> <select style="width:75" name="province" size="1" id="province" onchange="changecity(document.form1.province.options[document.form1.province.selectedIndex].value)">
          <option value="" selected>请选择省份</option>
          <?
$allprovince="安徽,北京,福建,甘肃,广东,广西,贵州,海南,河北,河南,黑龙江,湖北,湖南,吉林,江苏,江西,辽宁,内蒙古,宁夏,青海,山东,山西,陕西,上海,四川,天津,西藏,新疆,云南,浙江,重庆,台湾,香港,澳门,其他"; 
$everyprovince=explode(",",$allprovince);
for($i=0; $i<count($everyprovince); $i++){ 
?>
          <option value="<?=$everyprovince[$i]?>" <? if ($myrow["clubuser_province"]==$everyprovince[$i]){ ?>selected<? }?>> 
          <?=$everyprovince[$i]?>
          </option>
          <? }?>
        </select> <select name="city" style="width:75px" size="1" id="city">
          <option value="<?=$myrow["clubuser_city"]?>" selected> 
          <?=$myrow["clubuser_city"]?>
          </option>
        </select> </td>
    </tr>
    <tr> 
      <td width="27%" height="27" class="loopborder1"> 
        <div align="right">你的地址：</div></td>
      <td width="77%" class="loopborder1"> <input name="clubuser_address" type="text" id="clubuser_address" value="<?=$myrow["clubuser_address"]?>" size="35" class="inputpage"> 
      </td>
    </tr>
    <tr> 
      <td width="27%" height="11" class="loopborder1"> <div align="right">签名档：(150字以内)</div></td>
      <td width="77%" class="loopborder1"> <textarea name="signname" cols="55" rows="6"><?=$myrow["signname"]?></textarea>
        支持UBB </td>
    </tr>
    <tr> 
      <td width="27%" height="11" class="loopborder1" valign="top"> <div align="right"><br>
          头　像：</div></td>
      <td width="77%" class="loopborder1"> <input type="radio" name="img" value="cache1.gif" <? if ($myrow["userimg"]=="cache1.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache1.gif" width="42" height="42"> <input type="radio" name="img" value="cache2.gif" <? if ($myrow["userimg"]=="cache2.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache2.gif" width="42" height="42"> <input type="radio" name="img" value="cache3.gif" <? if ($myrow["userimg"]=="cache3.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache3.gif" width="42" height="42"> <input type="radio" name="img" value="cache4.gif" <? if ($myrow["userimg"]=="cache4.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache4.gif" width="42" height="42"> <input type="radio" name="img" value="cache5.gif" <? if ($myrow["userimg"]=="cache5.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache5.gif" width="42" height="42"> <input type="radio" name="img" value="cache6.gif" <? if ($myrow["userimg"]=="cache6.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache6.gif" width="42" height="42"> <br> <input type="radio" name="img" value="cache7.gif" <? if ($myrow["userimg"]=="cache7.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache7.gif" width="42" height="42"> <input type="radio" name="img" value="cache8.gif" <? if ($myrow["userimg"]=="cache8.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache8.gif" width="42" height="42"> <input type="radio" name="img" value="cache9.gif" <? if ($myrow["userimg"]=="cache9.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache9.gif" width="42" height="42"> <input type="radio" name="img" value="cache10.gif" <? if ($myrow["userimg"]=="cache10.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache10.gif" width="42" height="42"> <input type="radio" name="img" value="cache11.gif" <? if ($myrow["userimg"]=="cache11.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache11.gif" width="42" height="42"> <input type="radio" name="img" value="cache12.gif" <? if ($myrow["userimg"]=="cache12.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache12.gif" width="42" height="42"><br> <input type="radio" name="img" value="cache13.gif" <? if ($myrow["userimg"]=="cache13.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache13.gif" width="42" height="42"> <input type="radio" name="img" value="cache14.gif" <? if ($myrow["userimg"]=="cache14.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache14.gif" width="42" height="42"> <input type="radio" name="img" value="cache15.gif" <? if ($myrow["userimg"]=="cache15.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache15.gif" width="42" height="42"> <input type="radio" name="img" value="cache16.gif" <? if ($myrow["userimg"]=="cache16.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache16.gif" width="42" height="42"> <input type="radio" name="img" value="cache17.gif" <? if ($myrow["userimg"]=="cache17.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache17.gif" width="42" height="42"> <input type="radio" name="img" value="cache18.gif" <? if ($myrow["userimg"]=="cache18.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache18.gif" width="42" height="42"> <br> <input type="radio" name="img" value="cache19.gif" <? if ($myrow["userimg"]=="cache19.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache19.gif" width="42" height="42"> <input type="radio" name="img" value="cache20.gif" <? if ($myrow["userimg"]=="cache20.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache20.gif" width="42" height="42"> <input type="radio" name="img" value="cache21.gif" <? if ($myrow["userimg"]=="cache21.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache21.gif" width="42" height="42"> <input type="radio" name="img" value="cache22.gif" <? if ($myrow["userimg"]=="cache22.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache22.gif" width="42" height="42"> <input type="radio" name="img" value="cache23.gif" <? if ($myrow["userimg"]=="cache23.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache23.gif" width="42" height="42"> <input type="radio" name="img" value="cache24.gif" <? if ($myrow["userimg"]=="cache24.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache24.gif" width="42" height="42"> <br> <input type="radio" name="img" value="cache25.gif" <? if ($myrow["userimg"]=="cache25.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache25.gif" width="42" height="42"> <input type="radio" name="img" value="cache26.gif" <? if ($myrow["userimg"]=="cache26.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache26.gif" width="42" height="42"> <input type="radio" name="img" value="cache27.gif" <? if ($myrow["userimg"]=="cache27.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache27.gif" width="42" height="42"> <input type="radio" name="img" value="cache28.gif" <? if ($myrow["userimg"]=="cache28.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache28.gif" width="42" height="42"> <input type="radio" name="img" value="cache29.gif" <? if ($myrow["userimg"]=="cache29.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache29.gif" width="42" height="42"> <input type="radio" name="img" value="cache30.gif" <? if ($myrow["userimg"]=="cache30.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache30.gif" width="42" height="42"><br> <input type="radio" name="img" value="cache31.gif" <? if ($myrow["userimg"]=="cache31.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache31.gif" width="42" height="42"> <input type="radio" name="img" value="cache32.gif" <? if ($myrow["userimg"]=="cache32.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache32.gif" width="42" height="42"> <input type="radio" name="img" value="cache33.gif" <? if ($myrow["userimg"]=="cache33.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache33.gif" width="42" height="42"> <input type="radio" name="img" value="cache34.gif" <? if ($myrow["userimg"]=="cache34.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache34.gif" width="42" height="42"> <input type="radio" name="img" value="cache35.gif" <? if ($myrow["userimg"]=="cache35.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache35.gif" width="42" height="42"> <input type="radio" name="img" value="cache36.gif" <? if ($myrow["userimg"]=="cache36.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache36.gif" width="42" height="42"> <br> <input type="radio" name="img" value="cache37.gif" <? if ($myrow["userimg"]=="cache37.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache37.gif" width="42" height="42"> <input type="radio" name="img" value="cache38.gif" <? if ($myrow["userimg"]=="cache38.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache38.gif" width="42" height="42"> <input type="radio" name="img" value="cache39.gif" <? if ($myrow["userimg"]=="cache39.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache39.gif" width="42" height="42"> <input type="radio" name="img" value="cache40.gif" <? if ($myrow["userimg"]=="cache40.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache40.gif" width="42" height="42"> <input type="radio" name="img" value="cache41.gif" <? if ($myrow["userimg"]=="cache41.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache41.gif" width="42" height="42"> <input type="radio" name="img" value="cache42.gif" <? if ($myrow["userimg"]=="cache42.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache42.gif" width="42" height="42"><br> <input type="radio" name="img" value="cache43.gif" <? if ($myrow["userimg"]=="cache43.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache43.gif" width="42" height="42"> <input type="radio" name="img" value="cache44.gif" <? if ($myrow["userimg"]=="cache44.gif"){?>checked<? }?>> 
        <img src="userheadimg/cache44.gif" width="42" height="42"> <a href="userimg.php">自定义头像</a></td>
    </tr>
    <tr> 
      <td height="35" colspan="2" class="maintbtr3"> <div align="center"> 
          <INPUT TYPE="hidden" name="url" value="<?=$_SERVER["HTTP_REFERER"]?>">
          <input type="submit" name="Submit" value="修改">
        </div></td>
    </tr>
  </form>
</table>
<?
$db->close(); 
include_once("inc/bbstail.php");
?>