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


PHP UserUtils::is_user_on_module方法代碼示例

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


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

示例1: add_student_to_module

 /**
  * Enrole the student on a module.
  *
  * @param $idMod moduleID of module
  * @param $attempt
  * @param $session session of module
  * @param int $auto_update if system add
  *
  * @return bool return true if successful.
  */
 public function add_student_to_module($idMod, $attempt, $session, $auto_update = 0)
 {
     // need to check its a self reg module
     if (module_utils::get_full_details_by_ID($idMod, $this->db) === false) {
         return false;
     }
     if (UserUtils::is_user_on_module($this, $idMod, $session, $this->db)) {
         //don't add a user to a module multiple times
         return true;
     }
     $return = UserUtils::add_student_to_module($this->get_user_ID(), $idMod, $attempt, $session, $auto_update);
     $this->load_student_modules();
     return $return;
 }
開發者ID:vinod-co,項目名稱:centa,代碼行數:24,代碼來源:userobject.class.php

示例2: foreach

echo "<tr>\n";
foreach ($table_order as $col_title) {
    echo "<th style=\"background-color:#1E3C7B\" class=\"coltitle\">{$col_title}</th>\n";
}
?>
  </tr>
  </thead>

  <tbody>
<?php 
$stmt = false;
if ($userObject->has_role(array('Admin', 'SysAdmin')) or $userObject->get_user_ID() == $userID) {
    $log_viewable = true;
} else {
    $idMod = array_keys($userObject->get_staff_modules());
    $log_viewable = UserUtils::is_user_on_module($userID, $idMod, '', $mysqli);
}
$paper_types = array('Formative Self-Assessment', 'Progress Test', 'Summative Exam', 'Survey', 'OSCE Station', 'Offline Paper', 'Peer Review');
if ($log_viewable) {
    if (stripos($user_details['roles'], 'External Examiner') !== false) {
        // Get the papers the External is down to review.
        $external_array = array();
        $sql = "SELECT DISTINCT\n\t\t\t\t\t\t\t\tcrypt_name, paper_title, property_id, paper_type, started, DATE_FORMAT(started,'{$configObject->get('cfg_long_date_time')}') AS display_started\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t(properties, properties_reviewers)\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\treview_metadata\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\tproperties.property_id = review_metadata.paperID AND review_metadata.reviewerID = ?\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tproperties.property_id = properties_reviewers.paperID AND\n\t\t\t\t\t\t\t\tproperties_reviewers.reviewerID = ? AND\n\t\t\t\t\t\t\t\tdeleted IS NULL\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\tpaper_title";
        $stmt = $mysqli->prepare($sql);
        $stmt->bind_param('ii', $userID, $userID);
        $stmt->execute();
        $stmt->bind_result($crypt_name, $paper_title, $property_id, $paper_type, $started, $display_started);
        while ($stmt->fetch()) {
            $paper[$results_no]['crypt_name'] = $crypt_name;
            $paper[$results_no]['q_paper'] = $paper_title;
            $paper[$results_no]['id'] = $property_id;
開發者ID:vinod-co,項目名稱:centa,代碼行數:31,代碼來源:details.php


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