<?php
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
//checkAuth('83');	//判断登录和权限

//$js .= "<script src='".$conf_basedir."script/js/layer/layer.js'></script>";

$tbl ="tiantian315";
$title ="天天315管理";
//设置顶部查询部分


$cond_arr_2=array("2"=>"请选择","0"=>"未处理","1"=>"已处理");
$cond_search_2	= tonyForm("select","status",$cond_arr_2,$status);
$where ="";


if($status==='0'){
   $where .= "status = 0";
  
}elseif($status==='1'){
    $where .= "status = 1";
}


if($keyword = trim($keyword)){    
    $where .= $where == "" ? "" : " and";
    $where .= " title like '".$keyword."%' ";            

} 

 $where = $where == "" ? "" : " where $where";

//获得数据当前页面数据
$sql = "select count(*) from $tbl  $where";
$numrows = $dbback->GetOne($sql);

//分页参数
$pagesize	= $display_rows ? intval($display_rows) : 3;
$page_now	= $page_now ? max(1, intval($page_now)) : 1 ; // 获取当前页数
$offset		= ( $page_now - 1 ) * $pagesize;    

$ordercond ="";//排序

$sql = "select * from $tbl  $where  $ordercond  LIMIT ".$offset.",".$pagesize." ";



$data_info = $dbback->GetAll($sql);


$pagenum = $numrows;//当前页面数量
$numrows = $numrows >0 ? $numrows : 0;

if( $numrows <= 0 || $pagenum <=0){
    $pages = 0 ;  //计算总页数
}else{
    $pages = ceil($numrows/$pagesize) ;  //计算总页数
    $new_pagenavi = new_pagenavi($page_now,$pages,$numrows);
}



include_once(Template("header"));
include_once(Template("tiantian315/list"));
include_once(Template("footer"));

?>