require_once($_SERVER["DOCUMENT_ROOT"] . "/cms/default.php");
function action( &$c ){
$count = count($c->tbl_news->find( "del_flg='0' and view_flg='0'"));
if( $c->get["p"] ){
$p = $c->get["p"];
}else{
$p = 1;
}
$limit = 15;//1pあたりの表示件数
$offset = ( $p - 1 ) * $limit;
$res = $c->tbl_news->find( "del_flg='0' and view_flg='0'" , "date desc" , "{$offset} , {$limit}" );
foreach( $res as $v ){
$date = preg_replace( "/-/" , "." , $v["date"] );
$html .=<<<_EOF_
{$v["title"]}
_EOF_;
}
$option = array(
'baseUrl' => '', // リンクのURL
'queryStr' => 'p', // クエリー文字列
'curPage' => $p, // 現在のページ番号
'perPage' => $limit, // 1画面当たりのリスト数
'totalRows' => $count, // リストの合計数
'numLinks' => 3, // 前後のリンク数
'pageSummary' => FALSE, // サマリーの表示
'firstLink' => '«', // "最初" のページへのリンク文字列
'prevLink' => '‹', // "前" のページへのリンク文字列
'nextLink' => '›', // "次" のページへのリンク文字列
'lastLink' => '»', // "最後" のページへのリンク文字列
'fullTagOpen' => '', // ページネーションの終了タグ
'linkTagOpen' => '', // ページリンクの開始タグ
'linkTagClose' => '', // ページリンクの終了タグ
'curTagOpen' => '', // "現在" のページの番号の開始タグ
'curTagClose' => '' // "現在" のページの番号の終了タグ
);
$pager = $c->common->PageNation( $c , $option );
$c->setViewFile(USER_VIEW_PATH . "infomation/index.html");
$c->set( "list" , $html );
$c->set( "pager" , $pager );
}
?>