<?php
//$projectRootPath = "../../";	//相对当前应用程序根的位置
//require_once("../include/checkPurview.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" />
</head>
<body>
<br />
&nbsp; <a href="lovewall_Manage.php">祝福纸条管理</a> | <a href="lovewall_Add.php">添加祝福纸条</a>
<hr color="#0099FF" size="1" />
<br />
<dl class="manageContent">
    <dt>祝福纸条管理</dt>
    <dd>
    	<br />
        <script type="text/javascript">
            function delSelect(o){
                // 5 ,7 ,4 ,8
                var shus=new Array();
                //shus[0]=1;
                //shus[1]=2;
                //var s=0;
                var isSelected=false;
                var ids=document.getElementsByName("ids");
                for(i=0;i<ids.length;i++){
                    //alert("========="+ ids[i].checked);
                    if( ids[i].checked){
                        //shus[i]=ids[i].value;
                       // shus[s]=ids[i].value;
                       // s++;
                       shus.push(ids[i].value);
                       isSelected=true;
                    }
                }
                 //alert("------"+   shus.join(',') ); //5 -7 -4 -8
                 //o.href="lovewall_del.php?id="+shus.join(',');
                 if(isSelected==true){
                     location="lovewall_del.php?id="+shus.join(',');
                 }else{
                     alert("请选择后才能删除");
                 }
                 
            }
            //-------
            function idSlectAll(o){
                //alert("==========");
                var ids=document.getElementsByName("ids");
                for(i=0;i<ids.length;i++){
                        ids[i].checked=o.checked;
                }
            }
        </script>
        <table width="95%"class="tableBoder01">
            <tr>
                <th><a href="#" onclick="delSelect(this)" style="cursor: pointer" title="删除选择的祝福纸条">删除</a><br />
                (<input type="checkbox" name="idSlectAll" id="idSlectAll" onclick="idSlectAll(this)" />全选/取消)
                </th>
                <th>许愿人姓名</th>
                <th>祝福纸条内容</th>
                <th>发布时间</th>
                <th>管  理</th>
            </tr>
            <?php
            //--- 1 分页初始化 -----
		$oPageMySQL=new Deep_Page();
		$oPageMySQL->pageSize=20;	 //定义每页显示记录数 默认10条
		$oPageMySQL->getConnection($conn);
		$oPageMySQL->CountSql("deep_zhiTiao","");

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


            $sql="select * from deep_zhiTiao order by createTime desc"." limit ".  $oPageMySQL->startResult() .",".$oPageMySQL->pageSize ;
            $rs=$conn->query($sql);
            while($row=$rs->fetch()){
            ?>
            <tr>
                <td><input type="checkbox" name="ids" value="<?php echo $row['id']?>" /></td>
                <td><?php echo $row['fAuthor']?></td>
                <td><?php echo $row['fcontent']?></td>
                <td><?php echo $row['createTime']?></td>
                <td><a href="lovewall_update.php?id=<?php echo $row['id']?>">修改</a> | <a href="lovewall_del.php?id=<?php echo $row['id']?>" onclick="return confirm('你确定删除么？');" >删除</a></td>
            </tr>
            <?php
            }
            ?>
        </table>

        <?php
        //--- 2 分页导航 -----
        echo "<div align='center'>".$oPageMySQL->pageNavigateUrl()."</div>";
        ?>
        <br />
    </dd>
</dl>
<br />
</body>
</html>
