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

$id=trim($_POST["id"]);
$xiao=trim($_POST["xiao"]);
$da=trim($_POST["da"]);
$nick=trim($_POST["nick"]);
$classx=trim($_POST["classx"]);

if ($nick!="" && $da!="" && $xiao!="" && $classx!=""){
   if ($add!="ok"){
   $sql="update {$tablepre}ftbbs_touxian set xiao=".$xiao.",da=".$da.",nick='".$nick."',classx='".$classx."' where id=".$id;
   mysql_query($sql);
   }
   else{
   $sql="insert into {$tablepre}ftbbs_touxian (xiao,da,nick,classx) values('$xiao','$da','$nick','$classx')";
   mysql_query($sql);
   }
}

$str="select * from {$tablepre}ftbbs_touxian order by id asc";
$rs=mysql_query($str);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
?>
<html>
<head>
<title>级别管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link href="../css/main01.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="99%" border="0" bgcolor="#f1f1f1" cellspacing="1" cellpadding="0" align="center">
  <tr bgcolor="#f3f3f3" align="center" class="f12"> 
    <td height="25" colspan="2" bgcolor="#f3f3f3"><strong>头衔管理</strong></td>
  </tr>
  <tr bgcolor="#FFFFFF" align="center" class="f12"> 
    <td height="25">序号</td>
    <td width="96%" height="25"> <div align="left">经验值（以下所填经验值必须符合<a href="../help.php">算法规则</a>规则才行）</div></td>
  </tr>
<?
if ($numrows!=0){
$i=1;
do {		  
?>
  <tr bgcolor="#FFFFFF" align="center" class="f12"> 
    <form name="form1" method="post" action="">
      <td width="4%" height="25"><?=$i?></td>
      <td align="left"> 经验值在 
        <input name="xiao" type="text" id="xiao" value="<?=$myrow["xiao"]?>" size="10">
        到 
        <input name="da" type="text" id="da" value="<?=$myrow["da"]?>" size="10">
        范围内头衔为 
        <input name="nick" type="text" id="nick" value="<?=$myrow["nick"]?>" size="12">
        级别图标
        <input name="classx" type="text" id="classx" value="<?=$myrow["classx"]?>" size="22"> 
        <input type="submit" name="Submit" value="修改" <? if (false===strrpos($_SESSION["admin_qs"],"2")){?>disabled<? }?>> 
        <input name="id" type="hidden" id="id" value="<?=$myrow["id"]?>">
		<a href="deltouxian.php?id=<?=$myrow["id"]?>">删除</a></td></td>
    </form>
  </tr>
<?
$i++;
}
while ($myrow = mysql_fetch_array($rs));
?>
   <tr bgcolor="#FFFFFF" align="center" class="f12"> 
    <form name="form1" method="post" action="">
      <td width="4%" height="40">&nbsp;</td>
      <td align="left"> 积分值在 
        <input name="xiao" type="text" id="xiao" size="10">
        到 
        <input name="da" type="text" id="da" size="10">
        范围内头衔为 
        <input name="nick" type="text" id="nick" size="12">
        级别图标
        <input name="classx" type="text" id="classx" size="22"> 
        <input type="submit" name="Submit" value="添加" <? if (false===strrpos($_SESSION["admin_qs"],"1")){?>disabled<? }?>>
        <input name="add" type="hidden" id="add" value="ok"> </td>
    </form>
  </tr>
  <tr align=center bgcolor="#F3F3F3" class="f12"> 
    <td height="28" colspan="12" align="left"></td>
  </tr>
<?
}else{
?>
  <tr bgcolor="#F2F9F9"> 
    <td height="25" colspan=12 class="f12"> <div align=center> 找不到纪录！ </div></td>
  </tr>
<? }?>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="35" colspan="6" class="f12"><font color="#FF0000"><strong>以下是级别图标说明：</strong><font color="#000000">(如要修改上面的级别图标请参照下面的说明，如要自定义级别图标请<font color="#FF0000">上传</font>自定义的图标并输入对应路径)</font></font></td>
  </tr>
  <tr> 
    <td width="9%" height="25" class="f12">级别图标</td>
    <td width="18%" class="f12">级别图标路径</td>
    <td width="9%" class="f12">级别图标</td>
    <td width="18%" class="f12">级别图标路径</td>
    <td width="9%" class="f12">级别图标</td>
    <td width="44%" class="f12">级别图标路径</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class1.gif" width="63" height="10"></td>
    <td>userheadimg/class1.gif</td>
    <td><img src="../userheadimg/class2.gif" width="64" height="10"></td>
    <td>userheadimg/class2.gif</td>
    <td><img src="../userheadimg/class3.gif" width="63" height="10"></td>
    <td>userheadimg/class3.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class4.gif" width="63" height="10"></td>
    <td>userheadimg/class4.gif</td>
    <td><img src="../userheadimg/class5.gif" width="64" height="10"></td>
    <td>userheadimg/class5.gif</td>
    <td><img src="../userheadimg/class6.gif" width="63" height="10"></td>
    <td>userheadimg/class6.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class7.gif" width="63" height="10"></td>
    <td>userheadimg/class7.gif</td>
    <td><img src="../userheadimg/class8.gif" width="64" height="10"></td>
    <td>userheadimg/class8.gif</td>
    <td><img src="../userheadimg/class9.gif" width="63" height="10"></td>
    <td>userheadimg/class9.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class10.gif" width="63" height="10"></td>
    <td>userheadimg/class10.gif</td>
    <td><img src="../userheadimg/class11.gif" width="64" height="10"></td>
    <td>userheadimg/class11.gif</td>
    <td><img src="../userheadimg/class12.gif" width="63" height="10"></td>
    <td>userheadimg/class12.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class13.gif" width="63" height="10"></td>
    <td>userheadimg/class13.gif</td>
    <td><img src="../userheadimg/class14.gif" width="64" height="10"></td>
    <td>userheadimg/class14.gif</td>
    <td><img src="../userheadimg/class15.gif" width="63" height="10"></td>
    <td>userheadimg/class15.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class16.gif" width="63" height="10"></td>
    <td>userheadimg/class16.gif</td>
    <td><img src="../userheadimg/class17.gif" width="64" height="10"></td>
    <td>userheadimg/class17.gif</td>
    <td><img src="../userheadimg/class18.gif" width="63" height="10"></td>
    <td>userheadimg/class18.gif</td>
  </tr>
  <tr class="f12"> 
    <td height="25"><img src="../userheadimg/class19.gif" width="63" height="10"></td>
    <td>userheadimg/class19.gif</td>
    <td><img src="../userheadimg/class20.gif" width="64" height="10"></td>
    <td>userheadimg/class20.gif</td>
    <td></td>
    <td></td>
  </tr>
</table>
<br>
</body>
</html>