<?php
define('IN_SYS',TRUE);
define('IN_AdminMenu',TRUE);
require './admin_config.php';
require '../config.php';
require '../setup.php';
require("../lib/admin_chk.php");
?>
<?php
$pageTitle="留言信息列表";

$infoTable = "feedback";
$act = $_REQUEST["act"];
$id = intval($_REQUEST["id"]);

	if($act=="del" && $id>0)
	{
		mysql_query("delete from ".DB_TablePre.$infoTable." where id in ($id)");
		GoLink($ReturnUrl);
		//GoLink("feedbackList.php");
	}
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<title><?php echo $pageTitle?><?php echo $sysTitle?></title>
<link href="templates/admin.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../lib/jquery/jquery.js"></script>
<script type="text/javascript" src="js/controlPanelMenu.js"></script>
<script type="text/javascript" src="js/commmonAdmin.js"></script>
</head>
<body>
<?php
include("./admin_header.php")
?>
<div id="containerAdmin" class="wrapper_m">
<div id="sidebarAdmin">
<?php
include("./admin_controlPanelDir.php")
?>
</div>
<div id="contentbarAdmin">
<div class="tips_2"><?php echo adminPageLocation($pageTitle)?></div>

<?php
	$sql = "select * from ".DB_TablePre.$infoTable." order by addDate desc";
	$page_size = 10;					 //定义每页显示多少记录
	$num_cnt = @mysql_num_rows(mysql_query($sql)); //获取总记录数
	$page_cnt = ceil($num_cnt/$page_size);  //计算总页数	
	if(isset($_GET["page"])){
		$page = intval($_GET["page"]);
	}else{
		$page = 1;
	}
    if ($page<1)
	{
        $page=1;
	}
    elseif ($page>$page_cnt)
	{
        $page=$page_cnt;
    }
	$query_start = ($page - 1 ) * $page_size;   //计算每页开始的记录号
	$query_sql = $sql." limit $query_start,$page_size"; //使用limit获取记录
	//echo $query_sql;
	$query_set = @mysql_query($query_sql);
?>
<table cellspacing="0" class="adminTableV1">
<tr class="head1">
<td>留言人</td>
<td>联系手机</td>
<td>Email</td>
<td width="130">提交时间</td>
<td width="90">操作</td>
</tr>
<?php
if($num_cnt>0)
{
	while($rs = mysql_fetch_array($query_set))
	{
?>
<tr onMouseOver="this.style.backgroundColor='#FFFACA'" onMouseOut="this.style.backgroundColor='#FFFFFF'">
<td>&nbsp; <?php echo $rs["f_Name"]?></td>
<td>&nbsp; <?php echo $rs["f_MobTel"]?></td>
<td>&nbsp; <?php echo $rs["f_Mail"]?></td>
<td><?php echo $rs["addDate"] ?></td>
<td><a href="feedbackUpdate.php?id=<?php echo $rs["id"]?>">回复</a>&nbsp;|&nbsp;<a href="?id=<?php echo $rs["id"]?>&act=del" onClick="return confirm('是否确定删除此信息?\n\n删除后将不可恢复，请谨慎操作!')">删除</a></td>
</tr>
<?php
	}
}else{
?>
<tr>
<td colspan="5">暂无信息!</td>
</tr>
<?php
}
?>
<tr>
<td colspan="5"><?php Controlnews($num_cnt,$page_cnt,$page,$table_style,$font_style);?></td>
</tr>
</table>

</div>
<div class="clearfix"></div>
</div>
<?php
include("./admin_footer.php")
?>
</body>
</html>