コード例 #1
0
ファイル: list_news.php プロジェクト: quangphpd00900/maytinh
<?php

$data = array();
$data['title'] = "Danh sách tin tức";
$data['template'] = "news/list_news";
$data['act'] = 5;
$news = new libraries_news();
$pager = new libraries_pager();
$limit = 10;
$pager->set_link("index.php?mod=news&act=list");
$total = $news->total_news();
$start = $pager->start();
$pages = $pager->page($total, $limit);
$data['pagelist'] = $pager->listpage($pages, $start, $limit);
$data['news'] = $news->list_news($start, $limit);
loadview("layout", $data);
コード例 #2
0
ファイル: news_cago.php プロジェクト: quangphpd00900/maytinh
<?php

$data = array();
$id = $_GET['cid'];
$data['template'] = "news/news_cago_view";
$db = new model_mnews();
$data['cago_detail'] = $db->get_cago($id);
//debug($data['cago_detail']);
$pager = new libraries_pager();
$pager->set_link("index.php?page=news&act=list_cago&cid=" . $id . "");
$limit = 5;
$total = $db->total_cago($id);
$start = $pager->start();
$pages = $pager->page($total, $limit, $id);
$data['cate'] = $db->list_cate();
$data['title'] = $data['cago_detail']['cago_name'];
$data['pagelist'] = $pager->listpage($pages, $start, $limit);
$data['listnews'] = $db->list_cago($start, $limit, $id);
//debug($data['listnews']);
loadview("layout", $data);