当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::setSortItem方法代码示例

本文整理汇总了PHP中Paginator::setSortItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::setSortItem方法的具体用法?PHP Paginator::setSortItem怎么用?PHP Paginator::setSortItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::setSortItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$pagen->setMaxCount($GLOBAL_CONFIG['pagin_address_list_max_block_rows']);
# Get all the active firms info
//$address=$address_obj->getAllActiveCityTown();
$address =& $address_obj->getLimitActiveCityTown($GLOBAL_CONFIG['pagin_address_list_max_block_rows'], $pgx, $oitem, $odir);
# Get the resulting record count
//echo $address_obj->getLastQuery();
$linecount = $address_obj->LastRecordCount();
$pagen->setTotalBlockCount($linecount);
# Count total available data
if (isset($totalcount) && $totalcount) {
    $pagen->setTotalDataCount($totalcount);
} else {
    $totalcount = $address_obj->countAllActiveCityTown();
    $pagen->setTotalDataCount($totalcount);
}
$pagen->setSortItem($oitem);
$pagen->setSortDirection($odir);
# Start Smarty templating here
/**
 * LOAD Smarty
 */
# Note: it is advisable to load this after the inc_front_chain_lang.php so
# that the smarty script can use the user configured template theme
require_once $root_path . 'gui/smarty_template/smarty_care.class.php';
$smarty = new smarty_care('system_admin');
# Title in toolbar
$smarty->assign('sToolbarTitle', "{$LDAddress} :: {$LDListAll}");
# href for help button
$smarty->assign('pbHelp', "javascript:gethelp('address_list.php')");
# href for close button
$smarty->assign('breakfile', $breakfile);
开发者ID:patmark,项目名称:care2x-tz,代码行数:31,代码来源:citytown_list.php

示例2: display


//.........这里部分代码省略.........
                $linecount = $ergebnis->RecordCount();
            } else {
                $ergebnis = $person->SearchSelect($searchkey, $pagen->MaxCount(), $pagen->BlockStartIndex(), $oitem, $odir, $firstname_too);
                #Retrieve the sql fromwhere portion
                $fromwhere = $person->buffer;
                $HTTP_SESSION_VARS['sess_searchkey'] = $fromwhere;
                $sql = $person->getLastQuery();
                $linecount = $person->LastRecordCount();
            }
            if ($ergebnis) {
                if ($linecount == 1) {
                    if ($this->auto_show_bynumeric && $person->is_nr || $this->auto_show_byalphanumeric) {
                        $zeile = $ergebnis->FetchRow();
                        header("location:" . $this->targetfile . "?sid=" . $sid . "&lang=" . $lang . "&pid=" . $zeile['pid'] . "&edit=1&status=" . $status . "&user_origin=" . $user_origin . "&noresize=1&mode=");
                        exit;
                    }
                }
                $pagen->setTotalBlockCount($linecount);
                # If more than one count all available
                if (isset($totalcount) && $totalcount) {
                    $pagen->setTotalDataCount($totalcount);
                } else {
                    # Count total available data
                    $sql = 'SELECT COUNT(pid) AS maxnr FROM ' . $fromwhere;
                    if ($result = $db->Execute($sql)) {
                        if ($result->RecordCount()) {
                            $rescount = $result->FetchRow();
                            $totalcount = $rescount['maxnr'];
                        }
                    }
                    $pagen->setTotalDataCount($totalcount);
                }
                # Set the sort parameters
                $pagen->setSortItem($oitem);
                $pagen->setSortDirection($odir);
            } else {
                if ($show_sqlquery) {
                    echo $sql;
                }
            }
        } else {
            $mode = '';
        }
        $entry_block_bgcolor = $this->entry_block_bgcolor;
        $entry_border_bgcolor = $this->entry_border_bgcolor;
        $entry_body_bgcolor = $this->entry_body_bgcolor;
        $searchmask_bgcolor = $this->searchmask_bgcolor;
        ##############  Here starts the html output
        # Start Smarty templating here
        # Create smarty object without initiliazing the GUI (2nd param = FALSE)
        include_once $root_path . 'gui/smarty_template/smarty_care.class.php';
        $this->smarty = new smarty_care('common', FALSE);
        # Output any existing text before the search block
        if (!empty($this->pretext)) {
            $this->smarty->assign('sPretext', $this->pretext);
        }
        # Show tips and tricks link and the javascript
        if ($this->showtips) {
            ob_start();
            include_once $root_path . 'include/inc_js_gethelp.php';
            $sTemp = ob_get_contents();
            $this->smarty->assign('sJSGetHelp', $sTemp);
            ob_end_clean();
            $this->smarty->assign('LDTipsTricks', '<a href="javascript:gethelp(\'person_search_tips.php\')">' . $LDTipsTricks . '</a>');
        }
        #
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:67,代码来源:class_gui_search_person.php


注:本文中的Paginator::setSortItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。