<?php
require_once("../web.config.php");
?>
<!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 name="robots" content="noindex,nofollow" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>留言管理</title>
    <link href="../themes/<?php echo $themes_Path; ?>/main.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/default/theme.css" rel="stylesheet" type="text/css" />
</head>
<body  id="bodyBg1">
<br />
&nbsp; <a href="guestBook_Manage.php">留言管理</a> | <a href="guestBook_Add.php">添加留言</a>
<hr color="#0099FF" size="1" />

<dl class="manageContent">
    <dt>留言 回复删除管理</dt>
    <dd>
        <!-- 留言板 开始 父Repeater  -->
                <table class="guestOneTopic">
                    <?php
                    //--- 1 分页初始化 -----
		$oPageMySQL=new Deep_Page();
		$oPageMySQL->pageSize=20;	 //定义每页显示记录数 默认10条
		$oPageMySQL->getConnection($conn);
		$oPageMySQL->CountSql("deep_GuestBook","guestType=0");

		if( isset($_GET['page']) ){
			$oPageMySQL->currentPage = intval( $_GET['page'] );		//intval -- 获取变量的整数值
		}
		//$sql="SELECT * FROM addressList order by fName"." limit ".  $oPageMySQL->startResult() .",".$oPageMySQL->pageSize ;
		//-------------------------

                    $sqlGuestBook="select * from deep_GuestBook where guestType=0 order by guestDatetime desc"." limit ".  $oPageMySQL->startResult() .",".$oPageMySQL->pageSize;
                    //echo $sqlGuestBook;
                    $rsGuestBook=$conn->query($sqlGuestBook);
                    while($rowGuestBook = $rsGuestBook->fetch()){
                    ?>
                    <tr  <?php
                        if($rowGuestBook['guestIsPassed']==0){
                            echo "style='background-color: #cff'";
                        }
                        ?>  >
                        <td class="left">
                            留言人：<?php echo $rowGuestBook['guestName'] ?><br />
                            <div class="guestFace guestFace-<?php echo $rowGuestBook['guestFace'] ?>" ></div>
                            <br />
                            <?php echo $rowGuestBook['guestDatetime'] ?>
                            <br />
                            来自：<?php echo $rowGuestBook['guestFrom'] ?><br />
                            <div class="icon">
                                <a href="mailto:<?php echo $rowGuestBook['guestEmail'] ?>" class="icon-mail" title="留言人E-mail：<?php echo $rowGuestBook['guestEmail'] ?>"></a>
                                <span class="icon-QQ" title="留言人QQ：<?php echo $rowGuestBook['guestQQ'] ?>"></span>
                                <span class="icon-MSN" title="留言人msn：<?php echo $rowGuestBook['guestMSN'] ?>"></span>
                                <a href="<?php echo $rowGuestBook['guestHomePage'] ?>" class="icon-homepage" title="留言人主页：<?php echo $rowGuestBook['guestHomePage'] ?>"></a>
                                <span class="icon-tel" title="留言人电话：<?php echo $rowGuestBook['guestTel'] ?>"></span>
                            </div>
                        </td>
                        <td class="right">
                            <div class="title"><?php echo $rowGuestBook['guestTitle'] ?></div>
                            <div class="replyAhref" style="width:150px">
                                
                                    <a href="guestBook_isPass.php?id=<?php echo $rowGuestBook['guest_ID'] ?>"><?php 
									if($rowGuestBook['guestIsPassed']==0 ){
										echo "<span style='color:red'>未审核</span>";
									}else{
										echo '审核';
									} ?></a>
                                
                                <a href="guestBook_update.php?id=<?php echo $rowGuestBook['guest_ID'] ?>">编辑</a>
                                <a href="guestBook_del.php?id=<?php echo $rowGuestBook['guest_ID'] ?>">删除</a>
                                [<a href="guestBook_reply.php?id=<?php echo $rowGuestBook['guest_ID'] ?>" >回复</a>]</div>
                            <div class="content">
                                <?php echo $rowGuestBook['guestContent'] ?></div>
                            <!-- 回复 开始 子Repeater  -->
                                    <div class="reply" >
                                        <?php
                                        $sqlGuestBook_reply="select * from deep_GuestBook where guestType=".$rowGuestBook['guest_ID']." order by guestDatetime";
                                        $rsGuestBook_reply=$conn->query($sqlGuestBook_reply);
                                        while($rowGuestBook_reply=$rsGuestBook_reply->fetch() ){
                                        ?>
                                        <div class="replytitle" <?php
                                    if($rowGuestBook_reply['guestIsPassed']==0){
                                        echo "style='background-color: #cff'";
                                    }
                                    ?> >
                                            [<?php echo $rowGuestBook_reply['guestName'] ?>']回复 (<?php echo $rowGuestBook_reply['guestDatetime'] ?>
					    来自：<?php echo $rowGuestBook_reply['guestFrom'] ?>)
                                            <a href="guestBook_isPass.php?id=<?php echo $rowGuestBook_reply['guest_ID'] ?>"><?php 
											if($rowGuestBook_reply['guestIsPassed']==0 ){
												echo "<span style='color:red'>未审核</span>";
											}else{
												echo '审核';
											} ?></a>
                                             <a href="guestBook_update.php?id=<?php echo $rowGuestBook_reply['guest_ID'] ?>">编辑</a>
                                            <a href="guestBook_del.php?id=<?php echo $rowGuestBook_reply['guest_ID'] ?>">删除</a>
                                            <div class="icon">
                                            <a href="mailto:<?php echo $rowGuestBook_reply['guestEmail'] ?>" class="icon-mail" title="回复人E-mail:<?php echo $rowGuestBook_reply['guestEmail'] ?>"></a>
                                            <span class="icon-QQ" title="回复人QQ：<?php echo $rowGuestBook_reply['guestQQ'] ?>"></span>
                                            <span class="icon-MSN" title="回复人msn：<?php echo $rowGuestBook_reply['guestMSN'] ?>"></span>
                                            <a href="<?php echo $rowGuestBook_reply['guestHomePage'] ?>" class="icon-homepage" title="回复人主页：<?php echo $rowGuestBook_reply['guestHomePage'] ?>"></a>
                                            <span class="icon-tel" title="回复人电话：<?php echo $rowGuestBook_reply['guestTel'] ?>"></span>
                                            </div>
                                        	<br />
                                        	<?php echo $rowGuestBook_reply['guestContent'] ?>
                                        </div>
                                        <?php
                                        }
                                        ?>
                                    </div>
                            <!--  回复 结束 子Repeater  -->
                        </td>
                    </tr>
                    <?php
                    }

                    ?>
                </table>
                <?php
                 //--- 2 分页导航 -----
                    echo "<div align='center'>".$oPageMySQL->pageNavigateUrl()."</div>";
                ?>
        <!-- 留言板 结束 父Repeater -->
        <br />
    </dd>
</dl>
<br />
</body>
</html>
