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


PHP SessionManager::importCSV方法代碼示例

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


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

示例1: importSessions

 /**
  * @param string $file
  * @param bool   $moveFile
  * @param array $teacherBackup
  * @param array $groupBackup
  */
 private function importSessions($file, $moveFile = true, &$teacherBackup = array(), &$groupBackup = array())
 {
     $avoid = null;
     if (isset($this->conditions['importSessions']) && isset($this->conditions['importSessions']['update'])) {
         $avoid = $this->conditions['importSessions']['update'];
     }
     $result = SessionManager::importCSV($file, true, $this->defaultAdminId, $this->logger, array('SessionID' => 'extra_' . $this->extraFieldIdNameList['session']), $this->extraFieldIdNameList['session'], $this->daysCoachAccessBeforeBeginning, $this->daysCoachAccessAfterBeginning, $this->defaultSessionVisibility, $avoid, false, false, true, true, true, 1, $teacherBackup, $groupBackup);
     if (!empty($result['error_message'])) {
         $this->logger->addError($result['error_message']);
     }
     $this->logger->addInfo("Sessions - Sessions parsed: " . $result['session_counter']);
     if ($moveFile) {
         $this->moveFile($file);
     }
 }
開發者ID:omaoibrahim,項目名稱:chamilo-lms,代碼行數:21,代碼來源:import_csv.php

示例2: get_lang

                         $error_message .= get_lang('CourseDoesNotExist').' : '.$course_code.'<br />';
                     }
                     */
                 }
                 Database::query("UPDATE {$tbl_session} SET nbr_users='{$user_counter}', nbr_courses='{$course_counter}' WHERE id='{$session_id}'");
             }
         }
         if (empty($root->Users->User) && empty($root->Courses->Course) && empty($root->Session)) {
             $error_message = get_lang('NoNeededData');
         }
     } else {
         $error_message .= get_lang('XMLNotValid');
     }
 } else {
     // CSV
     $result = SessionManager::importCSV($_FILES['import_file']['tmp_name'], $updatesession, api_get_user_id());
     $error_message = $result['error_message'];
     $session_counter = $result['session_counter'];
 }
 if (!empty($error_message)) {
     $error_message = get_lang('ButProblemsOccured') . ' :<br />' . $error_message;
 }
 if (count($inserted_in_course) > 1) {
     $warn = get_lang('SeveralCoursesSubscribedToSessionBecauseOfSameVisualCode') . ': ';
     foreach ($inserted_in_course as $code => $title) {
         $warn .= ' ' . $title . ' (' . $code . '),';
     }
     $warn = substr($warn, 0, -1);
 }
 if ($session_counter == 1) {
     header('Location: resume_session.php?id_session=' . $session_id . '&warn=' . urlencode($warn));
開發者ID:ragebat,項目名稱:chamilo-lms,代碼行數:31,代碼來源:session_import.php

示例3: get_lang

                     }
                 }
                 Database::query("UPDATE {$tbl_session} SET nbr_users='{$user_counter}', nbr_courses='{$course_counter}' WHERE id='{$session_id}'");
             }
         }
         if (empty($root->Users->User) && empty($root->Courses->Course) && empty($root->Session)) {
             $error_message = get_lang('NoNeededData');
         }
     } else {
         $error_message .= get_lang('XMLNotValid');
     }
 } else {
     // CSV
     $updateCourseCoaches = isset($_POST['update_course_coaches']) ? true : false;
     $addOriginalCourseTeachersAsCourseSessionCoaches = isset($_POST['add_me_as_coach']) ? true : false;
     $result = SessionManager::importCSV($_FILES['import_file']['tmp_name'], $isOverwrite, api_get_user_id(), null, array(), null, null, null, 1, array(), $deleteUsersNotInList, $updateCourseCoaches, false, $addOriginalCourseTeachersAsCourseSessionCoaches, false);
     $sessionList = $result['session_list'];
     $error_message = $result['error_message'];
     $session_counter = $result['session_counter'];
 }
 if (!empty($error_message)) {
     $error_message = get_lang('ButProblemsOccured') . ' :<br />' . $error_message;
 }
 if (count($inserted_in_course) > 1) {
     $warn = get_lang('SeveralCoursesSubscribedToSessionBecauseOfSameVisualCode') . ': ';
     foreach ($inserted_in_course as $code => $title) {
         $warn .= ' ' . $title . ' (' . $code . '),';
     }
     $warn = substr($warn, 0, -1);
 }
 if ($session_counter == 1) {
開發者ID:annickvdp,項目名稱:Chamilo1.9.10,代碼行數:31,代碼來源:session_import.php


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