@@ -666,7 +666,7 @@ |
||
666 | 666 | $res = Database::query($sql); |
667 | 667 | $count1 = Database::fetch_object($res); |
668 | 668 | $sql = "SELECT COUNT(*) AS n FROM $user_table as u $table ". |
669 | - "WHERE LENGTH(picture_uri) > 0 $url_condition2"; |
|
669 | + "WHERE LENGTH(picture_uri) > 0 $url_condition2"; |
|
670 | 670 | $res = Database::query($sql); |
671 | 671 | $count2 = Database::fetch_object($res); |
672 | 672 | // #users without picture |
@@ -579,7 +579,7 @@ |
||
579 | 579 | GROUP BY date(login_date)"; |
580 | 580 | |
581 | 581 | $res = Database::query($sql); |
582 | - while ($row = Database::fetch_array($res,'ASSOC')){ |
|
582 | + while ($row = Database::fetch_array($res,'ASSOC')) { |
|
583 | 583 | $totalLogin[$row['login_date']] = $row['number']; |
584 | 584 | } |
585 | 585 |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
105 | 105 | $course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
106 | 106 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
107 | - $access_url_rel_user_table= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
107 | + $access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
108 | 108 | $current_url_id = api_get_current_access_url_id(); |
109 | - $active_filter = $onlyActive?' AND active=1':''; |
|
110 | - $status_filter = isset($status)?' AND status = '.intval($status):''; |
|
109 | + $active_filter = $onlyActive ? ' AND active=1' : ''; |
|
110 | + $status_filter = isset($status) ? ' AND status = '.intval($status) : ''; |
|
111 | 111 | |
112 | 112 | if (api_is_multiple_url_enabled()) { |
113 | 113 | $sql = "SELECT COUNT(DISTINCT(u.user_id)) AS number |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | FROM $user_table |
132 | 132 | WHERE 1=1 $status_filter $active_filter"; |
133 | 133 | if (isset($categoryCode)) { |
134 | - $status_filter = isset($status)?' AND status = '.intval($status):''; |
|
134 | + $status_filter = isset($status) ? ' AND status = '.intval($status) : ''; |
|
135 | 135 | $sql = "SELECT COUNT(DISTINCT(cu.user_id)) AS number |
136 | 136 | FROM $course_user_table cu, $course_table c |
137 | 137 | WHERE |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public static function countSessions() |
157 | 157 | { |
158 | 158 | $session_table = Database::get_main_table(TABLE_MAIN_SESSION); |
159 | - $access_url_rel_session_table= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
159 | + $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
160 | 160 | if (api_is_multiple_url_enabled()) { |
161 | 161 | $current_url_id = api_get_current_access_url_id(); |
162 | 162 | $sql = "SELECT COUNT(id) AS number |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | public static function getNumberOfActivities() |
180 | 180 | { |
181 | 181 | // Database table definitions |
182 | - $track_e_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); |
|
182 | + $track_e_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); |
|
183 | 183 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
184 | - $access_url_rel_user_table= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
184 | + $access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
185 | 185 | $current_url_id = api_get_current_access_url_id(); |
186 | 186 | if (api_is_multiple_url_enabled()) { |
187 | 187 | $sql = "SELECT count(default_id) AS total_number_of_items |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $from = intval($from); |
230 | 230 | $numberOfItems = intval($numberOfItems); |
231 | 231 | |
232 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
232 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
233 | 233 | $direction = 'DESC'; |
234 | 234 | } |
235 | 235 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $sql .= " LIMIT $from,$numberOfItems "; |
281 | 281 | |
282 | 282 | $res = Database::query($sql); |
283 | - $activities = array (); |
|
283 | + $activities = array(); |
|
284 | 284 | while ($row = Database::fetch_row($res)) { |
285 | 285 | if (strpos($row[1], '_object') === false && strpos($row[1], '_array') === false) { |
286 | 286 | $row[2] = $row[2]; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | FROM $categoryTable |
351 | 351 | ORDER BY tree_pos"; |
352 | 352 | $res = Database::query($sql); |
353 | - $categories = array (); |
|
353 | + $categories = array(); |
|
354 | 354 | while ($category = Database::fetch_object($res)) { |
355 | 355 | $categories[$category->code] = $category->name; |
356 | 356 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $data_max = ($data_max < $value ? $value : $data_max); |
372 | 372 | } |
373 | 373 | reset($data); |
374 | - $result = array (); |
|
374 | + $result = array(); |
|
375 | 375 | $delta = $max / $data_max; |
376 | 376 | foreach ($data as $index => $value) { |
377 | 377 | $result[$index] = (int) round($value * $delta); |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | } else { |
406 | 406 | $number_label = self::makeSizeString($number); |
407 | 407 | } |
408 | - $percentage = ($total>0?number_format(100*$number/$total, 1, ',', '.'):'0'); |
|
408 | + $percentage = ($total > 0 ? number_format(100 * $number / $total, 1, ',', '.') : '0'); |
|
409 | 409 | |
410 | - echo '<tr class="row_'.($i%2 == 0 ? 'odd' : 'even').'"> |
|
410 | + echo '<tr class="row_'.($i % 2 == 0 ? 'odd' : 'even').'"> |
|
411 | 411 | <td width="150">'.$subtitle.'</td> |
412 | 412 | <td width="550">'.Display::bar_progress($percentage, false).'</td> |
413 | 413 | <td align="right">'.$number_label.'</td>'; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | echo '<td align="right"> '.$percentage.'%</td>'; |
416 | 416 | } |
417 | 417 | echo '</tr>'; |
418 | - $i ++; |
|
418 | + $i++; |
|
419 | 419 | } |
420 | 420 | if ($showTotal) { |
421 | 421 | if (!$isFileSize) { |
@@ -441,11 +441,11 @@ discard block |
||
441 | 441 | $table_url = null; |
442 | 442 | $where_url = null; |
443 | 443 | $now = api_get_utc_datetime(); |
444 | - $where_url_last = ' WHERE login_date > DATE_SUB("' . $now . '",INTERVAL 1 %s)'; |
|
444 | + $where_url_last = ' WHERE login_date > DATE_SUB("'.$now.'",INTERVAL 1 %s)'; |
|
445 | 445 | if (api_is_multiple_url_enabled()) { |
446 | 446 | $table_url = ", $access_url_rel_user_table"; |
447 | 447 | $where_url = " WHERE login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
448 | - $where_url_last = ' AND login_date > DATE_SUB("' . $now . '",INTERVAL 1 %s)'; |
|
448 | + $where_url_last = ' AND login_date > DATE_SUB("'.$now.'",INTERVAL 1 %s)'; |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | $period = get_lang('PeriodMonth'); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | GROUP BY stat_date |
465 | 465 | ORDER BY stat_date "; |
466 | 466 | $sql_last_x = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins |
467 | - FROM ".$table.$table_url.$where_url.sprintf($where_url_last,'DAY')." |
|
467 | + FROM ".$table.$table_url.$where_url.sprintf($where_url_last, 'DAY')." |
|
468 | 468 | GROUP BY stat_date |
469 | 469 | ORDER BY stat_date "; |
470 | 470 | break; |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | GROUP BY stat_date |
477 | 477 | ORDER BY DATE_FORMAT( login_date, '%w' ) "; |
478 | 478 | $sql_last_x = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date, count( login_id ) AS number_of_logins |
479 | - FROM ".$table.$table_url.$where_url.sprintf($where_url_last,'WEEK')." |
|
479 | + FROM ".$table.$table_url.$where_url.sprintf($where_url_last, 'WEEK')." |
|
480 | 480 | GROUP BY stat_date |
481 | 481 | ORDER BY DATE_FORMAT( login_date, '%w' ) "; |
482 | 482 | break; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
528 | 528 | } else { |
529 | 529 | $table_url = ''; |
530 | - $where_url=''; |
|
530 | + $where_url = ''; |
|
531 | 531 | } |
532 | 532 | $now = api_get_utc_datetime(); |
533 | 533 | $field = 'login_user_id'; |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
567 | 567 | } else { |
568 | 568 | $table_url = ''; |
569 | - $where_url=''; |
|
569 | + $where_url = ''; |
|
570 | 570 | } |
571 | 571 | $now = api_get_utc_datetime(); |
572 | 572 | $field = 'login_user_id'; |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | GROUP BY date(login_date)"; |
580 | 580 | |
581 | 581 | $res = Database::query($sql); |
582 | - while ($row = Database::fetch_array($res,'ASSOC')){ |
|
582 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
583 | 583 | $totalLogin[$row['login_date']] = $row['number']; |
584 | 584 | } |
585 | 585 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | $url_condition2 = null; |
680 | 680 | $table = null; |
681 | 681 | if (api_is_multiple_url_enabled()) { |
682 | - $url_condition = ", $access_url_rel_user_table as url WHERE url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
|
682 | + $url_condition = ", $access_url_rel_user_table as url WHERE url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
|
683 | 683 | $url_condition2 = " AND url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
684 | 684 | $table = ", $access_url_rel_user_table as url "; |
685 | 685 | } |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | 'width=200px', |
713 | 713 | false |
714 | 714 | ); |
715 | - $renderer =& $form->defaultRenderer(); |
|
715 | + $renderer = & $form->defaultRenderer(); |
|
716 | 716 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
717 | 717 | $form->addElement('hidden', 'report', 'activities'); |
718 | 718 | $form->addElement('hidden', 'activities_direction', 'DESC'); |
@@ -762,10 +762,10 @@ discard block |
||
762 | 762 | $columns[1] = 'access_date'; |
763 | 763 | $sql_order[SORT_ASC] = 'ASC'; |
764 | 764 | $sql_order[SORT_DESC] = 'DESC'; |
765 | - $per_page = isset($_GET['per_page'])?intval($_GET['per_page']) : 10; |
|
766 | - $page_nr = isset($_GET['page_nr'])?intval($_GET['page_nr']) : 1; |
|
767 | - $column = isset($_GET['column'])?intval($_GET['column']) : 0; |
|
768 | - $date_diff = isset($_GET['date_diff'])?intval($_GET['date_diff']) : 60; |
|
765 | + $per_page = isset($_GET['per_page']) ? intval($_GET['per_page']) : 10; |
|
766 | + $page_nr = isset($_GET['page_nr']) ? intval($_GET['page_nr']) : 1; |
|
767 | + $column = isset($_GET['column']) ? intval($_GET['column']) : 0; |
|
768 | + $date_diff = isset($_GET['date_diff']) ? intval($_GET['date_diff']) : 60; |
|
769 | 769 | $direction = isset($_GET['direction']) ? $_GET['direction'] : SORT_ASC; |
770 | 770 | |
771 | 771 | if (!in_array($direction, array(SORT_ASC, SORT_DESC))) { |
@@ -793,25 +793,25 @@ discard block |
||
793 | 793 | access_url_id='".$current_url_id."' |
794 | 794 | GROUP BY t.c_id |
795 | 795 | HAVING t.c_id <> '' |
796 | - AND DATEDIFF( '".api_get_utc_datetime()."' , access_date ) <= ". $date_diff; |
|
796 | + AND DATEDIFF( '".api_get_utc_datetime()."' , access_date ) <= ".$date_diff; |
|
797 | 797 | } else { |
798 | 798 | $sql = "SELECT * FROM $table t |
799 | 799 | GROUP BY t.c_id |
800 | 800 | HAVING t.c_id <> '' |
801 | - AND DATEDIFF( '".api_get_utc_datetime()."' , access_date ) <= ". $date_diff; |
|
801 | + AND DATEDIFF( '".api_get_utc_datetime()."' , access_date ) <= ".$date_diff; |
|
802 | 802 | } |
803 | 803 | $sql .= ' ORDER BY '.$columns[$column].' '.$sql_order[$direction]; |
804 | - $from = ($page_nr -1) * $per_page; |
|
804 | + $from = ($page_nr - 1) * $per_page; |
|
805 | 805 | $sql .= ' LIMIT '.$from.','.$per_page; |
806 | 806 | |
807 | 807 | echo '<p>'.get_lang('LastAccess').' >= '.$date_diff.' '.get_lang('Days').'</p>'; |
808 | 808 | $res = Database::query($sql); |
809 | 809 | if (Database::num_rows($res) > 0) { |
810 | - $courses = array (); |
|
810 | + $courses = array(); |
|
811 | 811 | while ($obj = Database::fetch_object($res)) { |
812 | 812 | $courseInfo = api_get_course_info_by_id($obj->c_id); |
813 | - $course = array (); |
|
814 | - $course[]= '<a href="'.api_get_path(WEB_COURSE_PATH).$courseInfo['code'].'">'.$courseInfo['code'].' <a>'; |
|
813 | + $course = array(); |
|
814 | + $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$courseInfo['code'].'">'.$courseInfo['code'].' <a>'; |
|
815 | 815 | // Allow sort by date hiding the numerical date |
816 | 816 | $course[] = '<span style="display:none;">'.$obj->access_date.'</span>'.api_convert_and_format_date($obj->access_date); |
817 | 817 | $courses[] = $course; |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
938 | 938 | } else { |
939 | 939 | $table_url = ''; |
940 | - $where_url=''; |
|
940 | + $where_url = ''; |
|
941 | 941 | } |
942 | 942 | $now = api_get_utc_datetime(); |
943 | 943 | $sql[get_lang('ThisDay')] = |
@@ -18,9 +18,11 @@ |
||
18 | 18 | |
19 | 19 | foreach ($event_config[$event_name]["actions"] as $func) { |
20 | 20 | $execute = true; |
21 | - if (!function_exists($func)) // if the function doesn't exist, we log |
|
21 | + if (!function_exists($func)) { |
|
22 | + // if the function doesn't exist, we log |
|
22 | 23 | { |
23 | 24 | error_log("EventsDispatcher warning : ".$func." does not exist."); |
25 | + } |
|
24 | 26 | $execute = false; |
25 | 27 | } |
26 | 28 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | /** |
14 | 14 | * @param string $event_name |
15 | 15 | * @param array $event_data |
16 | - * @return bool |
|
16 | + * @return false|null |
|
17 | 17 | */ |
18 | 18 | public static function events($event_name, $event_data = array()) |
19 | 19 | { |
@@ -182,10 +182,11 @@ |
||
182 | 182 | echo "<td style='padding-left : 40px;' valign='top'>" . $beautifulDateTime . "</td>"; |
183 | 183 | echo"</tr>"; |
184 | 184 | // $limit is used to select only results between $results[$j] (current login) and next one |
185 | - if ($j == ( sizeof($results) - 1 )) |
|
186 | - $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
187 | - else |
|
188 | - $limit = $results[$j + 1]; |
|
185 | + if ($j == ( sizeof($results) - 1 )) { |
|
186 | + $limit = date("Y-m-d H:i:s", $nextReqDate); |
|
187 | + } else { |
|
188 | + $limit = $results[$j + 1]; |
|
189 | + } |
|
189 | 190 | // select all access to tool between displayed date and next displayed date or now() if |
190 | 191 | // displayed date is the last login date |
191 | 192 | $sql = "SELECT access_tool, count(access_tool) |
@@ -7,7 +7,6 @@ |
||
7 | 7 | * @author Sebastien Piraux |
8 | 8 | * |
9 | 9 | * @package chamilo.tracking |
10 | - |
|
11 | 10 | */ |
12 | 11 | /** |
13 | 12 | * Code |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | // check if uid is tutor of this group |
76 | 76 | $courseId = api_get_course_int_id(); |
77 | 77 | |
78 | - if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) { |
|
78 | + if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) { |
|
79 | 79 | if ($is_allowedToTrackEverybodyInCourse) { |
80 | 80 | $sql = "SELECT u.firstname,u.lastname, u.email |
81 | 81 | FROM $TABLECOURSUSER cu , $TABLEUSER u |
82 | 82 | WHERE |
83 | 83 | cu.user_id = u.user_id AND |
84 | - cu.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND |
|
84 | + cu.relation_type<>".COURSE_RELATION_TYPE_RRHH." AND |
|
85 | 85 | cu.c_id = '$courseId' AND |
86 | 86 | u.user_id = '$uInfo'"; |
87 | 87 | } else { |
@@ -97,21 +97,21 @@ discard block |
||
97 | 97 | $res[2] == "" ? $res2 = get_lang('NoEmail') : $res2 = Display::encrypted_mailto_link($res[2]); |
98 | 98 | |
99 | 99 | echo "<tr><td>"; |
100 | - echo $informationsAbout . " : <br>"; |
|
100 | + echo $informationsAbout." : <br>"; |
|
101 | 101 | echo "<ul>\n" |
102 | - . "<li>" . get_lang('FirstName') . " : " . $res[0] . "</li>\n" |
|
103 | - . "<li>" . get_lang('LastName') . " : " . $res[1] . "</li>\n" |
|
104 | - . "<li>" . get_lang('Email') . " : " . $res2 . "</li>\n" |
|
102 | + . "<li>".get_lang('FirstName')." : ".$res[0]."</li>\n" |
|
103 | + . "<li>".get_lang('LastName')." : ".$res[1]."</li>\n" |
|
104 | + . "<li>".get_lang('Email')." : ".$res2."</li>\n" |
|
105 | 105 | . "</ul>"; |
106 | 106 | echo "</td></tr>"; |
107 | 107 | /* * ***** MENU ******* */ |
108 | 108 | echo "<tr> |
109 | 109 | <td> |
110 | - [<a href='userLog.php?uInfo=$uInfo&view=$view'>" . get_lang('Back') . "</a>] |
|
110 | + [<a href='userLog.php?uInfo=$uInfo&view=$view'>".get_lang('Back')."</a>] |
|
111 | 111 | "; |
112 | 112 | echo " || |
113 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=week&reqdate=$reqdate' class='specialLink'>" . get_lang('PeriodWeek') . "</a>] |
|
114 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=month&reqdate=$reqdate' class='specialLink'>" . get_lang('PeriodMonth') . "</a>] |
|
113 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=week&reqdate=$reqdate' class='specialLink'>".get_lang('PeriodWeek')."</a>] |
|
114 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=month&reqdate=$reqdate' class='specialLink'>".get_lang('PeriodMonth')."</a>] |
|
115 | 115 | || |
116 | 116 | "; |
117 | 117 | switch ($period) { |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | $previousReqDate = $reqdate - 7 * 86400; |
121 | 121 | $nextReqDate = $reqdate + 7 * 86400; |
122 | 122 | echo " |
123 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=week&reqdate=$previousReqDate' class='specialLink'>" . get_lang('PreviousWeek') . "</a>] |
|
124 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=week&reqdate=$nextReqDate' class='specialLink'>" . get_lang('NextWeek') . "</a>] |
|
123 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=week&reqdate=$previousReqDate' class='specialLink'>".get_lang('PreviousWeek')."</a>] |
|
124 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=week&reqdate=$nextReqDate' class='specialLink'>".get_lang('NextWeek')."</a>] |
|
125 | 125 | "; |
126 | 126 | break; |
127 | 127 | default: |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $previousReqDate = mktime(1, 1, 1, date("m", $reqdate) - 1, 1, date("Y", $reqdate)); |
133 | 133 | $nextReqDate = mktime(1, 1, 1, date("m", $reqdate) + 1, 1, date("Y", $reqdate)); |
134 | 134 | echo " |
135 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=month&reqdate=$previousReqDate' class='specialLink'>" . get_lang('PreviousMonth') . "</a>] |
|
136 | - [<a href='" . api_get_self() . "?uInfo=$uInfo&view=$view&period=month&reqdate=$nextReqDate' class='specialLink'>" . get_lang('NextMonth') . "</a>] |
|
135 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=month&reqdate=$previousReqDate' class='specialLink'>".get_lang('PreviousMonth')."</a>] |
|
136 | + [<a href='" . api_get_self()."?uInfo=$uInfo&view=$view&period=month&reqdate=$nextReqDate' class='specialLink'>".get_lang('NextMonth')."</a>] |
|
137 | 137 | "; |
138 | 138 | break; |
139 | 139 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate')) |
154 | 154 | GROUP BY DAYOFMONTH(access_date) |
155 | 155 | ORDER BY access_date ASC"; |
156 | - $displayedDate = $MonthsLong[date("n", $reqdate) - 1] . date(" Y", $reqdate); |
|
156 | + $displayedDate = $MonthsLong[date("n", $reqdate) - 1].date(" Y", $reqdate); |
|
157 | 157 | break; |
158 | 158 | case "week" : |
159 | 159 | $sql = "SELECT access_date |
@@ -165,24 +165,24 @@ discard block |
||
165 | 165 | GROUP BY DAYOFMONTH(access_date) |
166 | 166 | ORDER BY access_date ASC"; |
167 | 167 | $weeklowreqdate = ($reqdate - (86400 * date("w", $reqdate))); |
168 | - $weekhighreqdate = ($reqdate + (86400 * (6 - date("w", $reqdate)) )); |
|
169 | - $displayedDate = get_lang('From') . " " . date("d ", $weeklowreqdate) . $MonthsLong[date("n", $weeklowreqdate) - 1] . date(" Y", $weeklowreqdate) |
|
170 | - . " " . get_lang('To') . " " . date("d ", $weekhighreqdate) . $MonthsLong[date("n", $weekhighreqdate) - 1] . date(" Y", $weekhighreqdate); |
|
168 | + $weekhighreqdate = ($reqdate + (86400 * (6 - date("w", $reqdate)))); |
|
169 | + $displayedDate = get_lang('From')." ".date("d ", $weeklowreqdate).$MonthsLong[date("n", $weeklowreqdate) - 1].date(" Y", $weeklowreqdate) |
|
170 | + . " ".get_lang('To')." ".date("d ", $weekhighreqdate).$MonthsLong[date("n", $weekhighreqdate) - 1].date(" Y", $weekhighreqdate); |
|
171 | 171 | break; |
172 | 172 | } |
173 | 173 | echo "<tr><td>"; |
174 | 174 | $results = StatsUtils::getManyResults1Col($sql); |
175 | 175 | /* * * display of the displayed period ** */ |
176 | 176 | echo "<table width='100%' cellpadding='2' cellspacing='1' border='0' align=center>"; |
177 | - echo "<td bgcolor='#E6E6E6'>" . $displayedDate . "</td>"; |
|
177 | + echo "<td bgcolor='#E6E6E6'>".$displayedDate."</td>"; |
|
178 | 178 | if (is_array($results)) { |
179 | 179 | for ($j = 0; $j < sizeof($results); $j++) { |
180 | 180 | $beautifulDateTime = api_convert_and_format_date($results[$j], null, date_default_timezone_get()); |
181 | 181 | echo "<tr>"; |
182 | - echo "<td style='padding-left : 40px;' valign='top'>" . $beautifulDateTime . "</td>"; |
|
182 | + echo "<td style='padding-left : 40px;' valign='top'>".$beautifulDateTime."</td>"; |
|
183 | 183 | echo"</tr>"; |
184 | 184 | // $limit is used to select only results between $results[$j] (current login) and next one |
185 | - if ($j == ( sizeof($results) - 1 )) |
|
185 | + if ($j == (sizeof($results) - 1)) |
|
186 | 186 | $limit = date("Y-m-d H:i:s", $nextReqDate); |
187 | 187 | else |
188 | 188 | $limit = $results[$j + 1]; |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | FROM $TABLETRACK_ACCESS |
193 | 193 | WHERE access_user_id = $uInfo |
194 | 194 | AND access_tool IS NOT NULL |
195 | - AND access_date > '" . $results[$j] . "' |
|
196 | - AND access_date < '" . $limit . "' |
|
195 | + AND access_date > '".$results[$j]."' |
|
196 | + AND access_date < '" . $limit."' |
|
197 | 197 | AND c_id = $courseId |
198 | 198 | GROUP BY access_tool |
199 | 199 | ORDER BY access_tool ASC"; |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | echo "<table width='50%' cellpadding='0' cellspacing='0' border='0'>\n"; |
205 | 205 | for ($k = 0; $k < count($results2); $k++) { |
206 | 206 | echo "<tr>\n"; |
207 | - echo "<td width='70%' style='padding-left : 60px;'>" . get_lang($results2[$k][0]) . "</td>\n"; |
|
208 | - echo "<td width='30%' align='right' style='padding-right : 40px'>" . $results2[$k][1] . " " . get_lang('Visits') . "</td>\n"; |
|
207 | + echo "<td width='70%' style='padding-left : 60px;'>".get_lang($results2[$k][0])."</td>\n"; |
|
208 | + echo "<td width='30%' align='right' style='padding-right : 40px'>".$results2[$k][1]." ".get_lang('Visits')."</td>\n"; |
|
209 | 209 | echo "</tr>"; |
210 | 210 | } |
211 | 211 | echo "</table>\n"; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | } else { |
217 | 217 | echo "<tr>"; |
218 | - echo "<td colspan='2' bgcolor='#eeeeee'>" . get_lang('NoResult') . "</td>"; |
|
218 | + echo "<td colspan='2' bgcolor='#eeeeee'>".get_lang('NoResult')."</td>"; |
|
219 | 219 | echo "</tr>"; |
220 | 220 | } |
221 | 221 | echo "</table>"; |
@@ -111,7 +111,7 @@ |
||
111 | 111 | get_lang('HideColumn'), |
112 | 112 | array('align' => 'absmiddle', 'hspace' => '3px'), |
113 | 113 | ICON_SIZE_SMALL |
114 | - ) . "</div>' |
|
114 | + ) . "</div>' |
|
115 | 115 | ); |
116 | 116 | } |
117 | 117 | ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | get_lang('HideColumn'), |
112 | 112 | array('align' => 'absmiddle', 'hspace' => '3px'), |
113 | 113 | ICON_SIZE_SMALL |
114 | - ) . "</div>' |
|
114 | + )."</div>' |
|
115 | 115 | ); |
116 | 116 | } |
117 | 117 | ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $TABLETRACK_LINKS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS); |
147 | 147 | $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
148 | 148 | $TABLETRACK_ACCESS_2 = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
149 | -$TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
|
149 | +$TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
|
150 | 150 | $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
151 | 151 | $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE); |
152 | 152 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | |
157 | 157 | // Breadcrumbs. |
158 | 158 | if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') { |
159 | - $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin')); |
|
160 | - $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList')); |
|
159 | + $interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin')); |
|
160 | + $interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList')); |
|
161 | 161 | $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview')); |
162 | 162 | } |
163 | 163 | |
@@ -228,21 +228,21 @@ discard block |
||
228 | 228 | if (!empty($sessionId)) { |
229 | 229 | $actionsLeft .= Display::url( |
230 | 230 | Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM), |
231 | - api_get_path(WEB_CODE_PATH) . 'attendance/index.php?' . api_get_cidreq() . '&action=calendar_logins' |
|
231 | + api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins' |
|
232 | 232 | ); |
233 | 233 | } |
234 | 234 | |
235 | 235 | $actionsRight = '<div class="pull-right">'; |
236 | 236 | $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'. |
237 | - Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
237 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
238 | 238 | |
239 | 239 | $addional_param = ''; |
240 | 240 | if (isset($_GET['additional_profile_field'])) { |
241 | - $addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']); |
|
241 | + $addional_param = 'additional_profile_field='.intval($_GET['additional_profile_field']); |
|
242 | 242 | } |
243 | 243 | $users_tracking_per_page = ''; |
244 | 244 | if (isset($_GET['users_tracking_per_page'])) { |
245 | - $users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']); |
|
245 | + $users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']); |
|
246 | 246 | } |
247 | 247 | $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'"> |
248 | 248 | '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>'; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $course_name = get_lang('Course').' '.$courseInfo['name']; |
267 | 267 | if ($session_id) { |
268 | 268 | $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id); |
269 | - $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name; |
|
269 | + $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name; |
|
270 | 270 | } else { |
271 | 271 | $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name']; |
272 | 272 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $html .= '<ul class="session-list">'; |
307 | 307 | foreach ($sessionList as $session) { |
308 | 308 | $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code']; |
309 | - $html .= Display::tag('li', $iconCourse . ' ' . Display::url($session['name'], $url)); |
|
309 | + $html .= Display::tag('li', $iconCourse.' '.Display::url($session['name'], $url)); |
|
310 | 310 | } |
311 | 311 | $html .= '</ul>'; |
312 | 312 | } |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | $form = new FormValidator( |
322 | 322 | 'reminder_form', |
323 | 323 | 'get', |
324 | - api_get_path(WEB_CODE_PATH).'announcements/announcements.php?' . api_get_cidreq(), |
|
324 | + api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(), |
|
325 | 325 | null, |
326 | 326 | ['style' => 'margin-bottom: 10px'], |
327 | 327 | FormValidator::LAYOUT_INLINE |
328 | 328 | ); |
329 | - $options = array ( |
|
329 | + $options = array( |
|
330 | 330 | 2 => sprintf($getLangXDays, 2), |
331 | 331 | 3 => sprintf($getLangXDays, 3), |
332 | 332 | 4 => sprintf($getLangXDays, 4), |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | ); |
340 | 340 | $el = $form->addSelect( |
341 | 341 | 'since', |
342 | - Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'), |
|
342 | + Display::returnFontAwesomeIcon('warning').get_lang('RemindInactivesLearnersSince'), |
|
343 | 343 | $options, |
344 | 344 | ['class' => 'col-sm-3'] |
345 | 345 | ); |
@@ -508,7 +508,7 @@ |
||
508 | 508 | $csv_headers[] = get_lang('FirstLoginInCourse', ''); |
509 | 509 | $csv_headers[] = get_lang('LatestLoginInCourse', ''); |
510 | 510 | |
511 | - if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) { |
|
511 | + if (isset($_GET['additional_profile_field']) and is_numeric($_GET['additional_profile_field'])) { |
|
512 | 512 | $csv_headers[] = $extra_info['display_text']; |
513 | 513 | } |
514 | 514 | ob_end_clean(); |
@@ -445,7 +445,10 @@ |
||
445 | 445 | } |
446 | 446 | } |
447 | 447 | ?> |
448 | - <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); ?>" /> |
|
448 | + <input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) { |
|
449 | + echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); |
|
450 | +} |
|
451 | +?>" /> |
|
449 | 452 | <input type="hidden" name="urlAppendPath" value="<?php echo api_htmlentities($urlAppendPath, ENT_QUOTES); ?>" /> |
450 | 453 | <input type="hidden" name="pathForm" value="<?php echo api_htmlentities($pathForm, ENT_QUOTES); ?>" /> |
451 | 454 | <input type="hidden" name="urlForm" value="<?php echo api_htmlentities($urlForm, ENT_QUOTES); ?>" /> |
@@ -261,7 +261,7 @@ |
||
261 | 261 | ?> |
262 | 262 | <option value="<?php echo $enreg['user_id']; ?>"><?php echo $enreg['username'].' - '.api_get_person_name($enreg['firstname'], $enreg['lastname']); ?></option> |
263 | 263 | <?php |
264 | - } |
|
264 | + } |
|
265 | 265 | unset($nosessionUsersList); |
266 | 266 | ?> |
267 | 267 | </select> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function send() { |
60 | 60 | if (document.formulaire.access_url_id.value!=0) { |
61 | 61 | document.formulaire.form_sent.value=0; |
62 | - document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
62 | + document.formulaire.add_type.value=\'' . $add_type.'\'; |
|
63 | 63 | document.formulaire.submit(); |
64 | 64 | } |
65 | 65 | } |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | $result = UrlManager::update_urls_rel_user($UserList, $access_url_id); |
96 | 96 | $url_info = UrlManager::get_url_data_from_id($access_url_id); |
97 | 97 | if (!empty($result)) { |
98 | - $message .= 'URL: ' . $url_info['url'] . '<br />'; |
|
98 | + $message .= 'URL: '.$url_info['url'].'<br />'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!empty($result['users_added'])) { |
102 | - $message .= '<h4>' . get_lang('UsersAdded') . ':</h4>'; |
|
102 | + $message .= '<h4>'.get_lang('UsersAdded').':</h4>'; |
|
103 | 103 | $i = 1; |
104 | 104 | $user_added_list = array(); |
105 | 105 | foreach ($result['users_added'] as $user) { |
106 | 106 | $user_info = api_get_user_info($user); |
107 | 107 | if (!empty($user_info)) { |
108 | - $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
108 | + $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
109 | 109 | $i++; |
110 | 110 | } |
111 | 111 | } |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | if (!empty($result['users_deleted'])) { |
118 | - $message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>'; |
|
118 | + $message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>'; |
|
119 | 119 | $user_deleted_list = array(); |
120 | 120 | $i = 1; |
121 | 121 | foreach ($result['users_deleted'] as $user) { |
122 | 122 | $user_info = api_get_user_info($user); |
123 | 123 | if (!empty($user_info)) { |
124 | - $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
124 | + $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
125 | 125 | $i++; |
126 | 126 | } |
127 | 127 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | echo '<div class="actions">'; |
143 | 143 | echo Display::url( |
144 | 144 | Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), |
145 | - api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php' |
|
145 | + api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php' |
|
146 | 146 | ); |
147 | 147 | echo '</div>'; |
148 | 148 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | $sql = "SELECT u.user_id, lastname, firstname, username |
170 | - FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " . |
|
170 | + FROM $tbl_user u WHERE status <> ".ANONYMOUS." ". |
|
171 | 171 | $order_clause; |
172 | 172 | $result = Database::query($sql); |
173 | 173 | $Users = Database::store_result($result); |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | if ($add_type == 'multiple') { |
183 | - $link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>'; |
|
183 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
184 | 184 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
185 | 185 | } else { |
186 | 186 | $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
187 | - $link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>'; |
|
187 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
188 | 188 | } |
189 | 189 | $url_list = UrlManager::get_url_data(); |
190 | 190 | ?> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) { |
197 | 197 | echo ' onsubmit="valide();"'; |
198 | 198 | } ?> > |
199 | - <?php echo get_lang('SelectUrl') . ' : '; ?> |
|
199 | + <?php echo get_lang('SelectUrl').' : '; ?> |
|
200 | 200 | <select name="access_url_id" onchange="javascript:send();"> |
201 | 201 | <option value="0"> <?php echo get_lang('SelectUrl') ?></option> |
202 | 202 | <?php |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | <td> |
233 | 233 | <h3> |
234 | 234 | <?php |
235 | - $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
235 | + $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
236 | 236 | echo get_lang('TotalAvailableUsers').' '.$total_users; |
237 | 237 | ?> |
238 | 238 | </h3> |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b> |
243 | 243 | </td> |
244 | 244 | <td></td> |
245 | - <td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
245 | + <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
246 | 246 | </tr> |
247 | 247 | <tr> |
248 | 248 | <td align="center"> |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | <br /> |
303 | 303 | <?php |
304 | 304 | if (isset($_GET['add'])) { |
305 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>'; |
|
305 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>'; |
|
306 | 306 | } else { |
307 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>'; |
|
307 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>'; |
|
308 | 308 | } |
309 | 309 | ?> |
310 | 310 | </td> |
@@ -33,36 +33,36 @@ |
||
33 | 33 | $result_course = Database::query($sql_course); |
34 | 34 | |
35 | 35 | if (Database::num_rows($result_course) > 0) { |
36 | - if (isset($_POST['export'])) { |
|
37 | - $export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet. |
|
38 | - Display :: display_error_message($export_result); |
|
39 | - } |
|
40 | - 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>'; |
|
41 | - $header = array(get_lang('Course', ''), get_lang('TempsFrequentation', ''), get_lang('Progression', ''), get_lang('MoyenneTest', '')); |
|
42 | - while ($a_course = Database::fetch_array($result_course)) { |
|
43 | - // TODO: This query is to be checked, there are no HotPotatoes tests results. |
|
44 | - $sql_moy_test = "SELECT exe_result,exe_weighting |
|
36 | + if (isset($_POST['export'])) { |
|
37 | + $export_result = export_csv($header, $data, 'test.csv'); // TODO: There is no data for exporting yet. |
|
38 | + Display :: display_error_message($export_result); |
|
39 | + } |
|
40 | + 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>'; |
|
41 | + $header = array(get_lang('Course', ''), get_lang('TempsFrequentation', ''), get_lang('Progression', ''), get_lang('MoyenneTest', '')); |
|
42 | + while ($a_course = Database::fetch_array($result_course)) { |
|
43 | + // TODO: This query is to be checked, there are no HotPotatoes tests results. |
|
44 | + $sql_moy_test = "SELECT exe_result,exe_weighting |
|
45 | 45 | FROM $tbl_track_exercice |
46 | 46 | WHERE c_id = ".$a_course['id']; |
47 | - $result_moy_test = Database::query($sql_moy_test); |
|
48 | - $result = 0; |
|
49 | - $weighting = 0; |
|
50 | - while ($moy_test = Database::fetch_array($result_moy_test)) { |
|
51 | - $result = $result + $moy_test['exe_result']; |
|
52 | - $weighting = $weighting + $moy_test['exe_weighting']; |
|
53 | - } |
|
54 | - if ($weighting != 0) { |
|
55 | - $moyenne_test = round(($result * 100) / $weighting); |
|
56 | - } else { |
|
57 | - $moyenne_test = null; |
|
58 | - } |
|
59 | - echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>'; |
|
60 | - } |
|
61 | - echo '</table>'; |
|
62 | - echo "<br /><br />"; |
|
63 | - echo "<form method='post'><input type='submit' name='export' value='".get_lang('ExportExcel')."'/><form>"; |
|
47 | + $result_moy_test = Database::query($sql_moy_test); |
|
48 | + $result = 0; |
|
49 | + $weighting = 0; |
|
50 | + while ($moy_test = Database::fetch_array($result_moy_test)) { |
|
51 | + $result = $result + $moy_test['exe_result']; |
|
52 | + $weighting = $weighting + $moy_test['exe_weighting']; |
|
53 | + } |
|
54 | + if ($weighting != 0) { |
|
55 | + $moyenne_test = round(($result * 100) / $weighting); |
|
56 | + } else { |
|
57 | + $moyenne_test = null; |
|
58 | + } |
|
59 | + echo '<tr><td>'.$a_course['title'].'</td><td> </td><td> </td><td>'.(is_null($moyenne_test) ? '' : $moyenne_test.'%').'</td> </tr>'; |
|
60 | + } |
|
61 | + echo '</table>'; |
|
62 | + echo "<br /><br />"; |
|
63 | + echo "<form method='post'><input type='submit' name='export' value='".get_lang('ExportExcel')."'/><form>"; |
|
64 | 64 | } else { |
65 | - echo get_lang('NoCourse'); |
|
65 | + echo get_lang('NoCourse'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | Display :: display_footer(); |
@@ -21,17 +21,17 @@ |
||
21 | 21 | |
22 | 22 | if ($ldap_login_success) |
23 | 23 | { |
24 | - //error_log('Found user '.$login.' on LDAP server',0); |
|
25 | - /* |
|
24 | + //error_log('Found user '.$login.' on LDAP server',0); |
|
25 | + /* |
|
26 | 26 | In here, we know that |
27 | 27 | - the user does not exist in dokeos |
28 | 28 | - the users login and password are correct |
29 | 29 | */ |
30 | - $info_array = ldap_find_user_info($login); |
|
31 | - ldap_put_user_info_locally($login, $info_array); |
|
30 | + $info_array = ldap_find_user_info($login); |
|
31 | + ldap_put_user_info_locally($login, $info_array); |
|
32 | 32 | } else { |
33 | 33 | //error_log('Could not find '.$login.' on LDAP server',0); |
34 | - $loginFailed = true; |
|
35 | - unset($_user['user_id']); |
|
36 | - $uidReset = false; |
|
34 | + $loginFailed = true; |
|
35 | + unset($_user['user_id']); |
|
36 | + $uidReset = false; |
|
37 | 37 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | |
20 | 20 | $ldap_login_success = ldap_login($login, $password); |
21 | 21 | |
22 | -if ($ldap_login_success) |
|
23 | -{ |
|
22 | +if ($ldap_login_success) { |
|
24 | 23 | //error_log('Found user '.$login.' on LDAP server',0); |
25 | 24 | /* |
26 | 25 | In here, we know that |
@@ -55,7 +55,7 @@ |
||
55 | 55 | //$gradebook['name'] = $gradebook['name']; |
56 | 56 | //$gradebook_list[] = $gradebook; |
57 | 57 | } else { |
58 | - // $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name']; |
|
58 | + // $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name']; |
|
59 | 59 | //$gradebook_list[] = $gradebook; |
60 | 60 | } |
61 | 61 | } |