Example #1
0
//$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']);