@@ -17,7 +17,7 @@ |
||
17 | 17 | $result = $objExercise->read($exercise_id); |
18 | 18 | |
19 | 19 | if (!$result) { |
20 | - api_not_allowed(true); |
|
20 | + api_not_allowed(true); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $interbreadcrumb[] = array( |
@@ -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> |
@@ -60,9 +60,9 @@ |
||
60 | 60 | |
61 | 61 | <?php |
62 | 62 | if (isset($action) && ($action=="synchro")) { |
63 | - $included=true; |
|
64 | - require('ldap_synchro.php'); |
|
65 | - Display :: display_normal_message($message,false); |
|
63 | + $included=true; |
|
64 | + require('ldap_synchro.php'); |
|
65 | + Display :: display_normal_message($message,false); |
|
66 | 66 | } |
67 | 67 | Display::display_footer(); |
68 | 68 | ?> |
@@ -24,39 +24,39 @@ |
||
24 | 24 | $message = null; |
25 | 25 | |
26 | 26 | if ($form->validate()) { |
27 | - $archive_path = api_get_path(SYS_ARCHIVE_PATH); |
|
28 | - $htaccess = @file_get_contents($archive_path.'.htaccess'); |
|
29 | - $result = rmdirr($archive_path, true, true); |
|
27 | + $archive_path = api_get_path(SYS_ARCHIVE_PATH); |
|
28 | + $htaccess = @file_get_contents($archive_path.'.htaccess'); |
|
29 | + $result = rmdirr($archive_path, true, true); |
|
30 | 30 | |
31 | - \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles(); |
|
31 | + \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles(); |
|
32 | 32 | |
33 | - if (!empty($htaccess)) { |
|
34 | - @file_put_contents($archive_path.'/.htaccess', $htaccess); |
|
35 | - } |
|
36 | - if ($result) { |
|
37 | - $message = 'ArchiveDirCleanupSucceeded'; |
|
38 | - $type = 'confirmation'; |
|
39 | - } else { |
|
40 | - $message = 'ArchiveDirCleanupFailed'; |
|
41 | - $type = 'error'; |
|
42 | - } |
|
33 | + if (!empty($htaccess)) { |
|
34 | + @file_put_contents($archive_path.'/.htaccess', $htaccess); |
|
35 | + } |
|
36 | + if ($result) { |
|
37 | + $message = 'ArchiveDirCleanupSucceeded'; |
|
38 | + $type = 'confirmation'; |
|
39 | + } else { |
|
40 | + $message = 'ArchiveDirCleanupFailed'; |
|
41 | + $type = 'error'; |
|
42 | + } |
|
43 | 43 | |
44 | - header('Location: '.api_get_self().'?msg='.$message.'&type='.$type); |
|
45 | - exit; |
|
44 | + header('Location: '.api_get_self().'?msg='.$message.'&type='.$type); |
|
45 | + exit; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | Display::display_header(get_lang('ArchiveDirCleanup')); |
49 | 49 | Display::display_warning_message(get_lang('ArchiveDirCleanupDescr')); |
50 | 50 | |
51 | 51 | if (isset($_GET['msg']) && isset($_GET['type'])) { |
52 | - if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
|
53 | - switch($_GET['type']) { |
|
54 | - case 'error': |
|
55 | - $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
|
56 | - break; |
|
57 | - case 'confirmation': |
|
58 | - $message = Display::return_message(get_lang($_GET['msg']), 'confirm'); |
|
59 | - } |
|
52 | + if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
|
53 | + switch($_GET['type']) { |
|
54 | + case 'error': |
|
55 | + $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
|
56 | + break; |
|
57 | + case 'confirmation': |
|
58 | + $message = Display::return_message(get_lang($_GET['msg']), 'confirm'); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if (!empty($message)) { |
@@ -4,8 +4,7 @@ |
||
4 | 4 | @author Andre Boivin base code |
5 | 5 | @author Julio Montoya fixing lot of little details |
6 | 6 | @todo this script is not ready for a production use that's why I'm commenting the function delete_inactive_student |
7 | - |
|
8 | -* @package chamilo.admin |
|
7 | + * @package chamilo.admin |
|
9 | 8 | * script pour effacer les user inactif depuis x temps |
10 | 9 | */ |
11 | 10 | $cidReset = true; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | public function deleteAction($id) { |
34 | - $event_email_template = new EventEmailTemplate(); |
|
34 | + $event_email_template = new EventEmailTemplate(); |
|
35 | 35 | return $event_email_template->delete($id); |
36 | 36 | } |
37 | 37 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | array('name'=>'language_id', 'index'=>'language_id', 'width'=>'80', 'align'=>'left'), |
74 | 74 | array('name'=>'activated', 'index'=>'activated', 'width'=>'80', 'align'=>'left'), |
75 | 75 | array('name'=>'actions', 'index'=>'actions', 'width'=>'100') |
76 | - ); |
|
76 | + ); |
|
77 | 77 | //Autowidth |
78 | 78 | $extra_params['autowidth'] = 'true'; |
79 | 79 | //height auto |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // Login as ... |
21 | 21 | if ($action == "login_as" && !empty ($login_as_user_id)) |
22 | 22 | { |
23 | - login_user($login_as_user_id); |
|
23 | + login_user($login_as_user_id); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | //if we already have a session id and a user... |
@@ -37,150 +37,150 @@ discard block |
||
37 | 37 | |
38 | 38 | if (isset ($_GET['action'])) |
39 | 39 | { |
40 | - $check = Security::check_token('get'); |
|
41 | - if($check) |
|
42 | - { |
|
43 | - switch ($_GET['action']) |
|
44 | - { |
|
45 | - case 'show_message' : |
|
46 | - Display :: display_header($tool_name); |
|
47 | - Display :: display_normal_message($_GET['message']); |
|
48 | - break; |
|
49 | - case 'delete_user' : |
|
50 | - Display :: display_header($tool_name); |
|
51 | - if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
|
52 | - { |
|
53 | - Display :: display_normal_message(get_lang('UserDeleted')); |
|
54 | - } |
|
55 | - else |
|
56 | - { |
|
57 | - Display :: display_error_message(get_lang('CannotDeleteUser')); |
|
58 | - } |
|
59 | - break; |
|
60 | - case 'lock' : |
|
61 | - Display :: display_header($tool_name); |
|
62 | - $message=lock_unlock_user('lock',$_GET['user_id']); |
|
63 | - Display :: display_normal_message($message); |
|
64 | - break; |
|
65 | - case 'unlock'; |
|
66 | - Display :: display_header($tool_name); |
|
67 | - $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
68 | - Display :: display_normal_message($message); |
|
69 | - break; |
|
70 | - case 'add_user'; |
|
71 | - $id=$_GET['id']; |
|
72 | - $UserList=array(); |
|
73 | - $userid_match_login = array(); |
|
74 | - foreach ($id as $user_id) { |
|
75 | - $tmp = ldap_add_user($user_id); |
|
76 | - $UserList[]= $tmp; |
|
77 | - $userid_match_login[$tmp] = $user_id; |
|
78 | - } |
|
79 | - if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
80 | - ldap_add_user_to_session($UserList, $_GET['id_session']); |
|
81 | - header('Location: resume_session.php?id_session='.$_GET['id_session']); |
|
82 | - } else { |
|
83 | - Display :: display_header($tool_name); |
|
84 | - if(count($userid_match_login)>0) |
|
85 | - { |
|
86 | - $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | - foreach($userid_match_login as $user_id => $login) |
|
88 | - { |
|
89 | - $message .= '- '.$login.'<br />'; |
|
90 | - } |
|
91 | - } |
|
92 | - else |
|
93 | - { |
|
94 | - $message=get_lang('NoUserAdded'); |
|
95 | - } |
|
96 | - Display :: display_normal_message($message,false); |
|
97 | - } |
|
98 | - break; |
|
99 | - default : |
|
100 | - Display :: display_header($tool_name); |
|
101 | - } |
|
102 | - Security::clear_token(); |
|
103 | - } |
|
104 | - else |
|
105 | - { |
|
106 | - Display::display_header($tool_name); |
|
107 | - } |
|
40 | + $check = Security::check_token('get'); |
|
41 | + if($check) |
|
42 | + { |
|
43 | + switch ($_GET['action']) |
|
44 | + { |
|
45 | + case 'show_message' : |
|
46 | + Display :: display_header($tool_name); |
|
47 | + Display :: display_normal_message($_GET['message']); |
|
48 | + break; |
|
49 | + case 'delete_user' : |
|
50 | + Display :: display_header($tool_name); |
|
51 | + if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
|
52 | + { |
|
53 | + Display :: display_normal_message(get_lang('UserDeleted')); |
|
54 | + } |
|
55 | + else |
|
56 | + { |
|
57 | + Display :: display_error_message(get_lang('CannotDeleteUser')); |
|
58 | + } |
|
59 | + break; |
|
60 | + case 'lock' : |
|
61 | + Display :: display_header($tool_name); |
|
62 | + $message=lock_unlock_user('lock',$_GET['user_id']); |
|
63 | + Display :: display_normal_message($message); |
|
64 | + break; |
|
65 | + case 'unlock'; |
|
66 | + Display :: display_header($tool_name); |
|
67 | + $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
68 | + Display :: display_normal_message($message); |
|
69 | + break; |
|
70 | + case 'add_user'; |
|
71 | + $id=$_GET['id']; |
|
72 | + $UserList=array(); |
|
73 | + $userid_match_login = array(); |
|
74 | + foreach ($id as $user_id) { |
|
75 | + $tmp = ldap_add_user($user_id); |
|
76 | + $UserList[]= $tmp; |
|
77 | + $userid_match_login[$tmp] = $user_id; |
|
78 | + } |
|
79 | + if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
80 | + ldap_add_user_to_session($UserList, $_GET['id_session']); |
|
81 | + header('Location: resume_session.php?id_session='.$_GET['id_session']); |
|
82 | + } else { |
|
83 | + Display :: display_header($tool_name); |
|
84 | + if(count($userid_match_login)>0) |
|
85 | + { |
|
86 | + $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | + foreach($userid_match_login as $user_id => $login) |
|
88 | + { |
|
89 | + $message .= '- '.$login.'<br />'; |
|
90 | + } |
|
91 | + } |
|
92 | + else |
|
93 | + { |
|
94 | + $message=get_lang('NoUserAdded'); |
|
95 | + } |
|
96 | + Display :: display_normal_message($message,false); |
|
97 | + } |
|
98 | + break; |
|
99 | + default : |
|
100 | + Display :: display_header($tool_name); |
|
101 | + } |
|
102 | + Security::clear_token(); |
|
103 | + } |
|
104 | + else |
|
105 | + { |
|
106 | + Display::display_header($tool_name); |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | else |
110 | 110 | { |
111 | - Display::display_header($tool_name); |
|
111 | + Display::display_header($tool_name); |
|
112 | 112 | } |
113 | 113 | if (isset ($_POST['action'])) |
114 | 114 | { |
115 | - $check = Security::check_token('get'); |
|
116 | - if($check) |
|
117 | - { |
|
118 | - switch ($_POST['action']) |
|
119 | - { |
|
120 | - case 'delete' : |
|
121 | - $number_of_selected_users = count($_POST['id']); |
|
122 | - $number_of_deleted_users = 0; |
|
123 | - foreach ($_POST['id'] as $index => $user_id) |
|
124 | - { |
|
125 | - if($user_id != $_user['user_id']) |
|
126 | - { |
|
127 | - if(UserManager :: delete_user($user_id)) |
|
128 | - { |
|
129 | - $number_of_deleted_users++; |
|
130 | - } |
|
131 | - } |
|
132 | - } |
|
133 | - if($number_of_selected_users == $number_of_deleted_users) |
|
134 | - { |
|
135 | - Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
|
136 | - } |
|
137 | - else |
|
138 | - { |
|
139 | - Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
|
140 | - } |
|
141 | - break; |
|
142 | - case 'add_user' : |
|
143 | - $number_of_selected_users = count($_POST['id']); |
|
144 | - $number_of_added_users = 0; |
|
145 | - $UserList=array(); |
|
146 | - foreach ($_POST['id'] as $index => $user_id) |
|
147 | - { |
|
148 | - if($user_id != $_user['user_id']) |
|
149 | - { |
|
150 | - $UserList[] = ldap_add_user($user_id); |
|
151 | - } |
|
152 | - } |
|
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
154 | - addUserToSession($UserList, $_GET['id_session']); |
|
155 | - if(count($UserList)>0) |
|
156 | - { |
|
157 | - Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
|
158 | - } |
|
159 | - else |
|
160 | - { |
|
161 | - Display :: display_normal_message(get_lang('NoUserAdded')); |
|
162 | - } |
|
163 | - break; |
|
115 | + $check = Security::check_token('get'); |
|
116 | + if($check) |
|
117 | + { |
|
118 | + switch ($_POST['action']) |
|
119 | + { |
|
120 | + case 'delete' : |
|
121 | + $number_of_selected_users = count($_POST['id']); |
|
122 | + $number_of_deleted_users = 0; |
|
123 | + foreach ($_POST['id'] as $index => $user_id) |
|
124 | + { |
|
125 | + if($user_id != $_user['user_id']) |
|
126 | + { |
|
127 | + if(UserManager :: delete_user($user_id)) |
|
128 | + { |
|
129 | + $number_of_deleted_users++; |
|
130 | + } |
|
131 | + } |
|
132 | + } |
|
133 | + if($number_of_selected_users == $number_of_deleted_users) |
|
134 | + { |
|
135 | + Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
|
136 | + } |
|
137 | + else |
|
138 | + { |
|
139 | + Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
|
140 | + } |
|
141 | + break; |
|
142 | + case 'add_user' : |
|
143 | + $number_of_selected_users = count($_POST['id']); |
|
144 | + $number_of_added_users = 0; |
|
145 | + $UserList=array(); |
|
146 | + foreach ($_POST['id'] as $index => $user_id) |
|
147 | + { |
|
148 | + if($user_id != $_user['user_id']) |
|
149 | + { |
|
150 | + $UserList[] = ldap_add_user($user_id); |
|
151 | + } |
|
152 | + } |
|
153 | + if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
154 | + addUserToSession($UserList, $_GET['id_session']); |
|
155 | + if(count($UserList)>0) |
|
156 | + { |
|
157 | + Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
|
158 | + } |
|
159 | + else |
|
160 | + { |
|
161 | + Display :: display_normal_message(get_lang('NoUserAdded')); |
|
162 | + } |
|
163 | + break; |
|
164 | 164 | |
165 | - } |
|
166 | - Security::clear_token(); |
|
167 | - } |
|
165 | + } |
|
166 | + Security::clear_token(); |
|
167 | + } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $form = new FormValidator('advanced_search','get'); |
171 | 171 | $form->addText('keyword_username',get_lang('LoginName'),false); |
172 | 172 | if (api_is_western_name_order()) |
173 | 173 | { |
174 | - $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
175 | - $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
174 | + $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
175 | + $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
176 | 176 | } |
177 | 177 | else |
178 | 178 | { |
179 | - $form->addText('keyword_lastname',get_lang('LastName'),false); |
|
180 | - $form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
179 | + $form->addText('keyword_lastname',get_lang('LastName'),false); |
|
180 | + $form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
181 | 181 | } |
182 | 182 | if (isset($_GET['id_session'])) |
183 | - $form->addElement('hidden','id_session',$_GET['id_session']); |
|
183 | + $form->addElement('hidden','id_session',$_GET['id_session']); |
|
184 | 184 | |
185 | 185 | $type = array(); |
186 | 186 | $type["all"] = get_lang('All'); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null; |
203 | 203 | $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null; |
204 | 204 | if (isset($_GET['id_session'])) |
205 | - $parameters['id_session'] = $_GET['id_session']; |
|
205 | + $parameters['id_session'] = $_GET['id_session']; |
|
206 | 206 | // Create a sortable table with user-data |
207 | 207 | |
208 | 208 | $parameters['sec_token'] = Security::get_token(); |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | $table->set_header(1, get_lang('LoginName')); |
213 | 213 | if (api_is_western_name_order()) |
214 | 214 | { |
215 | - $table->set_header(2, get_lang('FirstName')); |
|
216 | - $table->set_header(3, get_lang('LastName')); |
|
215 | + $table->set_header(2, get_lang('FirstName')); |
|
216 | + $table->set_header(3, get_lang('LastName')); |
|
217 | 217 | } |
218 | 218 | else |
219 | 219 | { |
220 | - $table->set_header(2, get_lang('LastName')); |
|
221 | - $table->set_header(3, get_lang('FirstName')); |
|
220 | + $table->set_header(2, get_lang('LastName')); |
|
221 | + $table->set_header(3, get_lang('FirstName')); |
|
222 | 222 | } |
223 | 223 | $table->set_header(4, get_lang('Email')); |
224 | 224 | $table->set_header(5, get_lang('Actions')); |
@@ -15,15 +15,15 @@ |
||
15 | 15 | Display::display_header($tool_name); |
16 | 16 | //api_display_tool_title($tool_name); |
17 | 17 | if (api_get_setting('server_type') != 'test') { |
18 | - echo get_lang('DummyCourseOnlyOnTestServer'); |
|
18 | + echo get_lang('DummyCourseOnlyOnTestServer'); |
|
19 | 19 | } elseif( isset($_POST['action'])) { |
20 | - require_once('../coursecopy/classes/DummyCourseCreator.class.php'); |
|
21 | - $dcc = new DummyCourseCreator(); |
|
22 | - $dcc->create_dummy_course($_POST['course_code']); |
|
23 | - echo get_lang('Done'); |
|
20 | + require_once('../coursecopy/classes/DummyCourseCreator.class.php'); |
|
21 | + $dcc = new DummyCourseCreator(); |
|
22 | + $dcc->create_dummy_course($_POST['course_code']); |
|
23 | + echo get_lang('Done'); |
|
24 | 24 | } else { |
25 | - echo get_lang('DummyCourseDescription'); |
|
26 | - echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS($_GET['course_code']).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>'; |
|
25 | + echo get_lang('DummyCourseDescription'); |
|
26 | + echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS($_GET['course_code']).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>'; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | Display::display_footer(); |
@@ -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(); |