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


PHP mosHTML::sortIcon方法代码示例

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


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

示例1: showSummary

function showSummary($option, $task)
{
    global $database, $mainframe;
    // get sort field and check against allowable field names
    $field = strtolower(mosGetParam($_REQUEST, 'field', ''));
    if (!in_array($field, array('agent', 'hits'))) {
        $field = '';
    }
    // get field ordering or set the default field to order
    $order = strtolower(mosGetParam($_REQUEST, 'order', 'asc'));
    if ($order != 'asc' && $order != 'desc' && $order != 'none') {
        $order = 'asc';
    } else {
        if ($order == 'none') {
            $field = 'agent';
            $order = 'asc';
        }
    }
    // browser stats
    $order_by = '';
    $sorts = array();
    $tab = mosGetParam($_REQUEST, 'tab', 'tab1');
    $sort_base = "index2.php?option={$option}&task={$task}";
    switch ($field) {
        case 'hits':
            $order_by = "hits {$order}";
            $sorts['b_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab1", "agente");
            $sorts['b_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab1", "acessos", $order);
            $sorts['o_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab2", "agente");
            $sorts['o_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab2", "acessos", $order);
            $sorts['d_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab3", "agente");
            $sorts['d_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab3", "acessos", $order);
            break;
        case 'agent':
        default:
            $order_by = "agent {$order}";
            $sorts['b_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab1", "agente", $order);
            $sorts['b_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab1", "acessos");
            $sorts['o_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab2", "agente", $order);
            $sorts['o_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab2", "acessos");
            $sorts['d_agent'] = mosHTML::sortIcon("{$sort_base}&tab=tab3", "agente", $order);
            $sorts['d_hits'] = mosHTML::sortIcon("{$sort_base}&tab=tab3", "acessos");
            break;
    }
    $query = "SELECT *" . "\n FROM #__stats_agents" . "\n WHERE type = 0" . "\n ORDER BY {$order_by}";
    $database->setQuery($query);
    $browsers = $database->loadObjectList();
    $query = "SELECT SUM( hits ) AS totalhits, MAX( hits ) AS maxhits" . "\n FROM #__stats_agents" . "\n WHERE type = 0";
    $database->setQuery($query);
    $bstats = null;
    $database->loadObject($bstats);
    // platform statistics
    $query = "SELECT *" . "\n FROM #__stats_agents" . "\n WHERE type = 1" . "\n ORDER BY hits DESC";
    $database->setQuery($query);
    $platforms = $database->loadObjectList();
    $query = "SELECT SUM( hits ) AS totalhits, MAX( hits ) AS maxhits" . "\n FROM #__stats_agents" . "\n WHERE type = 1";
    $database->setQuery($query);
    $pstats = null;
    $database->loadObject($pstats);
    // domain statistics
    $query = "SELECT *" . "\n FROM #__stats_agents" . "\n WHERE type = 2" . "\n ORDER BY hits DESC";
    $database->setQuery($query);
    $tldomains = $database->loadObjectList();
    $query = "SELECT SUM( hits ) AS totalhits, MAX( hits ) AS maxhits" . "\n FROM #__stats_agents" . "\n WHERE type = 2";
    $database->setQuery($query);
    $dstats = null;
    $database->loadObject($dstats);
    HTML_statistics::show($browsers, $platforms, $tldomains, $bstats, $pstats, $dstats, $sorts, $option);
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:69,代码来源:admin.statistics.php


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