本文整理汇总了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);
}
}
示例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));
示例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) {