Removing center alignment now it depends in the CSS class data_table see #5175

skala
Julio Montoya 13 years ago
parent fb4065008e
commit 5568f1b8e8
  1. 32
      main/mySpace/admin.php
  2. 9
      main/mySpace/coaches.php
  3. 6
      main/mySpace/course.php
  4. 2
      main/mySpace/current_courses.php
  5. 24
      main/mySpace/index.php
  6. 39
      main/mySpace/myStudents.php
  7. 2
      main/mySpace/progression.php
  8. 10
      main/mySpace/reussite.php
  9. 2
      main/mySpace/session.php
  10. 14
      main/mySpace/student.php
  11. 2
      main/mySpace/teachers.php

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/*
* Created on 18 October 2006 by Elixir Interactive http://www.elixir-interactive.com
@ -7,18 +8,18 @@
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';
require_once api_get_path(SYS_CODE_PATH) . 'mySpace/myspace.lib.php';
$this_section = SECTION_TRACKING;
$nameTools = get_lang('Administrators');
api_block_anonymous_users();
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
Display :: display_header($nameTools);
api_display_tool_title($nameTools);
@ -35,7 +36,6 @@ $tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
/**
* MAIN PART
*/
/*
* liste nominative avec coordonnies et lien vers les cours et les stagiaires dont il est le responsable.
*/
@ -47,13 +47,13 @@ if (isset($_POST['export'])) {
}
$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;
WHERE admin.user_id=user.user_id" . $order_clause;
$result_admins = Database::query($sql_admins);
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>';
echo '<table class="data_table"><tr><th>' . get_lang('FirstName') . '</th><th>' . get_lang('LastName') . '</th><th>' . get_lang('Email') . '</th></tr>';
} else {
echo '<table class="data_table"><tr><th>'.get_lang('LastName').'</th><th>'.get_lang('FirstName').'</th><th>'.get_lang('Email').'</th></tr>';
echo '<table class="data_table"><tr><th>' . get_lang('LastName') . '</th><th>' . get_lang('FirstName') . '</th><th>' . get_lang('Email') . '</th></tr>';
}
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
@ -77,9 +77,9 @@ if (Database::num_rows($result_admins) > 0) {
$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>';
echo '<tr><th>' . get_lang('FirstName') . '</th><th>' . get_lang('LastName') . '</th><th>' . get_lang('Email') . '</th></tr>';
} else {
echo '<tr><th>'.get_lang('LastName').'</th><th>'.get_lang('FirstName').'</th><th>'.get_lang('Email').'</th></tr>';
echo '<tr><th>' . get_lang('LastName') . '</th><th>' . get_lang('FirstName') . '</th><th>' . get_lang('Email') . '</th></tr>';
}
}
} else {
@ -89,9 +89,9 @@ if (Database::num_rows($result_admins) > 0) {
$i++;
if (api_is_western_name_order()) {
echo "<tr class=".$css_class."><td>$firstname</td><td>$lastname</td><td><a href='mailto:".$email."'>$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=".$css_class."><td>$lastname</td><td>$firstname</td><td><a href='mailto:".$email."'>$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)) {
@ -105,7 +105,7 @@ if (Database::num_rows($result_admins) > 0) {
}
} else {
// No results
echo '<tr><td colspan="3" "align=center">'.get_lang('NoResults').'</td></tr>';
echo '<tr><td colspan="3">' . get_lang('NoResults') . '</td></tr>';
}
echo '</table>';
@ -114,12 +114,6 @@ if (isset($_POST['export'])) {
}
echo "<br /><br />";
echo "<form method='post' action='admin.php'><button type='submit' class='save' name='export' value='".get_lang('exportExcel')."'>".get_lang('exportExcel')."</button><form>";
/*
==============================================================================
FOOTER
==============================================================================
*/
echo "<form method='post' action='admin.php'><button type='submit' class='save' name='export' value='" . get_lang('exportExcel') . "'>" . get_lang('exportExcel') . "</button><form>";
Display::display_footer();

@ -164,7 +164,7 @@ if (Database::num_rows($result_coachs) > 0) {
}
} else {
// No results
echo '<tr><td colspan="5" "align=center">'.get_lang("NoResult").'</td></tr>';
echo '<tr><td colspan="5">'.get_lang("NoResult").'</td></tr>';
}
echo '</table>';
@ -174,11 +174,4 @@ if (isset($_POST['export'])){
echo "<br /><br />";
echo "<form method='post' action='coaches.php'><button type='submit' class='save' name='export' value='".get_lang('exportExcel')."'>".get_lang('exportExcel')."</button><form>";
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();

@ -128,7 +128,7 @@ if (!api_is_drh() && !api_is_session_admin() && !api_is_platform_admin()) {
$nb_courses = count($a_courses);
$table = new SortableTable('tracking_list_course', 'count_courses');
$table -> set_header(0, get_lang('CourseTitle'), false, 'align="center"');
$table -> set_header(0, get_lang('CourseTitle'), false);
$table -> set_header(1, get_lang('NbStudents'), false);
$table -> set_header(2, get_lang('TimeSpentInTheCourse').Display :: return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table -> set_header(3, get_lang('ThematicAdvance'), false);
@ -230,8 +230,8 @@ if (is_array($a_courses)) {
// $csv_content = array_merge($csv_header, $csv_content); // Before this statement you are allowed to sort (in different way) the array $csv_content.
}
$table -> setColAttributes(0, array('align' => 'left'));
$table -> setColAttributes(7, array('align' => 'center'));
//$table -> setColAttributes(0);
//$table -> setColAttributes(7);
$table -> display();
Display :: display_footer();

@ -269,7 +269,7 @@ foreach ($array as $row_table) {
$column = 0;
foreach ($row_table as $cell) {
$table->setCellContents($row, $column, $cell);
$table->updateCellAttributes($row, $column, 'align="center"');
//$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);

@ -383,7 +383,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$parameters['view'] = 'teacher';
$parameters['class'] = 'data_table';
$table->set_additional_parameters($parameters);
$table -> set_header(0, get_lang('CourseTitle'), false, 'align="center"');
$table -> set_header(0, get_lang('CourseTitle'), false);
$table -> set_header(1, get_lang('NbStudents'), false);
$table -> set_header(2, get_lang('AvgTimeSpentInTheCourse').' '.Display :: return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table -> set_header(3, get_lang('AvgStudentsProgress').' '.Display :: return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
@ -455,10 +455,6 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$table -> addRow($row);
}
$table -> setColAttributes(1, array('align' => 'center'));
$table -> setColAttributes(2, array('align' => 'center'));
$table -> setColAttributes(3, array('align' => 'center'));
/* Start session over view stats */
$nb_sessions_past = $nb_sessions_current = 0;
@ -557,18 +553,18 @@ if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') {
$parameters['view'] = 'admin';
$table->set_additional_parameters($parameters);
if ($is_western_name_order) {
$table -> set_header(0, get_lang('FirstName'), true, 'align="center"');
$table -> set_header(1, get_lang('LastName'), true, 'align="center"');
$table -> set_header(0, get_lang('FirstName'), true);
$table -> set_header(1, get_lang('LastName'), true);
} else {
$table -> set_header(0, get_lang('LastName'), true, 'align="center"');
$table -> set_header(1, get_lang('FirstName'), true, 'align="center"');
$table -> set_header(0, get_lang('LastName'), true);
$table -> set_header(1, get_lang('FirstName'), true);
}
$table -> set_header(2, get_lang('TimeSpentOnThePlatform'), false);
$table -> set_header(3, get_lang('LastConnexion'), false, 'align="center"');
$table -> set_header(3, get_lang('LastConnexion'), false);
$table -> set_header(4, get_lang('NbStudents'), false);
$table -> set_header(5, get_lang('CountCours'), false);
$table -> set_header(6, get_lang('NumberOfSessions'), false);
$table -> set_header(7, get_lang('Sessions'), false, 'align="center"');
$table -> set_header(7, get_lang('Sessions'), false);
if ($is_western_name_order) {
$csv_header[] = array (
@ -667,7 +663,7 @@ if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') {
$table_row[] = $nb_students;
$table_row[] = $nb_courses;
$table_row[] = $nb_sessions;
$table_row[] = '<center><a href="session.php?id_coach='.$coaches['user_id'].'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></center>';
$table_row[] = '<a href="session.php?id_coach='.$coaches['user_id'].'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>';
$all_datas[] = $table_row;
if ($is_western_name_order) {
@ -711,11 +707,11 @@ if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') {
foreach ($all_datas as $row) {
$table -> addRow($row, 'align="right"');
}
/*
$table -> updateColAttributes(0, array('align' => 'left'));
$table -> updateColAttributes(1, array('align' => 'left'));
$table -> updateColAttributes(3, array('align' => 'left'));
$table -> updateColAttributes(7, array('align' => 'center'));
$table -> updateColAttributes(7, array('align' => 'center'));*/
$table -> display();
}
}

@ -656,17 +656,17 @@ if (empty($_GET['details'])) {
);
echo '<tr>
<td align="right">'.$course_info['title'].'</td>
<td align="right">'.$time_spent_on_course .'</td>
<td align="right">'.$progress.'</td>
<td align="right">'.$score.'</td>
<td align="right">'.$attendances_faults_avg.'</td>
<td align="right">'.$scoretotal_display.'</td>';
<td >'.$course_info['title'].'</td>
<td >'.$time_spent_on_course .'</td>
<td >'.$progress.'</td>
<td >'.$score.'</td>
<td >'.$attendances_faults_avg.'</td>
<td >'.$scoretotal_display.'</td>';
if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
} else {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
}
echo '</tr>';
}
@ -777,21 +777,21 @@ if (empty($_GET['details'])) {
echo '<tr class="'.$css_class.'">';
echo Display::tag('td', stripslashes($lp_name));
echo Display::tag('td', api_time_to_hms($total_time), array('align'=>'center'));
echo Display::tag('td', api_time_to_hms($total_time));
if (!is_null($score)) {
if (is_numeric($score)) {
$score = $score.'%';
}
}
echo Display::tag('td', $score, array('align'=>'center'));
echo Display::tag('td', $score);
if (!is_null($score_latest)) {
if (is_numeric($score_latest)) {
$score_latest = $score_latest.'%';
}
}
echo Display::tag('td', $score_latest, array('align'=>'center'));
echo Display::tag('td', $score_latest);
if (is_numeric($progress)) {
$progress = $progress.'%';
@ -799,11 +799,10 @@ if (empty($_GET['details'])) {
$progress = '-';
}
echo Display::tag('td', $progress, array('align'=>'center'));
echo Display::tag('td', $progress);
//Do not change with api_convert_and_format_date, because this value came from the lp_item_view table
//which implies several other changes not a priority right now
echo Display::tag('td', $start_time, array('align'=>'center'));
echo Display::tag('td', $start_time);
if ($any_result === true) {
$from = '';
@ -811,11 +810,11 @@ if (empty($_GET['details'])) {
$from ='&from=myspace';
}
$link = Display::url('<img src="../img/2rightarrow.gif" border="0" />','lp_tracking.php?course='.Security::remove_XSS($_GET['course']).$from.'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student_id='.$user_info['user_id'].'&id_session='.$session_id);
echo Display::tag('td', $link, array('align'=>'center'));
echo Display::tag('td', $link);
}
if (api_is_allowed_to_edit()) {
echo '<td align="center">';
echo '<td>';
if ($any_result === true) {
echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&course='.Security::remove_XSS($_GET['course']).'&details='.Security::remove_XSS($_GET['details']).'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student='.$user_info['user_id'].'&details=true&id_session='.Security::remove_XSS($_GET['id_session']).'">';
echo Display::return_icon('clean.png',get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
@ -878,7 +877,7 @@ if (empty($_GET['details'])) {
echo '<tr class="'.$css_class.'"><td>'.$exercices['title'].'</td>';
echo '<td align="center">';
echo '<td>';
if ($count_attempts > 0) {
echo $score_percentage . '%';
@ -888,8 +887,8 @@ if (empty($_GET['details'])) {
}
echo '</td>';
echo '<td align="center">'.$count_attempts.'</td>';
echo '<td align="center">';
echo '<td>'.$count_attempts.'</td>';
echo '<td>';
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
WHERE exe_exo_id ="'.$exercise_id.'" AND
@ -908,7 +907,7 @@ if (empty($_GET['details'])) {
}
echo '</td>';
echo '<td align="center">';
echo '<td>';
$all_attempt_url = "../exercice/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$session_id";
echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );

@ -58,7 +58,7 @@ if (Database::num_rows($result_course) > 0) {
} else {
$moyenne_test = null;
}
echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td align="center">'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>';
echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>';
}
echo '</table>';
echo "<br /><br />";

@ -69,7 +69,7 @@ if (!empty($_GET['session'])) {
$moyenne_test = null;
}
echo '<tr><td>'.$session['name'].'</td><td align="center">'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td><td> </td></tr>';
echo '<tr><td>'.$session['name'].'</td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td><td> </td></tr>';
}
echo '</table>';
} else {
@ -102,17 +102,11 @@ if (!empty($_GET['session'])) {
} else {
$moyenne_test = null;
}
echo '<tr><td>'.$course['title'].'</td><td align="center">'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td><td> </td></tr>';
echo '<tr><td>'.$course['title'].'</td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td><td> </td></tr>';
}
echo '</table>';
} else {
echo get_lang('NoCourse');
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display :: display_footer();

@ -156,7 +156,7 @@ if ($nb_sessions > 0) {
$table -> addRow($row);
}
$table -> setColAttributes(2, array('align' => 'center'));
//$table -> setColAttributes(2, array('align' => 'center'));
$table -> display();
if ($export_csv) {

@ -168,11 +168,11 @@ if (api_is_allowed_to_create_course() || api_is_drh()) {
if (count($students) > 0) {
$table = new SortableTable('tracking_student', 'count_student_coached', null, ($is_western_name_order xor $sort_by_first_name) ? 1 : 0);
if ($is_western_name_order) {
$table -> set_header(0, get_lang('FirstName'), false, 'align="center');
$table -> set_header(1, get_lang('LastName'), false, 'align="center');
$table -> set_header(0, get_lang('FirstName'), false);
$table -> set_header(1, get_lang('LastName'), false);
} else {
$table -> set_header(0, get_lang('LastName'), false, 'align="center');
$table -> set_header(1, get_lang('FirstName'), false, 'align="center');
$table -> set_header(0, get_lang('LastName'), false);
$table -> set_header(1, get_lang('FirstName'), false);
}
/* $table -> set_header(2, get_lang('Time'), false);
$table -> set_header(3, get_lang('Progress'), false);
@ -268,7 +268,6 @@ if (api_is_allowed_to_create_course() || api_is_drh()) {
$row[] = $string_date;
if ($export_csv) {
$row[count($row) - 1] = strip_tags($row[count($row) - 1]);
$row[count($row) - 2] = strip_tags($row[count($row) - 2]);
$csv_content[] = $row;
@ -297,11 +296,6 @@ if (api_is_allowed_to_create_course() || api_is_drh()) {
foreach ($all_datas as $row) {
$table -> addRow($row, 'align="right"');
}
$table -> updateColAttributes(0, array('align' => 'left'));
$table -> updateColAttributes(1, array('align' => 'left'));
/* $table -> updateColAttributes(7, array('align' => 'left'));
$table -> updateColAttributes(8, array('align' => 'left'));
$table -> setColAttributes(9, array('align' => 'center'));*/
$table -> display();
} else {
echo Display::display_warning_message(get_lang('NoStudent'));

@ -171,7 +171,7 @@ if (count($formateurs) > 0) {
}
} else {
// No results
echo '<tr><td colspan="6" "align=center">'.get_lang("NoResults").'</td></tr>';
echo '<tr><td colspan="6">'.get_lang("NoResults").'</td></tr>';
}
echo '</table>';

Loading…
Cancel
Save