<?
include_once("../inc/config.php");
include_once("../inc/publicfun.php");
include_once("../inc/ftbbsdbclass.php");
include_once("../inc/ftcode.php");
include_once("../conn.php");
include_once("../admin/check_master.php");

$getid=$_GET["id"];
if ($_POST["act"]=="y"){
   mysql_query("update {$tablepre}ftbbs_bmtb set username='".$_POST["username"]."',tel='".$_POST["tel"]."',age='".$_POST["age"]."',sex='".$_POST["sex"]."',job='".$_POST["job"]."',edu='".$_POST["edu"]."',address='".$_POST["address"]."',note='".htmlspecialchars($_POST["note"])."' where  id=".$_POST["id"]);
   header("Location:".$_POST["reurl"]);
}
$sql="select * from {$tablepre}ftbbs_bmtb where id=".$getid;
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/xmwuye.css">
<body leftmargin="0" topmargin="5">
<table width="98%" border="0" align="center">
  <form action="" method="post" name="form1" id="form1">
    <tr> 
      <td height="30" colspan="3" align="center" bgcolor="f3f3f3"> <strong>修改信息</strong></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td width="24%" height="25" align="right">姓名： </td>
      <td width="24%"> 
        <input name='username' type=text id="username" value="<?=$myrow["username"]?>" size='16' maxlength="50"></td>
      <td width="52%">电话： 
        <input name='tel' type=text id="tel" value="<?=$myrow["tel"]?>" size='15' maxlength="20"> 
      </td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td height="25" align="right">年龄：</td>
      <td> 
        <input name='age' type=text id="Age" value="<?=$myrow["age"]?>" size='16' maxlength="20"  min="1" max="100"> 
      </td>
      <td>性别： 
        <select name="sex" id="sex" style="width:96">
          <option value="男" <? if ($myrow["sex"]=="男"){?>selected <? }?>>男</option>
          <option value="女" <? if ($myrow["sex"]=="女"){?>selected <? }?>>女</option>
        </select>
	  </td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td height="25" align="right">职业：</td>
      <td> 
        <input name='Job' type=text id="Job" value="<?=$myrow["job"]?>" size='16' maxlength="20" /></td>
      <td>学历： 
        <select name="edu" id="edu" style="width:96">
          <option value="博士以上" <? if ($myrow["edu"]=="博士以上"){?>selected <? }?>>博士以上</option>
          <option value="博士" <? if ($myrow["edu"]=="博士"){?>selected <? }?>>博士</option>
          <option value="研究生" <? if ($myrow["edu"]=="研究生"){?>selected <? }?>>研究生</option>
          <option value="本科" <? if ($myrow["edu"]=="本科"){?>selected <? }?>>本科</option>
          <option value="大专" <? if ($myrow["edu"]=="大专"){?>selected <? }?>>大专</option>
          <option value="大专以下" <? if ($myrow["edu"]=="大专以下"){?>selected <? }?>>大专以下</option>
        </select></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td width="24%" height="25" align="right">来自： </td>
      <td width="24%"> 
        <input name='address' type=text id="address" value="<?=$myrow["address"]?>" size='16' maxlength="50"></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td align="right">爱好特长:<br>
        意见建议:</td>
      <td colspan="2"> 
        <textarea name="note" cols="57" rows="10" id="note"><?=htmltocode($myrow["note"])?></textarea></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td height="35"></td>
      <td colspan="2"> 
        <input type=submit value='提 交' name='bm'>
        <input name="act" type="hidden" id="act" value="y">
        <input name="id" type="hidden" id="id" value="<?=$id?>">
		<input name="reurl" type="hidden" id="reurl" value="<?=$_SERVER["HTTP_REFERER"]?>">
		</td>
    </tr>
</form>
</table>
</body>
</html>
