<?php
require_once('../common.php');
require_once('head.php');

$p=is_numeric($_GET['p'])?$_GET['p']:'1';
$pp=$p+8;
$pagesize=6;
$start=($p-1)*$pagesize;

  $pages=ceil(get_count('xc','1=1','id')/$pagesize);
  $ids=$db->get_results("select * from ".C('DB_PREFIX')."xc order by id desc limit $start,$pagesize");

if($pp>$pages) $pp=$pages;
if($p==1){
  $prev=1;
}else{
  $prev=$p-1;
}
if($p==$pages){
  $next=$p;
}else{
  $next=$p+1;
}

?>
<!DOCTYPE html>
<title>班级相册-<?=C('webname')?> </title>
<body>
<!--main content start-->
  <section id="container" class="">
      <section id="main-content">
          <section class="wrapper">
		  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                             班级相册
                          </header>
                          <div class="panel-body"> 
                        <?php if($ids){foreach($ids as $id){?>
                          	<img src="<?=$id['dz']?>" width="320" height="220">
							
							
<?php }}?>
<? if($pagedo!='seach'){?>
      <div class="row" style="text-align:center;">
        <ul class="pagination pagination-lg">
          <li <?php if($p==1){echo'class="disabled"';}?>><a href="?p=1">首页</a></li>
          <li <?php if($prev==$p){echo'class="disabled"';}?>><a href="?p=<?=$prev?>">&laquo;</a></li>
          <?php for($i=$p;$i<=$pp;$i++){?>
          <li <?php if($i==$p){echo'class="active"';}?>><a href="?p=<?=$i?>"><?=$i?></a></li>
          <?php }?>
          <li <?php if($next==$p){echo'class="disabled"';}?>><a href="?p=<?=$next?>">&raquo;</a></li>
          <li <?php if($p==$pages){echo'class="disabled"';}?>><a href="?p=<?=$pages?>">末页</a></li>
        </ul>
      </div>
      <?php } ?>

							
						  </div>
						  
						   </section>
						  </div>
						  
						  
<?php
require_once('foot.php');
?>
  </body>
</html>
