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


PHP CourseManager::get_real_course_list方法代码示例

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


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

示例1: AnnotationReader

<?php

/* For licensing terms, see /license.txt */
$config = new \Doctrine\ORM\Configuration();
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Symfony\Component\Yaml\Parser;
AnnotationRegistry::registerFile(api_get_path(SYS_PATH) . "vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
$reader = new AnnotationReader();
$driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(api_get_path(SYS_PATH) . "tests/doctrine_console/mapping"));
$config->setMetadataDriverImpl($driverImpl);
$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
$courseList = CourseManager::get_real_course_list();
//$courseList = array();
$configurationPath = api_get_path(SYS_PATH) . 'main/inc/conf/';
$newConfigurationFile = $configurationPath . 'configuration.yml';
if (is_file($newConfigurationFile) && file_exists($newConfigurationFile)) {
    $yaml = new Parser();
    $_configuration = $yaml->parse(file_get_contents($newConfigurationFile));
}
$connectionOptions = array();
if (!empty($courseList)) {
    $dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'] . Database::get_database_glue() : null;
    foreach ($courseList as $course) {
        $connectionOptions['_chamilo_course_' . $course['db_name']] = array('driver' => 'pdo_mysql', 'dbname' => $dbPrefix . $course['db_name'], 'user' => $_configuration['db_user'], 'password' => $_configuration['db_password'], 'host' => $_configuration['db_host']);
    }
}
if (isset($_configuration['main_database'])) {
    $connectionOptions['main_database'] = array('driver' => 'pdo_mysql', 'dbname' => $_configuration['main_database'], 'user' => $_configuration['db_user'], 'password' => $_configuration['db_password'], 'host' => $_configuration['db_host']);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:cli-config.php

示例2: reports_template_CourseArticulate_getSQL

function reports_template_CourseArticulate_getSQL()
{
    // settings
    // Nom, prenom
    $query = 'select u.lastname as "Last name", u.firstname as "First name" ';
    $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
    $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
    $query .= ' order by u.user_id ';
    $queries[0] = $query;
    // Custom Field
    foreach (array("tags" => "tags") as $k => $v) {
        // FIXME
        $query = 'select ufv.field_value  as "' . $v . '" ';
        $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
        $query .= 'left join' . Database::get_main_table(TABLE_MAIN_USER_FIELD) . ' uf ';
        $query .= ' on uf.field_variable="' . $k . '" ';
        $query .= 'left outer join ' . Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES) . ' ufv ';
        $query .= ' on ufv.user_id = u.user_id and ufv.field_id = uf.id ';
        $query .= 'where u.user_id in (' . reports_getVisibilitySQL() . ') ';
        $query .= ' order by u.user_id ';
        $queries[] = $query;
    }
    // Stored Value
    $sv = array();
    foreach ($sv as $k => $v) {
        if (!isset($v['sql'])) {
            $v['sql'] = 'FIELD';
        }
        $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']);
        $query = 'select ' . $sqlField . ' as "' . $v['title'] . '" ';
        //		$query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
        $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
        $query .= ' left outer join ' . Database::get_main_table(TABLE_TRACK_STORED_VALUES) . ' sv ';
        $query .= 'on sv.user_id = u.user_id and sv_key = "' . $k . '" ';
        $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
        $query .= ' group by u.user_id ';
        $query .= ' order by u.user_id ';
        $queries[] = $query;
    }
    // first and last connection
    $query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection"  ';
    $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
    $query .= 'left outer join ' . Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN) . ' tel ';
    $query .= ' on tel.login_user_id = u.user_id ';
    $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
    $query .= ' group by u.user_id ';
    $query .= ' order by u.user_id ';
    $queries[] = $query;
    // SCORM Data
    $scormData = array();
    $course_list = CourseManager::get_real_course_list();
    foreach ($course_list as $code => $details) {
        $list = Database::query('SELECT l.id as lid, l.name as lname, li.id as liid, li.title as lititle ' . ' FROM ' . Database::get_course_table(TABLE_LP_MAIN) . ' l, ' . Database::get_course_table(TABLE_LP_ITEM) . ' li ' . ' WHERE l.c_id = ' . $details['real_id'] . ' AND li.c_id = ' . $details['real_id'] . ' AND l.id = li.lp_id');
        while ($lpItem = Database::fetch_assoc($list)) {
            $scormData[] = array('coursedb' => $details['db_name'], 'lid' => $lpItem['lid'], 'liid' => $lpItem['liid'], 'target_view_count' => 1, 'target_indicator' => 'score', 'title' => $details['title'] . '/' . $lpItem['lname'] . '/' . $lpItem['lititle'] . '/1/score', 'sql' => 'FIELD');
            $scormData[] = array('coursedb' => $details['db_name'], 'lid' => $lpItem['lid'], 'liid' => $lpItem['liid'], 'target_view_count' => 2, 'target_indicator' => 'score', 'title' => $details['title'] . '/' . $lpItem['lname'] . '/' . $lpItem['lititle'] . '/2/score', 'sql' => 'FIELD');
            $scormData[] = array('coursedb' => $details['db_name'], 'lid' => $lpItem['lid'], 'liid' => $lpItem['liid'], 'target_view_count' => null, 'target_indicator' => 'score', 'title' => $details['title'] . '/' . $lpItem['lname'] . '/' . $lpItem['lititle'] . '/all/score', 'sql' => 'avg(FIELD)');
        }
    }
    foreach ($scormData as $v) {
        if (!isset($v['sql'])) {
            $v['sql'] = 'FIELD';
        }
        $sqlField = str_replace('FIELD', $v['target_indicator'], $v['sql']);
        $query = 'select ' . $sqlField . ' as "' . $v['title'] . '" ';
        $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u ';
        $query .= 'left outer join ' . Database::get_course_table(TABLE_LP_VIEW, $details['db_name']) . ' lv ';
        $query .= ' on u.user_id = lv.user_id and lv.lp_id = ' . $v['lid'];
        $query .= ' left outer join ' . Database::get_course_table(TABLE_LP_ITEM_VIEW, $details['db_name']) . ' liv ';
        $query .= ' on lv.id = liv.lp_view_id ';
        if ($v['target_view_count']) {
            $query .= ' and liv.view_count = ' . $v['target_view_count'];
        }
        $query .= ' and liv.lp_item_id = ' . $v['liid'] . ' ';
        $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') ';
        $query .= ' group by u.user_id ';
        $query .= ' order by u.user_id ';
        $queries[] = $query;
    }
    return $queries;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:81,代码来源:courseArticulate.reports.php

示例3: display_real_course_code_select

/**
*	This code creates a select form element to let the user
*	choose a real course to link to.
*
*	We display the course code, but internally store the course id.
*/
function display_real_course_code_select($element_name)
{
    $real_course_list = CourseManager::get_real_course_list();
    echo "<select name=\"{$element_name}\" size=\"" . SELECT_BOX_SIZE . "\" >\n";
    foreach ($real_course_list as $real_course) {
        $course_code = $real_course["code"];
        echo "<option value=\"" . $course_code . "\">";
        echo $course_code;
        echo "</option>\n";
    }
    echo "</select>\n";
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:18,代码来源:course_virtual.php

示例4: foreach

                 foreach ($courses_by_teacher as $course) {
                     $students_by_course = array_keys(CourseManager::get_student_list_from_course_code($course['real_id']));
                     if (count($students_by_course) > 0) {
                         foreach ($students_by_course as $student_by_course) {
                             $students[] = $student_by_course;
                         }
                     }
                 }
             }
             if (!empty($students)) {
                 $students = array_unique($students);
             }
         } else {
             $students = array_keys(UserManager::get_users_followed_by_drh(api_get_user_id(), STUDENT));
         }
         $courses_of_the_platform = CourseManager::get_real_course_list();
         foreach ($courses_of_the_platform as $course) {
             $courses[$course['code']] = $course['code'];
         }
     }
 } else {
     if (empty($session_id)) {
         //Getting courses
         $courses = CourseManager::get_course_list_as_coach($coach_id, false);
         if (isset($courses[0])) {
             $courses = $courses[0];
         }
         //Getting students
         $students = CourseManager::get_user_list_from_courses_as_coach($coach_id);
     } else {
         $students = Tracking::get_student_followed_by_coach_in_a_session($session_id, $coach_id);
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:student.php


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