@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | global $_configuration; |
37 | 37 | |
38 | 38 | if (api_is_multiple_url_enabled()) { |
39 | - $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
40 | - $access_url_id = api_get_current_access_url_id(); |
|
41 | - if ($access_url_id != -1){ |
|
42 | - $sql = "SELECT code,visual_code,title |
|
39 | + $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
40 | + $access_url_id = api_get_current_access_url_id(); |
|
41 | + if ($access_url_id != -1){ |
|
42 | + $sql = "SELECT code,visual_code,title |
|
43 | 43 | FROM $course_table as c |
44 | 44 | INNER JOIN $tbl_course_rel_access_url as course_rel_url |
45 | 45 | ON (c.id = course_rel_url.c_id) |
46 | 46 | WHERE access_url_id = $access_url_id |
47 | 47 | ORDER BY visual_code"; |
48 | - } |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | $result = Database::query($sql); |
51 | 51 | while ($course = Database::fetch_object($result)) { |
52 | - $courses[$course->code] = $course->visual_code.' - '.$course->title; |
|
52 | + $courses[$course->code] = $course->visual_code.' - '.$course->title; |
|
53 | 53 | } |
54 | 54 | $form = new FormValidator('export_users'); |
55 | 55 | $form->addElement('header', $tool_name); |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | $form->setDefaults(array('file_type' => 'csv')); |
65 | 65 | |
66 | 66 | if ($form->validate()) { |
67 | - $export = $form->exportValues(); |
|
68 | - $file_type = $export['file_type']; |
|
69 | - $course_code = Database::escape_string($export['course_code']); |
|
70 | - $courseInfo = api_get_course_info($course_code); |
|
71 | - $courseId = $courseInfo['real_id']; |
|
72 | - |
|
73 | - $courseSessionValue = explode(':', $export['course_session']); |
|
74 | - $courseSessionCode = ''; |
|
75 | - $sessionId = 0; |
|
76 | - $courseSessionId = 0; |
|
77 | - $sessionInfo = []; |
|
78 | - |
|
79 | - if (is_array($courseSessionValue) && isset($courseSessionValue[1])) { |
|
67 | + $export = $form->exportValues(); |
|
68 | + $file_type = $export['file_type']; |
|
69 | + $course_code = Database::escape_string($export['course_code']); |
|
70 | + $courseInfo = api_get_course_info($course_code); |
|
71 | + $courseId = $courseInfo['real_id']; |
|
72 | + |
|
73 | + $courseSessionValue = explode(':', $export['course_session']); |
|
74 | + $courseSessionCode = ''; |
|
75 | + $sessionId = 0; |
|
76 | + $courseSessionId = 0; |
|
77 | + $sessionInfo = []; |
|
78 | + |
|
79 | + if (is_array($courseSessionValue) && isset($courseSessionValue[1])) { |
|
80 | 80 | $courseSessionCode = $courseSessionValue[0]; |
81 | 81 | $sessionId = $courseSessionValue[1]; |
82 | 82 | $courseSessionInfo= api_get_course_info($courseSessionCode); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $sessionInfo = api_get_session_info($sessionId); |
85 | 85 | } |
86 | 86 | |
87 | - $sql = "SELECT |
|
87 | + $sql = "SELECT |
|
88 | 88 | u.user_id AS UserId, |
89 | 89 | u.lastname AS LastName, |
90 | 90 | u.firstname AS FirstName, |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | u.status AS Status, |
96 | 96 | u.official_code AS OfficialCode, |
97 | 97 | u.phone AS Phone"; |
98 | - if (strlen($course_code) > 0) { |
|
99 | - $sql .= " FROM $user_table u, $course_user_table cu |
|
98 | + if (strlen($course_code) > 0) { |
|
99 | + $sql .= " FROM $user_table u, $course_user_table cu |
|
100 | 100 | WHERE |
101 | 101 | u.user_id = cu.user_id AND |
102 | 102 | cu.c_id = $courseId AND |
103 | 103 | cu.relation_type<>".COURSE_RELATION_TYPE_RRHH." |
104 | 104 | ORDER BY lastname,firstname"; |
105 | - $filename = 'export_users_'.$course_code.'_'.api_get_local_time(); |
|
106 | - } else if (strlen($courseSessionCode) > 0) { |
|
105 | + $filename = 'export_users_'.$course_code.'_'.api_get_local_time(); |
|
106 | + } else if (strlen($courseSessionCode) > 0) { |
|
107 | 107 | $sql .= " FROM $user_table u, $session_course_user_table scu |
108 | 108 | WHERE |
109 | 109 | u.user_id = scu.user_id AND |
@@ -112,87 +112,87 @@ discard block |
||
112 | 112 | ORDER BY lastname,firstname"; |
113 | 113 | $filename = 'export_users_'.$courseSessionCode.'_'.$sessionInfo['name'].'_'.api_get_local_time(); |
114 | 114 | } else { |
115 | - if (api_is_multiple_url_enabled()) { |
|
116 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
117 | - $access_url_id = api_get_current_access_url_id(); |
|
118 | - if ($access_url_id != -1) { |
|
119 | - $sql.= " FROM $user_table u |
|
115 | + if (api_is_multiple_url_enabled()) { |
|
116 | + $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
117 | + $access_url_id = api_get_current_access_url_id(); |
|
118 | + if ($access_url_id != -1) { |
|
119 | + $sql.= " FROM $user_table u |
|
120 | 120 | INNER JOIN $tbl_user_rel_access_url as user_rel_url |
121 | 121 | ON (u.user_id= user_rel_url.user_id) |
122 | 122 | WHERE access_url_id = $access_url_id |
123 | 123 | ORDER BY lastname,firstname"; |
124 | - } |
|
125 | - } else { |
|
126 | - $sql .= " FROM $user_table u ORDER BY lastname,firstname"; |
|
127 | - } |
|
128 | - $filename = 'export_users_'.api_get_local_time(); |
|
129 | - } |
|
130 | - $data = array(); |
|
131 | - $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
132 | - if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
133 | - if ($_configuration['password_encryption'] != 'none') { |
|
134 | - $data[] = array( |
|
135 | - 'UserId', |
|
136 | - 'LastName', |
|
137 | - 'FirstName', |
|
138 | - 'Email', |
|
139 | - 'UserName', |
|
140 | - 'AuthSource', |
|
141 | - 'Status', |
|
142 | - 'OfficialCode', |
|
143 | - 'PhoneNumber', |
|
144 | - ); |
|
145 | - } else { |
|
146 | - $data[] = array( |
|
147 | - 'UserId', |
|
148 | - 'LastName', |
|
149 | - 'FirstName', |
|
150 | - 'Email', |
|
151 | - 'UserName', |
|
152 | - 'Password', |
|
153 | - 'AuthSource', |
|
154 | - 'Status', |
|
155 | - 'OfficialCode', |
|
156 | - 'PhoneNumber', |
|
157 | - ); |
|
158 | - } |
|
159 | - |
|
160 | - foreach($extra_fields as $extra) { |
|
161 | - $data[0][]=$extra[1]; |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - $res = Database::query($sql); |
|
166 | - while($user = Database::fetch_array($res,'ASSOC')) { |
|
167 | - $student_data = UserManager:: get_extra_user_data( |
|
168 | - $user['UserId'], |
|
169 | - true, |
|
170 | - false |
|
171 | - ); |
|
172 | - foreach($student_data as $key=>$value) { |
|
173 | - $key = substr($key, 6); |
|
174 | - if (is_array($value)) { |
|
175 | - $user[$key] = $value[$key]; |
|
176 | - } else { |
|
177 | - $user[$key] = $value; |
|
178 | - } |
|
179 | - } |
|
180 | - $data[] = $user ; |
|
181 | - } |
|
182 | - |
|
183 | - switch ($file_type) { |
|
184 | - case 'xml': |
|
185 | - Export::arrayToXml($data, $filename, 'Contact', 'Contacts'); |
|
186 | - exit; |
|
187 | - break; |
|
188 | - case 'csv': |
|
189 | - Export::arrayToCsv($data, $filename); |
|
190 | - exit; |
|
191 | - case 'xls': |
|
192 | - Export::arrayToXls($data, $filename); |
|
193 | - exit; |
|
194 | - break; |
|
195 | - } |
|
124 | + } |
|
125 | + } else { |
|
126 | + $sql .= " FROM $user_table u ORDER BY lastname,firstname"; |
|
127 | + } |
|
128 | + $filename = 'export_users_'.api_get_local_time(); |
|
129 | + } |
|
130 | + $data = array(); |
|
131 | + $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
132 | + if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
133 | + if ($_configuration['password_encryption'] != 'none') { |
|
134 | + $data[] = array( |
|
135 | + 'UserId', |
|
136 | + 'LastName', |
|
137 | + 'FirstName', |
|
138 | + 'Email', |
|
139 | + 'UserName', |
|
140 | + 'AuthSource', |
|
141 | + 'Status', |
|
142 | + 'OfficialCode', |
|
143 | + 'PhoneNumber', |
|
144 | + ); |
|
145 | + } else { |
|
146 | + $data[] = array( |
|
147 | + 'UserId', |
|
148 | + 'LastName', |
|
149 | + 'FirstName', |
|
150 | + 'Email', |
|
151 | + 'UserName', |
|
152 | + 'Password', |
|
153 | + 'AuthSource', |
|
154 | + 'Status', |
|
155 | + 'OfficialCode', |
|
156 | + 'PhoneNumber', |
|
157 | + ); |
|
158 | + } |
|
159 | + |
|
160 | + foreach($extra_fields as $extra) { |
|
161 | + $data[0][]=$extra[1]; |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + $res = Database::query($sql); |
|
166 | + while($user = Database::fetch_array($res,'ASSOC')) { |
|
167 | + $student_data = UserManager:: get_extra_user_data( |
|
168 | + $user['UserId'], |
|
169 | + true, |
|
170 | + false |
|
171 | + ); |
|
172 | + foreach($student_data as $key=>$value) { |
|
173 | + $key = substr($key, 6); |
|
174 | + if (is_array($value)) { |
|
175 | + $user[$key] = $value[$key]; |
|
176 | + } else { |
|
177 | + $user[$key] = $value; |
|
178 | + } |
|
179 | + } |
|
180 | + $data[] = $user ; |
|
181 | + } |
|
182 | + |
|
183 | + switch ($file_type) { |
|
184 | + case 'xml': |
|
185 | + Export::arrayToXml($data, $filename, 'Contact', 'Contacts'); |
|
186 | + exit; |
|
187 | + break; |
|
188 | + case 'csv': |
|
189 | + Export::arrayToCsv($data, $filename); |
|
190 | + exit; |
|
191 | + case 'xls': |
|
192 | + Export::arrayToXls($data, $filename); |
|
193 | + exit; |
|
194 | + break; |
|
195 | + } |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | Display :: display_header($tool_name); |
@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | |
30 | 30 | $coursesSessions = array_merge($coursesSessions, $allCoursesFromSessions); |
31 | 31 | |
32 | -$courses = array (); |
|
32 | +$courses = array(); |
|
33 | 33 | $courses[''] = '--'; |
34 | 34 | $sql = "SELECT code,visual_code,title FROM $course_table ORDER BY visual_code"; |
35 | 35 | |
36 | 36 | global $_configuration; |
37 | 37 | |
38 | 38 | if (api_is_multiple_url_enabled()) { |
39 | - $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
39 | + $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
40 | 40 | $access_url_id = api_get_current_access_url_id(); |
41 | - if ($access_url_id != -1){ |
|
41 | + if ($access_url_id != -1) { |
|
42 | 42 | $sql = "SELECT code,visual_code,title |
43 | 43 | FROM $course_table as c |
44 | 44 | INNER JOIN $tbl_course_rel_access_url as course_rel_url |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | } |
54 | 54 | $form = new FormValidator('export_users'); |
55 | 55 | $form->addElement('header', $tool_name); |
56 | -$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML','xml'); |
|
56 | +$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML', 'xml'); |
|
57 | 57 | $form->addElement('radio', 'file_type', null, 'CSV', 'csv'); |
58 | 58 | $form->addElement('radio', 'file_type', null, 'XLS', 'xls'); |
59 | 59 | |
60 | -$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'),'1'); |
|
60 | +$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'), '1'); |
|
61 | 61 | $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses); |
62 | 62 | $form->addElement('select', 'course_session', get_lang('OnlyUsersFromCourseSession'), $coursesSessions); |
63 | 63 | $form->addButtonExport(get_lang('Export')); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (is_array($courseSessionValue) && isset($courseSessionValue[1])) { |
80 | 80 | $courseSessionCode = $courseSessionValue[0]; |
81 | 81 | $sessionId = $courseSessionValue[1]; |
82 | - $courseSessionInfo= api_get_course_info($courseSessionCode); |
|
82 | + $courseSessionInfo = api_get_course_info($courseSessionCode); |
|
83 | 83 | $courseSessionId = $courseSessionInfo['real_id']; |
84 | 84 | $sessionInfo = api_get_session_info($sessionId); |
85 | 85 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | u.firstname AS FirstName, |
91 | 91 | u.email AS Email, |
92 | 92 | u.username AS UserName, |
93 | - ".(($_configuration['password_encryption']!='none')?" ":"u.password AS Password, ")." |
|
93 | + ".(($_configuration['password_encryption'] != 'none') ? " " : "u.password AS Password, ")." |
|
94 | 94 | u.auth_source AS AuthSource, |
95 | 95 | u.status AS Status, |
96 | 96 | u.official_code AS OfficialCode, |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | $filename = 'export_users_'.$courseSessionCode.'_'.$sessionInfo['name'].'_'.api_get_local_time(); |
114 | 114 | } else { |
115 | 115 | if (api_is_multiple_url_enabled()) { |
116 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
116 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
117 | 117 | $access_url_id = api_get_current_access_url_id(); |
118 | 118 | if ($access_url_id != -1) { |
119 | - $sql.= " FROM $user_table u |
|
119 | + $sql .= " FROM $user_table u |
|
120 | 120 | INNER JOIN $tbl_user_rel_access_url as user_rel_url |
121 | 121 | ON (u.user_id= user_rel_url.user_id) |
122 | 122 | WHERE access_url_id = $access_url_id |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | $filename = 'export_users_'.api_get_local_time(); |
129 | 129 | } |
130 | 130 | $data = array(); |
131 | - $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
132 | - if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
131 | + $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false); |
|
132 | + if ($export['addcsvheader'] == '1' AND $export['file_type'] == 'csv') { |
|
133 | 133 | if ($_configuration['password_encryption'] != 'none') { |
134 | 134 | $data[] = array( |
135 | 135 | 'UserId', |
@@ -157,19 +157,19 @@ discard block |
||
157 | 157 | ); |
158 | 158 | } |
159 | 159 | |
160 | - foreach($extra_fields as $extra) { |
|
161 | - $data[0][]=$extra[1]; |
|
160 | + foreach ($extra_fields as $extra) { |
|
161 | + $data[0][] = $extra[1]; |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | 165 | $res = Database::query($sql); |
166 | - while($user = Database::fetch_array($res,'ASSOC')) { |
|
166 | + while ($user = Database::fetch_array($res, 'ASSOC')) { |
|
167 | 167 | $student_data = UserManager:: get_extra_user_data( |
168 | 168 | $user['UserId'], |
169 | 169 | true, |
170 | 170 | false |
171 | 171 | ); |
172 | - foreach($student_data as $key=>$value) { |
|
172 | + foreach ($student_data as $key=>$value) { |
|
173 | 173 | $key = substr($key, 6); |
174 | 174 | if (is_array($value)) { |
175 | 175 | $user[$key] = $value[$key]; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $user[$key] = $value; |
178 | 178 | } |
179 | 179 | } |
180 | - $data[] = $user ; |
|
180 | + $data[] = $user; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | switch ($file_type) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | return $msg; |
178 | 178 | } |
179 | 179 | } else { |
180 | - $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='" . $name . "'"); |
|
180 | + $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='".$name."'"); |
|
181 | 181 | if (Database::num_rows($rs)) { |
182 | 182 | $msg = get_lang('SessionNameAlreadyExists'); |
183 | 183 | return $msg; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public static function session_name_exists($name) |
291 | 291 | { |
292 | 292 | $name = Database::escape_string($name); |
293 | - $sql = "SELECT COUNT(*) as count FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . " |
|
293 | + $sql = "SELECT COUNT(*) as count FROM ".Database::get_main_table(TABLE_MAIN_SESSION)." |
|
294 | 294 | WHERE name = '$name'"; |
295 | 295 | $result = Database::fetch_array(Database::query($sql)); |
296 | 296 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $where .= " AND ( |
322 | 322 | s.session_admin_id = $user_id OR |
323 | 323 | sru.user_id = '$user_id' AND |
324 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' |
|
324 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' |
|
325 | 325 | ) |
326 | 326 | "; |
327 | 327 | |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $where_condition = str_replace('category_name', 'sc.name', $where_condition); |
340 | 340 | $where_condition = str_replace( |
341 | 341 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
342 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
342 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
343 | 343 | , $where_condition |
344 | 344 | ); |
345 | 345 | $where_condition = str_replace( |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | $access_url_id = api_get_current_access_url_id(); |
386 | 386 | if ($access_url_id != -1) { |
387 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
387 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
388 | 388 | |
389 | 389 | $sql = "SELECT count(id) as total_rows FROM ( |
390 | 390 | SELECT DISTINCT |
@@ -434,14 +434,14 @@ discard block |
||
434 | 434 | if (api_is_session_admin() && |
435 | 435 | api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false' |
436 | 436 | ) { |
437 | - $where .=" AND s.session_admin_id = $user_id "; |
|
437 | + $where .= " AND s.session_admin_id = $user_id "; |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
441 | 441 | if (!api_is_platform_admin() && api_is_teacher() && |
442 | 442 | api_get_setting('allow_teachers_to_create_sessions') == 'true' |
443 | 443 | ) { |
444 | - $where .=" AND s.id_coach = $user_id "; |
|
444 | + $where .= " AND s.id_coach = $user_id "; |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | $extra_field = new ExtraFieldModel('session'); |
@@ -493,10 +493,10 @@ discard block |
||
493 | 493 | $query = "$select FROM $tbl_session s $inject_joins $where $inject_where"; |
494 | 494 | |
495 | 495 | if (api_is_multiple_url_enabled()) { |
496 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
496 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
497 | 497 | $access_url_id = api_get_current_access_url_id(); |
498 | 498 | if ($access_url_id != -1) { |
499 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
499 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
500 | 500 | $query = "$select |
501 | 501 | FROM $tbl_session s $inject_joins |
502 | 502 | INNER JOIN $table_access_url_rel_session ar |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | INNER JOIN $tbl_lp l ON l.id = v.lp_id |
600 | 600 | INNER JOIN $tbl_user u ON u.user_id = v.user_id |
601 | 601 | INNER JOIN $tbl_course c |
602 | - WHERE v.session_id = " . $sessionId; |
|
602 | + WHERE v.session_id = ".$sessionId; |
|
603 | 603 | $result_rows = Database::query($sql); |
604 | 604 | $row = Database::fetch_array($result_rows); |
605 | 605 | $num = $row['total_rows']; |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | |
652 | 652 | $limit = null; |
653 | 653 | if (!empty($options['limit'])) { |
654 | - $limit = " LIMIT " . $options['limit']; |
|
654 | + $limit = " LIMIT ".$options['limit']; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | if (!empty($options['where'])) { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | |
661 | 661 | $order = null; |
662 | 662 | if (!empty($options['order'])) { |
663 | - $order = " ORDER BY " . $options['order']; |
|
663 | + $order = " ORDER BY ".$options['order']; |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id |
@@ -719,13 +719,13 @@ discard block |
||
719 | 719 | foreach ($lessons as $lesson) { |
720 | 720 | $data[$lesson['id']] = (!empty($user_lessons[$lesson['id']]['progress'])) ? $user_lessons[$lesson['id']]['progress'] : 0; |
721 | 721 | $progress += $data[$lesson['id']]; |
722 | - $data[$lesson['id']] = $data[$lesson['id']] . '%'; |
|
722 | + $data[$lesson['id']] = $data[$lesson['id']].'%'; |
|
723 | 723 | $count++; |
724 | 724 | } |
725 | 725 | if ($count == 0) { |
726 | 726 | $data['total'] = 0; |
727 | 727 | } else { |
728 | - $data['total'] = round($progress / $count, 2) . '%'; |
|
728 | + $data['total'] = round($progress / $count, 2).'%'; |
|
729 | 729 | } |
730 | 730 | $table[] = $data; |
731 | 731 | } |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | |
767 | 767 | $limit = null; |
768 | 768 | if (!empty($options['limit'])) { |
769 | - $limit = " LIMIT " . $options['limit']; |
|
769 | + $limit = " LIMIT ".$options['limit']; |
|
770 | 770 | } |
771 | 771 | |
772 | 772 | if (!empty($options['where'])) { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | |
776 | 776 | $order = null; |
777 | 777 | if (!empty($options['order'])) { |
778 | - $order = " ORDER BY " . $options['order']; |
|
778 | + $order = " ORDER BY ".$options['order']; |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | |
878 | 878 | $limit = null; |
879 | 879 | if (!empty($options['limit'])) { |
880 | - $limit = " LIMIT " . $options['limit']; |
|
880 | + $limit = " LIMIT ".$options['limit']; |
|
881 | 881 | } |
882 | 882 | |
883 | 883 | if (!empty($options['where'])) { |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | |
887 | 887 | $order = null; |
888 | 888 | if (!empty($options['order'])) { |
889 | - $order = " ORDER BY " . $options['order']; |
|
889 | + $order = " ORDER BY ".$options['order']; |
|
890 | 890 | } |
891 | 891 | |
892 | 892 | //TODO, fix create report without session |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | /** |
920 | 920 | * Lessons |
921 | 921 | */ |
922 | - $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s |
|
922 | + $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s |
|
923 | 923 | $sql_query = sprintf($sql, $course['real_id']); |
924 | 924 | $result = Database::query($sql_query); |
925 | 925 | $arrLesson = array(array()); |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | if (empty($arrLesson[$row['session_id']]['lessons_total'])) { |
928 | 928 | $arrLesson[$row['session_id']]['lessons_total'] = 1; |
929 | 929 | } else { |
930 | - $arrLesson[$row['session_id']]['lessons_total'] ++; |
|
930 | + $arrLesson[$row['session_id']]['lessons_total']++; |
|
931 | 931 | } |
932 | 932 | } |
933 | 933 | |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | $course['real_id'] |
1004 | 1004 | ); |
1005 | 1005 | foreach ($user_list as $user_id) { |
1006 | - isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id] ++ : $survey_user_list[$user_id] = 1; |
|
1006 | + isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1; |
|
1007 | 1007 | } |
1008 | 1008 | } |
1009 | 1009 | |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | $assignments_done = Tracking::count_student_assignments($user['user_id'], $course['code'], $user['id_session']); |
1058 | 1058 | $assignments_left = $assignments_total - $assignments_done; |
1059 | 1059 | if (!empty($assignments_total)) { |
1060 | - $assignments_progress = round((( $assignments_done * 100 ) / $assignments_total), 2); |
|
1060 | + $assignments_progress = round((($assignments_done * 100) / $assignments_total), 2); |
|
1061 | 1061 | } else { |
1062 | 1062 | $assignments_progress = 0; |
1063 | 1063 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | $wiki_read = $row['count']; |
1088 | 1088 | $wiki_unread = $wiki_total - $wiki_read; |
1089 | 1089 | if (!empty($wiki_total)) { |
1090 | - $wiki_progress = round((( $wiki_read * 100 ) / $wiki_total), 2); |
|
1090 | + $wiki_progress = round((($wiki_read * 100) / $wiki_total), 2); |
|
1091 | 1091 | } else { |
1092 | 1092 | $wiki_progress = 0; |
1093 | 1093 | } |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | $surveys_done = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0); |
1097 | 1097 | $surveys_left = $surveys_total - $surveys_done; |
1098 | 1098 | if (!empty($surveys_total)) { |
1099 | - $surveys_progress = round((( $surveys_done * 100 ) / $surveys_total), 2); |
|
1099 | + $surveys_progress = round((($surveys_done * 100) / $surveys_total), 2); |
|
1100 | 1100 | } else { |
1101 | 1101 | $surveys_progress = 0; |
1102 | 1102 | } |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | ); |
1110 | 1110 | $forums_left = $forums_total - $forums_done; |
1111 | 1111 | if (!empty($forums_total)) { |
1112 | - $forums_progress = round((( $forums_done * 100 ) / $forums_total), 2); |
|
1112 | + $forums_progress = round((($forums_done * 100) / $forums_total), 2); |
|
1113 | 1113 | } else { |
1114 | 1114 | $forums_progress = 0; |
1115 | 1115 | } |
@@ -1117,58 +1117,58 @@ discard block |
||
1117 | 1117 | //Overall Total |
1118 | 1118 | $overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6; |
1119 | 1119 | |
1120 | - $link = '<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . $user[0] . '&details=true&course=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1121 | - $linkForum = '<a href="' . api_get_path(WEB_CODE_PATH) . 'forum/index.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1122 | - $linkWork = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1123 | - $linkWiki = '<a href="' . api_get_path(WEB_CODE_PATH) . 'wiki/index.php?cidReq=' . $course['code'] . '&session_id=' . $user['id_session'] . '&action=statistics"> %s </a>'; |
|
1124 | - $linkSurvey = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1120 | + $link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1121 | + $linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1122 | + $linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1123 | + $linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cidReq='.$course['code'].'&session_id='.$user['id_session'].'&action=statistics"> %s </a>'; |
|
1124 | + $linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1125 | 1125 | |
1126 | 1126 | $table[] = array( |
1127 | 1127 | 'lastname' => $user[1], |
1128 | 1128 | 'firstname' => $user[2], |
1129 | 1129 | 'username' => $user[3], |
1130 | 1130 | #'profile' => '', |
1131 | - 'total' => round($overall_total, 2) . '%', |
|
1132 | - 'courses' => sprintf($link, $course_description_progress . '%'), |
|
1133 | - 'lessons' => sprintf($link, $lessons_progress . '%'), |
|
1134 | - 'exercises' => sprintf($link, $exercises_progress . '%'), |
|
1135 | - 'forums' => sprintf($link, $forums_progress . '%'), |
|
1136 | - 'homeworks' => sprintf($link, $assignments_progress . '%'), |
|
1137 | - 'wikis' => sprintf($link, $wiki_progress . '%'), |
|
1138 | - 'surveys' => sprintf($link, $surveys_progress . '%'), |
|
1131 | + 'total' => round($overall_total, 2).'%', |
|
1132 | + 'courses' => sprintf($link, $course_description_progress.'%'), |
|
1133 | + 'lessons' => sprintf($link, $lessons_progress.'%'), |
|
1134 | + 'exercises' => sprintf($link, $exercises_progress.'%'), |
|
1135 | + 'forums' => sprintf($link, $forums_progress.'%'), |
|
1136 | + 'homeworks' => sprintf($link, $assignments_progress.'%'), |
|
1137 | + 'wikis' => sprintf($link, $wiki_progress.'%'), |
|
1138 | + 'surveys' => sprintf($link, $surveys_progress.'%'), |
|
1139 | 1139 | //course description |
1140 | - 'course_description_progress' => $course_description_progress . '%', |
|
1140 | + 'course_description_progress' => $course_description_progress.'%', |
|
1141 | 1141 | //lessons |
1142 | 1142 | 'lessons_total' => sprintf($link, $lessons_total), |
1143 | 1143 | 'lessons_done' => sprintf($link, $lessons_done), |
1144 | 1144 | 'lessons_left' => sprintf($link, $lessons_left), |
1145 | - 'lessons_progress' => sprintf($link, $lessons_progress . '%'), |
|
1145 | + 'lessons_progress' => sprintf($link, $lessons_progress.'%'), |
|
1146 | 1146 | //exercises |
1147 | 1147 | 'exercises_total' => sprintf($link, $exercises_total), |
1148 | 1148 | 'exercises_done' => sprintf($link, $exercises_done), |
1149 | 1149 | 'exercises_left' => sprintf($link, $exercises_left), |
1150 | - 'exercises_progress' => sprintf($link, $exercises_progress . '%'), |
|
1150 | + 'exercises_progress' => sprintf($link, $exercises_progress.'%'), |
|
1151 | 1151 | //forums |
1152 | 1152 | 'forums_total' => sprintf($linkForum, $forums_total), |
1153 | 1153 | 'forums_done' => sprintf($linkForum, $forums_done), |
1154 | 1154 | 'forums_left' => sprintf($linkForum, $forums_left), |
1155 | - 'forums_progress' => sprintf($linkForum, $forums_progress . '%'), |
|
1155 | + 'forums_progress' => sprintf($linkForum, $forums_progress.'%'), |
|
1156 | 1156 | //assignments |
1157 | 1157 | 'assignments_total' => sprintf($linkWork, $assignments_total), |
1158 | 1158 | 'assignments_done' => sprintf($linkWork, $assignments_done), |
1159 | 1159 | 'assignments_left' => sprintf($linkWork, $assignments_left), |
1160 | - 'assignments_progress' => sprintf($linkWork, $assignments_progress . '%'), |
|
1160 | + 'assignments_progress' => sprintf($linkWork, $assignments_progress.'%'), |
|
1161 | 1161 | //wiki |
1162 | 1162 | 'wiki_total' => sprintf($linkWiki, $wiki_total), |
1163 | 1163 | 'wiki_revisions' => sprintf($linkWiki, $wiki_revisions), |
1164 | 1164 | 'wiki_read' => sprintf($linkWiki, $wiki_read), |
1165 | 1165 | 'wiki_unread' => sprintf($linkWiki, $wiki_unread), |
1166 | - 'wiki_progress' => sprintf($linkWiki, $wiki_progress . '%'), |
|
1166 | + 'wiki_progress' => sprintf($linkWiki, $wiki_progress.'%'), |
|
1167 | 1167 | //survey |
1168 | 1168 | 'surveys_total' => sprintf($linkSurvey, $surveys_total), |
1169 | 1169 | 'surveys_done' => sprintf($linkSurvey, $surveys_done), |
1170 | 1170 | 'surveys_left' => sprintf($linkSurvey, $surveys_left), |
1171 | - 'surveys_progress' => sprintf($linkSurvey, $surveys_progress . '%'), |
|
1171 | + 'surveys_progress' => sprintf($linkSurvey, $surveys_progress.'%'), |
|
1172 | 1172 | ); |
1173 | 1173 | } |
1174 | 1174 | |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | |
1251 | 1251 | $limit = null; |
1252 | 1252 | if (!empty($options['limit'])) { |
1253 | - $limit = " LIMIT " . $options['limit']; |
|
1253 | + $limit = " LIMIT ".$options['limit']; |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | if (!empty($options['where'])) { |
@@ -1259,7 +1259,7 @@ discard block |
||
1259 | 1259 | |
1260 | 1260 | $order = null; |
1261 | 1261 | if (!empty($options['order'])) { |
1262 | - $order = " ORDER BY " . $options['order']; |
|
1262 | + $order = " ORDER BY ".$options['order']; |
|
1263 | 1263 | } |
1264 | 1264 | |
1265 | 1265 | //TODO add course name |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | " : " |
1273 | 1273 | u.lastname, |
1274 | 1274 | u.firstname, |
1275 | - ") . " |
|
1275 | + ")." |
|
1276 | 1276 | a.logout_course_date, |
1277 | 1277 | a.counter, |
1278 | 1278 | c.title, |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | if (Database::num_rows($result) > 0) { |
1355 | 1355 | $row = Database::fetch_array($result); |
1356 | 1356 | $count = $row['count'] + 1; |
1357 | - $session_name = $session_name . '_' . $count; |
|
1357 | + $session_name = $session_name.'_'.$count; |
|
1358 | 1358 | $result = self::session_name_exists($session_name); |
1359 | 1359 | if (!$result) { |
1360 | 1360 | return $session_name; |
@@ -1861,7 +1861,7 @@ discard block |
||
1861 | 1861 | // Delete users from the session |
1862 | 1862 | if ($empty_users === true) { |
1863 | 1863 | $sql = "DELETE FROM $tbl_session_rel_user |
1864 | - WHERE session_id = $id_session AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . ""; |
|
1864 | + WHERE session_id = $id_session AND relation_type<>".SESSION_RELATION_TYPE_RRHH.""; |
|
1865 | 1865 | Database::query($sql); |
1866 | 1866 | } |
1867 | 1867 | |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | $enreg_user = Database::escape_string($enreg_user); |
1873 | 1873 | $nbr_users++; |
1874 | 1874 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (relation_type, session_id, user_id, registered_at) |
1875 | - VALUES (0, $id_session, $enreg_user, '" . api_get_utc_datetime() . "')"; |
|
1875 | + VALUES (0, $id_session, $enreg_user, '".api_get_utc_datetime()."')"; |
|
1876 | 1876 | Database::query($sql); |
1877 | 1877 | } |
1878 | 1878 | |
@@ -1962,9 +1962,9 @@ discard block |
||
1962 | 1962 | is_array($courseInfo) ? $courseId = $courseInfo['real_id'] : $courseId = $courseInfo; |
1963 | 1963 | |
1964 | 1964 | $statusCondition = null; |
1965 | - if (isset($status) && !is_null($status)) { |
|
1965 | + if (isset($status) && !is_null($status)) { |
|
1966 | 1966 | $status = intval($status); |
1967 | - $statusCondition = " AND status = $status"; |
|
1967 | + $statusCondition = " AND status = $status"; |
|
1968 | 1968 | } |
1969 | 1969 | |
1970 | 1970 | foreach ($userList as $userId) { |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | if (empty($count)) { |
2097 | 2097 | // If user is not registered to a session then add it. |
2098 | 2098 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, registered_at) |
2099 | - VALUES ($session_id, $enreg_user, '" . api_get_utc_datetime() . "')"; |
|
2099 | + VALUES ($session_id, $enreg_user, '".api_get_utc_datetime()."')"; |
|
2100 | 2100 | Database::query($sql); |
2101 | 2101 | |
2102 | 2102 | $sql = "UPDATE $tbl_session SET nbr_users = nbr_users + 1 |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | WHERE |
2140 | 2140 | session_id = $session_id AND |
2141 | 2141 | user_id = $user_id AND |
2142 | - relation_type <> " . SESSION_RELATION_TYPE_RRHH . ""; |
|
2142 | + relation_type <> ".SESSION_RELATION_TYPE_RRHH.""; |
|
2143 | 2143 | $result = Database::query($sql); |
2144 | 2144 | $return = Database::affected_rows($result); |
2145 | 2145 | |
@@ -2224,7 +2224,7 @@ discard block |
||
2224 | 2224 | FROM $tbl_session_rel_user |
2225 | 2225 | WHERE |
2226 | 2226 | session_id = $sessionId AND |
2227 | - relation_type<>" . SESSION_RELATION_TYPE_RRHH; |
|
2227 | + relation_type<>".SESSION_RELATION_TYPE_RRHH; |
|
2228 | 2228 | $result = Database::query($sql); |
2229 | 2229 | $user_list = Database::store_result($result); |
2230 | 2230 | |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | |
2236 | 2236 | $sql = "DELETE FROM $tbl_session_rel_course |
2237 | 2237 | WHERE |
2238 | - c_id = " . $existingCourse['c_id'] . " AND |
|
2238 | + c_id = ".$existingCourse['c_id']." AND |
|
2239 | 2239 | session_id = $sessionId"; |
2240 | 2240 | Database::query($sql); |
2241 | 2241 | |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | $links = $cat->get_links(null, false, $courseInfo['code'], 0); |
2299 | 2299 | |
2300 | 2300 | $cat->set_session_id($sessionId); |
2301 | - $oldCategoryId= $cat->get_id(); |
|
2301 | + $oldCategoryId = $cat->get_id(); |
|
2302 | 2302 | $newId = $cat->add(); |
2303 | 2303 | $newCategoryIdList[$oldCategoryId] = $newId; |
2304 | 2304 | $parentId = $cat->get_parent_id(); |
@@ -2485,7 +2485,7 @@ discard block |
||
2485 | 2485 | $return_value = false; |
2486 | 2486 | $sql = "SELECT c_id FROM $tbl_session_course |
2487 | 2487 | WHERE |
2488 | - session_id = " . intval($session_id) . " AND |
|
2488 | + session_id = ".intval($session_id)." AND |
|
2489 | 2489 | c_id = " . intval($courseId); |
2490 | 2490 | $result = Database::query($sql); |
2491 | 2491 | $num = Database::num_rows($result); |
@@ -2509,8 +2509,8 @@ discard block |
||
2509 | 2509 | } |
2510 | 2510 | |
2511 | 2511 | $sql = 'SELECT * |
2512 | - FROM ' . $tbl_session . ' |
|
2513 | - WHERE name = "' . Database::escape_string($session_name) . '"'; |
|
2512 | + FROM ' . $tbl_session.' |
|
2513 | + WHERE name = "' . Database::escape_string($session_name).'"'; |
|
2514 | 2514 | $result = Database::query($sql); |
2515 | 2515 | $num = Database::num_rows($result); |
2516 | 2516 | if ($num > 0) { |
@@ -2550,8 +2550,8 @@ discard block |
||
2550 | 2550 | $month_end = intval($smonth_end); |
2551 | 2551 | $day_end = intval($sday_end); |
2552 | 2552 | |
2553 | - $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
|
2554 | - $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
|
2553 | + $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start); |
|
2554 | + $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end); |
|
2555 | 2555 | |
2556 | 2556 | if (empty($name)) { |
2557 | 2557 | $msg = get_lang('SessionCategoryNameIsRequired'); |
@@ -2628,8 +2628,8 @@ discard block |
||
2628 | 2628 | $month_end = intval($smonth_end); |
2629 | 2629 | $day_end = intval($sday_end); |
2630 | 2630 | $id = intval($id); |
2631 | - $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
|
2632 | - $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
|
2631 | + $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start); |
|
2632 | + $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end); |
|
2633 | 2633 | |
2634 | 2634 | if (empty($name)) { |
2635 | 2635 | $msg = get_lang('SessionCategoryNameIsRequired'); |
@@ -2649,13 +2649,13 @@ discard block |
||
2649 | 2649 | if ($date_end <> null) { |
2650 | 2650 | $sql = "UPDATE $tbl_session_category |
2651 | 2651 | SET |
2652 | - name = '" . Database::escape_string($name) . "', |
|
2652 | + name = '".Database::escape_string($name)."', |
|
2653 | 2653 | date_start = '$date_start' , |
2654 | 2654 | date_end = '$date_end' |
2655 | 2655 | WHERE id= $id"; |
2656 | 2656 | } else { |
2657 | 2657 | $sql = "UPDATE $tbl_session_category SET |
2658 | - name = '" . Database::escape_string($name) . "', |
|
2658 | + name = '".Database::escape_string($name)."', |
|
2659 | 2659 | date_start = '$date_start', |
2660 | 2660 | date_end = NULL |
2661 | 2661 | WHERE id= $id"; |
@@ -2685,10 +2685,10 @@ discard block |
||
2685 | 2685 | |
2686 | 2686 | //Setting session_category_id to 0 |
2687 | 2687 | $sql = "UPDATE $tbl_session SET session_category_id = 0 |
2688 | - WHERE session_category_id IN (" . $id_checked . ")"; |
|
2688 | + WHERE session_category_id IN (".$id_checked.")"; |
|
2689 | 2689 | Database::query($sql); |
2690 | 2690 | |
2691 | - $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (" . $id_checked . ")"; |
|
2691 | + $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (".$id_checked.")"; |
|
2692 | 2692 | $result = Database::query($sql); |
2693 | 2693 | while ($rows = Database::fetch_array($result)) { |
2694 | 2694 | $session_id = $rows['id']; |
@@ -2700,7 +2700,7 @@ discard block |
||
2700 | 2700 | } |
2701 | 2701 | } |
2702 | 2702 | } |
2703 | - $sql = "DELETE FROM $tbl_session_category WHERE id IN (" . $id_checked . ")"; |
|
2703 | + $sql = "DELETE FROM $tbl_session_category WHERE id IN (".$id_checked.")"; |
|
2704 | 2704 | Database::query($sql); |
2705 | 2705 | |
2706 | 2706 | // Add event to system log |
@@ -2773,7 +2773,7 @@ discard block |
||
2773 | 2773 | $value = Database::escape_string($options['value']); |
2774 | 2774 | $sql_query .= ' AND '; |
2775 | 2775 | if (in_array($field, $availableFields) && in_array($operator, $availableOperator)) { |
2776 | - $sql_query .= $field . " $operator '" . $value . "'"; |
|
2776 | + $sql_query .= $field." $operator '".$value."'"; |
|
2777 | 2777 | } |
2778 | 2778 | } |
2779 | 2779 | } |
@@ -2840,8 +2840,8 @@ discard block |
||
2840 | 2840 | { |
2841 | 2841 | $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); |
2842 | 2842 | $id = api_get_current_access_url_id(); |
2843 | - $sql = 'SELECT * FROM ' . $tbl_session_category . ' |
|
2844 | - WHERE access_url_id = ' . $id . ' |
|
2843 | + $sql = 'SELECT * FROM '.$tbl_session_category.' |
|
2844 | + WHERE access_url_id = ' . $id.' |
|
2845 | 2845 | ORDER BY name ASC'; |
2846 | 2846 | $result = Database::query($sql); |
2847 | 2847 | if (Database::num_rows($result) > 0) { |
@@ -2994,7 +2994,7 @@ discard block |
||
2994 | 2994 | $sql = "DELETE FROM $tbl_session_rel_user |
2995 | 2995 | WHERE |
2996 | 2996 | session_id = $sessionId AND |
2997 | - relation_type =" . SESSION_RELATION_TYPE_RRHH; |
|
2997 | + relation_type =".SESSION_RELATION_TYPE_RRHH; |
|
2998 | 2998 | Database::query($sql); |
2999 | 2999 | |
3000 | 3000 | return true; |
@@ -3048,12 +3048,12 @@ discard block |
||
3048 | 3048 | ON (a.session_id = s.session_id) |
3049 | 3049 | WHERE |
3050 | 3050 | s.user_id = $userId AND |
3051 | - relation_type = " . SESSION_RELATION_TYPE_RRHH . " AND |
|
3051 | + relation_type = ".SESSION_RELATION_TYPE_RRHH." AND |
|
3052 | 3052 | access_url_id = " . api_get_current_access_url_id(); |
3053 | 3053 | } else { |
3054 | 3054 | $sql = "SELECT s.session_id |
3055 | 3055 | FROM $tbl_session_rel_user s |
3056 | - WHERE user_id = $userId AND relation_type=" . SESSION_RELATION_TYPE_RRHH; |
|
3056 | + WHERE user_id = $userId AND relation_type=".SESSION_RELATION_TYPE_RRHH; |
|
3057 | 3057 | } |
3058 | 3058 | $result = Database::query($sql); |
3059 | 3059 | |
@@ -3063,7 +3063,7 @@ discard block |
||
3063 | 3063 | WHERE |
3064 | 3064 | session_id = {$row['session_id']} AND |
3065 | 3065 | user_id = $userId AND |
3066 | - relation_type =" . SESSION_RELATION_TYPE_RRHH; |
|
3066 | + relation_type =".SESSION_RELATION_TYPE_RRHH; |
|
3067 | 3067 | Database::query($sql); |
3068 | 3068 | } |
3069 | 3069 | } |
@@ -3078,7 +3078,7 @@ discard block |
||
3078 | 3078 | WHERE |
3079 | 3079 | session_id = $session_id AND |
3080 | 3080 | user_id = $userId AND |
3081 | - relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'"; |
|
3081 | + relation_type = '".SESSION_RELATION_TYPE_RRHH."'"; |
|
3082 | 3082 | $result = Database::query($sql); |
3083 | 3083 | if (Database::num_rows($result) == 0) { |
3084 | 3084 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, relation_type, registered_at) |
@@ -3128,8 +3128,8 @@ discard block |
||
3128 | 3128 | WHERE |
3129 | 3129 | sru.user_id = '$userId' AND |
3130 | 3130 | sru.session_id = '$sessionId' AND |
3131 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND |
|
3132 | - access_url_id = " . api_get_current_access_url_id() . " |
|
3131 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND |
|
3132 | + access_url_id = " . api_get_current_access_url_id()." |
|
3133 | 3133 | "; |
3134 | 3134 | } else { |
3135 | 3135 | $sql = "$select FROM $tbl_session s |
@@ -3138,7 +3138,7 @@ discard block |
||
3138 | 3138 | sru.session_id = s.id AND |
3139 | 3139 | sru.user_id = '$userId' AND |
3140 | 3140 | sru.session_id = '$sessionId' AND |
3141 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' |
|
3141 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' |
|
3142 | 3142 | "; |
3143 | 3143 | } |
3144 | 3144 | |
@@ -3238,7 +3238,7 @@ discard block |
||
3238 | 3238 | |
3239 | 3239 | $limitCondition = null; |
3240 | 3240 | if (!empty($start) && !empty($limit)) { |
3241 | - $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit); |
|
3241 | + $limitCondition = " LIMIT ".intval($start).", ".intval($limit); |
|
3242 | 3242 | } |
3243 | 3243 | |
3244 | 3244 | if (empty($orderCondition)) { |
@@ -3315,26 +3315,26 @@ discard block |
||
3315 | 3315 | |
3316 | 3316 | $sessions = array(); |
3317 | 3317 | if (Database::num_rows($result) > 0) { |
3318 | - $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/'; |
|
3319 | - $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/'; |
|
3318 | + $sysUploadPath = api_get_path(SYS_UPLOAD_PATH).'sessions/'; |
|
3319 | + $webUploadPath = api_get_path(WEB_UPLOAD_PATH).'sessions/'; |
|
3320 | 3320 | $imgPath = Display::return_icon('session_default_small.png', null, null, null, null, true); |
3321 | 3321 | |
3322 | 3322 | $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD); |
3323 | - $sql = "SELECT id FROM " . $tableExtraFields . " |
|
3323 | + $sql = "SELECT id FROM ".$tableExtraFields." |
|
3324 | 3324 | WHERE extra_field_type = 3 AND variable='image'"; |
3325 | 3325 | $resultField = Database::query($sql); |
3326 | 3326 | $imageFieldId = Database::fetch_assoc($resultField); |
3327 | 3327 | |
3328 | 3328 | while ($row = Database::fetch_array($result)) { |
3329 | 3329 | |
3330 | - $row['image'] = null; |
|
3331 | - $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png'; |
|
3330 | + $row['image'] = null; |
|
3331 | + $sessionImage = $sysUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png'; |
|
3332 | 3332 | |
3333 | 3333 | if (is_file($sessionImage)) { |
3334 | - $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png'; |
|
3334 | + $sessionImage = $webUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png'; |
|
3335 | 3335 | $row['image'] = $sessionImage; |
3336 | 3336 | } else { |
3337 | - $row['image'] = $imgPath; |
|
3337 | + $row['image'] = $imgPath; |
|
3338 | 3338 | } |
3339 | 3339 | |
3340 | 3340 | if ($row['display_start_date'] == '0000-00-00 00:00:00' || $row['display_start_date'] == '0000-00-00') { |
@@ -3434,7 +3434,7 @@ discard block |
||
3434 | 3434 | return intval($count['count']); |
3435 | 3435 | } |
3436 | 3436 | |
3437 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
3437 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
3438 | 3438 | $courses[$row['real_id']] = $row; |
3439 | 3439 | } |
3440 | 3440 | } |
@@ -3478,7 +3478,7 @@ discard block |
||
3478 | 3478 | } |
3479 | 3479 | |
3480 | 3480 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
3481 | - $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
3481 | + $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
3482 | 3482 | |
3483 | 3483 | if ($getCount) { |
3484 | 3484 | $select = "SELECT COUNT(DISTINCT(c.code)) as count "; |
@@ -3503,7 +3503,7 @@ discard block |
||
3503 | 3503 | "; |
3504 | 3504 | if ($getCount) { |
3505 | 3505 | $result = Database::query($sql); |
3506 | - $row = Database::fetch_array($result,'ASSOC'); |
|
3506 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
3507 | 3507 | return $row['count']; |
3508 | 3508 | } |
3509 | 3509 | |
@@ -3518,7 +3518,7 @@ discard block |
||
3518 | 3518 | $courses = array(); |
3519 | 3519 | |
3520 | 3520 | if ($num_rows > 0) { |
3521 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
3521 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
3522 | 3522 | $courses[$row['id']] = $row; |
3523 | 3523 | } |
3524 | 3524 | } |
@@ -3596,7 +3596,7 @@ discard block |
||
3596 | 3596 | $result = Database::query($sql); |
3597 | 3597 | $num_rows = Database::num_rows($result); |
3598 | 3598 | if ($num_rows > 0) { |
3599 | - $row = Database::fetch_array($result,'ASSOC'); |
|
3599 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
3600 | 3600 | return $row['count']; |
3601 | 3601 | } |
3602 | 3602 | |
@@ -3715,9 +3715,9 @@ discard block |
||
3715 | 3715 | |
3716 | 3716 | if ($access_url_id != -1) { |
3717 | 3717 | $sql = 'SELECT DISTINCT session.* |
3718 | - FROM ' . $session_table . ' session INNER JOIN ' . $tbl_session_rel_access_url . ' session_rel_url |
|
3718 | + FROM ' . $session_table.' session INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url |
|
3719 | 3719 | ON (session.id = session_rel_url.session_id) |
3720 | - WHERE '.$sqlCoach.' access_url_id = ' . $access_url_id; |
|
3720 | + WHERE '.$sqlCoach.' access_url_id = '.$access_url_id; |
|
3721 | 3721 | } |
3722 | 3722 | } |
3723 | 3723 | $sql .= ' ORDER by name'; |
@@ -3751,8 +3751,8 @@ discard block |
||
3751 | 3751 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
3752 | 3752 | WHERE |
3753 | 3753 | session_rcru.user_id = user.user_id AND |
3754 | - session_rcru.session_id = '" . intval($session_id) . "' AND |
|
3755 | - session_rcru.c_id ='" . intval($courseId) . "' AND |
|
3754 | + session_rcru.session_id = '".intval($session_id)."' AND |
|
3755 | + session_rcru.c_id ='" . intval($courseId)."' AND |
|
3756 | 3756 | user.user_id = " . intval($user_id); |
3757 | 3757 | |
3758 | 3758 | $result = Database::query($sql); |
@@ -3783,8 +3783,8 @@ discard block |
||
3783 | 3783 | $sql = "SELECT session_rcru.status |
3784 | 3784 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
3785 | 3785 | WHERE session_rcru.user_id = user.user_id AND |
3786 | - session_rcru.session_id = '" . intval($session_id) . "' AND |
|
3787 | - session_rcru.c_id ='" . intval($courseId) . "' AND |
|
3786 | + session_rcru.session_id = '".intval($session_id)."' AND |
|
3787 | + session_rcru.c_id ='" . intval($courseId)."' AND |
|
3788 | 3788 | user.user_id = " . intval($user_id); |
3789 | 3789 | $result = Database::query($sql); |
3790 | 3790 | $status = false; |
@@ -3861,7 +3861,7 @@ discard block |
||
3861 | 3861 | // Get timestamp for now in UTC - see http://php.net/manual/es/function.time.php#117251 |
3862 | 3862 | $now = time() - date('Z'); |
3863 | 3863 | // Timestamp in one month |
3864 | - $inOneMonth = $now + (30*24*3600); |
|
3864 | + $inOneMonth = $now + (30 * 24 * 3600); |
|
3865 | 3865 | $inOneMonth = api_get_local_time($inOneMonth); |
3866 | 3866 | if (api_strtotime($s['access_start_date']) < $now) { |
3867 | 3867 | $s['access_start_date'] = api_get_local_time($now); |
@@ -3883,16 +3883,16 @@ discard block |
||
3883 | 3883 | } |
3884 | 3884 | // Now try to create the session |
3885 | 3885 | $sid = self::create_session( |
3886 | - $s['name'] . ' ' . get_lang('CopyLabelSuffix'), |
|
3886 | + $s['name'].' '.get_lang('CopyLabelSuffix'), |
|
3887 | 3887 | $s['access_start_date'], |
3888 | 3888 | $s['access_end_date'], |
3889 | 3889 | $s['display_start_date'], |
3890 | 3890 | $s['display_end_date'], |
3891 | 3891 | $s['coach_access_start_date'], |
3892 | 3892 | $s['coach_access_end_date'], |
3893 | - (int)$s['id_coach'], |
|
3893 | + (int) $s['id_coach'], |
|
3894 | 3894 | $s['session_category_id'], |
3895 | - (int)$s['visibility'], |
|
3895 | + (int) $s['visibility'], |
|
3896 | 3896 | true |
3897 | 3897 | ); |
3898 | 3898 | |
@@ -4006,7 +4006,7 @@ discard block |
||
4006 | 4006 | $session_table = Database::get_main_table(TABLE_MAIN_SESSION); |
4007 | 4007 | $sql = "SELECT DISTINCT id |
4008 | 4008 | FROM $session_table |
4009 | - WHERE session.id_coach = '" . $user_id . "' AND id = '$session_id'"; |
|
4009 | + WHERE session.id_coach = '".$user_id."' AND id = '$session_id'"; |
|
4010 | 4010 | $result = Database::query($sql); |
4011 | 4011 | if ($result && Database::num_rows($result)) { |
4012 | 4012 | return true; |
@@ -4025,7 +4025,7 @@ discard block |
||
4025 | 4025 | $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
4026 | 4026 | $sql = "SELECT count(id) FROM $session_table s"; |
4027 | 4027 | if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) { |
4028 | - $sql .= ", $access_url_rel_session_table u " . |
|
4028 | + $sql .= ", $access_url_rel_session_table u ". |
|
4029 | 4029 | " WHERE s.id = u.session_id AND u.access_url_id = $access_url_id"; |
4030 | 4030 | } |
4031 | 4031 | $res = Database::query($sql); |
@@ -4264,7 +4264,7 @@ discard block |
||
4264 | 4264 | |
4265 | 4265 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
4266 | 4266 | $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
4267 | - $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
4267 | + $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
4268 | 4268 | $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
4269 | 4269 | |
4270 | 4270 | $sessions = array(); |
@@ -4400,10 +4400,10 @@ discard block |
||
4400 | 4400 | $suffix = null; |
4401 | 4401 | while (!$unique_name) { |
4402 | 4402 | if ($i > 1) { |
4403 | - $suffix = ' - ' . $i; |
|
4403 | + $suffix = ' - '.$i; |
|
4404 | 4404 | } |
4405 | - $sql = 'SELECT 1 FROM ' . $tbl_session . ' |
|
4406 | - WHERE name="' . Database::escape_string($session_name). $suffix . '"'; |
|
4405 | + $sql = 'SELECT 1 FROM '.$tbl_session.' |
|
4406 | + WHERE name="' . Database::escape_string($session_name).$suffix.'"'; |
|
4407 | 4407 | $rs = Database::query($sql); |
4408 | 4408 | |
4409 | 4409 | if (Database::result($rs, 0, 0)) { |
@@ -4416,14 +4416,14 @@ discard block |
||
4416 | 4416 | |
4417 | 4417 | // Creating the session. |
4418 | 4418 | $sql = "INSERT IGNORE INTO $tbl_session SET |
4419 | - name = '" . Database::escape_string($session_name). "', |
|
4419 | + name = '".Database::escape_string($session_name)."', |
|
4420 | 4420 | id_coach = '$coach_id', |
4421 | 4421 | access_start_date = '$dateStart', |
4422 | 4422 | access_end_date = '$dateEnd', |
4423 | 4423 | display_start_date = '$dateStart', |
4424 | 4424 | display_end_date = '$dateEnd', |
4425 | 4425 | visibility = '$visibilityAfterExpirationPerSession', |
4426 | - session_admin_id = " . $defaultUserId . " |
|
4426 | + session_admin_id = ".$defaultUserId." |
|
4427 | 4427 | $sessionCondition $extraParameters $extraSessionParameters"; |
4428 | 4428 | Database::query($sql); |
4429 | 4429 | |
@@ -4489,7 +4489,7 @@ discard block |
||
4489 | 4489 | |
4490 | 4490 | // Delete session-user relation only for students |
4491 | 4491 | $sql = "DELETE FROM $tbl_session_user |
4492 | - WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH; |
|
4492 | + WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH; |
|
4493 | 4493 | Database::query($sql); |
4494 | 4494 | |
4495 | 4495 | $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'"; |
@@ -4580,7 +4580,7 @@ discard block |
||
4580 | 4580 | |
4581 | 4581 | // Delete session-user relation only for students |
4582 | 4582 | $sql = "DELETE FROM $tbl_session_user |
4583 | - WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH; |
|
4583 | + WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH; |
|
4584 | 4584 | Database::query($sql); |
4585 | 4585 | |
4586 | 4586 | $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'"; |
@@ -4623,7 +4623,7 @@ discard block |
||
4623 | 4623 | $sql = "INSERT IGNORE INTO $tbl_session_user SET |
4624 | 4624 | user_id = '$user_id', |
4625 | 4625 | session_id = '$session_id', |
4626 | - registered_at = '" . api_get_utc_datetime() . "'"; |
|
4626 | + registered_at = '".api_get_utc_datetime()."'"; |
|
4627 | 4627 | Database::query($sql); |
4628 | 4628 | if ($debug) { |
4629 | 4629 | $logger->addInfo("Sessions - Adding User #$user_id ($user) to session #$session_id"); |
@@ -5147,7 +5147,7 @@ discard block |
||
5147 | 5147 | foreach ($sessions as $session) { |
5148 | 5148 | $courseList = SessionManager::get_course_list_by_session_id($session['id']); |
5149 | 5149 | foreach ($courseList as $course) { |
5150 | - $coursesFromSession[$course['code'].':'.$session['id']] = $course['visual_code'] . ' - ' . $course['title'] . ' (' . $session['name'] . ')'; |
|
5150 | + $coursesFromSession[$course['code'].':'.$session['id']] = $course['visual_code'].' - '.$course['title'].' ('.$session['name'].')'; |
|
5151 | 5151 | } |
5152 | 5152 | } |
5153 | 5153 | } |
@@ -5294,7 +5294,7 @@ discard block |
||
5294 | 5294 | |
5295 | 5295 | if (!empty($lastConnectionDate)) { |
5296 | 5296 | $lastConnectionDate = Database::escape_string($lastConnectionDate); |
5297 | - $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
5297 | + $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
5298 | 5298 | } |
5299 | 5299 | |
5300 | 5300 | if (!empty($keyword)) { |
@@ -5364,7 +5364,7 @@ discard block |
||
5364 | 5364 | $result = Database::query($sql); |
5365 | 5365 | $result = Database::store_result($result); |
5366 | 5366 | |
5367 | - return $result ; |
|
5367 | + return $result; |
|
5368 | 5368 | } |
5369 | 5369 | |
5370 | 5370 | /** |
@@ -5424,7 +5424,7 @@ discard block |
||
5424 | 5424 | $userToString = null; |
5425 | 5425 | foreach ($userList as $userInfo) { |
5426 | 5426 | $newUserList[] = $userInfo['user_id']; |
5427 | - $userToString .= $userInfo['firstname'] . ' ' . $userInfo['lastname'] . '<br />'; |
|
5427 | + $userToString .= $userInfo['firstname'].' '.$userInfo['lastname'].'<br />'; |
|
5428 | 5428 | } |
5429 | 5429 | |
5430 | 5430 | if (!empty($sessionsDestination)) { |
@@ -5437,7 +5437,7 @@ discard block |
||
5437 | 5437 | $messages[] = Display::return_message(sprintf(get_lang('SessionXSkipped'), $sessionDestinationId), 'warning', false); |
5438 | 5438 | continue; |
5439 | 5439 | } |
5440 | - $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false); |
|
5440 | + $messages[] = Display::return_message(get_lang('StudentList').'<br />'.$userToString, 'info', false); |
|
5441 | 5441 | SessionManager::subscribe_users_to_session( |
5442 | 5442 | $sessionDestinationId, |
5443 | 5443 | $newUserList, |
@@ -5492,7 +5492,7 @@ discard block |
||
5492 | 5492 | } |
5493 | 5493 | } |
5494 | 5494 | } |
5495 | - $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session='; |
|
5495 | + $sessionUrl = api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session='; |
|
5496 | 5496 | |
5497 | 5497 | $htmlResult = null; |
5498 | 5498 | |
@@ -5507,7 +5507,7 @@ discard block |
||
5507 | 5507 | $sessionInfo = self::fetch($sessionId); |
5508 | 5508 | $htmlResult .= '<br />'; |
5509 | 5509 | $htmlResult .= Display::url( |
5510 | - get_lang('Session') . ': ' . $sessionInfo['name'] . ' <br />', $sessionUrl . $sessionId, array('target' => '_blank') |
|
5510 | + get_lang('Session').': '.$sessionInfo['name'].' <br />', $sessionUrl.$sessionId, array('target' => '_blank') |
|
5511 | 5511 | ); |
5512 | 5512 | $teacherList = array(); |
5513 | 5513 | foreach ($coachList as $coachId) { |
@@ -5620,7 +5620,7 @@ discard block |
||
5620 | 5620 | } |
5621 | 5621 | |
5622 | 5622 | $sessionIdList = array_map('intval', $sessionIdList); |
5623 | - $sessionToString = implode("', '", $sessionIdList); |
|
5623 | + $sessionToString = implode("', '", $sessionIdList); |
|
5624 | 5624 | |
5625 | 5625 | $course = Database::get_main_table(TABLE_MAIN_COURSE); |
5626 | 5626 | $sessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
@@ -5632,7 +5632,7 @@ discard block |
||
5632 | 5632 | INNER JOIN $courseUser cu ON (cu.c_id = c.id) |
5633 | 5633 | WHERE src.session_id IN ('$sessionToString') AND cu.status = 1"; |
5634 | 5634 | $result = Database::query($sql); |
5635 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
5635 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
5636 | 5636 | $teacherListId[$row['user_id']] = $row['user_id']; |
5637 | 5637 | } |
5638 | 5638 | } else { |
@@ -5707,7 +5707,7 @@ discard block |
||
5707 | 5707 | $toolList = self::getCourseToolToBeManaged(); |
5708 | 5708 | |
5709 | 5709 | foreach ($toolList as $tool) { |
5710 | - $method = 'add' . $tool; |
|
5710 | + $method = 'add'.$tool; |
|
5711 | 5711 | if (method_exists(get_class(), $method)) { |
5712 | 5712 | self::$method($sessionId, $courseId); |
5713 | 5713 | } |
@@ -5726,7 +5726,7 @@ discard block |
||
5726 | 5726 | $toolList = self::getCourseToolToBeManaged(); |
5727 | 5727 | |
5728 | 5728 | foreach ($toolList as $tool) { |
5729 | - $method = 'remove' . $tool; |
|
5729 | + $method = 'remove'.$tool; |
|
5730 | 5730 | if (method_exists(get_class(), $method)) { |
5731 | 5731 | self::$method($sessionId, $courseId); |
5732 | 5732 | } |
@@ -5844,18 +5844,18 @@ discard block |
||
5844 | 5844 | } |
5845 | 5845 | } |
5846 | 5846 | |
5847 | - $message .= '<strong>' . get_lang('User') . '</strong> ' . $userInfo['complete_name'] . ' <br />'; |
|
5847 | + $message .= '<strong>'.get_lang('User').'</strong> '.$userInfo['complete_name'].' <br />'; |
|
5848 | 5848 | |
5849 | 5849 | if (!in_array($userInfo['status'], array(DRH)) && !api_is_platform_admin_by_id($userInfo['user_id'])) { |
5850 | - $message .= get_lang('UserMustHaveTheDrhRole') . '<br />'; |
|
5850 | + $message .= get_lang('UserMustHaveTheDrhRole').'<br />'; |
|
5851 | 5851 | continue; |
5852 | 5852 | } |
5853 | 5853 | |
5854 | 5854 | if (!empty($sessionList)) { |
5855 | - $message .= '<strong>' . get_lang('Sessions') . ':</strong> <br />'; |
|
5856 | - $message .= implode(', ', $sessionList) . '<br /><br />'; |
|
5855 | + $message .= '<strong>'.get_lang('Sessions').':</strong> <br />'; |
|
5856 | + $message .= implode(', ', $sessionList).'<br /><br />'; |
|
5857 | 5857 | } else { |
5858 | - $message .= get_lang('NoSessionProvided') . ' <br /><br />'; |
|
5858 | + $message .= get_lang('NoSessionProvided').' <br /><br />'; |
|
5859 | 5859 | } |
5860 | 5860 | } |
5861 | 5861 | } |
@@ -6035,8 +6035,8 @@ discard block |
||
6035 | 6035 | |
6036 | 6036 | $firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC'); |
6037 | 6037 | |
6038 | - $endDateInSeconds = $firstAccess + $duration*24*60*60; |
|
6039 | - $leftDays = round(($endDateInSeconds- $currentTime) / 60 / 60 / 24); |
|
6038 | + $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60; |
|
6039 | + $leftDays = round(($endDateInSeconds - $currentTime) / 60 / 60 / 24); |
|
6040 | 6040 | |
6041 | 6041 | return $leftDays; |
6042 | 6042 | } |
@@ -6328,7 +6328,7 @@ discard block |
||
6328 | 6328 | FROM $table scu |
6329 | 6329 | INNER JOIN $tableUser u |
6330 | 6330 | ON scu.user_id = u.id |
6331 | - WHERE scu.session_id = " . intval($sessionId) ." |
|
6331 | + WHERE scu.session_id = ".intval($sessionId)." |
|
6332 | 6332 | GROUP BY u.id"; |
6333 | 6333 | |
6334 | 6334 | $result = Database::query($sql); |
@@ -6366,7 +6366,7 @@ discard block |
||
6366 | 6366 | $sfTable = Database::get_main_table(TABLE_EXTRA_FIELD); |
6367 | 6367 | $sfvTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES); |
6368 | 6368 | // Join session field and session field values tables |
6369 | - $joinTable = $sfTable . ' sf INNER JOIN ' . $sfvTable . ' sfv ON sf.id = sfv.field_id'; |
|
6369 | + $joinTable = $sfTable.' sf INNER JOIN '.$sfvTable.' sfv ON sf.id = sfv.field_id'; |
|
6370 | 6370 | $fieldsArray = array(); |
6371 | 6371 | foreach ($extraFields as $field) { |
6372 | 6372 | $fieldsArray[] = Database::escape_string($field); |
@@ -6409,14 +6409,14 @@ discard block |
||
6409 | 6409 | for ($i = 1; $i < count($fieldsArray); $i++) { |
6410 | 6410 | $whereParams .= ', ?'; |
6411 | 6411 | } |
6412 | - $whereFieldVariables = ' variable IN ( ' . $whereParams .' )'; |
|
6413 | - $whereFieldIds = 'field_id IN ( ' . $whereParams . ' )'; |
|
6412 | + $whereFieldVariables = ' variable IN ( '.$whereParams.' )'; |
|
6413 | + $whereFieldIds = 'field_id IN ( '.$whereParams.' )'; |
|
6414 | 6414 | } |
6415 | 6415 | // Get session fields |
6416 | 6416 | $extraField = new ExtraFieldModel('session'); |
6417 | 6417 | $questionMarks = substr(str_repeat('?, ', count($fieldsArray)), 0, -2); |
6418 | 6418 | $fieldsList = $extraField->get_all(array( |
6419 | - ' variable IN ( ' . $questionMarks . ' )' => $fieldsArray, |
|
6419 | + ' variable IN ( '.$questionMarks.' )' => $fieldsArray, |
|
6420 | 6420 | )); |
6421 | 6421 | // Index session fields |
6422 | 6422 | foreach ($fieldsList as $field) { |
@@ -6425,7 +6425,7 @@ discard block |
||
6425 | 6425 | // Get session field values |
6426 | 6426 | $extra = new ExtraFieldValue('session'); |
6427 | 6427 | $questionMarksFields = substr(str_repeat('?, ', count($fields)), 0, -2); |
6428 | - $sessionFieldValueList = $extra->get_all(array ('where' => array('field_id IN ( ' . $questionMarksFields . ' )' => array_keys($fields)))); |
|
6428 | + $sessionFieldValueList = $extra->get_all(array('where' => array('field_id IN ( '.$questionMarksFields.' )' => array_keys($fields)))); |
|
6429 | 6429 | // Add session fields values to session list |
6430 | 6430 | foreach ($sessionList as $id => &$session) { |
6431 | 6431 | foreach ($sessionFieldValueList as $sessionFieldValue) { |
@@ -6478,7 +6478,7 @@ discard block |
||
6478 | 6478 | // Check the result |
6479 | 6479 | if ($result < 1) { |
6480 | 6480 | // If not found any result, update error message |
6481 | - $errorResult['errorMessage'] = 'Not found any session category name ' . $categoryName; |
|
6481 | + $errorResult['errorMessage'] = 'Not found any session category name '.$categoryName; |
|
6482 | 6482 | } elseif (count($result) > 1 && !$force) { |
6483 | 6483 | // If found more than one result and force is disabled, update error message |
6484 | 6484 | $errorResult['errorMessage'] = 'Found many session categories'; |
@@ -6537,7 +6537,7 @@ discard block |
||
6537 | 6537 | // Check if session list query had result |
6538 | 6538 | if (!empty($sessionList)) { |
6539 | 6539 | // implode all session id |
6540 | - $sessionIdsString = '(' . implode(', ', array_keys($sessionList)) . ')'; |
|
6540 | + $sessionIdsString = '('.implode(', ', array_keys($sessionList)).')'; |
|
6541 | 6541 | // Get all field variables |
6542 | 6542 | $sessionFieldList = Database::select( |
6543 | 6543 | 'id, variable', |
@@ -6624,7 +6624,7 @@ discard block |
||
6624 | 6624 | return $sessionList; |
6625 | 6625 | } else { |
6626 | 6626 | // Not found result, update error message |
6627 | - $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId; |
|
6627 | + $errorResult['errorMessage'] = 'Not found any session for session category id '.$sessionCategoryId; |
|
6628 | 6628 | } |
6629 | 6629 | } |
6630 | 6630 | |
@@ -6728,7 +6728,7 @@ discard block |
||
6728 | 6728 | |
6729 | 6729 | $sessionExtraField = new ExtraFieldModel('session'); |
6730 | 6730 | $fieldList = $sessionExtraField->get_all(array( |
6731 | - "variable IN ( " . implode(", ", $variablePlaceHolders) . " ) " => $variables, |
|
6731 | + "variable IN ( ".implode(", ", $variablePlaceHolders)." ) " => $variables, |
|
6732 | 6732 | )); |
6733 | 6733 | |
6734 | 6734 | $fields = array(); |
@@ -6742,7 +6742,7 @@ discard block |
||
6742 | 6742 | $extra = new ExtraFieldValue('session'); |
6743 | 6743 | $sessionFieldValueList = $extra->get_all( |
6744 | 6744 | array( |
6745 | - "field_id IN ( " . implode(", ", $variablePlaceHolders) . " )" => array_keys($fields), |
|
6745 | + "field_id IN ( ".implode(", ", $variablePlaceHolders)." )" => array_keys($fields), |
|
6746 | 6746 | ) |
6747 | 6747 | ); |
6748 | 6748 | |
@@ -6814,7 +6814,7 @@ discard block |
||
6814 | 6814 | INNER JOIN $sessionUserTable sru |
6815 | 6815 | ON s.id = sru.id_session |
6816 | 6816 | WHERE |
6817 | - (sru.id_user IN (" . implode(', ', $userIdList) . ") |
|
6817 | + (sru.id_user IN (".implode(', ', $userIdList).") |
|
6818 | 6818 | AND sru.relation_type = 0 |
6819 | 6819 | )"; |
6820 | 6820 | |
@@ -6830,7 +6830,7 @@ discard block |
||
6830 | 6830 | WHERE |
6831 | 6831 | srau.access_url_id = $accessUrlId |
6832 | 6832 | AND ( |
6833 | - sru.id_user IN (" . implode(', ', $userIdList) . ") |
|
6833 | + sru.id_user IN (".implode(', ', $userIdList).") |
|
6834 | 6834 | AND sru.relation_type = 0 |
6835 | 6835 | )"; |
6836 | 6836 | } |
@@ -7050,7 +7050,7 @@ discard block |
||
7050 | 7050 | get_lang('CoachName'), |
7051 | 7051 | $coachInfo ? [$coachInfo['id'] => $coachInfo['complete_name_with_username']] : [], |
7052 | 7052 | [ |
7053 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=search_general_coach', |
|
7053 | + 'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach', |
|
7054 | 7054 | 'width' => '100%', |
7055 | 7055 | ] |
7056 | 7056 | ); |
@@ -7061,7 +7061,7 @@ discard block |
||
7061 | 7061 | $form->addHtml('<div id="ajax_list_coachs"></div>'); |
7062 | 7062 | |
7063 | 7063 | $form->addButtonAdvancedSettings('advanced_params'); |
7064 | - $form->addElement('html','<div id="advanced_params_options" style="display:none">'); |
|
7064 | + $form->addElement('html', '<div id="advanced_params_options" style="display:none">'); |
|
7065 | 7065 | |
7066 | 7066 | $form->addSelect( |
7067 | 7067 | 'session_category', |
@@ -7233,16 +7233,16 @@ discard block |
||
7233 | 7233 | if (api_is_session_admin() && |
7234 | 7234 | api_get_setting('allow_session_admins_to_see_all_sessions') == 'false' |
7235 | 7235 | ) { |
7236 | - $where.=" WHERE s.session_admin_id = $user_id "; |
|
7236 | + $where .= " WHERE s.session_admin_id = $user_id "; |
|
7237 | 7237 | } |
7238 | 7238 | |
7239 | 7239 | if (!empty($options['where'])) { |
7240 | 7240 | $options['where'] = str_replace('course_title', 'c.title', $options['where']); |
7241 | - $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7241 | + $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7242 | 7242 | |
7243 | 7243 | $options['where'] = str_replace( |
7244 | 7244 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
7245 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
7245 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
7246 | 7246 | , $options['where'] |
7247 | 7247 | ); |
7248 | 7248 | |
@@ -7284,10 +7284,10 @@ discard block |
||
7284 | 7284 | $where "; |
7285 | 7285 | |
7286 | 7286 | if (api_is_multiple_url_enabled()) { |
7287 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7287 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7288 | 7288 | $access_url_id = api_get_current_access_url_id(); |
7289 | 7289 | if ($access_url_id != -1) { |
7290 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
7290 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
7291 | 7291 | |
7292 | 7292 | $query_rows = "SELECT count(*) as total_rows |
7293 | 7293 | FROM $tbl_session s |
@@ -7332,12 +7332,12 @@ discard block |
||
7332 | 7332 | //get_lang('CourseTitle'), |
7333 | 7333 | get_lang('Visibility'), |
7334 | 7334 | ); |
7335 | - $column_model = array ( |
|
7336 | - array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7337 | - array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7338 | - array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7339 | - array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7340 | - array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7335 | + $column_model = array( |
|
7336 | + array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7337 | + array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7338 | + array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7339 | + array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7340 | + array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7341 | 7341 | ); |
7342 | 7342 | break; |
7343 | 7343 | case 'complete': |
@@ -7350,12 +7350,12 @@ discard block |
||
7350 | 7350 | get_lang('Visibility'), |
7351 | 7351 | get_lang('CourseTitle'), |
7352 | 7352 | ); |
7353 | - $column_model = array ( |
|
7354 | - array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7355 | - array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7356 | - array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7357 | - array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)), |
|
7358 | - array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
7353 | + $column_model = array( |
|
7354 | + array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7355 | + array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7356 | + array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7357 | + array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)), |
|
7358 | + array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
7359 | 7359 | // for the bottom bar |
7360 | 7360 | 'searchoptions' => array( |
7361 | 7361 | 'defaultValue' => '1', |
@@ -7363,8 +7363,8 @@ discard block |
||
7363 | 7363 | // for the top bar |
7364 | 7364 | 'editoptions' => array('value' => '" ":'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')), |
7365 | 7365 | ), |
7366 | - array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7367 | - array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true','sopt' => $operators)), |
|
7366 | + array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7367 | + array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true', 'sopt' => $operators)), |
|
7368 | 7368 | ); |
7369 | 7369 | break; |
7370 | 7370 | } |
@@ -7373,14 +7373,14 @@ discard block |
||
7373 | 7373 | $session_field = new ExtraFieldModel('session'); |
7374 | 7374 | $rules = $session_field->getRules($columns, $column_model); |
7375 | 7375 | |
7376 | - $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false'); |
|
7376 | + $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false'); |
|
7377 | 7377 | $columns[] = get_lang('Actions'); |
7378 | 7378 | |
7379 | 7379 | foreach ($column_model as $col_model) { |
7380 | 7380 | $simple_column_name[] = $col_model['name']; |
7381 | 7381 | } |
7382 | 7382 | |
7383 | - $return_array = array( |
|
7383 | + $return_array = array( |
|
7384 | 7384 | 'columns' => $columns, |
7385 | 7385 | 'column_model' => $column_model, |
7386 | 7386 | 'rules' => $rules, |
@@ -7469,7 +7469,7 @@ discard block |
||
7469 | 7469 | if (api_is_session_admin() && |
7470 | 7470 | api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false' |
7471 | 7471 | ) { |
7472 | - $where.=" AND s.session_admin_id = $user_id "; |
|
7472 | + $where .= " AND s.session_admin_id = $user_id "; |
|
7473 | 7473 | } |
7474 | 7474 | } |
7475 | 7475 | |
@@ -7551,11 +7551,11 @@ discard block |
||
7551 | 7551 | } |
7552 | 7552 | $options['where'] = str_replace('course_title', 'c.title', $options['where']); |
7553 | 7553 | |
7554 | - $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7554 | + $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7555 | 7555 | |
7556 | 7556 | $options['where'] = str_replace( |
7557 | 7557 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
7558 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
7558 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
7559 | 7559 | , $options['where'] |
7560 | 7560 | ); |
7561 | 7561 | |
@@ -7590,10 +7590,10 @@ discard block |
||
7590 | 7590 | $where; |
7591 | 7591 | |
7592 | 7592 | if (api_is_multiple_url_enabled()) { |
7593 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7593 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7594 | 7594 | $access_url_id = api_get_current_access_url_id(); |
7595 | 7595 | if ($access_url_id != -1) { |
7596 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
7596 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
7597 | 7597 | $query = "$select |
7598 | 7598 | FROM $tbl_session s |
7599 | 7599 | LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id) |
@@ -7617,7 +7617,7 @@ discard block |
||
7617 | 7617 | $formatted_sessions = array(); |
7618 | 7618 | |
7619 | 7619 | if (Database::num_rows($result)) { |
7620 | - $sessions = Database::store_result($result, 'ASSOC'); |
|
7620 | + $sessions = Database::store_result($result, 'ASSOC'); |
|
7621 | 7621 | foreach ($sessions as $session) { |
7622 | 7622 | $session_id = $session['id']; |
7623 | 7623 | $session['name'] = Display::url($session['name'], "resume_session.php?id_session=".$session['id']); |
@@ -7632,14 +7632,14 @@ discard block |
||
7632 | 7632 | |
7633 | 7633 | switch ($session['visibility']) { |
7634 | 7634 | case SESSION_VISIBLE_READ_ONLY: //1 |
7635 | - $session['visibility'] = get_lang('ReadOnly'); |
|
7635 | + $session['visibility'] = get_lang('ReadOnly'); |
|
7636 | 7636 | break; |
7637 | 7637 | case SESSION_VISIBLE: //2 |
7638 | 7638 | case SESSION_AVAILABLE: //4 |
7639 | - $session['visibility'] = get_lang('Visible'); |
|
7639 | + $session['visibility'] = get_lang('Visible'); |
|
7640 | 7640 | break; |
7641 | 7641 | case SESSION_INVISIBLE: //3 |
7642 | - $session['visibility'] = api_ucfirst(get_lang('Invisible')); |
|
7642 | + $session['visibility'] = api_ucfirst(get_lang('Invisible')); |
|
7643 | 7643 | break; |
7644 | 7644 | } |
7645 | 7645 | |
@@ -7715,7 +7715,7 @@ discard block |
||
7715 | 7715 | if (empty($session)) { |
7716 | 7716 | return false; |
7717 | 7717 | } |
7718 | - return api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $id; |
|
7718 | + return api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id; |
|
7719 | 7719 | } |
7720 | 7720 | |
7721 | 7721 | /** |
@@ -7733,7 +7733,7 @@ discard block |
||
7733 | 7733 | return false; |
7734 | 7734 | } |
7735 | 7735 | if (empty($courseId)) { |
7736 | - return api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $id; |
|
7736 | + return api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$id; |
|
7737 | 7737 | } else { |
7738 | 7738 | $courseInfo = api_get_course_info_by_id($courseId); |
7739 | 7739 | if ($courseInfo) { |
@@ -7944,7 +7944,7 @@ discard block |
||
7944 | 7944 | // sort $listCat by catSessionName |
7945 | 7945 | usort($listCat, 'self::compareBySessionName'); |
7946 | 7946 | // in each catSession sort sessionList by sessionName |
7947 | - foreach($listCat as $i => $listCatSessionInfo) { |
|
7947 | + foreach ($listCat as $i => $listCatSessionInfo) { |
|
7948 | 7948 | $listSessionList = $listCatSessionInfo['sessionList']; |
7949 | 7949 | usort($listSessionList, 'self::compareCatSessionInfo'); |
7950 | 7950 | $listCat[$i]['sessionList'] = $listSessionList; |
@@ -7959,8 +7959,8 @@ discard block |
||
7959 | 7959 | ); |
7960 | 7960 | |
7961 | 7961 | $userCatId = intval($userCatId); |
7962 | - $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId; |
|
7963 | - $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle; |
|
7962 | + $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId; |
|
7963 | + $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle; |
|
7964 | 7964 | $listResults[$userCatId]['courseInUserCatList'][] = $listOneCourse; |
7965 | 7965 | } |
7966 | 7966 | |
@@ -7986,7 +7986,7 @@ discard block |
||
7986 | 7986 | { |
7987 | 7987 | if ($listA['sessionName'] == $listB['sessionName']) { |
7988 | 7988 | return 0; |
7989 | - } else if($listA['sessionName'] > $listB['sessionName']) { |
|
7989 | + } else if ($listA['sessionName'] > $listB['sessionName']) { |
|
7990 | 7990 | return 1; |
7991 | 7991 | } else { |
7992 | 7992 | return -1; |
@@ -8006,7 +8006,7 @@ discard block |
||
8006 | 8006 | return 1; |
8007 | 8007 | } else if ($listA['catSessionName'] == $listB['catSessionName']) { |
8008 | 8008 | return 0; |
8009 | - } else if($listA['catSessionName'] > $listB['catSessionName']) { |
|
8009 | + } else if ($listA['catSessionName'] > $listB['catSessionName']) { |
|
8010 | 8010 | return 1; |
8011 | 8011 | } else { |
8012 | 8012 | return -1; |
@@ -8022,7 +8022,7 @@ discard block |
||
8022 | 8022 | { |
8023 | 8023 | if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) { |
8024 | 8024 | return 0; |
8025 | - } else if($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) { |
|
8025 | + } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) { |
|
8026 | 8026 | return 1; |
8027 | 8027 | } else { |
8028 | 8028 | return -1; |
@@ -8038,7 +8038,7 @@ discard block |
||
8038 | 8038 | { |
8039 | 8039 | if ($listA['title'] == $listB['title']) { |
8040 | 8040 | return 0; |
8041 | - } else if($listA['title'] > $listB['title']) { |
|
8041 | + } else if ($listA['title'] > $listB['title']) { |
|
8042 | 8042 | return 1; |
8043 | 8043 | } else { |
8044 | 8044 | return -1; |
@@ -8084,8 +8084,8 @@ discard block |
||
8084 | 8084 | |
8085 | 8085 | $marginShift = 20; |
8086 | 8086 | if ($catSessionName != '') { |
8087 | - $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">' . |
|
8088 | - CourseManager::course_item_html($listParamsCatSession, true) . '</div>'; |
|
8087 | + $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">'. |
|
8088 | + CourseManager::course_item_html($listParamsCatSession, true).'</div>'; |
|
8089 | 8089 | $marginShift = 40; |
8090 | 8090 | } |
8091 | 8091 |