$urlParam .= '&keyword=' . $_REQUEST['keyword']; } $query = "select custom_template_id, template_name,template_format,template_status from custom_templates where " . $qryApp . " order by custom_template_id desc"; $rs = $dbClass->prepareConditionStatement($query, $conditionValues); $numRows = $dbClass->getAffectedRows(); if ($numRows > 0) { $urlParameters = $urlParam; $pager = new SqlPager($query, $numRows, $conditionValues, $url->urlBase . "custom_templates.php?{$urlParam}", $items_per_page, $dbDetails); $pager->opt_texts['first'] = "<<"; $pager->opt_texts['back'] = "<"; $pager->opt_texts['next'] = ">"; $pager->opt_texts['last'] = ">>"; $pager->opt_texts['links_seperator'] = " "; $pager->opt_links_count = 5; $templates = array(); foreach ($pager->getPage($conditionValues) as $ky => $ns) { $templates[$ky] = $ns; } } if (count($errorList) > 0) { $errorString .= '<div class="errorlists" style="font-weight:bold">Please fix the following errors:-</div>'; foreach ($errorList as $errorKey => $errorValue) { $errorString .= '<div class="errorlists">' . $errorValue . '</div>'; } } $smarty->assign('errorString', $errorString); $smarty->assign('listCnt', $numRows); if ($numRows > 0) { $smarty->assign('pager', $pager); } $smarty->assign('urlParam', $urlParam);
<?php include '../common.php'; $search = ''; if (i($QUERY, 'search')) { $keywords = array_unique(preg_split("/[\\s,\\.\\-]+/", $QUERY['search'])); //Split the search query to its individual keywords $stop_words = array('I', 'a', 'about', 'an', 'are', 'as', 'at', 'be', 'by', 'for', 'from', 'how', 'in', 'is', 'it', 'la', 'of', 'on', 'or', 'that', 'the', 'this', 'to', 'was', 'what', 'when', 'where', 'who', 'will', 'with', 'the'); $keywords = array_diff($keywords, $stop_words); //We don't need the frequently used words in the keywords if (!$keywords) { showMessage('Please be more specific in your query', 'index.php', 'search-status'); } //Make the necessary query fragments $name = array(); foreach ($keywords as $key) { $name[] = "name LIKE '%{$key}%'"; } $search = ' AND ' . implode(' AND ', $name); } $pager = new SqlPager("SELECT Comic.id, IF(ComicTerm.comic_name,ComicTerm.comic_name,Comic.name) AS name, Comic.url, \n\t\tIF(ComicTerm.user_id={$_SESSION['user_id']},1,0) AS subscribed\n\tFROM Comic LEFT JOIN ComicTerm ON Comic.id=ComicTerm.comic_id \n\tWHERE Comic.status='1' {$search}\n\tORDER BY subscribed DESC, Comic.name", 20); $comics = $pager->getPage(); render();
for ($i = 0; $i < count($QUERY['task_id']); $i++) { $order[$QUERY['task_id'][$i]] = $QUERY['sort_order'][$i]; } $Task->reOrder($order); $QUERY['action'] = 'change_order'; } //We bring in the pager. $options = array(); if (isset($_REQUEST['project'])) { $options['project'] = $_REQUEST['project']; } if (isset($_REQUEST['contexts'])) { $options['contexts'] = $_REQUEST['contexts']; } $pager = new SqlPager($qry_tasks, 10); $tasks = $pager->getPage(); $bbcode = new BBcode(); //Get the project name and context names into the $tasks array for ($i = 0; $i < count($tasks); $i++) { $tasks[$i]['project_name'] = $projects[$tasks[$i]['project_id']]; $tasks[$i]['contexts'] = $sql->getCol("SELECT context_id FROM {$config['db_prefix']}TaskContext WHERE task_id=" . $tasks[$i]['id']); $tasks[$i]['description'] = $bbcode->Parse($tasks[$i]['description']); } //Change Order Settings $change_order = false; $colspan = 6; if (isset($QUERY['action']) and $QUERY['action'] == 'change_order') { $colspan = 7; $change_order = true; } $template->addResource('bbcode.css', 'css');
<?php include '../common.php'; include '_form.php'; checkTaskOwnership($QUERY['task']); if (isset($QUERY['action']) and $QUERY['action'] == 'Edit') { if ($Task->edit($QUERY['task'], $QUERY['name'], $QUERY['description'], $QUERY['status'], $QUERY['type'], $QUERY['completed_on'], $QUERY['project_id'])) { showMessage("Task updated successfully", 'tasks/index.php'); } } $pager = new SqlPager("SELECT id, UNIX_TIMESTAMP(from_time) AS from_time, \n\tIF(to_time='0000-00-00 00:00:00', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(to_time)) AS to_time FROM Duration WHERE task_id={$QUERY['task']} ORDER BY from_time DESC", 20); $task_details = $pager->getPage(); $total_time = $sql->getOne("SELECT SUM(IF(to_time='0000-00-00 00:00:00', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(to_time)) - UNIX_TIMESTAMP(from_time)) FROM Duration WHERE task_id={$QUERY['task']}"); $data = $Task->find($QUERY['task']); if (!$data) { showMessage("Invalid task specified", 'tasks/index.php', 'error'); } render();
<?php include '../common.php'; include '../includes/classes/SqlPager.php'; //Show all the reminders in this month $reminder_qry = "SELECT id,name,created_on,day,description FROM {$config['db_prefix']}Reminder " . " WHERE MONTH(CURDATE())=MONTH(day) AND day>=CURDATE()" . " AND user_id='{$_SESSION['user']}' ORDER BY day"; $pager = new SqlPager($reminder_qry, 10); $reminders = $pager->getPage(); // Convert bbcode to html $bbcode = new BBcode(); for ($i = 0; $i < count($reminders); $i++) { $reminders[$i]['description'] = $bbcode->Parse($reminders[$i]['description']); } $template->addResource('bbcode.css', 'css'); $template->addResource('bbcode.js', 'js'); $template->addResource('_list.js', 'js'); $template->addResource('reminders/list.css', 'css'); $template->addResource('reminders/list.js', 'js'); render();