<?php 
require_once '../../Config.php';
if (intval ( BLL_Admin::isLogin () ) === 0) {
	header ( 'Location:../index.html' );
	die();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link rel="stylesheet" type="text/css" href="../Css/RightFrm.css" />
<script type="text/javascript" src="../jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../Comm.js"></script>
</head>
<body>
<table  border="0" cellpadding="0" cellspacing="1" class="headTable">
  <tr>
    <th>留言列表</th>
  </tr>
</table>
<table  border="0" cellpadding="0" cellspacing="1" class="listTable">
  <tr>
    <th width="3%">&nbsp;</th>
    <th width="42%">主题</th>
    <th width="10%">昵称</th>
	<th width="10%">电话</th>
    <th width="20%">邮箱</th>
    <th width="15%">操作</th>
  </tr>
  <?php
	$Pd = new COM_PagingDevice ();
	$Pd->_setDataList ( BLL_GuestBook::getList ( true, 'id,subject,nickname,tel,email,isSh,repaly', $Pd->_getLimitArr () ) );
	$dataList = $Pd->_getDataList ();
	for($i = 0; $i < count ( $dataList ); $i ++) {
		$row = $dataList [$i];
		echo "<tr>\r\n";
		echo "<td><input type=\"checkbox\" name=\"theId\" value=\"$row[id]\"></td>\r\n";
		echo "<td>$row[subject]";
		if (! empty ( $row ["repaly"] )) {
			echo "&nbsp;&nbsp;&nbsp;<span style='color:#ff0000;'>已回复</span>";
		}
		echo "</td>\r\n";
		echo "<td class=\"center\">$row[nickname]</td>\r\n";
		echo "<td class=\"center\">$row[tel]</td>\r\n";
		echo "<td class=\"center\">$row[email]</td>\r\n";
		echo "<td>";
		echo "<a href=\"GuestBook_Repaly.php?theId=$row[id]\">【回复】</a>";
		echo "&nbsp;&nbsp;&nbsp;&nbsp;";
		if (intval ( $row ['isSh'] ) === 1) {
			echo "<a href=\"TheAction.php?action=guestBookSh&isSh=0&theId=$row[id]\" style=\"color:#ff0000;\" target=\"hideframe\">【已审核】</a>";
		} else {
			echo "<a href=\"TheAction.php?action=guestBookSh&isSh=1&theId=$row[id]\" target=\"hideframe\">【审核】</a>";
		}
		echo "</td>\r\n";
		echo "</tr>\r\n";
	}
  ?>
  <tr>
  	<td colspan='6' class="pageInfo">
  	<?php echo COM_OftenFunction::managerPageInfo($Pd->_getPageInfo());?>
  	</td>
  </tr>
</table>
<table  border=0 cellpadding=0 cellspacing=1  class="cmdTable">
  <tr>
    <th>
	<span onClick="selectAll('theId');">全选</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span onClick="unSelectAll('theId');">全不选</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span onClick="antiSelectAll('theId');">反选</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span onClick="handleSelect('theId','TheAction.php?action=delete','hideframe');">删除</span>
	</th>
  </tr>
</table>
<iframe name="hideframe" width="0" height="0"></iframe>
<script type="text/javascript">$(function(){setTableColor();});</script>
</body>
</html>