"index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers'));
}
if(isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"]=="coach"){
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors'));
}
api_block_anonymous_users();
Display :: display_header($nameTools);
/*
* ======================================================================================
* FUNCTIONS
* ======================================================================================
*/
function exportCsv($a_infosUser,$tableTitle,$a_header,$a_dataLearnpath,$a_dataExercices,$a_dataProduction)
{
global $archiveDirName;
$fileName = 'test.csv';
$archivePath = api_get_path(SYS_PATH).$archiveDirName.'/';
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if(!$open = fopen($archivePath.$fileName,'w+'))
{
$message = get_lang('noOpen');
}
else
{
$info = '';
$info .= $a_infosUser['name'];
$info .= "\r\n";
$info .= $a_infosUser['email'];
$info .= "\r\n";
$info .= $a_infosUser['phone'];
/*$info .= "\r\n";
$info .= $a_infosUser['adresse'];*/
$info .= "\r\n";
$info .= "\r\n";
$info .= $tableTitle;
$info .= "\r\n";
for($i=0;$i<4;$i++)
{
$info .= $a_header[$i].';';
}
$info .= "\r\n";
foreach($a_dataLearnpath as $a_learnpath)
{
foreach($a_learnpath as $learnpath)
{
$info .= $learnpath.';';
}
$info .= "\r\n";
}
for($i=4;$i<8;$i++)
{
$info .= $a_header[$i].';';
}
$info .= "\r\n";
foreach($a_dataExercices as $a_exercice)
{
foreach($a_exercice as $exercice)
{
$info .= $exercice.';';
}
$info .= "\r\n";
}
for($i=8;$i<12;$i++)
{
$info .= $a_header[$i].';';
}
$info .= "\r\n";
foreach($a_dataProduction as $a_production)
{
foreach($a_production as $production)
{
$info .= $production.';';
}
$info .= "\r\n";
}
fwrite($open,$info);
fclose($open);
chmod($fileName,0777);
$message = get_lang('UsageDatacreated');
header("Location:".$archiveURL.$fileName);
}
return $message;
}
/*
*===============================================================================
* MAIN CODE
*===============================================================================
*/
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_session_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_stats_exercices = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
//$tbl_course_lp_view = Database :: get_course_table('lp_view');
//$tbl_course_lp_view_item = Database :: get_course_table('lp_item_view');
//$tbl_course_lp_item = Database :: get_course_table('lp_item');
$tbl_course_lp_view = 'lp_view';
$tbl_course_lp_view_item = 'lp_item_view';
$tbl_course_lp_item = 'lp_item';
$tbl_course_lp = 'lp';
$tbl_course_quiz = 'quiz';
$course_quiz_question = 'quiz_question';
$course_quiz_rel_question = 'quiz_rel_question';
$course_quiz_answer = 'quiz_answer';
$course_student_publication = Database::get_course_table(STUDENT_PUBLICATION_TABLE);
api_display_tool_title($nameTools);
if(isset($_GET["user_id"]) && $_GET["user_id"]!=""){
$i_user_id=$_GET["user_id"];
}
else{
$i_user_id=$_uid;
}
?>
|
|
|
|
'.$students['email'].'';
else
echo get_lang('NoEmail');
?>
|
|
class="border">
';
}
?>
|
'.$a_infosUser['email'].'';
}
else
{
echo get_lang('NoEmail');
}
?>
|
|
|
|
'.get_lang('SendMail'));
?>
|
";
echo $sendMail;
echo "";
}
else
{
echo "";
echo ' > '.get_lang('SendMail').'';
echo " | ";
}
?>
".'> '.get_lang('RdvAgenda').""; ?>
|
".'> '.get_lang('VideoConf').""; ?>
|
".'> '.get_lang('Chat').""; ?>
|
".'> '.get_lang('ExcelFormat').""; ?>
|
|
|
|
|
|
|
|
|
0)
{
$i = 0;
while($a_learnpath = mysql_fetch_array($resultLearnpath))
{
$sqlProgress = "SELECT COUNT(DISTINCT lp_item_id) AS nbItem
FROM ".$a_infosCours['db_name'].".".$tbl_course_lp_view_item." AS item_view
INNER JOIN ".$a_infosCours['db_name'].".".$tbl_course_lp_view." AS view
ON item_view.lp_view_id = view.id
AND view.lp_id = ".$a_learnpath['id']."
AND view.user_id = ".$_GET['student']."
WHERE item_view.status = 'completed'
";
$resultProgress = api_sql_query($sqlProgress);
$a_nbItem = mysql_fetch_array($resultProgress);
$sqlTotalItem = " SELECT COUNT(item_type) AS totalItem
FROM ".$a_infosCours['db_name'].".".$tbl_course_lp_item."
WHERE lp_id = ".$a_learnpath['id']
;
$resultItem = api_sql_query($sqlTotalItem);
$a_totalItem = mysql_fetch_array($resultItem);
$progress = round(($a_nbItem['nbItem'] * 100)/$a_totalItem['totalItem']);
if($i%2==0){
$s_css_class="row_odd";
}
else{
$s_css_class="row_even";
}
$i++;
?>
|
|
|
|
".get_lang('NoLearnpath')."
|
";
}
?>
|
|
|
|
|
|
0)
{
while($a_exercices = mysql_fetch_array($resultExercices))
{
$sqlEssais = " SELECT COUNT(ex.exe_id) as essais
FROM $tbl_stats_exercices AS ex
WHERE ex.exe_cours_id = '".$a_infosCours['code']."'
AND ex.exe_exo_id = ".$a_exercices['id']
;
$resultEssais = api_sql_query($sqlEssais);
$a_essais = mysql_fetch_array($resultEssais);
$sqlScore = "SELECT exe_result,exe_weighting
FROM $tbl_stats_exercices
WHERE exe_user_id = ".$_GET['student']."
AND exe_cours_id = '".$a_infosCours['code']."'
AND exe_exo_id = ".$a_exercices['id']
;
$resultScore = api_sql_query($sqlScore);
$score = 0;
while($a_score = mysql_fetch_array($resultScore))
{
$score = $score + $a_score['exe_result'];
$weighting = $weighting + $a_score['exe_weighting'];
}
$pourcentageScore = round(($score*100)/$weighting);
$weighting = 0;
if($i%2==0){
$s_css_class="row_odd";
}
else{
$s_css_class="row_even";
}
$i++;
echo "
";
echo $a_exercices['title'];
echo " |
";
echo "
";
echo $pourcentageScore.'%';
echo " |
";
echo " -> ";
echo " |
";
echo $a_essais['essais'];
echo " |
";
echo " |
";
echo " -> ";
echo " |
";
$dataExercices[$i][] = $a_exercices['title'];
$dataExercices[$i][] = $pourcentageScore.'%';
$dataExercices[$i][] = $a_essais['essais'];
//$dataExercices[$i][] = corrections;
$i++;
}
}
else
{
echo "
".get_lang('NoExercice')."
|
";
}
?>
|
|
|
|
|
0)
{
$i = 0;
while($a_production = mysql_fetch_array($resultProduction))
{
//$tmp_limitDate = $newDate = mktime(0 , 0 , 0 , date("m") , date("d") , date("Y"));
$tmp_limitDate = $newDate = mktime(0 , 0 , 0 ,8 , 20 , 2006);
$a_sentDate = explode(' ',$a_production['sent_date']);
$a_sentDate = explode('-',$a_sentDate[0]);
$tmp_sentDate = mktime(0,0,0,$a_sentDate[1],$a_sentDate[2],$a_sentDate[0]);
$sentDate = $a_sentDate[2].'/'.$a_sentDate[1].'/'.$a_sentDate[0];
if($i%2==0){
$s_css_class="row_odd";
}
else{
$s_css_class="row_even";
}
$i++;
echo "
";
echo $a_production['title'];
echo " |
";
echo "
";
echo " |
";
if($tmp_sentDate > $tmp_limitDate)
{
echo "";
$tmp_retard = $tmp_sentDate - $tmp_limitDate;
$retard = round($tmp_retard/86400);
echo $retard.' '.get_lang('DayOfDelay');
echo " | ";
}
else
{
echo "";
echo $sentDate;
echo " | ";
}
echo "
";
$remarque = '';
if($remarque == '')
{
echo "--";
}
echo " |
";
echo " -> ";
echo " |
";
$dataProduction[$i][] = $a_production['title'];
//$dataProduction[$i][] = $a_production['sent_date'];
$dataProduction[$i][] = $a_production['sent_date'];
//$dataProduction[$i][] = remarques;
$i++;
}
}
else
{
echo "
".get_lang('NoProduction')."
|
";
}
}
else
{
?>
|
|
|
|
|
0)
{
while($a_cours = mysql_fetch_array($resultCours))
{
if($i%2==0){
$s_css_class="row_odd";
}
else{
$s_css_class="row_even";
}
$i++;
$sqlScore = " SELECT exe_result,
exe_weighting
FROM $tbl_stats_exercices
WHERE exe_user_id = ".$_GET['student']."
AND exe_cours_id = '".$a_cours['code']."'
";
$resultScore = api_sql_query($sqlScore);
$i = 0;
$score = 0;
while($a_score = mysql_fetch_array($resultScore))
{
$score = $score + $a_score['exe_result'];
$weighting = $weighting + $a_score['exe_weighting'];
$i++;
}
$totalScore = $totalScore + $score;
$totalWeighting = $totalWeighting + $weighting;
$pourcentageScore = round(($score*100)/$weighting);
$weighting = 0;
$sqlProgress = "SELECT COUNT( DISTINCT item_view.lp_item_id ) AS nbItem
FROM ".$a_cours['db_name'].".".$tbl_course_lp_view_item." AS item_view
INNER JOIN ".$a_cours['db_name'].".".$tbl_course_lp_view." AS lpview
ON lpview.user_id = ".$_GET['student']."
WHERE item_view.status = 'completed'
";
//echo $sqlProgress;
$resultProgress = api_sql_query($sqlProgress);
$a_nbItem = mysql_fetch_array($resultProgress);
$table = $a_cours['db_name'].'.'.$tbl_course_lp_item;
if(mysql_select_db($a_cours['db_name']))
$nbTotalItem = Database::count_rows($table);
$totalItem = $totalItem + $nbTotalItem;
$totalProgress = $totalProgress + $a_nbItem['nbItem'];
$progress = round(($a_nbItem['nbItem'] * 100)/$nbTotalItem);
?>
|
|
|
|
-> ';
}
?>
|
Total
|
|
|
|
|
".get_lang('NoCourse')."
|
";
}
}//end of else !empty($details)
?>
".$a_exName['title']."
|
";
while($a_exerciceDetails = mysql_fetch_array($resultExerciceDetails))
{
$sqlAnswer = " SELECT qa.comment, qa.answer
FROM ".$a_infosCours['db_name'].".".$course_quiz_answer." as qa
WHERE qa.question_id = ".$a_exerciceDetails['id']
;
$resultAnswer = api_sql_query($sqlAnswer);
echo "";
//print_r($a_exerciceDetails);
echo"
".$a_exerciceDetails['question'].' /'.$a_exerciceDetails['ponderation']."
|
";
while($a_answer = mysql_fetch_array($resultAnswer))
{
echo"
".$a_answer['answer']."
|
";
if(!empty($a_answer['comment']))
echo $a_answer['comment'];
else
echo get_lang('NoComment');
echo "
|
";
}
}
echo "";
}
$a_header = array_merge($a_headerLearnpath,$a_headerExercices,$a_headerProductions);
if($_GET['csv'] == "true")
{
$exportResult = exportCsv($a_infosUser,$tableTitle,$a_header,$dataLearnpath,$dataExercices,$dataProduction);
Display :: display_error_message($exportResult);
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
?>