本文整理汇总了PHP中Templates::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::getAll方法的具体用法?PHP Templates::getAll怎么用?PHP Templates::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::getAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Paginator
}
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
if ($ccc >= 1 + $recordsPerPage * ($pp - 1) and $ccc <= $recordsPerPage * $pp) {
$all[$ccc] = $row;
$all[$ccc][4] = $ccc;
}
$ccc++;
}
// deg($all);
$paginator = new Paginator($count);
$paginator->setRecordsPerPage($recordsPerPage);
$paginator->setCurrentPage($pp);
$append .= " LIMIT " . $paginator->getLimit();
$_SESSION['admin_filters_stats']['filters']['count'] = $count;
$templates = new Templates();
$templates_list = $templates->getAll();
// deg($templates_list);
if (!$default_show) {
$template_names_by_hash = array();
foreach ($templates_list as $s) {
$template_names_by_hash[$s->hash] = $s->name;
}
$smarty->assign('template_names_by_hash', $template_names_by_hash);
// deg($template_names_by_hash);
}
$smarty->assign('templateClass', $templates);
$smarty->assign('templates', $templates_list);
$smarty->assign('paginatorHtml', $paginator->getHtml());
$smarty->assign('paginator', $paginator);
$smarty->assign('filters', $filters);
$smarty->assign('arr', $all);
示例2: date
$filters['start_date'] = $min_date;
}
if (empty($_SESSION['admin_filters_quizz']['filters']['end_date'])) {
$_SESSION['admin_filters_quizz']['filters']['end_date'] = date("Y-m-d");
$filters['end_date'] = date("Y-m-d");
}
$smarty = Application::getSmarty('/admin/templates/', '/admin/templates_c/');
$smarty->assign($filters);
$res = array();
$res_all = array();
$max = array();
// ------------------- start query
$query = " SELECT `templates`.`name` , `templates`.`id` , `notifications`.`type`";
$initial = 2;
$templates = new Templates();
$tpls = $templates->getAll();
if (!empty($filters['type_editable'])) {
if ($initial > 0) {
$query .= ", ";
} else {
$initial++;
}
$query .= " sum( `notifications`.`status` = 'EDITABLE') as `type_editable` ";
}
if (!empty($filters['type_published_free'])) {
if ($initial > 0) {
$query .= ", ";
} else {
$initial++;
}
$query .= " sum( `notifications`.`status`='PUBLISHED' AND NOT (`notifications`.`flags` & " . Notify::FLAG_PREMIUM . ")) as `type_published_free` ";
示例3: isset
//$append .= " AND flags & " . Notify::FLAG_NOTIF_DATA_SAVED;
$orderAlbums = isset($_SESSION['admin_filters_quizz']['order']) ? $_SESSION['admin_filters_quizz']['order'] : null;
if (isset($orderAlbums->orderBy)) {
$append .= ' ORDER BY `' . $orderAlbums->orderBy . '` ' . $orderAlbums->orderType . ' ';
} else {
$append .= ' ORDER BY `id` DESC ';
}
$recordsPerPage = isset($filters['records']) ? intval($filters['records']) : 10;
if ($recordsPerPage < 10 || $recordsPerPage > 500) {
$recordsPerPage = 10;
}
$album = new Notify();
$count = $album->getCount($append);
$templates = new Templates();
$paginator = new Paginator($count);
$paginator->setRecordsPerPage($recordsPerPage);
$append .= " LIMIT " . $paginator->getLimit();
$filters['order'] = $orderAlbums;
$smarty->assign('paginatorHtml', $paginator->getHtml());
$smarty->assign('paginator', $paginator);
$smarty->assign('notifications', Notify::getNotificationsListAdmin($append));
$smarty->assign('filters', $filters);
if (!isset($arr)) {
$arr[] = '';
}
$smarty->assign('arr_template', $arr);
$smarty->assign('templates', $templates->getAll(' order by name '));
$smarty->assign('quizTypes', Notify::getTypes());
$smarty->assign($_SESSION['admin_filters_quizz']['filters'], $_SESSION['admin_filters_quizz']['filters']);
$smarty->assign('filter_chart_period', $_SESSION['admin_filters_quizz']['filters']['filter_chart_period']);
$smarty->assign('filter_chart_y_axis', $_SESSION['admin_filters_quizz']['filters']['filter_chart_y_axis']);
示例4: isset
<?php
$smarty->assign('action', $action);
$id = isset($_GET['id']) ? intval($_GET['id']) : null;
$template = new Templates($id);
switch ($action) {
case 'list':
default:
$type = isset($_GET['type']) ? $_GET['type'] : null;
$obj = new Templates();
$append = "";
if (!empty($type)) {
$append = "WHERE type = '" . realEscapeString($type) . "' ";
}
$smarty->assign('obj', $obj->getAll($append . " ORDER BY `display_order` "));
$smarty->assign('CONTENT', 'templates/list.tpl');
$smarty->assign('type', $type);
break;
case 'status':
if (!isset($_GET['id'])) {
jump('index.php?page=templates');
}
$obj = new Templates((int) $_GET['id']);
$obj->status = $obj->status == 0 ? 1 : 0;
$obj->save();
Messages::addNotice('Status changed');
jump('index.php?page=templates');
break;
case 'default':
if (!isset($_GET['id'])) {
jump('index.php?page=templates');