Completed
Push — 1.11.x ( 7ffd51...902ebd )
by José
50:21 queued 21:28
created
main/admin/subscribe_user2course.php 2 patches
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -317,7 +317,10 @@  discard block
 block discarded – undo
317 317
     <td width="40%" align="center">
318 318
      <select name="UserList[]" multiple="multiple" size="20" style="width:300px;">
319 319
     <?php foreach ($db_users as $user) { ?>
320
-          <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>>
320
+          <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) {
321
+    echo 'selected="selected"';
322
+}
323
+?>>
321 324
       <?php
322 325
         $userName = $user['lastname'].' '.$user['firstname'].' ('.$user['username'].')';
323 326
         if ($showOfficialCode) {
@@ -338,7 +341,10 @@  discard block
 block discarded – undo
338 341
    <td width="40%" align="center">
339 342
     <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;">
340 343
     <?php foreach ($db_courses as $course) { ?>
341
-         <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>>
344
+         <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) {
345
+    echo 'selected="selected"';
346
+}
347
+?>>
342 348
              <?php echo '('.$course['visual_code'].') '.$course['title']; ?>
343 349
          </option>
344 350
     <?php } ?>
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
       <option value="">--</option>
300 300
       <?php
301 301
         echo Display :: get_alphabet_options($first_letter_user);
302
-      ?>
302
+        ?>
303 303
      </select>
304 304
     </td>
305 305
     <td width="20%">&nbsp;</td>
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
         aria-label="<?php echo get_lang('FirstLetterCourse'); ?>">
313 313
       <option value="">--</option>
314 314
       <?php
315
-      echo Display :: get_alphabet_options($first_letter_course);
316
-      ?>
315
+        echo Display :: get_alphabet_options($first_letter_course);
316
+        ?>
317 317
      </select>
318 318
     </td>
319 319
    </tr>
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
             $userName = $officialCode.$userName;
330 330
         }
331 331
         echo $userName;
332
-      ?>
332
+        ?>
333 333
           </option>
334 334
     <?php } ?>
335 335
     </select>
Please login to merge, or discard this patch.
main/social/profile.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -595,7 +595,7 @@
 block discarded – undo
595 595
                                 .' width="40px">';
596 596
                     $userInfo = api_get_user_info($user_invitation_id);
597 597
                     $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'">'
598
-                                 .api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>';
598
+                                    .api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>';
599 599
 
600 600
                     $invitations .= '<div class="pull-right">';
601 601
                     $invitations .= Display::toolbarButton(
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -538,7 +538,8 @@
 block discarded – undo
538 538
         $i = 1;
539 539
 
540 540
         foreach ($list as $key => $value) {
541
-            if (empty($value[2])) { //if out of any session
541
+            if (empty($value[2])) {
542
+//if out of any session
542 543
                 $my_courses .= $value[1];
543 544
                 $i++;
544 545
             }
Please login to merge, or discard this patch.
plugin/sepe/src/sepe.lib.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@
 block discarded – undo
192 192
 function listTutorType($condition)
193 193
 {
194 194
     global $tableTutorCompany;
195
-       $sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
195
+        $sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
196 196
     $res = Database::query($sql);
197 197
     $aux = array();
198 198
     while ($row = Database::fetch_assoc($res)) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 {
361 361
     global $tableSepeParticipants;
362 362
     global $tableUser;
363
-    $sql = "SELECT $tableSepeParticipants.id AS id, document_type, document_number, document_letter, firstname, lastname
363
+    $sql = "select $tableSepeParticipants.id AS id, document_type, document_number, document_letter, firstname, lastname
364 364
             FROM $tableSepeParticipants LEFT JOIN $tableUser ON $tableSepeParticipants.platform_user_id=$tableUser.user_id
365 365
             WHERE action_id = $actionId";
366 366
     $res = Database::query($sql);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 {
443 443
     global $tableSepeActions;
444 444
     global $tableSepeCourseActions;
445
-    $sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code 
445
+    $sql = "select $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code 
446 446
             FROM $tableSepeCourseActions, course, $tableSepeActions 
447 447
             WHERE $tableSepeCourseActions.course_id=course.id 
448 448
             AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
Please login to merge, or discard this patch.
Braces   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 $tableSepeLogParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_PARTICIPANT);
26 26
 $tableSepeLogChangeParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_MOD_PARTICIPANT);
27 27
 
28
-function getInfoIdentificationData()
29
-{
28
+function getInfoIdentificationData()
29
+{
30 30
     global $tableSepeCenter;
31 31
     $sql = "SELECT * FROM $tableSepeCenter;";
32 32
     $res = Database::query($sql);
33
-    if (Database::num_rows($res) > 0) {
33
+    if (Database::num_rows($res) > 0) {
34 34
         $row = Database::fetch_assoc($res);
35 35
         $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
36 36
         $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
@@ -39,26 +39,26 @@  discard block
 block discarded – undo
39 39
         $row['tracking_url'] = Security::remove_XSS(stripslashes($row['tracking_url']));
40 40
         $row['phone'] = Security::remove_XSS(stripslashes($row['phone']));
41 41
         $row['mail'] = Security::remove_XSS(stripslashes($row['mail']));
42
-    } else {
42
+    } else {
43 43
         $row = false;
44 44
     }
45 45
     return $row;
46 46
 }
47 47
 
48
-function checkIdentificationData()
49
-{
48
+function checkIdentificationData()
49
+{
50 50
     global $tableSepeCenter;
51 51
     $sql = "SELECT 1 FROM $tableSepeCenter;";
52 52
     $result = Database::query($sql);
53
-    if (Database::affected_rows($result) > 0) {
53
+    if (Database::affected_rows($result) > 0) {
54 54
         return true;
55
-    } else {
55
+    } else {
56 56
         return false;
57 57
     }
58 58
 }
59 59
 
60
-function getActionId($courseId)
61
-{
60
+function getActionId($courseId)
61
+{
62 62
     global $tableSepeCourseActions;
63 63
     $sql = "SELECT action_id FROM $tableSepeCourseActions WHERE course_id = $courseId";
64 64
     $rs = Database::query($sql);
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
     return $aux['action_id'];
67 67
 }
68 68
 
69
-function getCourse($actionId)
70
-{
69
+function getCourse($actionId)
70
+{
71 71
     global $tableSepeCourseActions;
72 72
     $sql = "SELECT course_id FROM $tableSepeCourseActions WHERE action_id = $actionId";
73 73
     $rs = Database::query($sql);
74 74
     $aux = Database::fetch_assoc($rs);
75 75
     return $aux['course_id'];
76 76
 }
77
-function getCourseCode($actionId)
78
-{
77
+function getCourseCode($actionId)
78
+{
79 79
     global $tableCourse;
80 80
     $courseId = getCourse($actionId);
81 81
     $sql = "SELECT code FROM $tableCourse WHERE id = $courseId";    
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
     return $aux['code'];
85 85
 }
86 86
 
87
-function getActionInfo($id)
88
-{
87
+function getActionInfo($id)
88
+{
89 89
     global $tableSepeActions;
90 90
     $sql = "SELECT * FROM $tableSepeActions WHERE id = $id";
91 91
     $res = Database::query($sql);
92 92
     $row = false;
93
-    if (Database::num_rows($res) > 0) {
93
+    if (Database::num_rows($res) > 0) {
94 94
         $row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
95 95
         $row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
96 96
         $row['situation'] = Security::remove_XSS(stripslashes($row['situation']));
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
     return $row;
110 110
 }
111 111
 
112
-function getSpecialtActionInfo($specialtyId)
113
-{
112
+function getSpecialtActionInfo($specialtyId)
113
+{
114 114
     global $tableSepeSpecialty;
115 115
     $sql = "SELECT * FROM $tableSepeSpecialty WHERE id = $specialtyId";
116 116
     $res = Database::query($sql);
117 117
     $row = false;
118
-    if (Database::num_rows($res) > 0) {
118
+    if (Database::num_rows($res) > 0) {
119 119
         $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
120 120
         $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
121 121
         $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     return $row;
128 128
 }
129 129
 
130
-function getInfoSpecialtyClassroom($classroomId)
131
-{
130
+function getInfoSpecialtyClassroom($classroomId)
131
+{
132 132
     global $tableSepeSpecialtyClassroom;
133 133
     global $tableCenters;
134 134
     $sql = "SELECT a.*, center_origin, center_code 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             WHERE a.id = $classroomId";
137 137
     $res = Database::query($sql);
138 138
     $row = false;
139
-    if (Database::num_rows($res) > 0) {
139
+    if (Database::num_rows($res) > 0) {
140 140
         $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
141 141
         $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
142 142
         $row = Database::fetch_assoc($res);
@@ -144,57 +144,57 @@  discard block
 block discarded – undo
144 144
     return $row;
145 145
 }
146 146
 
147
-function getInfoSpecialtyTutorial($tutorialId)
148
-{
147
+function getInfoSpecialtyTutorial($tutorialId)
148
+{
149 149
     global $tableSepeParticipantsSpecialtyTutorials;
150 150
     $sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE id = $tutorialId";
151 151
     $res = Database::query($sql);
152 152
     $aux = array();
153
-    if (Database::num_rows($res) > 0) {
153
+    if (Database::num_rows($res) > 0) {
154 154
         $row = Database::fetch_assoc($res);
155
-    } else {
155
+    } else {
156 156
         $row = false;
157 157
     }
158 158
     return $row;
159 159
 }
160 160
 
161
-function list_tutor($specialtyId)
162
-{
161
+function list_tutor($specialtyId)
162
+{
163 163
     global $tableSepeSpecialtyTutors;
164 164
     $sql = "SELECT * FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
165 165
     $res = Database::query($sql);
166
-    if (Database::num_rows($res) > 0) {
166
+    if (Database::num_rows($res) > 0) {
167 167
         $row = Database::fetch_assoc($res);
168
-    } else {
168
+    } else {
169 169
         $row = false;
170 170
     }
171 171
     return $row;
172 172
 }
173 173
 
174
-function getCentersList() 
175
-{
174
+function getCentersList()
175
+{
176 176
     global $tableCenters;
177 177
     $sql = "SELECT * FROM $tableCenters;";
178 178
     $res = Database::query($sql);
179 179
     $aux = array();
180
-    while ($row = Database::fetch_assoc($res)) {
180
+    while ($row = Database::fetch_assoc($res)) {
181 181
         $aux[] = $row;
182 182
     }
183 183
     return $aux;
184 184
 }
185 185
 
186
-function listTutorType($condition)
187
-{
186
+function listTutorType($condition)
187
+{
188 188
     global $tableTutorCompany;
189 189
        $sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
190 190
     $res = Database::query($sql);
191 191
     $aux = array();
192
-    while ($row = Database::fetch_assoc($res)) {
192
+    while ($row = Database::fetch_assoc($res)) {
193 193
         $tmp = array();
194 194
         $tmp['id'] = $row['id'];
195
-        if (trim($row['alias']) != '') {
195
+        if (trim($row['alias']) != '') {
196 196
             $tmp['alias'] = $row['alias'].' - '.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];    
197
-        } else {
197
+        } else {
198 198
             $tmp['alias'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];    
199 199
         }
200 200
         $aux[] = $tmp;
@@ -202,28 +202,28 @@  discard block
 block discarded – undo
202 202
     return $aux;
203 203
 }
204 204
 
205
-function getTutorsSpecialty($specialtyId)
206
-{
205
+function getTutorsSpecialty($specialtyId)
206
+{
207 207
     global $tableSepeSpecialtyTutors;
208 208
     global $tableSepeTutors;
209 209
     global $tableUser;
210 210
     $sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
211 211
     $rs = Database::query($sql);
212 212
     $tutorsList = array();
213
-    while ($tmp = Database::fetch_assoc($rs)) {
213
+    while ($tmp = Database::fetch_assoc($rs)) {
214 214
         $tutorsList[] = $tmp['tutor_id'];
215 215
     }
216 216
     $sql = "SELECT a.*, b.firstname AS firstname, b.lastname AS lastname 
217 217
             FROM $tableSepeTutors AS a LEFT JOIN $tableUser AS b ON a.platform_user_id=b.user_id;";
218 218
     $res = Database::query($sql);
219 219
     $aux = array();
220
-    while ($row = Database::fetch_assoc($res)) {
221
-        if (!in_array($row['id'], $tutorsList)) {
220
+    while ($row = Database::fetch_assoc($res)) {
221
+        if (!in_array($row['id'], $tutorsList)) {
222 222
             $tutor = array();
223 223
             $tutor['id'] = $row['id'];
224
-            if (trim($row['firstname']) != '' || trim($row['lastname']) != '') {
224
+            if (trim($row['firstname']) != '' || trim($row['lastname']) != '') {
225 225
                 $tutor['data'] = $row['firstname'].' '.$row['lastname'].' ('.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'].' )';    
226
-            } else {
226
+            } else {
227 227
                 $tutor['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];    
228 228
             }
229 229
             $aux[] = $tutor;
@@ -232,8 +232,8 @@  discard block
 block discarded – undo
232 232
     return $aux;
233 233
 }
234 234
 
235
-function getInfoSpecialtyTutor($tutorId)
236
-{
235
+function getInfoSpecialtyTutor($tutorId)
236
+{
237 237
     global $tableSepeSpecialtyTutors;
238 238
     global $tableSepeTutors;
239 239
     $sql = "SELECT a.*,platform_user_id,document_type, document_number,document_letter 
@@ -242,32 +242,32 @@  discard block
 block discarded – undo
242 242
             WHERE a.id = $tutorId;";
243 243
     $res = Database::query($sql);
244 244
     $aux = array();
245
-    if (Database::num_rows($res) > 0) {
245
+    if (Database::num_rows($res) > 0) {
246 246
         $row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
247 247
         $row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
248 248
         $row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
249 249
         $row = Database::fetch_assoc($res);
250
-    } else {
250
+    } else {
251 251
         $row = false;
252 252
     }
253 253
     return $row;
254 254
 }
255 255
 
256
-function freeTeacherList($teacherList, $specialtyId, $platform_user_id)
257
-{
256
+function freeTeacherList($teacherList, $specialtyId, $platform_user_id)
257
+{
258 258
     global $tableSepeSpecialtyTutors;
259 259
     global $tableSepeTutors;
260 260
     $sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
261 261
     $rs = Database::query($sql);
262
-    if (Database::num_rows($rs) > 0) {
263
-        while ($aux = Database::fetch_assoc($rs)) {
262
+    if (Database::num_rows($rs) > 0) {
263
+        while ($aux = Database::fetch_assoc($rs)) {
264 264
             $sql = "SELECT platform_user_id FROM $tableSepeTutors WHERE id='".$aux['tutor_id']."';";
265 265
             $res = Database::query($sql);
266
-            if (Database::num_rows($res) > 0) {
266
+            if (Database::num_rows($res) > 0) {
267 267
                 $tmp = Database::fetch_assoc($res);
268
-                if ($tmp['platform_user_id'] != 0 && $tmp['platform_user_id'] != $platform_user_id) {
269
-                    foreach ($teacherList as $key => $value) {
270
-                        if ($value['id'] == $tmp['platform_user_id']) {
268
+                if ($tmp['platform_user_id'] != 0 && $tmp['platform_user_id'] != $platform_user_id) {
269
+                    foreach ($teacherList as $key => $value) {
270
+                        if ($value['id'] == $tmp['platform_user_id']) {
271 271
                             unset($teacherList[$key]);
272 272
                             break;
273 273
                         }
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
     return $teacherList;
280 280
 }
281 281
 
282
-function getInfoParticipantAction($participantId)
283
-{
282
+function getInfoParticipantAction($participantId)
283
+{
284 284
     global $tableSepeParticipants;
285 285
     $sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
286 286
     $res = Database::query($sql);
287 287
     $aux = array();
288
-    if (Database::num_rows($res) > 0) {
288
+    if (Database::num_rows($res) > 0) {
289 289
         $row = Database::fetch_assoc($res);
290 290
         $result = [];
291 291
         $result['id'] = $row[''];
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
         $result['key_competence'] = Security::remove_XSS(stripslashes($row['key_competence']));
300 300
         $result['contract_id'] = Security::remove_XSS(stripslashes($row['contract_id']));
301 301
         $result['company_fiscal_number'] = Security::remove_XSS(stripslashes($row['company_fiscal_number']));
302
-    } else {
302
+    } else {
303 303
         $result = false;
304 304
     }
305 305
     return $result;
306 306
 }
307 307
 
308
-function getParticipantId($id)
309
-{
308
+function getParticipantId($id)
309
+{
310 310
     global $tableSepeParticipantsSpecialty;
311 311
     $sql = "SELECT participant_id FROM  $tableSepeParticipantsSpecialty WHERE id = $id";
312 312
     $rs = Database::query($sql);
@@ -314,13 +314,13 @@  discard block
 block discarded – undo
314 314
     return $aux['participant_id'];
315 315
 }
316 316
 
317
-function getInfoSpecialtyParticipant($specialtyId)
318
-{
317
+function getInfoSpecialtyParticipant($specialtyId)
318
+{
319 319
     global $tableSepeParticipantsSpecialty;
320 320
     $sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE id = $specialtyId";
321 321
     $res = Database::query($sql);
322 322
     $aux = array();
323
-    if (Database::num_rows($res) > 0) {
323
+    if (Database::num_rows($res) > 0) {
324 324
         $row = Database::fetch_assoc($res);
325 325
         $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
326 326
         $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
@@ -330,28 +330,28 @@  discard block
 block discarded – undo
330 330
         $row['final_result'] = Security::remove_XSS(stripslashes($row['final_result']));
331 331
         $row['final_qualification'] = Security::remove_XSS(stripslashes($row['final_qualification']));
332 332
         $row['final_score'] = Security::remove_XSS(stripslashes($row['final_score']));
333
-    } else {
333
+    } else {
334 334
         $row = false;
335 335
     }
336 336
     return $row;
337 337
 }
338 338
 
339
-function specialtyList($actionId)
340
-{
339
+function specialtyList($actionId)
340
+{
341 341
     global $tableSepeSpecialty;
342 342
     $sql = "SELECT id, specialty_origin, professional_area, specialty_code
343 343
             FROM $tableSepeSpecialty
344 344
             WHERE action_id = $actionId";
345 345
     $res = Database::query($sql);
346 346
     $aux = array();
347
-    while ($row = Database::fetch_assoc($res)) {
347
+    while ($row = Database::fetch_assoc($res)) {
348 348
         $aux[] = $row;
349 349
     }
350 350
     return $aux;
351 351
 }
352 352
 
353
-function participantList($actionId)
354
-{
353
+function participantList($actionId)
354
+{
355 355
     global $tableSepeParticipants;
356 356
     global $tableUser;
357 357
     $sql = "SELECT $tableSepeParticipants.id AS id, document_type, document_number, document_letter, firstname, lastname
@@ -359,19 +359,19 @@  discard block
 block discarded – undo
359 359
             WHERE action_id = $actionId";
360 360
     $res = Database::query($sql);
361 361
     $aux = array();
362
-    while ($row = Database::fetch_assoc($res)) {
362
+    while ($row = Database::fetch_assoc($res)) {
363 363
         $aux[] = $row;
364 364
     }
365 365
     return $aux;
366 366
 }
367 367
 
368
-function listParticipantSpecialty($participantId)
369
-{
368
+function listParticipantSpecialty($participantId)
369
+{
370 370
     global $tableSepeParticipantsSpecialty;
371 371
     $sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE participant_id = $participantId";
372 372
     $res = Database::query($sql);
373 373
     $aux = array();
374
-    while ($row = Database::fetch_assoc($res)) {
374
+    while ($row = Database::fetch_assoc($res)) {
375 375
         $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
376 376
         $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
377 377
         $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
     return $aux;
386 386
 }
387 387
 
388
-function classroomList($specialtyId)
389
-{
388
+function classroomList($specialtyId)
389
+{
390 390
     global $tableSepeSpecialtyClassroom;
391 391
     global $tableCenters;
392 392
     $sql = "SELECT a.*, center_origin, center_code
@@ -394,14 +394,14 @@  discard block
 block discarded – undo
394 394
             WHERE specialty_id = $specialtyId";
395 395
     $res = Database::query($sql);
396 396
     $aux = array();
397
-    while ($row = Database::fetch_assoc($res)) {
397
+    while ($row = Database::fetch_assoc($res)) {
398 398
         $aux[] = $row;
399 399
     }
400 400
     return $aux;
401 401
 }
402 402
 
403
-function tutorsList($specialtyId)
404
-{
403
+function tutorsList($specialtyId)
404
+{
405 405
     global $tableSepeSpecialtyTutors;
406 406
     global $tableSepeTutors;
407 407
     global $tableUser;
@@ -411,19 +411,19 @@  discard block
 block discarded – undo
411 411
             LEFT JOIN $tableUser c ON b.platform_user_id=c.user_id 
412 412
             WHERE a.specialty_id = $specialtyId";
413 413
     $res = Database::query($sql);
414
-    while ($row = Database::fetch_assoc($res)) {
414
+    while ($row = Database::fetch_assoc($res)) {
415 415
         $aux[] = $row;
416 416
     }
417 417
     return $aux;
418 418
 }
419 419
 
420
-function getListSpecialtyTutorial($specialtyId)
421
-{
420
+function getListSpecialtyTutorial($specialtyId)
421
+{
422 422
     global $tableSepeParticipantsSpecialtyTutorials;
423 423
     $sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE participant_specialty_id = $specialtyId";
424 424
     $res = Database::query($sql);
425 425
     $aux = array();
426
-    while ($row = Database::fetch_assoc($res)) {
426
+    while ($row = Database::fetch_assoc($res)) {
427 427
         $row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
428 428
         $row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
429 429
         $row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
@@ -432,8 +432,8 @@  discard block
 block discarded – undo
432 432
     return $aux;
433 433
 }
434 434
 
435
-function listCourseAction()
436
-{
435
+function listCourseAction()
436
+{
437 437
     global $tableSepeActions;
438 438
     global $tableSepeCourseActions;
439 439
     $sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code 
@@ -442,14 +442,14 @@  discard block
 block discarded – undo
442 442
             AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
443 443
     $res = Database::query($sql);
444 444
     $aux = array();
445
-    while ($row = Database::fetch_assoc($res)) {
445
+    while ($row = Database::fetch_assoc($res)) {
446 446
         $aux[] = $row;
447 447
     }
448 448
     return $aux;
449 449
 }
450 450
 
451
-function listCourseFree()
452
-{
451
+function listCourseFree()
452
+{
453 453
     global $tableCourse;
454 454
     global $tableSepeCourseActions;
455 455
     $sql = "SELECT id, title FROM $tableCourse
@@ -457,14 +457,14 @@  discard block
 block discarded – undo
457 457
                 SELECT * FROM $tableSepeCourseActions WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
458 458
             ;";
459 459
     $res = Database::query($sql);
460
-    while ($row = Database::fetch_assoc($res)) {
460
+    while ($row = Database::fetch_assoc($res)) {
461 461
         $aux[] = $row;
462 462
     }
463 463
     return $aux;
464 464
 }
465 465
 
466
-function listActionFree()
467
-{
466
+function listActionFree()
467
+{
468 468
     global $tableSepeActions;
469 469
     global $tableSepeCourseActions;
470 470
     $sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
             ;";
474 474
     $res = Database::query($sql);
475 475
     $aux = array();
476
-    while ($row = Database::fetch_assoc($res)) {
476
+    while ($row = Database::fetch_assoc($res)) {
477 477
         $row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
478 478
         $row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
479 479
         $aux[] = $row;
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
     return $aux;
482 482
 }
483 483
 
484
-function getSpecialtyTutorId($specialtyId, $tutorId)
485
-{
484
+function getSpecialtyTutorId($specialtyId, $tutorId)
485
+{
486 486
     global $tableSepeSpecialtyTutors;
487 487
     $sql = "SELECT id 
488 488
             FROM $tableSepeSpecialtyTutors 
@@ -492,27 +492,27 @@  discard block
 block discarded – undo
492 492
     return $row['id'];
493 493
 }
494 494
 
495
-function checkInsertNewLog($platformUserId, $actionId)
496
-{
495
+function checkInsertNewLog($platformUserId, $actionId)
496
+{
497 497
     global $tableSepeLogParticipant;
498 498
     $sql = "SELECT * FROM $tableSepeLogParticipant WHERE platform_user_id = $platformUserId AND action_id = $actionId";
499 499
     $res = Database::query($sql);
500
-    if (Database::num_rows($res) > 0) {
500
+    if (Database::num_rows($res) > 0) {
501 501
         return false;
502
-    } else {
502
+    } else {
503 503
         return true;
504 504
     }
505 505
 }
506 506
 
507
-function getUserPlatformFromParticipant($participantId)
508
-{
507
+function getUserPlatformFromParticipant($participantId)
508
+{
509 509
     global $tableSepeParticipants;
510 510
     $sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
511 511
     $res = Database::query($sql);
512 512
     $row = Database::fetch_assoc($res);
513
-    if ($row['platform_user_id'] == 0 || $row['platform_user_id'] == '') {
513
+    if ($row['platform_user_id'] == 0 || $row['platform_user_id'] == '') {
514 514
         return false;
515
-    } else {
515
+    } else {
516 516
         return $row['platform_user_id'];
517 517
     }
518 518
 }
Please login to merge, or discard this patch.
plugin/sepe/src/index.sepe.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 if (api_is_platform_admin() && $enable) {
12 12
     echo '<div class="panel panel-default">';
13 13
         echo '<div class="panel-heading" role="tab">';
14
-           echo '<h4 class="panel-title">'.$title.'</h4>';
14
+            echo '<h4 class="panel-title">'.$title.'</h4>';
15 15
         echo '</div>';
16 16
         echo '<div class="panel-collapse collapse in" role="tabpanel">';
17 17
             echo '<div class="panel-body">';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $enable = $plugin->get('sepe_enable') == 'true';
9 9
 $title = $plugin->get_lang('AdministratorSepe');
10 10
 $pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/';
11
-if (api_is_platform_admin() && $enable) {
11
+if (api_is_platform_admin() && $enable) {
12 12
     echo '<div class="panel panel-default">';
13 13
         echo '<div class="panel-heading" role="tab">';
14 14
            echo '<h4 class="panel-title">'.$title.'</h4>';
Please login to merge, or discard this patch.
plugin/sepe/src/identification-data-edit.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         $id = intval($_POST['id']);
23 23
         
24 24
         if (checkIdentificationData()) {
25
-            $sql = "UPDATE $tableSepeCenter SET 
25
+            $sql = "update $tableSepeCenter SET 
26 26
                         center_origin = '".$centerOrigin."', 
27 27
                         center_code = '".$centerCode."', 
28 28
                         center_name = '".$centerName."', 
Please login to merge, or discard this patch.
Braces   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 require_once '../config.php';
10 10
 $plugin = SepePlugin::create();
11 11
 
12
-if (!empty($_POST)) {
12
+if (!empty($_POST)) {
13 13
     $check = Security::check_token('post');
14
-    if ($check) {
14
+    if ($check) {
15 15
         $centerOrigin = Database::escape_string(trim($_POST['center_origin']));
16 16
         $centerCode = Database::escape_string(trim($_POST['center_code']));
17 17
         $centerName = Database::escape_string(trim($_POST['center_name']));
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $mail = Database::escape_string(trim($_POST['mail']));
22 22
         $id = intval($_POST['id']);
23 23
         
24
-        if (checkIdentificationData()) {
24
+        if (checkIdentificationData()) {
25 25
             $sql = "UPDATE $tableSepeCenter SET 
26 26
                         center_origin = '".$centerOrigin."', 
27 27
                         center_code = '".$centerCode."', 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
                         phone = '".$phone."', 
32 32
                         mail = '".$mail."' 
33 33
                     WHERE id = $id";    
34
-        } else {
34
+        } else {
35 35
             $sql = "INSERT INTO $tableSepeCenter (
36 36
                         id, 
37 37
                         center_origin, 
@@ -53,33 +53,33 @@  discard block
 block discarded – undo
53 53
                     );";
54 54
         }
55 55
         $res = Database::query($sql);
56
-        if (!$res) {
56
+        if (!$res) {
57 57
             $_SESSION['sepe_message_error'] = $plugin->get_lang('NoSaveChange');
58
-        } else {
58
+        } else {
59 59
             $_SESSION['sepe_message_info'] = $plugin->get_lang('SaveChange');
60 60
         }
61 61
         header("Location: identification-data.php");
62
-    } else {
62
+    } else {
63 63
         $_SESSION['sepe_message_error'] = $plugin->get_lang('ProblemToken');
64 64
         Security::clear_token();
65 65
         $token = Security::get_token();
66 66
     }
67
-} else {
67
+} else {
68 68
     $token = Security::get_token();
69 69
 }
70 70
 
71
-if (api_is_platform_admin()) {
71
+if (api_is_platform_admin()) {
72 72
     $interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe'));
73 73
     $interbreadcrumb[] = array("url" => "identification-data.php", "name" => $plugin->get_lang('DataCenter'));
74 74
     $templateName = $plugin->get_lang('DataCenterEdit');
75 75
     $tpl = new Template($templateName);
76 76
     $info = getInfoIdentificationData();
77 77
     $tpl->assign('info', $info);
78
-    if (isset($_SESSION['sepe_message_info'])) {
78
+    if (isset($_SESSION['sepe_message_info'])) {
79 79
         $tpl->assign('message_info', $_SESSION['sepe_message_info']);
80 80
         unset($_SESSION['sepe_message_info']);
81 81
     }
82
-    if (isset($_SESSION['sepe_message_error'])) {
82
+    if (isset($_SESSION['sepe_message_error'])) {
83 83
         $tpl->assign('message_error', $_SESSION['sepe_message_error']);
84 84
         unset($_SESSION['sepe_message_error']);
85 85
     }
@@ -88,6 +88,6 @@  discard block
 block discarded – undo
88 88
     $content = $tpl->fetch($listing_tpl);
89 89
     $tpl->assign('content', $content);
90 90
     $tpl->display_one_col_template();
91
-} else {
91
+} else {
92 92
     header('Location:'.api_get_path(WEB_PATH));
93 93
 }
Please login to merge, or discard this patch.
plugin/sepe/admin.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 $enable = $plugin->get('sepe_enable') == 'true';
6 6
 $pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/sepe-administration-menu.php';
7 7
 
8
-if ($enable && api_is_platform_admin()) {
8
+if ($enable && api_is_platform_admin()) {
9 9
     header('Location:'.$pluginPath);
10
-} else {
10
+} else {
11 11
     header('Location: ../../index.php');
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
main/exercise/admin.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -359,9 +359,10 @@
 block discarded – undo
359 359
 
360 360
 if ($inATest) {
361 361
     echo '<div class="actions">';
362
-    if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
363
-        echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
362
+    if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) {
363
+            echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
364 364
             Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
365
+    }
365 366
 
366 367
     if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
367 368
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'.
Please login to merge, or discard this patch.
main/inc/lib/specific_fields_manager.lib.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 /**
102 102
  * @param array $conditions a list of condition (exemple : status=>STUDENT)
103
- * @param array $order_by a list of fields on which sort
103
+ * @param string[] $order_by a list of fields on which sort
104 104
  * @return array An array with all users of the platform.
105 105
  */
106 106
 function get_specific_field_values_list(
@@ -235,6 +235,7 @@  discard block
 block discarded – undo
235 235
  * @param   string  Course code
236 236
  * @param   string  Tool ID
237 237
  * @param   int     Internal ID used in specific tool table
238
+ * @param string $tool_id
238 239
  */
239 240
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240 241
   $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
@@ -248,6 +249,7 @@  discard block
 block discarded – undo
248 249
  * Defaults to the first letter of the name, otherwise iterate through available
249 250
  * letters
250 251
  * @param   string  Name
252
+ * @param string $name
251 253
  * @return  string  One-letter code, upper-case
252 254
  */
253 255
 function get_specific_field_code_from_name($name) {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,10 +237,10 @@
 block discarded – undo
237 237
  * @param   int     Internal ID used in specific tool table
238 238
  */
239 239
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240
-  $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
-  $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
-  $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
-  Database::query($sql);
240
+    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
+    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
+    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
+    Database::query($sql);
244 244
 }
245 245
 
246 246
 /**
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -106,7 +106,8 @@  discard block
 block discarded – undo
106 106
 function get_specific_field_values_list(
107 107
     $conditions = array(),
108 108
     $order_by = array()
109
-) {
109
+)
110
+{
110 111
     $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
111 112
     $return_array = array();
112 113
     $sql = "SELECT * FROM $table_sfv";
@@ -153,7 +154,8 @@  discard block
 block discarded – undo
153 154
     $course_code,
154 155
     $tool_id,
155 156
     $ref_id
156
-) {
157
+)
158
+{
157 159
     $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
158 160
     $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
159 161
     $sql = 'SELECT sfv.value FROM %s sf LEFT JOIN %s sfv ON sf.id = sfv.field_id'.
@@ -189,7 +191,8 @@  discard block
 block discarded – undo
189 191
     $tool_id,
190 192
     $ref_id,
191 193
     $value
192
-) {
194
+)
195
+{
193 196
     $table_sf_values = Database::get_main_table(
194 197
         TABLE_MAIN_SPECIFIC_FIELD_VALUES
195 198
     );
@@ -222,7 +225,8 @@  discard block
 block discarded – undo
222 225
  * @param string $tool_id tool id, from main.api.lib
223 226
  * @param int $ref_id intern id inside specific tool table
224 227
  */
225
-function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id) {
228
+function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
229
+{
226 230
     $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
227 231
     $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
228 232
     $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);
@@ -236,7 +240,8 @@  discard block
 block discarded – undo
236 240
  * @param   string  Tool ID
237 241
  * @param   int     Internal ID used in specific tool table
238 242
  */
239
-function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
243
+function delete_all_values_for_item($course_id, $tool_id, $ref_id)
244
+{
240 245
   $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241 246
   $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242 247
   $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
@@ -250,7 +255,8 @@  discard block
 block discarded – undo
250 255
  * @param   string  Name
251 256
  * @return  string  One-letter code, upper-case
252 257
  */
253
-function get_specific_field_code_from_name($name) {
258
+function get_specific_field_code_from_name($name)
259
+{
254 260
     // Z is used internally by Xapian
255 261
     // O & C already used by tool_id and course_id
256 262
     $list = array(
Please login to merge, or discard this patch.
plugin/vchamilo/views/editinstance_form.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 
14 14
     /**
15 15
      * ChamiloForm constructor.
16
-     * @param $mode
17
-     * @param $returnurl
18
-     * @param $cancelurl
16
+     * @param string $mode
17
+     * @param string $returnurl
18
+     * @param string $cancelurl
19 19
      * @param $customdata
20 20
      */
21 21
     public function __construct($mode, $returnurl, $cancelurl, $customdata = [])
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      * Check that form data is valid.
138 138
      * You should almost always use this, rather than {@see validate_defined_fields}
139 139
      *
140
-     * @return bool true if form data valid
140
+     * @return boolean|null true if form data valid
141 141
      */
142 142
     public function is_validated()
143 143
     {
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      *                is NOT to validate the form when a no submit button has been pressed.
167 167
      *                pass true here to override this behaviour
168 168
      *
169
-     * @return bool true if form data valid
169
+     * @return boolean|null true if form data valid
170 170
      */
171 171
     public function validate_defined_fields($validateonnosubmit = false)
172 172
     {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@
 block discarded – undo
248 248
         if (is_object($default_values)) {
249 249
             $default_values = (array) $default_values;
250 250
         }
251
-        $filter = $slashed ? 'stripslashes' : NULL;
251
+        $filter = $slashed ? 'stripslashes' : null;
252 252
         $this->_form->setDefaults($default_values, $filter);
253 253
     }
254 254
 
Please login to merge, or discard this patch.