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


PHP Database::get_course_table方法代码示例

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


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

示例1: uninstall

 function uninstall()
 {
     $t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
     $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
     $t_tool = Database::get_course_table(TABLE_TOOL_LIST);
     //Delete settings
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'ticket_tool_enable'";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_ticket";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_status";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_project";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_priority";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_message_attch";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_message";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_category";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_assigned_log";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS ticket_ticket";
     Database::query($sql);
     //Deleting course settings
     $this->uninstall_course_fields_in_all_courses();
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:29,代码来源:ticket_plugin.class.php

示例2: get_information

 /**
  * Get document information
  */
 private function get_information($course_id, $link_id)
 {
     $course_information = api_get_course_info($course_id);
     $course_id = $course_information['real_id'];
     $course_id_alpha = $course_information['id'];
     if (!empty($course_information)) {
         $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
         $link_id = Database::escape_string($link_id);
         $sql = "SELECT insert_user_id FROM {$item_property_table}\n              \t\tWHERE ref = {$link_id} AND tool = '" . TOOL_LINK . "' AND c_id = {$course_id}\n              \t\tLIMIT 1";
         $name = get_lang('Links');
         $url = api_get_path(WEB_PATH) . 'main/link/link.php?cidReq=%s';
         $url = sprintf($url, $course_id_alpha);
         // Get the image path
         $thumbnail = api_get_path(WEB_IMG_PATH) . 'link.gif';
         $image = $thumbnail;
         //FIXME: use big images
         // get author
         $author = '';
         $item_result = Database::query($sql);
         if ($row = Database::fetch_array($item_result)) {
             $user_data = api_get_user_info($row['insert_user_id']);
             $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);
         }
         return array($thumbnail, $image, $name, $author, $url);
     } else {
         return array();
     }
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:link_processor.class.php

示例3: uninstall

 public function uninstall()
 {
     $t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
     $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
     $t_tool = Database::get_course_table(TABLE_TOOL_LIST);
     //New settings
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_tool_enable'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_salt'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_host'";
     Database::query($sql);
     //Old settings deleting just in case
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_plugin'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_options} WHERE variable  = 'bbb_plugin'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_plugin_host'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'bbb_plugin_salt'";
     Database::query($sql);
     //hack to get rid of Database::query warning (please add c_id...)
     $sql = "DELETE FROM {$t_tool} WHERE name = 'bbb' AND c_id != 0";
     Database::query($sql);
     $t = Database::get_main_table('plugin_bbb_meeting');
     $sql = "DROP TABLE IF EXISTS {$t}";
     Database::query($sql);
     //Deleting course settings
     $this->uninstall_course_fields_in_all_courses($this->course_settings);
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:30,代码来源:bbb_plugin.class.php

示例4: get_course_usage

/**
 *
 */
function get_course_usage($course_code, $session_id = 0)
{
    $table = Database::get_main_table(TABLE_MAIN_COURSE);
    $course_code = Database::escape_string($course_code);
    $sql = "SELECT * FROM {$table} WHERE code='" . $course_code . "'";
    $res = Database::query($sql);
    $course = Database::fetch_object($res);
    // Learnpaths
    $table = Database::get_course_table(TABLE_LP_MAIN);
    $usage[] = array(get_lang(ucfirst(TOOL_LEARNPATH)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Forums
    $table = Database::get_course_table(TABLE_FORUM);
    $usage[] = array(get_lang('Forums'), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Quizzes
    $table = Database::get_course_table(TABLE_QUIZ_TEST);
    $usage[] = array(get_lang(ucfirst(TOOL_QUIZ)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Documents
    $table = Database::get_course_table(TABLE_DOCUMENT);
    $usage[] = array(get_lang(ucfirst(TOOL_DOCUMENT)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Groups
    $table = Database::get_course_table(TABLE_GROUP);
    $usage[] = array(get_lang(ucfirst(TOOL_GROUP)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Calendar
    $table = Database::get_course_table(TABLE_AGENDA);
    $usage[] = array(get_lang(ucfirst(TOOL_CALENDAR_EVENT)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Link
    $table = Database::get_course_table(TABLE_LINK);
    $usage[] = array(get_lang(ucfirst(TOOL_LINK)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    // Announcements
    $table = Database::get_course_table(TABLE_ANNOUNCEMENT);
    $usage[] = array(get_lang(ucfirst(TOOL_ANNOUNCEMENT)), CourseManager::count_rows_course_table($table, $session_id, $course->id));
    return $usage;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:36,代码来源:course_information.php

示例5: mdobject

 function mdobject($_course, $eid)
 {
     if (!($dotpos = strpos($eid, '.'))) {
         return;
     }
     $this->mdo_course = $_course;
     $this->mdo_eid = $eid;
     $this->mdo_type = $type = substr($eid, 0, $dotpos);
     $this->mdo_id = $id = substr($eid, $dotpos + 1);
     if ($type == 'Document' || $type == 'Scorm') {
         $table = $type == 'Scorm' ? Database::get_course_table(TABLE_SCORMDOC) : Database::get_course_table(TABLE_DOCUMENT);
         if ($dotpos = strpos($id, '.')) {
             $urlp = '?sid=' . urlencode(substr($id, $dotpos + 1));
             $id = substr($id, 0, $dotpos);
         }
         if ($docinfo = @mysql_fetch_array(Database::query("SELECT path,comment,filetype FROM\n                 {$table} WHERE id='" . addslashes($id) . "'"))) {
             $this->mdo_path = $docinfo['path'];
             $this->mdo_comment = $docinfo['comment'];
             $this->mdo_filetype = $docinfo['filetype'];
             if ($type == 'Scorm') {
                 $this->mdo_base_url = get_course_web() . $this->mdo_course['path'] . '/scorm' . $this->mdo_path;
                 $this->mdo_url = $this->mdo_base_url . '/index.php' . $urlp;
             } else {
                 $this->mdo_url = api_get_path(WEB_PATH) . 'main/document/' . ($this->mdo_filetype == 'file' ? 'download' : 'document') . '.php?' . ($this->mdo_filetype == 'file' ? 'doc_url=' : 'curdirpath=') . urlencode($this->mdo_path);
             }
         }
     } elseif ($type == 'Link') {
         $link_table = Database::get_course_table(TABLE_LINK);
         if ($linkinfo = @mysql_fetch_array(Database::query("SELECT url,title,description,category_id FROM\n                 {$link_table} WHERE id='" . addslashes($id) . "'"))) {
             $this->mdo_url = $linkinfo['url'];
         }
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:33,代码来源:md_mix.php

示例6: mdobject

 function mdobject($_course, $id)
 {
     global $ieee_dcmap_e, $ieee_dcmap_v;
     // md_funcs
     $scormdocument = Database::get_course_table(TABLE_LP_MAIN);
     $this->mdo_course = $_course;
     $this->mdo_type = 'Scorm';
     $this->mdo_id = $id;
     $this->mdo_eid = $this->mdo_type . '.' . $id;
     $this->mdo_dcmap_e = $ieee_dcmap_e;
     $this->mdo_dcmap_v = $ieee_dcmap_v;
     $sql = "SELECT path,description,lp_type FROM {$scormdocument} WHERE id='" . addslashes($id) . "'";
     if ($docinfo = @Database::fetch_array(Database::query($sql))) {
         $this->mdo_path = $docinfo['path'];
         //Sometimes the new scorm-tool adds '/.' at the end of a directory name, so remove this before continue
         //the process -- bmol
         if (substr($this->mdo_path, -2) == '/.') {
             $this->mdo_path = substr($this->mdo_path, 0, strlen($this->mdo_path) - 2);
         }
         $this->mdo_comment = $docinfo['description'];
         //Don't think the next line is correct. There used to be a 'type' field in the scormdocument table.
         //This metadata tool only works on folder types -- bmol
         $this->mdo_filetype = $docinfo['lp_type'] == 2 ? 'folder' : 'xxx';
         $this->mdo_url = get_course_web() . $this->mdo_course['path'] . '/scorm/' . $this->mdo_path . '/index.php';
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:26,代码来源:md_scorm.php

示例7: editAction

 /**
  * @Route("/edit/{tool}")
  * @Method({"GET"})
  *
  * @param string $tool
  * @return Response
  */
 public function editAction($tool)
 {
     $message = null;
     // @todo use proper functions not api functions.
     $courseId = api_get_course_int_id();
     $sessionId = api_get_session_id();
     $tool = \Database::escape_string($tool);
     $TBL_INTRODUCTION = \Database::get_course_table(TABLE_TOOL_INTRO);
     $url = $this->generateUrl('introduction.controller:editAction', array('tool' => $tool, 'course' => api_get_course_id()));
     $form = $this->getForm($url, $tool);
     if ($form->validate()) {
         $values = $form->exportValues();
         $content = $values['content'];
         $sql = "REPLACE {$TBL_INTRODUCTION}\n                    SET c_id = {$courseId},\n                        id = '{$tool}',\n                        intro_text='" . \Database::escape_string($content) . "',\n                        session_id='" . intval($sessionId) . "'";
         \Database::query($sql);
         $message = \Display::return_message(get_lang('IntroductionTextUpdated'), 'confirmation', false);
     } else {
         $sql = "SELECT intro_text FROM {$TBL_INTRODUCTION}\n                    WHERE c_id = {$courseId} AND id='" . $tool . "' AND session_id = '" . intval($sessionId) . "'";
         $result = \Database::query($sql);
         $content = null;
         if (\Database::num_rows($result) > 0) {
             $row = \Database::fetch_array($result);
             $content = $row['intro_text'];
         }
         $form->setDefaults(array('content' => $content));
     }
     $this->getTemplate()->assign('content', $form->return_form());
     $this->getTemplate()->assign('message', $message);
     $response = $this->getTemplate()->renderLayout('layout_1_col.tpl');
     return new Response($response, 200, array());
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:38,代码来源:IntroductionController.php

示例8: uninstall

 public function uninstall()
 {
     $t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
     $t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
     $t_tool = Database::get_course_table(TABLE_TOOL_LIST);
     //New settings
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'openmeetings_tool_enable'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'openmeetings_pass'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'openmeetings_user'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'openmeetings_host'";
     Database::query($sql);
     //Old settings deleting just in case
     $sql = "DELETE FROM {$t_settings} WHERE variable = 'openmeetings_plugin'";
     Database::query($sql);
     $sql = "DELETE FROM {$t_options} WHERE variable  = 'openmeetings_plugin'";
     Database::query($sql);
     //        $sql = "DELETE FROM $t_settings WHERE variable = 'openmeetings_plugin_host'";
     //        Database::query($sql);
     //        $sql = "DELETE FROM $t_settings WHERE variable = 'openmeetings_plugin_salt'";
     //        Database::query($sql);
     //hack to get rid of Database::query warning (please add c_id...)
     $sql = "DELETE FROM {$t_tool} WHERE name = 'openmeetings' AND c_id = c_id";
     Database::query($sql);
     $sql = "DROP TABLE IF EXISTS plugin_openmeetings";
     Database::query($sql);
     //Deleting course settings
     $this->uninstall_course_fields_in_all_courses();
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:openmeetings_plugin.class.php

示例9: __construct

 /**
  * Sets the surveylist and the plainsurveylist
  */
 public function __construct()
 {
     // Database table definitions
     $table_survey = Database::get_course_table(TABLE_SURVEY);
     $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
     $table_user = Database::get_main_table(TABLE_MAIN_USER);
     // searching
     $search_restriction = SurveyUtil::survey_search_restriction();
     if ($search_restriction) {
         $search_restriction = ' AND ' . $search_restriction;
     }
     $course_id = api_get_course_int_id();
     $sql = "SELECT\n                    survey.survey_id,\n                    survey.parent_id,\n                    survey_version,\n                    survey.code as name\n\t\t\t\tFROM {$table_survey} survey\n\t\t\t\tLEFT JOIN {$table_survey_question}  survey_question\n\t\t\t\tON survey.survey_id = survey_question.survey_id , {$table_user} user\n\t\t\t\tWHERE\n\t\t\t\t\tsurvey.c_id \t\t\t=  {$course_id} AND\n\t\t\t\t\tsurvey_question.c_id \t=  {$course_id} AND\n\t\t\t\t\tsurvey.author \t\t\t= user.user_id\n\t\t\t\tGROUP BY survey.survey_id";
     $res = Database::query($sql);
     $surveys_parents = array();
     $refs = array();
     $list = array();
     $plain_array = array();
     while ($survey = Database::fetch_array($res, 'ASSOC')) {
         $plain_array[$survey['survey_id']] = $survey;
         $surveys_parents[] = $survey['survey_version'];
         $thisref =& $refs[$survey['survey_id']];
         $thisref['parent_id'] = $survey['parent_id'];
         $thisref['name'] = $survey['name'];
         $thisref['id'] = $survey['survey_id'];
         $thisref['survey_version'] = $survey['survey_version'];
         if ($survey['parent_id'] == 0) {
             $list[$survey['survey_id']] =& $thisref;
         } else {
             $refs[$survey['parent_id']]['children'][$survey['survey_id']] =& $thisref;
         }
     }
     $this->surveylist = $list;
     $this->plainsurveylist = $plain_array;
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:38,代码来源:surveymanager.lib.php

示例10: update_db_info

/**
 * Update the file or directory path in the document db document table
 *
 * @author - Hugues Peeters <peeters@ipm.ucl.ac.be>
 * @param  - action (string) - action type require : 'delete' or 'update'
 * @param  - old_path (string) - old path info stored to change
 * @param  - new_path (string) - new path info to substitute
 * @desc Update the file or directory path in the document db document table
 *
 */
function update_db_info($action, $old_path, $new_path = '')
{
    $dbTable = Database::get_course_table(TABLE_DOCUMENT);
    $course_id = api_get_course_int_id();
    switch ($action) {
        case 'delete':
            $old_path = Database::escape_string($old_path);
            $to_delete = "WHERE c_id = {$course_id} AND (path LIKE BINARY '" . $old_path . "' OR path LIKE BINARY '" . $old_path . "/%')";
            $query = "DELETE FROM {$dbTable} " . $to_delete;
            $result = Database::query("SELECT id FROM {$dbTable} " . $to_delete);
            if (Database::num_rows($result)) {
                require_once api_get_path(INCLUDE_PATH) . '../metadata/md_funcs.php';
                $mdStore = new mdstore(TRUE);
                // create if needed
                $md_type = substr($dbTable, -13) == 'scormdocument' ? 'Scorm' : 'Document';
                while ($row = Database::fetch_array($result)) {
                    $eid = $md_type . '.' . $row['id'];
                    $mdStore->mds_delete($eid);
                    $mdStore->mds_delete_offspring($eid);
                }
            }
            Database::query($query);
            break;
        case 'update':
            if ($new_path[0] == '.') {
                $new_path = substr($new_path, 1);
            }
            $new_path = str_replace('//', '/', $new_path);
            // Attempt to update	- tested & working for root	dir
            $new_path = Database::escape_string($new_path);
            $query = "UPDATE {$dbTable} SET\n                        path = CONCAT('" . $new_path . "', SUBSTRING(path, LENGTH('" . $old_path . "')+1) )\n                    WHERE c_id = {$course_id} AND (path LIKE BINARY '" . $old_path . "' OR path LIKE BINARY '" . $old_path . "/%')";
            Database::query($query);
            break;
    }
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:45,代码来源:fileManage.lib.php

示例11: check_download_survey

/**
 *	@package chamilo.survey
 *	@author Arnaud Ligot <arnaud@cblue.be>
 *	@version $Id: $
 *
 *	A small peace of code to enable user to access images included into survey
 *	which are accessible by non authenticated users. This file is included
 *	by document/download.php
 */
function check_download_survey($course, $invitation, $doc_url)
{
    require_once 'survey.lib.php';
    // Getting all the course information
    $_course = CourseManager::get_course_information($course);
    $course_id = $_course['real_id'];
    // Database table definitions
    $table_survey = Database::get_course_table(TABLE_SURVEY);
    $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
    $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
    $table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
    // Now we check if the invitationcode is valid
    $sql = "SELECT * FROM {$table_survey_invitation}\n\t        WHERE\n\t            c_id = {$course_id} AND\n\t            invitation_code = '" . Database::escape_string($invitation) . "'";
    $result = Database::query($sql);
    if (Database::num_rows($result) < 1) {
        Display::display_error_message(get_lang('WrongInvitationCode'), false);
        Display::display_footer();
        exit;
    }
    $survey_invitation = Database::fetch_assoc($result);
    // Now we check if the user already filled the survey
    if ($survey_invitation['answered'] == 1) {
        Display::display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false);
        Display::display_footer();
        exit;
    }
    // Very basic security check: check if a text field from a survey/answer/option contains the name of the document requested
    // Fetch survey ID
    // If this is the case there will be a language choice
    $sql = "SELECT * FROM {$table_survey}\n\t        WHERE\n\t            c_id = {$course_id} AND\n\t            code='" . Database::escape_string($survey_invitation['survey_code']) . "'";
    $result = Database::query($sql);
    if (Database::num_rows($result) > 1) {
        if ($_POST['language']) {
            $survey_invitation['survey_id'] = $_POST['language'];
        } else {
            echo '<form id="language" name="language" method="POST" action="' . api_get_self() . '?course=' . $_GET['course'] . '&invitationcode=' . $_GET['invitationcode'] . '">';
            echo '  <select name="language">';
            while ($row = Database::fetch_assoc($result)) {
                echo '<option value="' . $row['survey_id'] . '">' . $row['lang'] . '</option>';
            }
            echo '</select>';
            echo '  <input type="submit" name="Submit" value="' . get_lang('Ok') . '" />';
            echo '</form>';
            display::display_footer();
            exit;
        }
    } else {
        $row = Database::fetch_assoc($result);
        $survey_invitation['survey_id'] = $row['survey_id'];
    }
    $sql = "SELECT count(*)\n\t        FROM {$table_survey}\n\t        WHERE\n\t            c_id = {$course_id} AND\n\t            survey_id = " . $survey_invitation['survey_id'] . " AND (\n                    title LIKE '%{$doc_url}%'\n                    or subtitle LIKE '%{$doc_url}%'\n                    or intro LIKE '%{$doc_url}%'\n                    or surveythanks LIKE '%{$doc_url}%'\n                )\n\t\t    UNION\n\t\t        SELECT count(*)\n\t\t        FROM {$table_survey_question}\n\t\t        WHERE\n\t\t            c_id = {$course_id} AND\n\t\t            survey_id = " . $survey_invitation['survey_id'] . " AND (\n                        survey_question LIKE '%{$doc_url}%'\n                        or survey_question_comment LIKE '%{$doc_url}%'\n                    )\n\t\t    UNION\n\t\t        SELECT count(*)\n\t\t        FROM {$table_survey_question_option}\n\t\t        WHERE\n\t\t            c_id = {$course_id} AND\n\t\t            survey_id = " . $survey_invitation['survey_id'] . " AND (\n                        option_text LIKE '%{$doc_url}%'\n                    )";
    $result = Database::query($sql);
    if (Database::num_rows($result) == 0) {
        Display::display_error_message(get_lang('WrongInvitationCode'), false);
        Display::display_footer();
        exit;
    }
    return $_course;
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:68,代码来源:survey.download.inc.php

示例12: update_in_bdd

 /**
  * Update in database
  */
 public function update_in_bdd()
 {
     $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
     if ($this->c_id > 0 && $this->id > 0) {
         $sql = "UPDATE {$item_view_table} SET\n                        lp_id = '" . intval($this->lp_id) . "' ,\n                        item_type = '" . Database::escape_string($this->item_type) . "' ,\n                        ref = '" . Database::escape_string($this->ref) . "' ,\n                        title = '" . Database::escape_string($this->title) . "' ,\n                        description = '" . Database::escape_string($this->description) . "' ,\n                        path = '" . Database::escape_string($this->path) . "' ,\n                        min_score = '" . Database::escape_string($this->min_score) . "' ,\n                        max_score = '" . Database::escape_string($this->max_score) . "' ,\n                        mastery_score = '" . Database::escape_string($this->mastery_score) . "' ,\n                        parent_item_id = '" . Database::escape_string($this->parent_item_id) . "' ,\n                        previous_item_id = '" . Database::escape_string($this->previous_item_id) . "' ,\n                        next_item_id = '" . Database::escape_string($this->next_item_id) . "' ,\n                        display_order = '" . Database::escape_string($this->display_order) . "' ,\n                        prerequisite = '" . Database::escape_string($this->prerequisite) . "' ,\n                        parameters = '" . Database::escape_string($this->parameters) . "' ,\n                        launch_data = '" . Database::escape_string($this->launch_data) . "' ,\n                        max_time_allowed = '" . Database::escape_string($this->max_time_allowed) . "' ,\n                        terms = '" . Database::escape_string($this->terms) . "' ,\n                        search_did = '" . Database::escape_string($this->search_did) . "' ,\n                        audio = '" . Database::escape_string($this->audio) . "'\n                    WHERE c_id=" . $this->c_id . " AND id=" . $this->id;
         Database::query($sql);
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:11,代码来源:lp_item.lib.php

示例13: get_glossary_term_by_glossary_name

 /**
  * Get glossary term by glossary id
  * @author Isaac Flores <florespaz_isaac@hotmail.com>
  * @param String The glossary term name
  * @return String The glossary description
  */
 public static function get_glossary_term_by_glossary_name($glossary_name)
 {
     global $_course;
     $glossary_table = Database::get_course_table(TABLE_GLOSSARY);
     $sql = 'SELECT description FROM ' . $glossary_table . ' WHERE name like trim("' . Database::escape_string($glossary_name) . '") ';
     $rs = Database::query($sql, __FILE__, __LINE__);
     $row = Database::fetch_array($rs);
     return $row['description'];
 }
开发者ID:Eidn,项目名称:shanghai,代码行数:15,代码来源:glossary.class.php

示例14: get_cat

function get_cat($catname)
{
    global $_course; $cateq = "category_title='". addslashes($catname) . "'";

    $linkcat_table = Database::get_course_table(TABLE_LINK_CATEGORY);
    $result = Database::query("SELECT id FROM $linkcat_table WHERE " . $cateq);

    if (Database::num_rows($result) >= 1 && ($row = Database::fetch_array($result)))
        return $row['id'];  // several categories with same name: take first

    return FALSE;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:12,代码来源:importlinks.php

示例15: reports_modules_quiz_init_forEachCourses

function reports_modules_quiz_init_forEachCourses($course_code, $course_id, $course_db) {
	global $reports_modules;
	
	$reports_modules_quiz_toolid = reports_getToolId(TOOL_QUIZ);

	array_push($reports_modules['quiz'], 
	  array('keys_query' =>  
		'select '.$course_id.' as course_id, '.
		$reports_modules_quiz_toolid.' as tool_id, '.
		'q.id as child_id, q.title as child_name, '.
		"'".$course_code."'".' as course_code from '.Database::get_course_table(TABLE_QUIZ_TEST).' q ',
		'values_query_function' => 'reports_modules_quiz_quizVal'));		
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:13,代码来源:quiz.php


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