本文整理汇总了PHP中Movie::getCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::getCount方法的具体用法?PHP Movie::getCount怎么用?PHP Movie::getCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::getCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AdminPage
<?php
require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/movie.php";
$page = new AdminPage();
$movie = new Movie();
$page->title = "Movie List";
$tname = "";
if (isset($_REQUEST['moviename']) && !empty($_REQUEST['moviename'])) {
$tname = $_REQUEST['moviename'];
}
$movcount = $movie->getCount($tname);
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$tsearch = $tname != "" ? 'moviename=' . $tname . '&' : '';
$page->smarty->assign('pagertotalitems', $movcount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/movie-list.php?" . $tsearch . "&offset=");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$movielist = $movie->getRange($offset, ITEMS_PER_PAGE, $tname);
$page->smarty->assign('movielist', $movielist);
$page->content = $page->smarty->fetch('movie-list.tpl');
$page->render();
示例2: AdminPage
<?php
require_once "config.php";
$page = new AdminPage();
$movie = new Movie(['Settings' => $page->settings]);
$page->title = "Movie List";
$movcount = $movie->getCount();
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$page->smarty->assign('pagertotalitems', $movcount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/movie-list.php?offset=");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$movielist = $movie->getRange($offset, ITEMS_PER_PAGE);
$page->smarty->assign('movielist', $movielist);
$page->content = $page->smarty->fetch('movie-list.tpl');
$page->render();