<?php include("dh.php"); 
include("../sql/conn.php");
include("yz.php"); 
$llym = $_SERVER["HTTP_REFERER"];
?>


<?php
if ($_GET['s']=="ok")
{
mysql_query("DELETE FROM user WHERE id='".$_GET['id']."'");

mysql_query("INSERT INTO text (name, time, ip, ing, f) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '删档-[".$_GET['id']."]', '0')");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}

if ($_GET['paty']=="paty")
{
mysql_query("UPDATE user SET paty = '".$_POST['paty']."' WHERE id = '".$_GET['id']."'");
mysql_query("UPDATE user SET qq = '".$_POST['qq']."' WHERE id = '".$_GET['id']."'");
mysql_query("UPDATE user SET bz = '".$_POST['bz']."' WHERE id = '".$_GET['id']."'");

mysql_query("INSERT INTO text (name, time, ip, ing, f) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '奖励[".$_GET['id']."][".$_POST['paty']."]', '0')");

?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}


?>

<form action="" method="get">
搜用户名或UID: 
<input name="gjc" type="text" id="gjc" />
<input type="submit" value="搜索" />
</form>


<?php

echo "<table >";
  echo "<tr bgcolor=#CCCC00 >";
  echo "<td><a href=?ys=".$_GET['ys']."&px=id>ID</a></td>";
  echo "<td><a href=?ys=".$_GET['ys']."&px=name>用户</a></td>";
  echo "<td>Emall</td>";
  echo "<td>第一IP</td>";
  echo "<td>注册时间</td>";  
  echo "<td><a href=?ys=".$_GET['ys']."&px=nt>最后登陆</a></td>";
  echo "<td><a href=?ys=".$_GET['ys']."&px=jf>积分</a></td>";
  echo "<td>信</td>";
  echo "<td>加分</td>";
  echo "<td>减分</td>";
  echo "<td>删</td>";
  echo "<td>[<a href=?ys=".$_GET['ys']."&px=paty>奖励</a>][QQ][备注]</td>";
  echo "<td><a href=?ys=".$_GET['ys']."&px=qq>qq</a></td>";
  echo "</tr>";


if($_GET['gjc']!="")
{
echo "<tr bgcolor=#fff height=2 ><td colspan=12 ></td></tr>";

$result = mysql_query("SELECT * FROM user WHERE id='".$_GET['gjc']."' OR name like '%".$_GET['gjc']."%'");
while($row = mysql_fetch_array($result))
  {
  echo "<tr bgcolor=#fff>";
  echo "<td><input  type=text size=3 value=".$row['id']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['name']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['e']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['fip']." /></td>";
    $tim = date("m月d日H:i:s",$row['ft']);
  echo "<td><input  type=text size=8 value=".$tim." /></td>";
    $tim = date("m月d日H:i:s",$row['nt']);
  echo "<td><input  type=text size=8 value=".$tim." /></td>";
  echo "<td><input  type=text size=5 value=".$row['jf']." /></td>";
  echo "<td><a href=../msn.php?id=a&name=".$row['name']." target=_blank >信</a></td>";
  echo "<form action=--.php?id=".$row['id']." method=post><td class=td12 bgcolor=#330066>";
  echo "<input name=f value=120 type=text size=3 maxlength=5 />";
  echo "<input type=submit value=+ /></td></form>";
  echo "<form action=-.php?id=".$row['id']." method=post><td class=td12 bgcolor=#330066>";
  echo "<input name=f value=1000 type=text size=3 maxlength=5 />";
  echo "<input type=submit value=- /></td></form>";
  echo "<td><a ";
  ?>onClick="return confirm('删除要小心！？')"<?php
  echo " href=?s=ok&id=".$row['id']." >▉</a></td>";
  
  echo "<td class=td12 >";
  echo "<form name=form1 method=post action=?id=".$row['id']."&paty=paty >";
  echo "<textarea name=paty cols=3 rows=1>".$row['paty']."</textarea>";
  echo "<textarea name=qq cols=5 rows=1>".$row['qq']."</textarea>";
  echo "<textarea name=bz cols=8 rows=1>".$row['bz']."</textarea>";
  echo "<input type=submit value=改 /></form>";
  echo "</td>";

  if($row['qq']!="")  {
  echo "<td><a target=_blank href=http://wpa.qq.com/msgrd?v=3&uin=".$row['qq']."&site=qq&menu=yes title=".$row['qq']." >聊</a></td>";  }
  
  echo "</tr>";
  }

echo "<tr bgcolor=#fff height=2 ><td colspan=12 ></td></tr>";

}


if($_GET['ys'])
{
$ys = $_SESSION['ts']*($_GET['ys']-1);
}	 
else
{
$ys = 0;
}

if($_GET['px'])
{
$px = $_GET['px'];
}	 
else
{
$px = nt;
}

$result = mysql_query("SELECT * FROM user ORDER  BY ".$px." DESC LIMIT ".$ys.",".$_SESSION['ts']);

while($row = mysql_fetch_array($result))
  {
  echo "<tr";
?> onmouseover="this.style.background='#000'; " onmouseout ="this.style.background=''; this.style.borderColor=''" <?php 
  echo ">";
  echo "<td><input  type=text size=3 value=".$row['id']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['name']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['e']." /></td>";
  echo "<td><input  type=text size=8 value=".$row['fip']." /></td>";
    $tim = date("m月d日H:i:s",$row['ft']);
  echo "<td><input  type=text size=8 value=".$tim." /></td>";
    $tim = date("m月d日H:i:s",$row['nt']);
  echo "<td><input  type=text size=8 value=".$tim." /></td>";
  echo "<td><input  type=text size=5 value=".$row['jf']." /></td>";
  echo "<td><a href=../msn.php?id=a&name=".$row['name']." target=_blank >信</a></td>";

  echo "<form action=--.php?id=".$row['id']." method=post><td class=td12 bgcolor=#330066>";
  echo "<input name=f value=120 type=text size=3 maxlength=5 />";
  echo "<input type=submit value=+ /></td></form>";
  
  echo "<form action=-.php?id=".$row['id']." method=post><td class=td12 bgcolor=#330066>";
  echo "<input name=f value=1000 type=text size=3 maxlength=5 />";
  echo "<input type=submit value=- /></td></form>";
  
  echo "<td><a ";
  ?>onClick="return confirm('删除要小心！？')"<?php
  echo " href=?s=ok&id=".$row['id']." >删</a></td>";
  
  
  echo "<td class=td12 >";
  echo "<form name=form1 method=post action=?id=".$row['id']."&paty=paty >";
  echo "<textarea name=paty cols=3 rows=1>".$row['paty']."</textarea>";
  echo "<textarea name=qq cols=5 rows=1>".$row['qq']."</textarea>";
  echo "<textarea name=bz cols=8 rows=1>".$row['bz']."</textarea>";
  echo "<input type=submit value=改 /></form>";
  echo "</td>";
  
  if($row['qq']!="")  {
  echo "<td><a target=_blank href=http://wpa.qq.com/msgrd?v=3&uin=".$row['qq']."&site=qq&menu=yes title=".$row['qq']." >聊</a></td>";  }

  echo "</tr>";
  
  }
echo "</table >";
?>

<?php 

$result = mysql_query("SELECT * FROM user");//查看总留言数并分页
$num = mysql_num_rows($result);
echo "注册用户".$num." 个";
$ys = ceil($num/$_SESSION['ts']);

for ($i=1; $i<=$ys; $i++)
{
if ($_GET['ys']!=$i)
echo "〖<a href=?ys=".$i."&px=".$_GET['px'].">".$i."</a>〗";
else
echo "<strong>[".$i."]</strong>";

}

echo "</p>";

?> 
<hr>
<textarea cols="88" rows="3">用户admin和adm是提前注册好的，请不要删除！
表格加黑部分为可操作积分区，您可以将数字１０改为其它值，点击+或-进行积分操作。
文本框内星号请不要更改，其内容为用户身份值。
</textarea>

<?php include("../sql/close.php"); ?>
