|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<?php // $Id: session_import.php 19639 2009-04-08 13:06:16Z pcool $
|
|
|
|
<?php // $Id: session_import.php 19770 2009-04-14 20:44:00Z cfasanando $
|
|
|
|
/* For licensing terms, see /dokeos_license.txt */ |
|
|
|
/* For licensing terms, see /dokeos_license.txt */ |
|
|
|
/** |
|
|
|
/** |
|
|
|
============================================================================== |
|
|
|
============================================================================== |
|
|
|
@ -56,6 +56,7 @@ if ($_POST['formSent']) { |
|
|
|
|
|
|
|
|
|
|
|
$racine = simplexml_load_file($_FILES['import_file']['tmp_name']); |
|
|
|
$racine = simplexml_load_file($_FILES['import_file']['tmp_name']); |
|
|
|
if (is_object($racine)) { |
|
|
|
if (is_object($racine)) { |
|
|
|
|
|
|
|
if (count($racine->Users->User) > 0) { |
|
|
|
foreach($racine->Users->User as $userNode) |
|
|
|
foreach($racine->Users->User as $userNode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$username = mb_convert_encoding($userNode->Username,$charset,'utf-8'); |
|
|
|
$username = mb_convert_encoding($userNode->Username,$charset,'utf-8'); |
|
|
|
@ -151,6 +152,8 @@ if ($_POST['formSent']) { |
|
|
|
api_sql_query($sql, __FILE__, __LINE__); |
|
|
|
api_sql_query($sql, __FILE__, __LINE__); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (count($racine->Courses->Course) > 0) { |
|
|
|
foreach($racine->Courses->Course as $courseNode) { |
|
|
|
foreach($racine->Courses->Course as $courseNode) { |
|
|
|
$course_code = mb_convert_encoding($courseNode->CourseCode,$charset,'utf-8'); |
|
|
|
$course_code = mb_convert_encoding($courseNode->CourseCode,$charset,'utf-8'); |
|
|
|
$title = mb_convert_encoding($courseNode->CourseTitle,$charset,'utf-8'); |
|
|
|
$title = mb_convert_encoding($courseNode->CourseTitle,$charset,'utf-8'); |
|
|
|
@ -216,7 +219,8 @@ if ($_POST['formSent']) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (count($racine->Session) > 0) { |
|
|
|
foreach ($racine->Session as $sessionNode) { // foreach session |
|
|
|
foreach ($racine->Session as $sessionNode) { // foreach session |
|
|
|
|
|
|
|
|
|
|
|
$countCourses = 0; |
|
|
|
$countCourses = 0; |
|
|
|
@ -259,7 +263,7 @@ if ($_POST['formSent']) { |
|
|
|
$errorMsg .= get_lang('StartDateShouldBeBeforeEndDate').' : '.$DateEnd.'<br />'; |
|
|
|
$errorMsg .= get_lang('StartDateShouldBeBeforeEndDate').' : '.$DateEnd.'<br />'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// verify that session doesn't exist |
|
|
|
// verify that session doesn't exist |
|
|
|
while(!$uniqueName) |
|
|
|
while(!$uniqueName) |
|
|
|
|