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


PHP Statistics::printStats方法代码示例

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


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

示例1: printUsersNotLoggedInStats

 /**
  * Print the number of users that didn't login for a certain period of time
  */
 public static function printUsersNotLoggedInStats()
 {
     $totalLogin = array();
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
     $access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
     $current_url_id = api_get_current_access_url_id();
     $total = self::countUsers();
     if (api_is_multiple_url_enabled()) {
         $table_url = ", {$access_url_rel_user_table}";
         $where_url = " AND login_user_id=user_id AND access_url_id='" . $current_url_id . "'";
     } else {
         $table_url = '';
         $where_url = '';
     }
     $now = api_get_utc_datetime();
     $sql[get_lang('ThisDay')] = "SELECT count(distinct(login_user_id)) AS number " . " FROM {$table} {$table_url} " . " WHERE DATE_ADD(login_date, INTERVAL 1 DAY) >= '{$now}' {$where_url}";
     $sql[get_lang('Last7days')] = "SELECT count(distinct(login_user_id)) AS number " . " FROM {$table} {$table_url} " . " WHERE DATE_ADD(login_date, INTERVAL 7 DAY) >= '{$now}' {$where_url}";
     $sql[get_lang('Last31days')] = "SELECT count(distinct(login_user_id)) AS number " . " FROM {$table} {$table_url} " . " WHERE DATE_ADD(login_date, INTERVAL 31 DAY) >= '{$now}' {$where_url}";
     $sql[sprintf(get_lang('LastXMonths'), 6)] = "SELECT count(distinct(login_user_id)) AS number " . " FROM {$table} {$table_url} " . " WHERE DATE_ADD(login_date, INTERVAL 6 MONTH) >= '{$now}' {$where_url}";
     $sql[get_lang('NeverConnected')] = "SELECT count(distinct(login_user_id)) AS number " . " FROM {$table} {$table_url} WHERE 1=1 {$where_url}";
     foreach ($sql as $index => $query) {
         $res = Database::query($query);
         $obj = Database::fetch_object($res);
         $r = $total - $obj->number;
         $totalLogin[$index] = $r < 0 ? 0 : $r;
     }
     Statistics::printStats(get_lang('StatsUsersDidNotLoginInLastPeriods'), $totalLogin, false);
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:statistics.lib.php

示例2:

        break;
    case 'logins':
        Statistics::printLoginStats($_GET['type']);
        break;
    case 'pictures':
        Statistics::printUserPicturesStats();
        break;
    case 'no_login_users':
        Statistics::printUsersNotLoggedInStats();
        break;
    case 'zombies':
        ZombieReport::create(array('report' => 'zombies'))->display();
        break;
    case 'activities':
        Statistics::printActivitiesStats();
        break;
    case 'messagesent':
        $messages_sent = Statistics::getMessages('sent');
        Statistics::printStats(get_lang('MessagesSent'), $messages_sent);
        break;
    case 'messagereceived':
        $messages_received = Statistics::getMessages('received');
        Statistics::printStats(get_lang('MessagesReceived'), $messages_received);
        break;
    case 'friends':
        // total amount of friends
        $friends = Statistics::getFriends();
        Statistics::printStats(get_lang('CountFriends'), $friends);
        break;
}
Display::display_footer();
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:index.php


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