本文整理汇总了PHP中PSU::paginationInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP PSU::paginationInfo方法的具体用法?PHP PSU::paginationInfo怎么用?PHP PSU::paginationInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSU
的用法示例。
在下文中一共展示了PSU::paginationInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_all_checklists
/**
* returns all employee checklists of the type in the constructer
*/
public function get_all_checklists($hidden = false)
{
if (!$this->type) {
return false;
}
$args = array($this->type, false, $_SESSION['pidm']);
//end array
if (!$hidden) {
$where = " AND NOT EXISTS( SELECT 1 FROM checklist_user_settings u WHERE u.checklist_id = p.id AND pidm = ? )";
} else {
$where = " AND EXISTS( SELECT 1 FROM checklist_user_settings u WHERE u.checklist_id = p.id AND pidm = ? )";
}
//end else
$sql = "\n\t\t\tSELECT p.* \n\t\t\tFROM \n\t\t\t\tperson_checklists p\n\t\t\t\tJOIN phonebook.phonebook ph\n\t\t\t\t\tON ph.pidm = p.pidm\n\t\t\t\tLEFT JOIN person_checklist_meta m\n\t\t\t\t\tON m.checklist_id = p.id\n\t\t\t\t\tAND m.meta_key = 'end_date'\n\t\t\tWHERE \n\t\t\t\tp.type=?\n\t\t\tAND\n\t\t\t\tp.closed=?\n\t\t\t\t{$where}\n\t\t\tORDER BY\n\t\t\t\tm.meta_value,\n\t\t\t\tph.name_last,\n\t\t\t\tph.name_first,\n\t\t\t\tp.activity_date\n\t\t\t" . $this->sort;
$this->checklists['pending'] = PSU::db('hr')->GetAll($sql, $args);
if (!(bool) $this->is_incomplete) {
$args = array($this->type, true, $_SESSION['pidm']);
//end array
$params = array('sort' => 'desc');
$this->checklists['closed'] = PSU::db('hr')->PageExecute($sql, $this->limit, $this->offset, $args);
$this->pagination = PSU::paginationInfo($params, $this->checklists['closed']);
$this->pagination['display_num'] = $this->pagination['display_end'] - $this->pagination['display_start'] + 1;
}
//end if
}
示例2: channels
/**
* Portal Content browser
*/
public function channels($view = null, $page = 1)
{
if ($view == 'newest' || $view == 'popular') {
$channels = MyChannel::$view($this->portal->person);
} else {
$channels = MyChannel::fetchAll($this->portal->person);
}
$data = array();
foreach ($channels as $channel) {
if (ChannelAuthZ::_authz($channel->slug)) {
$data[] = $channel;
}
}
//end foreach
$per_page = 20;
$num_records = count($data);
$data = array_slice($data, ($page - 1) * $per_page, $per_page);
$overrides = array('last_page' => ceil($num_records / $per_page), 'total_records' => $num_records, 'num_rows' => count($data), 'rows_per_page' => $per_page, 'current_page' => $page);
$pagination = PSU::paginationResults(PSU::paginationInfo($_GET, $results, $overrides), $data);
$this->tpl->assign('channels', $pagination['items']);
$this->tpl->assign('pages', $pagination);
$this->tpl->assign('user_channels', MyChannel::fetchAll($this->person));
$this->tpl->display('channels.tpl');
}
示例3: run
/**
* Executes the report and returns the data
*/
public function run($return_results = false)
{
if (!$this->params_changed && $this->records) {
return $this->records;
}
//end if
if (!$this->sql) {
throw new Exception('SQL for this report is not set');
}
//end if
if ($this->debug) {
PSU::db($this->database)->debug = $this->debug;
}
//end if
$this->prepSQL();
// retrieve the results
$this->results = $this->execute($this->execute_sql, $this->final_bind, $this->key, $this->database, $this->paging ? 'CachePageExecute' : ($GLOBALS['NO_CACHE_EXECUTE'] || $this->args['nocache'] ? 'Execute' : 'CacheExecute'), true);
// parse the result set into records
if ($this->results instanceof ADORecordSet) {
if ($this->paging) {
$this->pagination = PSU::paginationInfo($_GET, $this->results);
}
//end if
$this->records = $this->parse_results($this->results, $this->key, $this->id);
}
//end if
return $return_results ? $this->results : $this->records;
}