當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Institution::count_members方法代碼示例

本文整理匯總了PHP中Institution::count_members方法的典型用法代碼示例。如果您正苦於以下問題:PHP Institution::count_members方法的具體用法?PHP Institution::count_members怎麽用?PHP Institution::count_members使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Institution的用法示例。


在下文中一共展示了Institution::count_members方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: user_institution_graph

function user_institution_graph($type = null)
{
    // Draw a bar graph showing the number of users in each institution
    require_once get_config('libroot') . 'institution.php';
    $institutions = Institution::count_members(false, true);
    if (count($institutions) > 1) {
        $dataarray = array();
        foreach ($institutions as &$i) {
            $dataarray[$i->displayname][get_string('institution')] = $i->members;
        }
        arsort($dataarray);
        // Truncate to avoid trying to fit too many results onto graph
        $dataarray = array_slice($dataarray, 0, 12, true);
        $data['graph'] = $type ? $type : 'bar';
        $data['graph_function_name'] = 'user_institution_graph';
        $data['title'] = get_string('institutionmembers', 'admin');
        $data['labels'] = array_keys($dataarray[$i->displayname]);
        $data['data'] = $dataarray;
        return $data;
    }
}
開發者ID:kienv,項目名稱:mahara,代碼行數:21,代碼來源:registration.php

示例2: build_institutions_html

function build_institutions_html($filter, $showdefault, $query, $limit, $offset, &$count = null)
{
    global $USER;
    $institutions = Institution::count_members($filter, $showdefault, $query, $limit, $offset, $count);
    $smarty = smarty_core();
    $smarty->assign('institutions', $institutions);
    $smarty->assign('siteadmin', $USER->get('admin'));
    $data['tablerows'] = $smarty->fetch('admin/users/institutionsresults.tpl');
    $pagination = build_pagination(array('id' => 'adminstitutionslist_pagination', 'datatable' => 'adminstitutionslist', 'url' => get_config('wwwroot') . 'admin/users/institutions.php' . (!empty($query) ? '?query=' . urlencode($query) : ''), 'jsonscript' => 'admin/users/institutions.json.php', 'count' => $count, 'limit' => $limit, 'offset' => $offset, 'resultcounttextsingular' => get_string('institution', 'admin'), 'resultcounttextplural' => get_string('institutions', 'admin')));
    $data['pagination'] = $pagination['html'];
    $data['pagination_js'] = $pagination['javascript'];
    return $data;
}
開發者ID:richardmansfield,項目名稱:richardms-mahara,代碼行數:13,代碼來源:institution.php

示例3: user_institution_graph

function user_institution_graph()
{
    // Draw a bar graph showing the number of users in each institution
    require_once get_config('libroot') . 'institution.php';
    $institutions = Institution::count_members(false, true);
    if (count($institutions) > 1) {
        $dataarray = array();
        foreach ($institutions as &$i) {
            $dataarray[$i->displayname] = $i->members;
        }
        arsort($dataarray);
        // Truncate to avoid overlapping labels
        $dataarray = array_slice($dataarray, 0, 25, true);
        require_once get_config('libroot') . "pear/Image/Graph.php";
        $Graph =& Image_Graph::factory('graph', array(300, 300));
        $Font =& $Graph->addNew('font', 'Vera');
        $Font->setSize(9);
        $Graph->setFont($Font);
        $Graph->add(Image_Graph::vertical(Image_Graph::vertical(Image_Graph::factory('title', array(get_string('institutionmembers', 'admin'), 9)), $Plotarea = Image_Graph::factory('plotarea'), 5), $Date = Image_Graph::factory('title', array(format_date(time(), 'strftimew3cdate'), 7)), 96));
        $Date->setAlignment(IMAGE_GRAPH_ALIGN_RIGHT);
        $DateFont =& $Graph->addNew('font', 'Vera');
        $DateFont->setColor('gray@0.8');
        $Date->setFont($DateFont);
        $Dataset =& Image_Graph::factory('dataset', array($dataarray));
        $Plot =& $Plotarea->addNew('bar', array(&$Dataset));
        $Plot->setLineColor('gray');
        $Plot->setSpacing(2);
        $FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
        $Plot->setFillStyle($FillArray);
        $FillArray->addColor('blue@0.6');
        $FillArray->addColor('green@0.6');
        $FillArray->addColor('red@0.6');
        $FillArray->addColor('yellow@0.6');
        $FillArray->addColor('orange@0.6');
        $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
        if (count($dataarray) > 4) {
            $AxisX->setFontAngle('vertical');
        }
        $AxisX->setFontSize(8);
        $Graph->done(array('filename' => stats_graph_path('institutions')));
    }
}
開發者ID:richardmansfield,項目名稱:richardms-mahara,代碼行數:42,代碼來源:registration.php


注:本文中的Institution::count_members方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。