<?php
/*************************************************************\
+-------------------------------------------------------------+
| 通灵佛教网在线烧香程序 System                                 |
| Copyright (c) 2003-2010 Alfred China                        |
| All rights reserved.                                        |
+-------------------------------------------------------------+
\*************************************************************/
require_once('chk.php');
$pagepermission = 27;
require_once('netgou.php');

$txturl = "";
$txtsou = "WHERE 1=1";

$modetype = addslashes($modetype);
$modetype && $txturl .= "&modetype=$modetype";
$modetype && $txtsou .= " AND $sql_tbl[gongde].modetype='$modetype'";

$myuid = intval($myuid);
$myuid && $txturl .= "&myuid=$myuid";
$myuid && $txtsou .= " AND $sql_tbl[gongde].uid='$myuid'";

$total_items = ng_query_first_cell("SELECT COUNT($sql_tbl[gongde].gdid) FROM $sql_tbl[gongde] $txtsou");
	
if ($total_items > 0) {
		
	$pageurl = "gongde.php?".$txturl;
	$objects_per_page = 50;
			
	$total_nav_pages = ceil($total_items/$objects_per_page);
	if($page > $total_nav_pages)
		$page = $total_nav_pages;
	$netgou["max_nav_pages"] = 10;
	include_once ng_dir."/include/navigation.php";
	
	$gongde = ng_query("SELECT $sql_tbl[gongde].gdid, $sql_tbl[gongde].uid, $sql_tbl[gongde].username, $sql_tbl[gongde].modetype, $sql_tbl[gongde].oldgd, $sql_tbl[gongde].gdnum, $sql_tbl[gongde].newgd, $sql_tbl[gongde].gddtm, $sql_tbl[gongde].gdcaozuo, $sql_tbl[gongde].gdip FROM $sql_tbl[gongde] $txtsou ORDER BY $sql_tbl[gongde].gdid DESC LIMIT $first_page, $objects_per_page");
	
	$first_item = $first_page+1;
	$last_item =  min($first_page+$objects_per_page, $total_items);
}

$ng_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
$ng_obstart ? $ng_gzip="Gzip enabled":$ng_gzip="Gzip disabled";

require_once PrintTemp('gongde');
require_once "./footer.php";

$output=str_replace(array('<!--<!--<!---->','<!--<!---->','<!---->'),array('','',''),ob_get_contents());
ob_end_clean();
echo $output;
flush;
exit;
?>