<?php include_once 'config.php'; include_once INC_PATH . 'headleader.php'; require_once INC_PATH . 'aunav.php'; include_once 'dist/news_data.php'; $shownum = 6; $p = isset($_GET["p"]) ? $p = $_GET["p"] : ($p = 1); $db = new JPDO(); $sql = "SELECT *\n\t\t\tFROM `news`\n\t\t\tWHERE `enable`='Y'\n\t\t\t\tAND `type`=:type\n\t\t"; $rowPerPage = $shownum; $pageNo = $p - 1; $arrOrderBy = isset($_GET['_orderBy']) ? $_GET['_orderBy'] : array('`news`.`date` DESC', '`news`.`id` DESC'); $pagerText = $db->queryFetchPage($sql, $pageNo, 6, $arrOrderBy, array(':type' => '圖文')); $pagerVideo = $db->queryFetchPage($sql, $pageNo, 2, $arrOrderBy, array(':type' => '影音')); $start = ($p - 1) * $shownum; // 總頁數 $maxPage = $pagerText->pageNum >= $pagerVideo->pageNum ? $pagerText->pageNum : $pagerVideo->pageNum; if ($p > $maxPage || $p < 1 || !is_int($p * 1) || !isset($_GET["p"])) { $p = 1; header("Location: news.php?p={$p}"); } ?> <title>市場消息 / 康和快訊 | <?php echo $webTitle; ?> </title> <?php // ------------------------------- // SEO
<?php include_once 'config.php'; include_once INC_PATH . 'headleader.php'; require_once INC_PATH . 'aunav.php'; // include_once 'dist/chatroom_data.php'; $shownum = 6; $p = isset($_GET["p"]) ? $p = $_GET["p"] : ($p = 1); $db = new JPDO(); $sql = "SELECT *\n\t\t\tFROM `advisory`\n\t\t\tWHERE `enable`='Y'\n\t\t"; $rowPerPage = $shownum; $pageNo = $p - 1; $arrOrderBy = isset($_GET['_orderBy']) ? $_GET['_orderBy'] : array('`advisory`.`ord` ASC', '`advisory`.`id` DESC'); $pager = $db->queryFetchPage($sql, $pageNo, $shownum, $arrOrderBy); $start = ($p - 1) * $shownum; $maxPage = $pager->pageNum; if ($p > $maxPage || $p < 1 || !is_int($p * 1) || !isset($_GET["p"])) { $p = 1; header("Location: products_list3.php?p={$p}"); } ?> <title>康和期經產品介紹 | <?php echo $webTitle; ?> </title> <?php // ------------------------------- // SEO // CSS // Script in the HEAD
<?php include_once 'config.php'; include_once INC_PATH . 'headleader.php'; require_once INC_PATH . 'aunav.php'; $shownum = 6; $p = isset($_GET["p"]) ? $p = $_GET["p"] : ($p = 1); $db = new JPDO(); $sql = "SELECT *\n\t\t\tFROM `news`\n\t\t\tWHERE `enable`='Y'\n\t\t\t\tAND `type`='圖文'\n\t\t\t\tAND\n\t\t\t\t( `title` LIKE :search\n\t\t\t\t\tOR `content` LIKE :search\n\t\t\t\t)\n\t\t"; $rowPerPage = $shownum; $pageNo = $p - 1; $arrOrderBy = isset($_GET['_orderBy']) ? $_GET['_orderBy'] : array('`news`.`date` DESC', '`news`.`id` DESC'); $pager = $db->queryFetchPage($sql, $pageNo, 6, $arrOrderBy, array(':search' => "%{$_GET['search']}%")); $start = ($p - 1) * $shownum; // 總頁數 $maxPage = $pager->pageNum; ?> <title>文章搜尋 | <?php echo $webTitle; ?> </title> <?php // ------------------------------- // SEO // CSS // Script in the HEAD // ------------------------------- include_once INC_PATH . 'head.php'; ?>