// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file='admin';
// resetting the course id
@ -78,23 +78,23 @@ if($_POST['formSent'])
{
$CourseList=array();
}
$nbr_courses=0;
$nbr_courses=0;
$id_coach = api_sql_query("SELECT id_coach FROM $tbl_session WHERE id=$id_session");
$id_coach = mysql_fetch_array($id_coach);
$id_coach = $id_coach[0];
$rs = api_sql_query("SELECT course_code FROM $tbl_session_rel_course WHERE id_session=$id_session");
$existingCourses = api_store_result($rs);
$existingCourses = api_store_result($rs);
$sql="SELECT id_user
FROM $tbl_session_rel_user
WHERE id_session = $id_session";
$result=api_sql_query($sql,__FILE__,__LINE__);
$UserList=api_store_result($result);
foreach($CourseList as $enreg_course)
{
$exists = false;
@ -104,18 +104,18 @@ if($_POST['formSent'])
{
$exists=true;
}
}
}
if(!$exists)
{
{
api_sql_query("INSERT INTO $tbl_session_rel_course(id_session,course_code, id_coach) VALUES('$id_session','$enreg_course','$id_coach')",__FILE__,__LINE__);
$nbr_users=0;
foreach($UserList as $enreg_user)
{
$enreg_user = $enreg_user['id_user'];
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_course_rel_user(id_session,course_code,id_user) VALUES('$id_session','$enreg_course','$enreg_user')",__FILE__,__LINE__);
if(mysql_affected_rows())
{
$nbr_users++;
@ -123,14 +123,14 @@ if($_POST['formSent'])
}
api_sql_query("UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'",__FILE__,__LINE__);
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file='admin';
// resetting the course id
@ -89,7 +89,7 @@ if($_POST['formSent'])
while($row = mysql_fetch_array($result)){
$existingUsers[] = $row['id_user'];
}
$result=api_sql_query("SELECT course_code FROM $tbl_session_rel_course WHERE id_session='$id_session'",__FILE__,__LINE__);
$CourseList=array();
@ -98,7 +98,7 @@ if($_POST['formSent'])
{
$CourseList[]=$row['course_code'];
}
foreach($CourseList as $enreg_course)
{
$nbr_users=0;
@ -106,7 +106,7 @@ if($_POST['formSent'])
{
if(!in_array($enreg_user, $existingUsers)){
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_course_rel_user(id_session,course_code,id_user) VALUES('$id_session','$enreg_course','$enreg_user')",__FILE__,__LINE__);
if(mysql_affected_rows())
{
$nbr_users++;
@ -117,7 +117,7 @@ if($_POST['formSent'])
if(!in_array($existing_user, $UserList)){
$sql = "DELETE FROM $tbl_session_rel_course_rel_user WHERE id_session='$id_session' AND course_code='$enreg_course' AND id_user='$existing_user'";
api_sql_query($sql);
if(mysql_affected_rows())
{
$nbr_users--;
@ -128,24 +128,24 @@ if($_POST['formSent'])
$rs = api_sql_query($sql, __FILE__, __LINE__);
list($nbr_users) = mysql_fetch_array($rs);
api_sql_query("UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'",__FILE__,__LINE__);
}
api_sql_query("DELETE FROM $tbl_session_rel_user WHERE id_session = $id_session");
$nbr_users = 0;
foreach($UserList as $enreg_user){
$nbr_users++;
api_sql_query("INSERT IGNORE INTO $tbl_session_rel_user(id_session, id_user) VALUES('$id_session','$enreg_user')",__FILE__,__LINE__);
}
$nbr_users = count($UserList);
api_sql_query("UPDATE $tbl_session SET nbr_users= $nbr_users WHERE id='$id_session' ",__FILE__,__LINE__);
$dropbox_cnf["maxFilesize"] = get_setting("dropbox_max_filesize"); //file size limit as imposed by the platform admin (see Dokeos Config Settings on the platform administration section)
$dropbox_cnf["maxFilesize"] = api_get_setting("dropbox_max_filesize"); //file size limit as imposed by the platform admin (see Dokeos Config Settings on the platform administration section)
$langToolInfo = "This tool imports Blackboard 5.5 areas (Course Material, Discussion Board, and External Links). <br>In the future it will import more modules, Blackboard 6 and WebCT areas, and normal IMS and SCORM packages.";