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

?>

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

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

?>

<?php
if ($_GET['xg']=="xg")
{
mysql_query("UPDATE wz SET bz = '".$_POST['bz']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE wz SET fl = '".$_POST['fl']."' WHERE id='".$_GET['id']."'");
mysql_query("UPDATE wz SET tm = '".$_POST['tm']."' WHERE id='".$_GET['id']."'");

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



<?php

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

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

?>

 
 <?php
echo "<TABLE ><TBODY><TR  bgcolor=#CCCC00 >";
echo "<b><TD >查看</td><TD >ID</td><TD ><a href=?ys=".$_GET['ys']."&px=tm >题目</a>";
echo "<TD >TIME</td></td><TD ><a href=?ys=".$_GET['ys']."&px=fl >分类</a></td><td>图片链接</td><TD >-</td><TD >删除</td></b></TR>";

$result = mysql_query("SELECT * FROM wz ORDER  BY ".$px." DESC LIMIT ".$ys.",".$_SESSION['ts']);
while($row = mysql_fetch_array($result))
  {
echo "<TR ";
?> onmouseover="this.style.background='#FFF'; " onmouseout ="this.style.background=''; this.style.borderColor=''" <?php 
echo "><form action=wzg.php?xg=xg&id=".$row['id']." method=post>";
echo "<TD ><a target=_blank href=../wz.php?id=".$row['id'] . " >查看</a></td>";
echo "<TD ><input type=text size=8 value=".$row['id'] . " /></a></td>";
echo "<TD ><input type=text name=tm size=18 value=".$row['tm']. " /></td>";
  $tim = date("m月d日H:i:s",$row['time']);
echo "<TD ><input type=text size=18 value=".$tim. " /></td>";
echo "<TD ><select name=fl>
<option value=".$row['fl'].">".$row['fl']."</option>
<option value=web1>网页1</option>
<option value=zs>展示</option>
<option value=web>网页</option>
<option value=zs>展示</option>
</select></td>";
echo "<TD ><input name=bz type=text size=8 value=".$row['bz'] . " /></td>";
echo "<TD ><input type=submit value=修改 /></td>";
echo "<TD ><a href='?id=".$row['id']."&s=ok' >删</a></td>";
if($row['bz']!="")
{echo "<td>分类改展示ZS图片不空即可展示</td>";}

echo "</form></TR>";
  }
echo "</TBODY></TABLE>";

?>

 
<?php 

$result = mysql_query("SELECT * FROM wz");//查看总留言数并分页
$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">分类改成展示ZS图片不为空，即可在综合宽页面下展示

</textarea>


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