日期:2014-05-16 浏览次数:20595 次
<?php
$act=$_GET['act'];
$id=$_GET['id'];
switch($act){
case "del";
$del=$dbc->prepare("delete from naszt where 1=1 and id=?");
if($del->execute(array($id))){
echo "<script>";
echo "$(function() {";
echo "$('.del').click(function() {";
echo " $('#'+$(this).attr('id')).remove()";
echo "})";
echo "})";
echo "</script>";
}else{
echo '<script>alert("由于网络原因,删除失败,请重试!");</script>';
}
}
?>
<?php
$selectSpecialContent=$dbc->prepare("select * from naszt");
$selectSpecialContent->execute();
?>
<table align="center" cellspacing="0" cellpadding="0">
<tr>
<th>专题名称</th>
<th>专题类型</th>
<th>发表时间</th>
<th>发表ip</th>
<th>操作</th>
</tr>
<?php while($row=$selectSpecialContent->fetch()){ ?>
<tr id="<?php echo $row['id']?>">
<td><?php echo $row['ztname']?></td>
<td><?php echo $row['zttype']?></td>
<td><?php echo $row['zttime']?></td>
<td><?php echo $row['publiship']?></td>
<td><button><a href="ztselect.php?id=<?php echo $row['id']?>">查看</a></button><button><a href="upzt.php?act=up&id=<?php echo $row['id']?>">修改</a></button><button class='del' id="<?php echo $row['id']?>"><a href="selectzt.php?act=del&id=<?php echo $row['id']?>" >删除</a></button></td>
</tr>
<?php }; ?>
</table>