Issue #306 - Training reporting: Reworks are in progress.

skala
Ivan Tcholakov 16 years ago
parent 7a2ed349bd
commit e6c22cfb4d
  1. 27
      main/course_info/download.php
  2. 274
      main/mySpace/access_details.php
  3. 104
      main/mySpace/admin.php
  4. 156
      main/mySpace/coaches.php
  5. 1
      main/mySpace/course.php
  6. 2
      main/mySpace/lp_tracking.php
  7. 38
      main/mySpace/myStudents.php
  8. 81
      main/mySpace/progression.php
  9. 1
      main/mySpace/reussite.php
  10. 1
      main/mySpace/session.php
  11. 1
      main/mySpace/student.php
  12. 112
      main/mySpace/teachers.php
  13. 1
      main/mySpace/user_add.php
  14. 2
      main/mySpace/user_import.php

@ -24,29 +24,29 @@
session_cache_limiter('public');
include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
require '../inc/global.inc.php';
$this_section = SECTION_COURSES;
include_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php');
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
$archivePath = api_get_path(SYS_PATH).$archiveDirName.'/';
$archiveFile = $_GET['archive'];
$archive_path = api_get_path(SYS_ARCHIVE_PATH);
$archive_file = $_GET['archive'];
$archiveFile = str_replace(array('..', '/', '\\'), '', $archiveFile);
$archive_file = str_replace(array('..', '/', '\\'), '', $archive_file);
list($extension) = getextension($archiveFile);
list($extension) = getextension($archive_file);
if (empty($extension) || !file_exists($archivePath.$archiveFile)) {
if (empty($extension) || !file_exists($archive_path.$archive_file)) {
exit();
}
$content_type = '';
if (in_array(strtolower($extension), array('xml','csv')) && api_is_platform_admin(true)) {
$content_type='application/force-download';
$content_type = 'application/force-download';
}
elseif (strtolower($extension) == 'zip' && $_cid && $is_courseAdmin) {
$content_type='application/force-download';
$content_type = 'application/force-download';
}
if (empty($content_type)) {
@ -59,8 +59,7 @@ header('Cache-Control: public');
header('Pragma: no-cache');
header('Content-Type: '.$content_type);
header('Content-Length: '.filesize($archivePath.$archiveFile));
header('Content-Disposition: attachment; filename='.$archiveFile);
header('Content-Length: '.filesize($archive_path.$archive_file));
header('Content-Disposition: attachment; filename='.$archive_file);
readfile($archivePath.$archiveFile);
?>
readfile($archive_path.$archive_file);

@ -5,7 +5,7 @@
Dokeos - elearning and course management software
Copyright (c) 2009 Dokeos SPRL
Copyright (c) 2008 Furio Petrossi
Copyright (c) 2008 Furio Petrossi
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
@ -38,12 +38,12 @@
$language_file = array ('registration', 'index', 'tracking');
// including the global Dokeos file
require_once '../inc/global.inc.php';
require '../inc/global.inc.php';
// including additional libraries
include_once api_get_path(LIBRARY_PATH).'pchart/pData.class.php';
include_once api_get_path(LIBRARY_PATH).'pchart/pChart.class.php';
include_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
require_once api_get_path(LIBRARY_PATH).'pchart/pData.class.php';
require_once api_get_path(LIBRARY_PATH).'pchart/pChart.class.php';
require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
// the section (for the tabs)
$this_section = "session_my_space";
@ -59,116 +59,112 @@ if (api_is_xml_http_request()) {
$main_year = $main_month_year = $main_day = array();
// get last 8 days/months
$last_days = 8;
$last_months = 5;
$last_months = 5;
for ($i = $last_days; $i >= 0; $i--) {
$main_day[date ('d-m-Y', mktime () - $i * 3600 * 24)] = 0;
}
$main_day[date ('d-m-Y', mktime () - $i * 3600 * 24)] = 0;
}
for ($i = $last_months; $i >= 0; $i--) {
$main_month_year[date ('m-Y', mktime () - $i*30 * 3600 * 24)] = 0;
}
$main_month_year[date ('m-Y', mktime () - $i * 30 * 3600 * 24)] = 0;
}
$i = 0;
if (is_array($connections) && count($connections) > 0) {
foreach ($connections as $key => $data) {
//creating the main array
//$main_year[date('Y', $data['login'])] += calculHours($data['logout'] - $data['login']) * 60;
//$main_month_year[date('m-Y', $data['login'])] += calculHours($data['logout'] - $data['login']) * 60;
foreach ($connections as $key => $data) {
//creating the main array
$main_month_year[date('m-Y', $data['login'])] += float_format(($data['logout'] - $data['login']) / 60, 0);
//$main_day[date('d-m-Y', $data['login'])] += calculHours($data['logout'] - $data['login']) * 60;
$main_day[date('d-m-Y', $data['login'])] += float_format(($data['logout'] - $data['login']) / 60, 0);
if ($i > 500) {
break;
if ($i > 500) {
break;
}
$i++;
}
$i++;
}
//var_dump($main_month_year);
switch ($type) {
case 'day':
$main_date = $main_day;
break;
case 'month':
$main_date = $main_month_year ;
break;
case 'year':
$main_date = $main_year;
break;
}
//echo '<pre>'; print_r($main_date);
// the nice graphics :D
$labels = array_keys($main_date);
if (count($main_date) == 1) {
$labels = $labels[0];
$main_date = $main_date[$labels];
}
switch ($type) {
case 'day':
$main_date = $main_day;
break;
case 'month':
$main_date = $main_month_year;
break;
case 'year':
$main_date = $main_year;
break;
}
$DataSet = new pData;
$DataSet->AddPoint($main_date, 'Q');
if (count($main_date)!= 1) {
$DataSet->AddPoint($labels, 'Date');
}
$DataSet->AddAllSeries();
$DataSet->RemoveSerie('Date');
$DataSet->SetAbsciseLabelSerie('Date');
$DataSet->SetYAxisName(get_lang('Minutes'));
$graph_id = api_get_user_id().'AccessDetails'.api_get_course_id();
$DataSet->AddAllSeries();
$Cache = new pCache();
// the graph id
$data = $DataSet->GetData();
if ($Cache->IsInCache($graph_id, $DataSet->GetData())) {
//if (0) {
//if we already created the img
// echo 'in cache';
$img_file = $Cache->GetHash($graph_id, $DataSet->GetData());
} else {
// if the image does not exist in the archive/ folder
// Initialise the graph
$Test = new pChart(760, 230);
//which schema of color will be used
$quant_resources = count($data[0]) - 1;
// Adding the color schemma
$Test->loadColorPalette(api_get_path(LIBRARY_PATH)."pchart/palette/default.txt");
$Test->setFontProperties(api_get_path(LIBRARY_PATH)."pchart/fonts/tahoma.ttf", 8);
$Test->setGraphArea(70, 30, 680, 200);
$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, 150, 150, 150, TRUE, 0, 0);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
$Test->setLineStyle(2);
// Draw the 0 line
$Test->setFontProperties(api_get_path(LIBRARY_PATH)."pchart/fonts/tahoma.ttf", 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
if (count($main_date) == 1) {
//Draw a graph
echo '<strong>'.$labels.'</strong><br/>';
$Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE);
} else {
//Draw the line graph
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
}
// Finish the graph
$Test->setFontProperties(api_get_path(LIBRARY_PATH)."pchart/fonts/tahoma.ttf", 8);
$Test->setFontProperties(api_get_path(LIBRARY_PATH)."pchart/fonts/tahoma.ttf", 10);
$Test->drawTitle(60, 22, get_lang('AccessDetails'), 50, 50, 50, 585);
//------------------
//echo 'not in cache';
$Cache->WriteToCache($graph_id,$DataSet->GetData(),$Test);
ob_start();
$Test->Stroke();
ob_end_clean();
$img_file = $Cache->GetHash($graph_id,$DataSet->GetData());
}
// the nice graphics :D
$labels = array_keys($main_date);
if (count($main_date) == 1) {
$labels = $labels[0];
$main_date = $main_date[$labels];
}
$DataSet = new pData;
$DataSet->AddPoint($main_date, 'Q');
if (count($main_date)!= 1) {
$DataSet->AddPoint($labels, 'Date');
}
$DataSet->AddAllSeries();
$DataSet->RemoveSerie('Date');
$DataSet->SetAbsciseLabelSerie('Date');
$DataSet->SetYAxisName(get_lang('Minutes'));
$graph_id = api_get_user_id().'AccessDetails'.api_get_course_id();
$DataSet->AddAllSeries();
$Cache = new pCache();
// the graph id
$data = $DataSet->GetData();
if ($Cache->IsInCache($graph_id, $DataSet->GetData())) {
//if (0) {
//if we already created the img
// echo 'in cache';
$img_file = $Cache->GetHash($graph_id, $DataSet->GetData());
} else {
// if the image does not exist in the archive/ folder
// Initialise the graph
$Test = new pChart(760, 230);
//which schema of color will be used
$quant_resources = count($data[0]) - 1;
// Adding the color schemma
$Test->loadColorPalette(api_get_path(LIBRARY_PATH).'pchart/palette/default.txt');
$Test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf', 8);
$Test->setGraphArea(70, 30, 680, 200);
$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, 150, 150, 150, TRUE, 0, 0);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
$Test->setLineStyle(2);
// Draw the 0 line
$Test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf', 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
if (count($main_date) == 1) {
//Draw a graph
echo '<strong>'.$labels.'</strong><br/>';
$Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE);
} else {
//Draw the line graph
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
}
// Finish the graph
$Test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf', 8);
$Test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf', 10);
$Test->drawTitle(60, 22, get_lang('AccessDetails'), 50, 50, 50, 585);
//------------------
//echo 'not in cache';
$Cache->WriteToCache($graph_id, $DataSet->GetData(), $Test);
ob_start();
$Test->Stroke();
ob_end_clean();
$img_file = $Cache->GetHash($graph_id,$DataSet->GetData());
}
echo '<img src="'.api_get_path(WEB_ARCHIVE_PATH).$img_file.'">';
} else {
Display::display_warning_message (get_lang('GraphicNotAvailable'));
@ -176,7 +172,7 @@ if (api_is_xml_http_request()) {
exit;
}
$nameTools= get_lang('AccessDetails');
$nameTools = get_lang('AccessDetails');
//StudentDetails
if (isset($_GET['origin']) && strcmp($_GET['origin'], 'tracking_course') === 0) {
@ -197,10 +193,10 @@ $htmlHeadXtra[] = '<link rel="stylesheet" href="../inc/lib/javascript/jquery.tab
$htmlHeadXtra[] = '<script type="text/javascript">
$(function() {
$("#container-9").tabs({ remote: true});
$("#container-9").tabs({ remote: true});
});
</script>' ;
</script>';
Display :: display_header('');
$TBL_USERINFO_DEF = Database :: get_course_table(TABLE_USER_INFO);
@ -209,8 +205,8 @@ $mainUserInfo = api_get_user_info($user_id);
$result_to_print = '';
$main_date_array = array();
foreach ($connections as $key => $data) {
$result_to_print .= '&nbsp;&nbsp;'.date('d-m-Y (H:i:s)', $data['login']).' - '.calculHours($data['logout'] - $data['login']).'<br />'."\n";
foreach ($connections as $key => $data) {
$result_to_print .= '&nbsp;&nbsp;'.date('d-m-Y (H:i:s)', $data['login']).' - '.api_time_to_hms($data['logout'] - $data['login']).'<br />'."\n";
}
api_display_tool_title(get_lang('DetailsStudentInCourse'));
echo '<div class="actions">';
@ -218,11 +214,11 @@ echo '<strong>'.get_lang('User').': '.api_get_person_name($mainUserInfo['firstNa
?>
<div id="container-9">
<ul>
<li><a href="access_details.php?type=day&course=<?php echo $course_code?>&student=<?php echo $user_id?>"><span> <?php echo get_lang('Day'); ?></span></a></li>
<ul>
<li><a href="access_details.php?type=day&course=<?php echo $course_code?>&student=<?php echo $user_id?>"><span> <?php echo api_ucfirst(get_lang('Day')); ?></span></a></li>
<li><a href="access_details.php?type=month&course=<?php echo $course_code?>&student=<?php echo $user_id?>"><span><?php echo api_ucfirst(get_lang('MinMonth')); ?></span></a></li>
</ul>
<?php echo '<div id="show"></div>';?>
<?php echo '<div id="show"></div>'; ?>
</div>
<?php
@ -232,15 +228,16 @@ echo $result_to_print;
/* Login time against logout time
foreach ($connections as $key => $data) {
echo ("<tr><td>".date("d-m-Y (H:i:s)",$data['login'])."</td><td>".date("d-m-Y (H:i:s)",$data['logout'])."</td></tr>");
echo ("<tr><td>".date("d-m-Y (H:i:s)", $data['login'])."</td><td>".date("d-m-Y (H:i:s)", $data['logout'])."</td></tr>");
}
*/
/*
foreach ($connections as $key => $data) {
echo ("<tr><td>".date("d-m-Y (H:i:s)",$data['login'])."</td><td>".calculHours($data['logout']-$data['login'])."</td></tr>");
echo ("<tr><td>".date("d-m-Y (H:i:s)", $data['login'])."</td><td>".api_time_to_hms($data['logout'] - $data['login'])."</td></tr>");
}
echo ("</table>");
*/
Display:: display_footer();
@ -264,10 +261,10 @@ function get_connections_to_course($user_id, $course_code) {
$sql_query = 'SELECT visual_code as course_code FROM '.$tbl_main.' c WHERE code="'.Database::escape_string($course_code).'";';
$result = Database::query($sql_query, __FILE__, __LINE__);
$row_query = Database::fetch_array($result,'ASSOC');
$row_query = Database::fetch_array($result, 'ASSOC');
$course_true = isset($row_query['course_code']) ? $row_query['course_code']: $course_code;
$sql = 'SELECT login_course_date, logout_course_date FROM ' . $tbl_track_course . '
$sql = 'SELECT login_course_date, logout_course_date FROM ' . $tbl_track_course . '
WHERE user_id = ' . intval($user_id) . '
AND course_code="' . Database::escape_string($course_true) . '" ORDER BY login_course_date ASC';
@ -307,44 +304,19 @@ function get_connections_to_course_by_time($user_id, $course_code, $year = '', $
$row_query = Database::fetch_array($result,'ASSOC');
$course_true = isset($row_query['course_code']) ? $row_query['course_code']: $course_code;
$sql = 'SELECT login_course_date, logout_course_date FROM ' . $tbl_track_course . '
$sql = 'SELECT login_course_date, logout_course_date FROM ' . $tbl_track_course . '
WHERE user_id = ' . intval($user_id) . '
AND course_code="' . Database::escape_string($course_true) . '"
AND course_code="' . Database::escape_string($course_true) . '"
ORDER BY login_course_date DESC';
$rs = Database::query($sql, __FILE__, __LINE__);
$connections = array();
while ($a_connections = Database::fetch_array($rs)) {
$connections = array();
while ($a_connections = Database::fetch_array($rs)) {
$s_login_date = $a_connections['login_course_date'];
$s_logout_date = $a_connections['logout_course_date'];
$s_logout_date = $a_connections['logout_course_date'];
$i_timestamp_login_date = strtotime($s_login_date);
$i_timestamp_logout_date = strtotime($s_logout_date);
$connections[] = array('login' => $i_timestamp_login_date, 'logout' => $i_timestamp_logout_date);
}
$i_timestamp_logout_date = strtotime($s_logout_date);
$connections[] = array('login' => $i_timestamp_login_date, 'logout' => $i_timestamp_logout_date);
}
return $connections;
}
/**
* Transforms seconds into a time format
*
* @param unknown_type $seconds
* @return unknown
*/
function calculHours($seconds) {
//How many hours ?
$hours = floor($seconds / 3600);
//How many minutes ?
$min = floor(($seconds - ($hours * 3600)) / 60);
if ($min < 10) {
$min = '0'.$min;
}
//How many seconds
$sec = $seconds - ($hours * 3600) - ($min * 60);
if ($sec < 10) {
$sec = '0'.$sec;
}
return $hours.get_lang('HourShort').' '.$min.':'.$sec;
}

@ -7,9 +7,11 @@
ob_start();
// name of the language file that needs to be included
$language_file = array ('registration', 'index','trad4all', 'tracking');
$language_file = array ('registration', 'index', 'trad4all', 'tracking');
$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
$this_section = "session_my_space";
@ -30,56 +32,12 @@ $tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
/*
===============================================================================
FUNCTION
===============================================================================
*/
function exportCsv($a_header, $a_data) {
global $archiveDirName;
$fileName = 'administrators.csv';
$archivePath = api_get_path(SYS_ARCHIVE_PATH);
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if (!$open = fopen($archivePath.$fileName, 'w+')) {
$message = get_lang('noOpen');
} else {
$info = '';
foreach ($a_header as $header) {
$info .= $header.';';
}
$info .= "\r\n";
foreach ($a_data as $data) {
foreach ($data as $infos) {
$info .= $infos.';';
}
$info .= "\r\n";
}
fwrite($open, $info);
fclose($open);
$perm = api_get_setting('permissions_for_new_files');
$perm = octdec(!empty($perm) ? $perm : '0660');
chmod($fileName, $perm);
header("Location:".$archiveURL.$fileName);
}
return $message;
}
/**
* MAIN PART
*/
/*
* liste nominative avec coordonn<EFBFBD>es et lien vers les cours et
les stagiaires dont il est le
responsable.
* liste nominative avec coordonnies et lien vers les cours et les stagiaires dont il est le responsable.
*/
if (isset($_POST['export'])) {
@ -87,10 +45,10 @@ if (isset($_POST['export'])) {
} else {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
}
$sqlAdmins = "SELECT user.user_id,lastname,firstname,email
$sql_admins = "SELECT user.user_id,lastname,firstname,email
FROM $tbl_user as user, $tbl_admin as admin
WHERE admin.user_id=user.user_id".$order_clause;
$resultAdmins = Database::query($sqlAdmins, __FILE__, __LINE__);
$result_admins = Database::query($sql_admins, __FILE__, __LINE__);
if (api_is_western_name_order()) {
echo '<table class="data_table"><tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('Email').'</th></tr>';
@ -99,24 +57,24 @@ if (api_is_western_name_order()) {
}
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
$a_header[] = get_lang('FirstName', '');
$a_header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
} else {
$a_header[] = get_lang('LastName', '');
$a_header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
}
$a_header[] = get_lang('Email', '');
$header[] = get_lang('Email', '');
if (Database::num_rows($resultAdmins) > 0) {
while ($a_admins = Database::fetch_array($resultAdmins)) {
if (Database::num_rows($result_admins) > 0) {
while ($admins = Database::fetch_array($result_admins)) {
$i_user_id = $a_admins["user_id"];
$s_lastname = $a_admins["lastname"];
$s_firstname = $a_admins["firstname"];
$s_email = $a_admins["email"];
$user_id = $admins["user_id"];
$lastname = $admins["lastname"];
$firstname = $admins["firstname"];
$email = $admins["email"];
if ($i % 2 == 0) {
$s_css_class = "row_odd";
$css_class = "row_odd";
if ($i % 20 == 0 && $i != 0) {
if (api_is_western_name_order()) {
echo '<tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('Email').'</th></tr>';
@ -125,36 +83,34 @@ if (Database::num_rows($resultAdmins) > 0) {
}
}
} else {
$s_css_class = "row_even";
$css_class = "row_even";
}
$i++;
if (api_is_western_name_order()) {
echo "<tr class=".$s_css_class."><td>$s_firstname</td><td>$s_lastname</td><td><a href='mailto:".$s_email."'>$s_email</a></td></tr>";
echo "<tr class=".$css_class."><td>$firstname</td><td>$lastname</td><td><a href='mailto:".$email."'>$email</a></td></tr>";
} else {
echo "<tr class=".$s_css_class."><td>$s_lastname</td><td>$s_firstname</td><td><a href='mailto:".$s_email."'>$s_email</a></td></tr>";
echo "<tr class=".$css_class."><td>$lastname</td><td>$firstname</td><td><a href='mailto:".$email."'>$email</a></td></tr>";
}
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
$a_data[$i_user_id]["firstname"] = $s_firstname;
$a_data[$i_user_id]["lastname"] = $s_lastname;
$data[$user_id]["firstname"] = $firstname;
$data[$user_id]["lastname"] = $lastname;
} else {
$a_data[$i_user_id]["lastname"] = $s_lastname;
$a_data[$i_user_id]["firstname"] = $s_firstname;
$data[$user_id]["lastname"] = $lastname;
$data[$user_id]["firstname"] = $firstname;
}
$a_data[$i_user_id]["email"] = $s_email;
$data[$user_id]["email"] = $email;
}
}
//No results
else {
echo '<tr><td colspan="3" "align=center">'.get_lang("NoResults").'</td></tr>';
} else {
// No results
echo '<tr><td colspan="3" "align=center">'.get_lang('NoResults').'</td></tr>';
}
echo '</table>';
if (isset($_POST['export'])) {
exportCsv($a_header, $a_data);
export_csv($header, $data, 'administrators.csv');
}
echo "<br /><br />";

@ -4,12 +4,14 @@
* Created on 18 October 2006 by Elixir Interactive http://www.elixir-interactive.com
*/
ob_start();
ob_start();
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'tracking', 'admin');
$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
$this_section = "session_my_space";
@ -39,71 +41,16 @@ $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_
/*
===============================================================================
FUNCTION
FUNCTIONS
===============================================================================
*/
function exportCsv($a_header, $a_data) {
global $archiveDirName;
$fileName = 'coaches.csv';
$archivePath = api_get_path(SYS_ARCHIVE_PATH);
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if (!$open = fopen($archivePath.$fileName, 'w+')) {
$message = get_lang('noOpen');
} else {
$info = '';
foreach ($a_header as $header) {
$info .= $header.';';
}
$info .= "\r\n";
foreach ($a_data as $data) {
foreach ($data as $infos) {
$info .= $infos.';';
}
$info .= "\r\n";
}
fwrite($open, $info);
fclose($open);
$perm = api_get_setting('permissions_for_new_files');
$perm = octdec(!empty($perm) ? $perm : '0660');
chmod($fileName, $perm);
header("Location:".$archiveURL.$fileName);
}
return $message;
}
function calculHours($seconds) {
//combien d'heures ?
$hours = floor($seconds / 3600);
//combien de minutes ?
$min = floor(($seconds - ($hours * 3600)) / 60);
if ($min < 10) {
$min = "0".$min;
}
//combien de secondes
$sec = $seconds - ($hours * 3600) - ($min * 60);
if ($sec < 10) {
$sec = "0".$sec;
}
//echo $hours."h".$min."m".$sec."s";
return $hours."h".$min."m".$sec."s" ;
}
function is_coach() {
global $tbl_session_course;
$sql = "SELECT course_code FROM $tbl_session_course WHERE id_coach='".$_SESSION["_uid"]."'";
$result = Database::query($sql, __FILE__, __LINE__);
if (Database::num_rows($result) > 0) {
return true;
return true;
}
return false;
}
@ -119,23 +66,23 @@ if (isset($_POST['export'])) {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
}
if (isset($_GET["id_student"])) {
$i_id_student=$_GET["id_student"];
$sqlCoachs = "SELECT DISTINCT src.id_coach " .
$id_student = $_GET["id_student"];
$sql_coachs = "SELECT DISTINCT src.id_coach " .
"FROM $tbl_session_rel_course as src, $tbl_session_rel_course_rel_user as srcru " .
"WHERE src.id_coach<>'0' AND src.course_code=srcru.course_code AND srcru.id_user='$i_id_student' AND srcru.id_session=src.id_session";
"WHERE src.id_coach<>'0' AND src.course_code=srcru.course_code AND srcru.id_user='$id_student' AND srcru.id_session=src.id_session";
} else {
if (api_is_platform_admin()) {
$sqlCoachs = "SELECT DISTINCT id_coach, user_id, lastname, firstname
$sql_coachs = "SELECT DISTINCT id_coach, user_id, lastname, firstname
FROM $tbl_user, $tbl_session_rel_course
WHERE id_coach=user_id".$order_clause;
} else {
$sqlCoachs = "SELECT DISTINCT id_coach, $tbl_user.user_id, lastname, firstname
$sql_coachs = "SELECT DISTINCT id_coach, $tbl_user.user_id, lastname, firstname
FROM $tbl_user as user, $tbl_session_rel_course as session_rel_course, $tbl_course_user as course_rel_user
WHERE course_rel_user.course_code=session_rel_course.course_code AND course_rel_user.status='1' AND course_rel_user.user_id='".$_SESSION["_uid"]."'
AND session_rel_course.id_coach=user.user_id".$order_clause;
}
}
$resultCoachs = Database::query($sqlCoachs, __FILE__, __LINE__);
$result_coachs = Database::query($sql_coachs, __FILE__, __LINE__);
if (api_is_western_name_order()) {
echo '<table class="data_table"><tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('ConnectionTime').'</th><th>'.get_lang('AdminCourses').'</th><th>'.get_lang('Students').'</th></tr>';
@ -144,47 +91,48 @@ if (api_is_western_name_order()) {
}
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
$a_header[] = get_lang('FirstName', '');
$a_header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
} else {
$a_header[] = get_lang('LastName', '');
$a_header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
}
$a_header[] = get_lang('ConnectionTime', '');
$header[] = get_lang('ConnectionTime', '');
if (Database::num_rows($resultCoachs) > 0) {
while ($a_coachs = Database::fetch_array($resultCoachs)) {
$i_id_coach = $a_coachs["id_coach"];
if (Database::num_rows($result_coachs) > 0) {
while ($coachs = Database::fetch_array($result_coachs)) {
$id_coach = $coachs["id_coach"];
if (isset($_GET["id_student"])) {
$sql_infos_coach = "SELECT lastname, firstname FROM $tbl_user WHERE user_id='$i_id_coach'";
$resultCoachsInfos = Database::query($sql_infos_coach, __FILE__, __LINE__);
$s_lastname = Database::result($resultCoachsInfos, 0, "lastname");
$s_firstname = Database::result($resultCoachsInfos, 0, "firstname");
$sql_infos_coach = "SELECT lastname, firstname FROM $tbl_user WHERE user_id='$id_coach'";
$result_coachs_infos = Database::query($sql_infos_coach, __FILE__, __LINE__);
$lastname = Database::result($result_coachs_infos, 0, "lastname");
$firstname = Database::result($result_coachs_infos, 0, "firstname");
} else {
$s_lastname = $a_coachs["lastname"];
$s_firstname = $a_coachs["firstname"];
$lastname = $coachs["lastname"];
$firstname = $coachs["firstname"];
}
$s_sql_connection_time = "SELECT login_date, logout_date FROM $tbl_track_login WHERE login_user_id ='$i_id_coach' AND logout_date <> 'null'";
$q_result_connection_time = Database::query($s_sql_connection_time, __FILE__, __LINE__);
$sql_connection_time = "SELECT login_date, logout_date FROM $tbl_track_login WHERE login_user_id ='$id_coach' AND logout_date <> 'null'";
$result_connection_time = Database::query($sql_connection_time, __FILE__, __LINE__);
$i_nb_seconds = 0;
while ($a_connections = Database::fetch_array($q_result_connection_time)) {
$s_login_date = $a_connections["login_date"];
$s_logout_date = $a_connections["logout_date"];
$i_timestamp_login_date = strtotime($s_login_date);
$i_timestamp_logout_date = strtotime($s_logout_date);
$i_nb_seconds += ($i_timestamp_logout_date - $i_timestamp_login_date);
$nb_seconds = 0;
while ($connections = Database::fetch_array($result_connection_time)) {
$login_date = $connections["login_date"];
$logout_date = $connections["logout_date"];
$timestamp_login_date = strtotime($login_date);
$timestamp_logout_date = strtotime($logout_date);
$nb_seconds += ($timestamp_logout_date - $timestamp_login_date);
}
$s_connection_time = calculHours($i_nb_seconds);
if ($s_connection_time == "0h00m00s") {
$s_connection_time = "";
if ($nb_seconds == 0) {
$s_connection_time = '';
} else {
$s_connection_time = api_time_to_hms($nb_seconds);
}
if ($i % 2 == 0) {
$s_css_class = "row_odd";
$css_class = "row_odd";
if ($i % 20 == 0 && $i != 0) {
if (api_is_western_name_order()) {
echo '<tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('ConnectionTime').'</th><th>'.get_lang('AdminCourses').'</th><th>'.get_lang('Students').'</th></tr>';
@ -193,36 +141,34 @@ if (Database::num_rows($resultCoachs) > 0) {
}
}
} else {
$s_css_class = "row_even";
$css_class = "row_even";
}
$i++;
if (api_is_western_name_order()) {
echo '<tr class="'.$s_css_class.'"><td>'.$s_firstname.'</td><td>'.$s_lastname.'</td><td>'.$s_connection_time.'</td><td><a href="course.php?type=coach&user_id='.$i_id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?type=coach&user_id='.$i_id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
echo '<tr class="'.$css_class.'"><td>'.$firstname.'</td><td>'.$lastname.'</td><td>'.$s_connection_time.'</td><td><a href="course.php?type=coach&user_id='.$id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?type=coach&user_id='.$id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
} else {
echo '<tr class="'.$s_css_class.'"><td>'.$s_lastname.'</td><td>'.$s_firstname.'</td><td>'.$s_connection_time.'</td><td><a href="course.php?type=coach&user_id='.$i_id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?type=coach&user_id='.$i_id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
echo '<tr class="'.$css_class.'"><td>'.$lastname.'</td><td>'.$firstname.'</td><td>'.$s_connection_time.'</td><td><a href="course.php?type=coach&user_id='.$id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?type=coach&user_id='.$id_coach.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
}
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
$a_data[$i_id_coach]["firstname"] = $s_firstname;
$a_data[$i_id_coach]["lastname"] = $s_lastname;
$data[$id_coach]["firstname"] = $firstname;
$data[$id_coach]["lastname"] = $lastname;
} else {
$a_data[$i_id_coach]["lastname"] = $s_lastname;
$a_data[$i_id_coach]["firstname"] = $s_firstname;
$data[$id_coach]["lastname"] = $lastname;
$data[$id_coach]["firstname"] = $firstname;
}
$a_data[$i_id_coach]["connection_time"] = $s_connection_time;
$data[$id_coach]["connection_time"] = $s_connection_time;
}
}
//No results
else {
} else {
// No results
echo '<tr><td colspan="5" "align=center">'.get_lang("NoResult").'</td></tr>';
}
echo '</table>';
if (isset($_POST['export'])){
exportCsv($a_header, $a_data);
export_csv($header, $data, 'coaches.csv');
}
echo "<br /><br />";

@ -7,6 +7,7 @@ $nameTools = 'Cours';
// name of the language file that needs to be included
$language_file = array ('admin', 'registration', 'index', 'trad4all', 'tracking');
$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';

@ -9,7 +9,7 @@
$language_file = array ('registration', 'index', 'tracking', 'exercice', 'scorm', 'learnpath');
//$cidReset = true;
include '../inc/global.inc.php';
require '../inc/global.inc.php';
$from_myspace = false;
$from_link = '';

@ -8,13 +8,15 @@
// name of the language file that needs to be included
$language_file = array('registration', 'index', 'tracking', 'exercice', 'admin');
//$cidReset=true;
//$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'export.lib.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
$htmlHeadXtra[] = '<script type="text/javascript">
@ -162,26 +164,6 @@ Display :: display_header($nameTools);
* ======================================================================================
*/
function calculHours($seconds) {
//How many hours ?
$hours = floor($seconds / 3600);
//How many minutes ?
$min = floor(($seconds - ($hours * 3600)) / 60);
if ($min < 10) {
$min = "0" . $min;
}
//How many seconds
$sec = $seconds - ($hours * 3600) - ($min * 60);
if ($sec < 10) {
$sec = "0" . $sec;
}
return $hours . "h" . $min . "m" . $sec . "s";
}
function is_teacher($course_code) {
global $_user;
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
@ -209,9 +191,9 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$tbl_stats_exercices_attempts = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
//$tbl_course_lp_view = Database :: get_course_table(TABLE_LP_VIEW);
//$tbl_course_lp_view = Database :: get_course_table(TABLE_LP_VIEW);
//$tbl_course_lp_view_item = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
//$tbl_course_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
//$tbl_course_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
$tbl_course_lp_view = 'lp_view';
$tbl_course_lp_view_item = 'lp_item_view';

@ -1,10 +1,16 @@
<?php
/*
* Created on 28 juil. 2006 by Elixir Interactive http://www.elixir-interactive.com
*/
// TODO: This file seems to be unfinished and unused.
$language_file = array ('registration', 'index', 'tracking');
require '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
$nameTools = get_lang('Progression');
$cidReset = true;
@ -22,83 +28,42 @@ $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_track_exercice = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
/*
===============================================================================
FUNCTION
===============================================================================
*/
function exportCsv($a_header, $a_data) {
global $archiveDirName;
$fileName = 'test.csv';
$archivePath = api_get_path(SYS_ARCHIVE_PATH);
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if (!$open = fopen($archivePath.$fileName, 'w+')) {
$message = get_lang('noOpen');
} else {
$info = '';
foreach ($a_header as $header) {
$info .= $header.';';
}
$info .= "\r\n";
foreach ($a_data as $data) {
foreach($data as $infos) {
$info .= $infos.';';
}
$info .= "\r\n";
}
fwrite($open, $info);
fclose($open);
$perm = api_get_setting('permissions_for_new_files');
$perm = octdec(!empty($perm) ? $perm : '0660');
chmod($fileName, $perm);
$message = get_lang('UsageDatacreated');
header("Location:".$archiveURL.$fileName);
}
return $message;
}
/*
===============================================================================
MAIN CODE
===============================================================================
*/
$sqlCourse = "SELECT title,code
$sql_course = "SELECT title,code
FROM $tbl_course as course
ORDER BY title ASC";
$resultCourse = Database::query($sqlCourse, __FILE__, __LINE__);
$result_course = Database::query($sql_course, __FILE__, __LINE__);
if (Database::num_rows($resultCourse) > 0) {
if (Database::num_rows($result_course) > 0) {
if (isset($_POST['export'])) {
$exportResult = exportCsv($header,$data);
Display :: display_error_message($exportResult);
$export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet.
Display :: display_error_message($export_result);
}
echo '<table class="data_table"><tr><th>'.get_lang('Course').'</th><th>'.get_lang('TempsFrequentation').'</th><th>'.get_lang('Progression').'</th><th>'.get_lang('MoyenneTest').'</th></tr>';
$header = array(get_lang('Course'),get_lang('TempsFrequentation'),get_lang('Progression'),get_lang('MoyenneTest'));
while ($a_course = Database::fetch_array($resultCourse)) {
$sqlMoyTest = "SELECT exe_result,exe_weighting
$header = array(get_lang('Course', ''), get_lang('TempsFrequentation', ''), get_lang('Progression', ''), get_lang('MoyenneTest', ''));
while ($a_course = Database::fetch_array($result_course)) {
// TODO: This query is to be checked, there are no HotPotatoes tests results.
$sql_moy_test = "SELECT exe_result,exe_weighting
FROM $tbl_track_exercice
WHERE exe_cours_id = '".$a_course['code']."'";
$resultMoyTest = Database::query($sqlMoyTest, __FILE__, __LINE__);
$result_moy_test = Database::query($sql_moy_test, __FILE__, __LINE__);
$result = 0;
$weighting = 0;
while ($a_moyTest = Database::fetch_array($resultMoyTest)) {
$result = $result + $a_moyTest['exe_result'];
$weighting = $weighting + $a_moyTest['exe_weighting'];
while ($moy_test = Database::fetch_array($result_moy_test)) {
$result = $result + $moy_test['exe_result'];
$weighting = $weighting + $moy_test['exe_weighting'];
}
if ($weighting != 0) {
$moyenneTest = round(($result * 100) / $weighting);
$moyenne_test = round(($result * 100) / $weighting);
} else {
$moyenneTest = null;
$moyenne_test = null;
}
echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td align="center">'.(is_null($moyenneTest) ? '' : $moyenneTest.'%').'</td> </tr>';
echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td align="center">'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>';
}
echo '</table>';
echo "<br /><br />";

@ -7,6 +7,7 @@ $nameTools = 'Reussite';
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'trad4all', 'tracking');
$cidReset = true;
require '../inc/global.inc.php';
$this_section = "session_my_space";

@ -30,6 +30,7 @@ $nameTools= 'Sessions';
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'trad4all', 'tracking');
$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';

@ -7,6 +7,7 @@
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'tracking');
$cidReset = true;
require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';

@ -4,12 +4,14 @@
* Created on 18 October 2006 by Elixir Interactive http://www.elixir-interactive.com
*/
ob_start();
ob_start();
// names of the language file that needs to be included
// names of the language file that needs to be included
$language_file = array ('registration', 'index', 'trad4all', 'tracking', 'admin');
$cidReset = true;
require '../inc/global.inc.php';
require_once '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
$this_section = "session_my_space";
@ -29,48 +31,6 @@ $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
/*
===============================================================================
FUNCTION
===============================================================================
*/
function exportCsv($a_header, $a_data) {
global $archiveDirName;
$fileName = 'teachers.csv';
$archivePath = api_get_path(SYS_ARCHIVE_PATH);
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if (!$open = fopen($archivePath.$fileName, 'w+')) {
$message = get_lang('noOpen');
} else {
$info = '';
foreach ($a_header as $header) {
$info .= $header.';';
}
$info .= "\r\n";
foreach ($a_data as $data) {
foreach ($data as $infos) {
$info .= $infos.';';
}
$info .= "\r\n";
}
fwrite($open, $info);
fclose($open);
$perm = api_get_setting('permissions_for_new_files');
$perm = octdec(!empty($perm) ? $perm : '0660');
chmod($fileName, $perm);
header("Location:".$archiveURL.$fileName);
}
return $message;
}
/**
* MAIN PART
*/
@ -84,17 +44,17 @@ $sort_by_first_name = api_sort_by_first_name();
$order_clause = $sort_by_first_name ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
if (isset($_GET["teacher_id"]) && $_GET["teacher_id"] != 0) {
$i_teacher_id = $_GET["teacher_id"];
$sqlFormateurs = "SELECT user_id,lastname,firstname,email
$teacher_id = $_GET["teacher_id"];
$sql_formateurs = "SELECT user_id,lastname,firstname,email
FROM $tbl_user
WHERE user_id='$i_teacher_id'".$order_clause;
WHERE user_id='$teacher_id'".$order_clause;
} else {
$sqlFormateurs = "SELECT user_id,lastname,firstname,email
$sql_formateurs = "SELECT user_id,lastname,firstname,email
FROM $tbl_user
WHERE status = 1".$order_clause;
}
$resultFormateurs = Database::query($sqlFormateurs, __FILE__, __LINE__);
$result_formateurs = Database::query($sql_formateurs, __FILE__, __LINE__);
if ($is_western_name_order) {
echo '<table class="data_table"><tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('Email').'</th><th>'.get_lang('AdminCourses').'</th><th>'.get_lang('Students').'</th></tr>';
@ -103,30 +63,30 @@ if ($is_western_name_order) {
}
if ($is_western_name_order) {
$a_header[] = get_lang('FirstName', '');
$a_header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
} else {
$a_header[] = get_lang('LastName', '');
$a_header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', '');
}
$a_header[] = get_lang('Email', '');
$header[] = get_lang('Email', '');
$a_data = array();
$data = array();
if (Database::num_rows($resultFormateurs) > 0) {
if (Database::num_rows($result_formateurs) > 0) {
$i = 1;
while ($a_formateurs = Database::fetch_array($resultFormateurs)) {
while ($formateurs = Database::fetch_array($result_formateurs)) {
$i_user_id = $a_formateurs["user_id"];
$s_lastname = $a_formateurs["lastname"];
$s_firstname = $a_formateurs["firstname"];
$s_email = $a_formateurs["email"];
$user_id = $formateurs["user_id"];
$lastname = $formateurs["lastname"];
$firstname = $formateurs["firstname"];
$email = $formateurs["email"];
if ($i % 2 == 0) {
$s_css_class = "row_odd";
$css_class = "row_odd";
if ($i % 20 == 0 && $i != 0){
if ($i % 20 == 0 && $i != 0) {
if ($is_western_name_order) {
echo '<tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('Email').'</th><th>'.get_lang('AdminCourses').'</th><th>'.get_lang('Students').'</th></tr>';
} else {
@ -134,36 +94,34 @@ if (Database::num_rows($resultFormateurs) > 0) {
}
}
} else {
$s_css_class = "row_even";
$css_class = "row_even";
}
$i++;
if ($is_western_name_order) {
$a_data[$i_user_id]["firstname"] = $s_firstname;
$a_data[$i_user_id]["lastname"] = $s_lastname;
$data[$user_id]["firstname"] = $firstname;
$data[$user_id]["lastname"] = $lastname;
} else {
$a_data[$i_user_id]["lastname"] = $s_lastname;
$a_data[$i_user_id]["firstname"] = $s_firstname;
$data[$user_id]["lastname"] = $lastname;
$data[$user_id]["firstname"] = $firstname;
}
$a_data[$i_user_id]["email"] = $s_email;
$data[$user_id]["email"] = $email;
if ($is_western_name_order) {
echo '<tr class="'.$s_css_class.'"><td>'.$s_firstname.'</td><td>'.$s_lastname.'</td><td><a href="mailto:'.$s_email.'">'.$s_email.'</a></td><td><a href="course.php?user_id='.$i_user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?user_id='.$i_user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
echo '<tr class="'.$css_class.'"><td>'.$firstname.'</td><td>'.$lastname.'</td><td><a href="mailto:'.$email.'">'.$email.'</a></td><td><a href="course.php?user_id='.$user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?user_id='.$user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
} else {
echo '<tr class="'.$s_css_class.'"><td>'.$s_lastname.'</td><td>'.$s_firstname.'</td><td><a href="mailto:'.$s_email.'">'.$s_email.'</a></td><td><a href="course.php?user_id='.$i_user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?user_id='.$i_user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
echo '<tr class="'.$css_class.'"><td>'.$lastname.'</td><td>'.$firstname.'</td><td><a href="mailto:'.$email.'">'.$email.'</a></td><td><a href="course.php?user_id='.$user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td><td><a href="student.php?user_id='.$user_id.'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td></tr>';
}
}
}
//No results
else {
} else {
// No results
echo '<tr><td colspan="5" "align=center">'.get_lang("NoResults").'</td></tr>';
}
echo '</table>';
if (isset($_POST['export'])) {
exportCsv($a_header, $a_data);
export_csv($header, $data, 'teachers.csv');
}
echo "<br /><br />";

@ -23,6 +23,7 @@
// name of the language file that needs to be included
$language_file = array('admin', 'registration');
$cidReset = true;
// including necessary libraries
require '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH);

@ -445,7 +445,7 @@ function parse_xml_data($file) {
$language_file = array ('admin', 'registration', 'index', 'trad4all', 'tracking');
$cidReset = true;
include '../inc/global.inc.php';
require '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
require_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');

Loading…
Cancel
Save