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

<?php

///$mulu=dirname(__FILE__);
///echo $mulu."<br>";
///$newname = "../webfl/".$_GET['id'].".jpg";/////////////这三行改名
///echo $newname;


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

mysql_query("INSERT INTO text (name, time, ip, ing, f, bz) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '种类删除-".$_GET['id']."', '0', '')");
header("Location: ".$llym);
}
?>

<?php
if ($_GET['xg']=="xg")
{
$mulu=dirname(__FILE__);
$mulu = str_replace("adm","webfl",$mulu);
////echo "<p>".$mulu."\\123.jpg</p>";//////// 以上取得目录

mysql_query("UPDATE webyxlb SET name = '".$_POST['name']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE webyxlb SET js = '".$_POST['js']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE webyxlb SET yx = '".$_POST['yx']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE webyxlb SET bz = '".$_POST['bz']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE webyxlb SET img = '".$_POST['img']."' WHERE id='".$_GET['id']."'");
///$oldname = $mulu."\\".$_POST['name'].".jpg"; /////////
///$newname = $mulu."\\".$_GET['id'].".jpg";/////////////这三行改名

$oldname = "../webfl/".$_POST['name'].".jpg"; /////////
$newname = "../webfl/".$_GET['id'].".jpg";/////////////这三行改名
rename($oldname,$newname);////////////////////////////


mysql_query("INSERT INTO text (name, time, ip, ing, f, bz) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '改页游信息-".$_GET['id']."', '0', '')");
header("Location: ".$llym);
}
?>


<?php

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

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

?>




<table>
  <tr>
    <td>
<form action="" method="get">
搜用户名: 
<input name="gjc" type="text" id="gjc" />
<input type="submit" value="搜索" />　　
</form>
	</td>
    <td>
<form action="upload.php" enctype="multipart/form-data" method="post" name="up">
上传文件：
<input name="upfile" type="file"/>
<input type="submit" value="上传"/><br/>
</form>
	</td>
  </tr>
</table>


 
<?php
echo "<TABLE ><TBODY><TR  bgcolor=#CCCC00 >";
echo "<TD >ID</td><TD >图</td><TD >找图</td><TD ><a href=?ys=".$_GET['ys']."&px=name >名字</a></td><TD ><a href=?ys=".$_GET['ys']."&px=js >介绍</a>";
echo "</td><td>搜</td>";
echo "<TD ><a href=?ys=".$_GET['ys']."&px=yx >优先</a></td>";
echo "<TD >显示</td><TD >备注</td><TD >--</td><TD >--</td></TR>";






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

$result = mysql_query("SELECT * FROM webyxlb WHERE name='".$_GET['gjc']."' OR id='".$_GET['gjc']."'");
while($row = mysql_fetch_array($result))
  {
  {
echo "<form action=yyzl.php?xg=xg&id=".$row['id'] ." method=post>";
echo "<TD ><textarea disabled cols=2 rows=2>".$row['id'] ."</textarea></td>";
echo "<TD ><a href=../webfl/".$row['id'].".jpg  target=_blank ><img src=../webfl/".$row['id'].".jpg width=35 height=35 ></a></td>";

echo "<td>[<a href=http://image.baidu.com/i?tn=baiduimage&ct=201326592&cl=2&lm=-1&st=-1&fm=result&fr=&sf=1&fmq=1346758111281_R&pv=&ic=0&nc=1&z=&se=1&showtab=0&fb=0&width=&height=&face=0&istype=2&word=".$row['name']."#z=&width=110&height=80&pn=0 target=_blank>图</a>]</td>";

echo "<TD ><textarea name=name cols=12 rows=2>".$row['name'] ."</textarea></td>";
echo "<TD ><textarea name=js cols=12 rows=2>".$row['js'] ."</textarea></td>";
echo "<td><a href=http://zhidao.baidu.com/search?fr=bk&word=".$row['name']." target=_blank>知</a>-";
echo "<a href=http://www.baidu.com/baidu?word=".$row['name']." target=_blank>度</a></td>";
echo "<TD ><textarea name=yx cols=8 rows=2>".$row['yx'] ."</textarea></td>";
echo "<TD ><textarea name=img cols=2 rows=2>".$row['img'] ."</textarea></td>";
echo "<TD ><textarea name=bz cols=2 rows=2>".$row['bz'] ."</textarea></td>";
echo "<TD ><input type=submit value=修改 ";
?>onClick="return confirm('您确定修改！！')"<?php
echo " /></td>";
echo "<TD >----<a href='?id=".$row['id']."&s=ok' ";
?>onClick="return confirm('您确定删除！！')"<?php
echo " >删</a>-</td>";
echo "</form></TR>";
  }

  }

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







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

while($row = mysql_fetch_array($result))
  {
echo "<form action=yyzl.php?xg=xg&id=".$row['id'] ." method=post>";
echo "<TD ><textarea disabled cols=2 rows=2>".$row['id'] ."</textarea></td>";
echo "<TD ><a href=../webfl/".$row['id'].".jpg  target=_blank ><img src=../webfl/".$row['id'].".jpg width=35 height=35 ></a></td>";

echo "<td>[<a href=http://image.baidu.com/i?tn=baiduimage&ct=201326592&cl=2&lm=-1&st=-1&fm=result&fr=&sf=1&fmq=1346758111281_R&pv=&ic=0&nc=1&z=&se=1&showtab=0&fb=0&width=&height=&face=0&istype=2&word=".$row['name']."#z=&width=110&height=80&pn=0 target=_blank>搜</a>]</td>";

echo "<TD ><textarea name=name cols=12 rows=2>".$row['name'] ."</textarea></td>";
echo "<TD ><textarea name=js cols=12 rows=2>".$row['js'] ."</textarea></td>";
echo "<td><a href=http://zhidao.baidu.com/search?fr=bk&word=".$row['name']." target=_blank>知</a>-";
echo "<a href=http://www.baidu.com/baidu?word=".$row['name']." target=_blank>度</a></td>";
echo "<TD ><textarea name=yx cols=8 rows=2>".$row['yx'] ."</textarea></td>";
echo "<TD ><textarea name=img cols=2 rows=2>".$row['img'] ."</textarea></td>";
echo "<TD ><textarea name=bz cols=2 rows=2>".$row['bz'] ."</textarea></td>";
echo "<TD ><input type=submit value=修改 ";
?>onClick="return confirm('您确定修改！！')"<?php
echo " /></td>";
echo "<TD >----<a href='?id=".$row['id']."&s=ok' ";
?>onClick="return confirm('您确定删除！！')"<?php
echo " >删</a>-</td>";
echo "</form></TR>";
  }
echo "</TBODY></TABLE>";

?>


 
<?php 

$result = mysql_query("SELECT * FROM webyxlb");//查看总留言数并分页
$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">优先值大于等于30就会出现那个火的标制，其它按字大小排序，大的在前。
</textarea>


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