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


PHP UserGroup::get_sessions_by_usergroup方法代码示例

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


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

示例1: array

         $sidx = 'name';
     }
     $result = Database::select('*', "{$obj->table} ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
     $new_result = array();
     foreach ($result as $item) {
         $new_result[] = $item;
     }
     $result = $new_result;
     break;
 case 'get_usergroups':
     $columns = array('name', 'users', 'courses', 'sessions', 'group_type', 'actions');
     $result = Database::select('*', $obj->table, array('order' => "name {$sord}", 'LIMIT' => "{$start} , {$limit}"));
     $new_result = array();
     if (!empty($result)) {
         foreach ($result as $group) {
             $group['sessions'] = count($obj->get_sessions_by_usergroup($group['id']));
             $group['courses'] = count($obj->get_courses_by_usergroup($group['id']));
             $group['users'] = count($obj->get_users_by_usergroup($group['id']));
             switch ($group['group_type']) {
                 case '0':
                     $group['group_type'] = Display::label(get_lang('Class'), 'info');
                     break;
                 case '1':
                     $group['group_type'] = Display::label(get_lang('Social'), 'success');
                     break;
             }
             $new_result[] = $group;
         }
         $result = $new_result;
     }
     $columns = array('name', 'users', 'courses', 'sessions', 'group_type');
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:model.ajax.php

示例2: search_sessions

$id = intval($_GET['id']);
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
    $form_sent = $_POST['form_sent'];
    $elements_posted = $_POST['elements_in_name'];
    if (!is_array($elements_posted)) {
        $elements_posted = array();
    }
    if ($form_sent == 1) {
        //added a parameter to send emails when registering a user
        $usergroup->subscribe_sessions_to_usergroup($id, $elements_posted);
        header('Location: usergroups.php');
        exit;
    }
}
$data = $usergroup->get($id);
$session_list_in = $usergroup->get_sessions_by_usergroup($id);
$session_list = SessionManager::get_sessions_list(array(), array('name'));
//api_display_tool_title($tool_name.' ('.$session_info['name'].')');
$elements_not_in = $elements_in = array();
if (!empty($session_list)) {
    foreach ($session_list as $session) {
        if (in_array($session['id'], $session_list_in)) {
            $elements_in[$session['id']] = $session['name'];
        } else {
            $elements_not_in[$session['id']] = $session['name'];
        }
    }
}
$ajax_search = $add_type == 'unique' ? true : false;
//checking for extra field with filter on
function search_sessions($needle, $type)
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:add_sessions_to_usergroup.php

示例3: indexAction


//.........这里部分代码省略.........
         case 'get_promotions':
             $columns = array('name', 'career', 'description', 'actions');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'name';
             }
             $result = Database::select('p.id,p.name, p.description, c.name as career, p.status', "{$obj->table} p LEFT JOIN " . Database::get_main_table(TABLE_CAREER) . " c  ON c.id = p.career_id ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             foreach ($result as $item) {
                 if (!$item['status']) {
                     $item['name'] = '<font style="color:#AAA">' . $item['name'] . '</font>';
                 }
                 $new_result[] = $item;
             }
             $result = $new_result;
             break;
         case 'get_grade_models':
             $columns = array('name', 'description', 'actions');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'name';
             }
             $result = Database::select('*', "{$obj->table} ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             foreach ($result as $item) {
                 $new_result[] = $item;
             }
             $result = $new_result;
             break;
         case 'get_usergroups':
             $columns = array('name', 'users', 'courses', 'sessions', 'group_type', 'actions');
             $result = Database::select('*', $obj->table, array('order' => "name {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             if (!empty($result)) {
                 foreach ($result as $group) {
                     $group['sessions'] = count($obj->get_sessions_by_usergroup($group['id']));
                     $group['courses'] = count($obj->get_courses_by_usergroup($group['id']));
                     $group['users'] = count($obj->get_users_by_usergroup($group['id']));
                     switch ($group['group_type']) {
                         case '0':
                             $group['group_type'] = Display::label(get_lang('Class'), 'info');
                             break;
                         case '1':
                             $group['group_type'] = Display::label(get_lang('Social'), 'success');
                             break;
                     }
                     $new_result[] = $group;
                 }
                 $result = $new_result;
             }
             $columns = array('name', 'users', 'courses', 'sessions', 'group_type');
             if (!in_array($sidx, $columns)) {
                 $sidx = 'name';
             }
             //Multidimensional sort
             ArrayClass::msort($result, $sidx);
             break;
         case 'get_extra_fields':
             $obj = new \ExtraField($type);
             $columns = array('field_display_text', 'field_variable', 'field_type', 'field_changeable', 'field_visible', 'field_filter', 'field_order');
             $result = \Database::select('*', $obj->table, array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
             $new_result = array();
             if (!empty($result)) {
                 foreach ($result as $item) {
                     $item['field_type'] = $obj->get_field_type_by_id($item['field_type']);
                     $item['field_changeable'] = $item['field_changeable'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
                     $item['field_visible'] = $item['field_visible'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
                     $item['field_filter'] = $item['field_filter'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:67,代码来源:ModelAjaxController.php


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