Completed
Push — 1.10.x ( f2aaaf...ef00db )
by Yannick
241:15 queued 197:35
created
main/survey/copy_survey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 // Setting the global file that gets the general configuration, the databases, the languages, ...
8 8
 require_once '../inc/global.inc.php';
9
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
9
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
10 10
 api_protect_course_script(true);
11 11
 
12 12
 // Notice for unauthorized people.
Please login to merge, or discard this patch.
main/survey/preview.php 2 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 
44 44
 // We exit here if there is no valid $_GET parameter
45 45
 if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])){
46
-	Display::display_header(get_lang('SurveyPreview'));
47
-	Display::display_error_message(get_lang('InvallidSurvey'), false);
48
-	Display::display_footer();
49
-	exit;
46
+    Display::display_header(get_lang('SurveyPreview'));
47
+    Display::display_error_message(get_lang('InvallidSurvey'), false);
48
+    Display::display_footer();
49
+    exit;
50 50
 }
51 51
 
52 52
 // Getting the survey information
@@ -54,17 +54,17 @@  discard block
 block discarded – undo
54 54
 $survey_data = SurveyManager::get_survey($survey_id);
55 55
 
56 56
 if (empty($survey_data)) {
57
-	Display::display_header(get_lang('SurveyPreview'));
58
-	Display::display_error_message(get_lang('InvallidSurvey'), false);
59
-	Display::display_footer();
60
-	exit;
57
+    Display::display_header(get_lang('SurveyPreview'));
58
+    Display::display_error_message(get_lang('InvallidSurvey'), false);
59
+    Display::display_footer();
60
+    exit;
61 61
 }
62 62
 
63 63
 $urlname = strip_tags($survey_data['title']);
64 64
 if (api_is_allowed_to_edit()) {
65
-	// Breadcrumbs
66
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php', 'name' => get_lang('SurveyList'));
67
-	$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id, 'name' => $urlname);
65
+    // Breadcrumbs
66
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php', 'name' => get_lang('SurveyList'));
67
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id, 'name' => $urlname);
68 68
 }
69 69
 $courseCode = isset($_GET['cidReq']) ? $_GET['cidReq'] : null;
70 70
 $surveyAnonymous = SurveyManager::get_survey($survey_id, 0, $courseCode);
@@ -92,57 +92,57 @@  discard block
 block discarded – undo
92 92
 $counter_question = 0;
93 93
 // Only a course admin is allowed to preview a survey: you are a course admin
94 94
 if (api_is_course_admin() ||
95
-	(api_is_course_admin() && $_GET['isStudentView'] == 'true') ||
96
-	api_is_allowed_to_session_edit(false, true)
95
+    (api_is_course_admin() && $_GET['isStudentView'] == 'true') ||
96
+    api_is_allowed_to_session_edit(false, true)
97 97
 ) {
98
-	// Survey information
99
-	echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
100
-	echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';
98
+    // Survey information
99
+    echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
100
+    echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';
101 101
 
102
-	// Displaying the survey introduction
103
-	if (!isset($_GET['show'])) {
102
+    // Displaying the survey introduction
103
+    if (!isset($_GET['show'])) {
104 104
         if (!empty($survey_data['survey_introduction'])) {
105 105
             echo '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>';
106 106
         }
107
-		$limit = 0;
108
-	}
107
+        $limit = 0;
108
+    }
109 109
 
110
-	// Displaying the survey thanks message
111
-	if (isset($_POST['finish_survey'])) {
112
-		Display::display_confirmation_message(get_lang('SurveyFinished'));
110
+    // Displaying the survey thanks message
111
+    if (isset($_POST['finish_survey'])) {
112
+        Display::display_confirmation_message(get_lang('SurveyFinished'));
113 113
         echo $survey_data['survey_thanks'];
114
-		Display :: display_footer();
115
-		exit;
116
-	}
114
+        Display :: display_footer();
115
+        exit;
116
+    }
117 117
 
118 118
     $questions = array();
119 119
 
120
-	if (isset($_GET['show'])) {
121
-		// Getting all the questions for this page and add them to a
122
-		// multidimensional array where the first index is the page.
123
-		// as long as there is no pagebreak fount we keep adding questions to the page
124
-		$questions_displayed = array();
125
-		$paged_questions = array();
126
-		$counter = 0;
127
-		$sql = "SELECT * FROM $table_survey_question
120
+    if (isset($_GET['show'])) {
121
+        // Getting all the questions for this page and add them to a
122
+        // multidimensional array where the first index is the page.
123
+        // as long as there is no pagebreak fount we keep adding questions to the page
124
+        $questions_displayed = array();
125
+        $paged_questions = array();
126
+        $counter = 0;
127
+        $sql = "SELECT * FROM $table_survey_question
128 128
 		        WHERE c_id = $course_id AND survey_id = '".intval($survey_id)."'
129 129
 				ORDER BY sort ASC";
130
-		$result = Database::query($sql);
130
+        $result = Database::query($sql);
131 131
         $questions_exists = true;
132 132
         if (Database::num_rows($result)) {
133
-    		while ($row = Database::fetch_array($result)) {
134
-    			if ($row['type'] == 'pagebreak') {
135
-    				$counter++;
136
-    			} else {
137
-    				$paged_questions[$counter][] = $row['question_id'];
138
-    			}
139
-    		}
133
+            while ($row = Database::fetch_array($result)) {
134
+                if ($row['type'] == 'pagebreak') {
135
+                    $counter++;
136
+                } else {
137
+                    $paged_questions[$counter][] = $row['question_id'];
138
+                }
139
+            }
140 140
         } else {
141 141
             $questions_exists = false;
142 142
         }
143 143
 
144
-		if (array_key_exists($_GET['show'], $paged_questions)) {
145
-			$sql = "SELECT
144
+        if (array_key_exists($_GET['show'], $paged_questions)) {
145
+            $sql = "SELECT
146 146
                         survey_question.question_id,
147 147
                         survey_question.survey_id,
148 148
                         survey_question.survey_question,
@@ -164,75 +164,75 @@  discard block
 block discarded – undo
164 164
 						survey_question.c_id =  $course_id
165 165
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
166 166
 
167
-			$result = Database::query($sql);
168
-			$question_counter_max = Database::num_rows($result);
169
-			$limit = 0;
170
-			while ($row = Database::fetch_array($result)) {
171
-				// If the type is not a pagebreak we store it in the $questions array
172
-				if ($row['type'] != 'pagebreak') {
173
-					$questions[$row['sort']]['question_id'] = $row['question_id'];
174
-					$questions[$row['sort']]['survey_id'] = $row['survey_id'];
175
-					$questions[$row['sort']]['survey_question'] = $row['survey_question'];
176
-					$questions[$row['sort']]['display'] = $row['display'];
177
-					$questions[$row['sort']]['type'] = $row['type'];
178
-					$questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text'];
179
-					$questions[$row['sort']]['maximum_score'] = $row['max_value'];
180
-				} else {
181
-					// If the type is a pagebreak we are finished loading the questions for this page
182
-					break;
183
-				}
184
-				$counter_question++;
185
-			}
186
-		}
187
-	}
188
-
189
-	// Selecting the maximum number of pages
190
-	$sql = "SELECT * FROM $table_survey_question
167
+            $result = Database::query($sql);
168
+            $question_counter_max = Database::num_rows($result);
169
+            $limit = 0;
170
+            while ($row = Database::fetch_array($result)) {
171
+                // If the type is not a pagebreak we store it in the $questions array
172
+                if ($row['type'] != 'pagebreak') {
173
+                    $questions[$row['sort']]['question_id'] = $row['question_id'];
174
+                    $questions[$row['sort']]['survey_id'] = $row['survey_id'];
175
+                    $questions[$row['sort']]['survey_question'] = $row['survey_question'];
176
+                    $questions[$row['sort']]['display'] = $row['display'];
177
+                    $questions[$row['sort']]['type'] = $row['type'];
178
+                    $questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text'];
179
+                    $questions[$row['sort']]['maximum_score'] = $row['max_value'];
180
+                } else {
181
+                    // If the type is a pagebreak we are finished loading the questions for this page
182
+                    break;
183
+                }
184
+                $counter_question++;
185
+            }
186
+        }
187
+    }
188
+
189
+    // Selecting the maximum number of pages
190
+    $sql = "SELECT * FROM $table_survey_question
191 191
 	        WHERE
192 192
 	            c_id = $course_id AND
193 193
 	            type='".Database::escape_string('pagebreak')."' AND
194 194
 	            survey_id='".intval($survey_id)."'";
195
-	$result = Database::query($sql);
196
-	$numberofpages = Database::num_rows($result) + 1;
197
-
198
-	// Displaying the form with the questions
199
-	if (isset($_GET['show'])) {
200
-		$show = (int)$_GET['show'] + 1;
201
-	} else {
202
-		$show = 0;
203
-	}
204
-
205
-	$url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show;
206
-	$form = new FormValidator('question', 'post', $url);
207
-
208
-	if (is_array($questions) && count($questions) > 0) {
209
-		foreach ($questions as $key => & $question) {
210
-			$ch_type = 'ch_'.$question['type'];
211
-			/** @var survey_question $display */
212
-			$display = new $ch_type;
213
-			$form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
214
-			$form->addHtml($question['survey_question']);
215
-			$display->render($form, $question);
216
-			$form->addHtml('</div></div>');
217
-		}
218
-	}
219
-
220
-	if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) {
195
+    $result = Database::query($sql);
196
+    $numberofpages = Database::num_rows($result) + 1;
197
+
198
+    // Displaying the form with the questions
199
+    if (isset($_GET['show'])) {
200
+        $show = (int)$_GET['show'] + 1;
201
+    } else {
202
+        $show = 0;
203
+    }
204
+
205
+    $url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show;
206
+    $form = new FormValidator('question', 'post', $url);
207
+
208
+    if (is_array($questions) && count($questions) > 0) {
209
+        foreach ($questions as $key => & $question) {
210
+            $ch_type = 'ch_'.$question['type'];
211
+            /** @var survey_question $display */
212
+            $display = new $ch_type;
213
+            $form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
214
+            $form->addHtml($question['survey_question']);
215
+            $display->render($form, $question);
216
+            $form->addHtml('</div></div>');
217
+        }
218
+    }
219
+
220
+    if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) {
221 221
         if ($show == 0) {
222
-			$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
222
+            $form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
223 223
         } else {
224
-			$form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right');
224
+            $form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right');
225 225
         }
226
-	}
227
-	if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) {
228
-		if ($questions_exists == false) {
229
-			echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
230
-		}
231
-		$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
232
-	}
233
-	$form->display();
226
+    }
227
+    if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) {
228
+        if ($questions_exists == false) {
229
+            echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
230
+        }
231
+        $form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
232
+    }
233
+    $form->display();
234 234
 } else {
235
-	Display :: display_error_message(get_lang('NotAllowed'), false);
235
+    Display :: display_error_message(get_lang('NotAllowed'), false);
236 236
 }
237 237
 
238 238
 // Footer
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // We exit here if there is no valid $_GET parameter
45
-if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])){
45
+if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])) {
46 46
 	Display::display_header(get_lang('SurveyPreview'));
47 47
 	Display::display_error_message(get_lang('InvallidSurvey'), false);
48 48
 	Display::display_footer();
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 						survey_question_option.c_id = $course_id
161 161
 					WHERE
162 162
 					    survey_question.survey_id = '".intval($survey_id)."' AND
163
-						survey_question.question_id IN (".Database::escape_string(implode(',',$paged_questions[$_GET['show']]), null, false).") AND
163
+						survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
164 164
 						survey_question.c_id =  $course_id
165 165
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
166 166
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
 	// Displaying the form with the questions
199 199
 	if (isset($_GET['show'])) {
200
-		$show = (int)$_GET['show'] + 1;
200
+		$show = (int) $_GET['show'] + 1;
201 201
 	} else {
202 202
 		$show = 0;
203 203
 	}
Please login to merge, or discard this patch.
main/survey/ch_score.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
             $options = array(
39 39
                 '--' => '--'
40 40
             );
41
-            for ($i=1; $i <= $questionData['maximum_score']; $i++) {
41
+            for ($i = 1; $i <= $questionData['maximum_score']; $i++) {
42 42
                 $options[$i] = $i;
43 43
             }
44 44
 
Please login to merge, or discard this patch.
main/survey/survey_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     if (api_is_allowed_to_edit()) {
76 76
         SurveyManager::copy_survey($_GET['survey_id']);
77 77
         $message = get_lang('SurveyCopied');
78
-        header('Location: ' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq());
78
+        header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq());
79 79
         exit;
80 80
     }
81 81
 }
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 if (!api_is_course_coach() || $extend_rights_for_coachs == 'true') {
163 163
     // Action links
164 164
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=add">'.
165
-        Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).'</a> ';
165
+        Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'), '', ICON_SIZE_MEDIUM).'</a> ';
166 166
 }
167 167
 echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;search=advanced">'.
168
-    Display::return_icon('search.png', get_lang('Search'),'',ICON_SIZE_MEDIUM).'</a>';
168
+    Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).'</a>';
169 169
 echo '</div>';
170 170
 
171 171
 // Load main content
Please login to merge, or discard this patch.
main/survey/create_new_survey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@
 block discarded – undo
216 216
             foreach ($field_list as $key => & $field) {
217 217
                 if ($field['visibility'] == 1) {
218 218
                     $form->addElement('checkbox', 'profile_'.$key, ' ', '&nbsp;&nbsp;'.$field['name']);
219
-                    $input_name_list.= 'profile_'.$key.',';
219
+                    $input_name_list .= 'profile_'.$key.',';
220 220
                 }
221 221
             }
222 222
 
Please login to merge, or discard this patch.
main/session/session_course_user_list.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 
51 51
 $result = Database::query($sql);
52 52
 if (!list($session_name,$course_title) = Database::fetch_row($result)) {
53
-	header('Location: session_course_list.php?id_session='.$id_session);
54
-	exit();
53
+    header('Location: session_course_list.php?id_session='.$id_session);
54
+    exit();
55 55
 }
56 56
 
57 57
 switch ($action) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a>
123 123
 <?php
124 124
 } else {
125
-	echo get_lang('Previous');
125
+    echo get_lang('Previous');
126 126
 }
127 127
 ?>
128 128
 |
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a>
133 133
 <?php
134 134
 } else {
135
-	echo get_lang('Next');
135
+    echo get_lang('Next');
136 136
 }
137 137
 ?>
138 138
 </div>
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 $i=0;
155 155
 foreach ($users as $key => $enreg) {
156 156
 
157
-	if ($key == $limit) {
158
-		break;
159
-	}
157
+    if ($key == $limit) {
158
+        break;
159
+    }
160 160
     ?>
161 161
     <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
162 162
         <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 $id_session = intval($_GET['id_session']);
19 19
 SessionManager::protectSession($id_session);
20 20
 
21
-if (empty($id_session )) {
21
+if (empty($id_session)) {
22 22
     api_not_allowed();
23 23
 }
24 24
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 
29 29
 $page           = isset($_GET['page']) ? intval($_GET['page']) : null;
30 30
 $action         = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
31
-$default_sort   = api_sort_by_first_name() ? 'firstname':'lastname';
32
-$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort;
31
+$default_sort   = api_sort_by_first_name() ? 'firstname' : 'lastname';
32
+$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname', 'firstname', 'username')) ? $_GET['sort'] : $default_sort;
33 33
 $idChecked      = isset($_GET['idChecked']) && is_array($_GET['idChecked']) ? $_GET['idChecked'] : (isset($_POST['idChecked']) && is_array($_POST['idChecked']) ? $_POST['idChecked'] : null);
34
-$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc','asc')) ? $_GET['direction'] : 'desc';
34
+$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc', 'asc')) ? $_GET['direction'] : 'desc';
35 35
 
36 36
 if (is_array($idChecked)) {
37 37
     $my_temp = array();
38 38
     foreach ($idChecked as $id) {
39 39
         // forcing the intval
40
-        $my_temp[]= intval($id);
40
+        $my_temp[] = intval($id);
41 41
     }
42 42
     $idChecked = $my_temp;
43 43
 }
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 		WHERE src.session_id='$id_session' AND src.c_id='$courseId' ";
50 50
 
51 51
 $result = Database::query($sql);
52
-if (!list($session_name,$course_title) = Database::fetch_row($result)) {
52
+if (!list($session_name, $course_title) = Database::fetch_row($result)) {
53 53
 	header('Location: session_course_list.php?id_session='.$id_session);
54 54
 	exit();
55 55
 }
56 56
 
57 57
 switch ($action) {
58 58
     case 'delete':
59
-        if (is_array($idChecked) && count($idChecked)>0) {
59
+        if (is_array($idChecked) && count($idChecked) > 0) {
60 60
             array_map('intval', $idChecked);
61 61
             $idChecked = implode(',', $idChecked);
62 62
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
          ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = '".$courseId."' )
92 92
          WHERE s.session_id='$id_session'
93 93
          ORDER BY $sort $direction
94
-         LIMIT $from,".($limit+1);
94
+         LIMIT $from,".($limit + 1);
95 95
 
96 96
 if ($direction == 'desc') {
97 97
     $direction = 'asc';
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title;
108 108
 
109 109
 //$interbreadcrumb[] = array("url" => "index.php","name" => get_lang('PlatformAdmin'));
110
-$interbreadcrumb[] = array("url" => "session_list.php","name" => get_lang('SessionList'));
111
-$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
110
+$interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList'));
111
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview'));
112 112
 
113 113
 Display::display_header($tool_name);
114 114
 
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 <form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
118 118
 <div align="right">
119 119
 <?php
120
-if($page) {
120
+if ($page) {
121 121
 ?>
122
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a>
122
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
123 123
 <?php
124 124
 } else {
125 125
 	echo get_lang('Previous');
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 ?>
128 128
 |
129 129
 <?php
130
-if($nbr_results > $limit) {
130
+if ($nbr_results > $limit) {
131 131
 ?>
132
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a>
132
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
133 133
 <?php
134 134
 } else {
135 135
 	echo get_lang('Next');
@@ -141,39 +141,39 @@  discard block
 block discarded – undo
141 141
 <tr>
142 142
   <th>&nbsp;</th>
143 143
   <?php if ($is_western_name_order) { ?>
144
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
145
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
144
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
145
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
146 146
   <?php } else { ?>
147
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
148
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
147
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
148
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
149 149
   <?php } ?>
150
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login');?></a></th>
151
-  <th><?php echo get_lang('Actions');?></th>
150
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login'); ?></a></th>
151
+  <th><?php echo get_lang('Actions'); ?></th>
152 152
 </tr>
153 153
 <?php
154
-$i=0;
154
+$i = 0;
155 155
 foreach ($users as $key => $enreg) {
156 156
 
157 157
 	if ($key == $limit) {
158 158
 		break;
159 159
 	}
160 160
     ?>
161
-    <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
161
+    <tr class="<?php echo $i ? 'row_odd' : 'row_even'; ?>">
162 162
         <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
163 163
         <?php if ($is_western_name_order) { ?>
164
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
165
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
164
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
165
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
166 166
         <?php } else { ?>
167
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
168
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
167
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
168
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
169 169
         <?php } ?>
170
-        <td><?php echo api_htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td>
170
+        <td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES, $charset); ?></td>
171 171
         <td>
172 172
         <?php if ($enreg['is_subscribed']) { ?>
173 173
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=delete&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
174 174
                 <?php Display::display_icon('delete.png', get_lang('Delete')); ?>
175 175
             </a>
176
-        <?php } else  { ?>
176
+        <?php } else { ?>
177 177
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=add&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
178 178
                 <?php Display::display_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL); ?>
179 179
             </a>
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         </td>
183 183
     </tr>
184 184
     <?php
185
-        $i=$i ? 0 : 1;
185
+        $i = $i ? 0 : 1;
186 186
 }
187 187
 unset($users);
188 188
 ?>
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 <br />
191 191
 <div align="left">
192 192
     <?php
193
-    if($page) {
193
+    if ($page) {
194 194
     ?>
195
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
195
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
196 196
     <?php
197 197
     } else {
198 198
         echo get_lang('Previous');
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
     ?>
201 201
     |
202 202
     <?php
203
-    if($nbr_results > $limit) {
203
+    if ($nbr_results > $limit) {
204 204
     ?>
205
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
205
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
206 206
     <?php
207 207
     } else {
208 208
         echo get_lang('Next');
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 </div>
212 212
 <br />
213 213
 <select name="action">
214
-<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession');?></option>
215
-<option value="add"><?php echo get_lang('AddUsers');?></option>
214
+<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession'); ?></option>
215
+<option value="add"><?php echo get_lang('AddUsers'); ?></option>
216 216
 </select>
217 217
 <button class="save" type="submit"> <?php echo get_lang('Ok'); ?></button>
218 218
 </form>
Please login to merge, or discard this patch.
main/session/session_course_user.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 SessionManager::protectSession($id_session);
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
19
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
20 20
 $interbreadcrumb[] = array(
21 21
     'url' => 'resume_session.php?id_session='.$id_session,
22 22
     'name' => get_lang('SessionOverview'),
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).'
44 44
             WHERE id='.$id_session;
45 45
     $rs = Database::query($sql);
46
-    if (Database::result($rs,0,0)!=$_user['user_id']) {
46
+    if (Database::result($rs, 0, 0) != $_user['user_id']) {
47 47
         api_not_allowed(true);
48 48
     }
49 49
 }
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
 
89 89
     foreach ($CourseList as $enreg_course) {
90 90
         $exists = false;
91
-        foreach($existingCourses as $existingCourse) {
91
+        foreach ($existingCourses as $existingCourse) {
92 92
             if ($enreg_course == $existingCourse['id']) {
93
-                $exists=true;
93
+                $exists = true;
94 94
             }
95 95
         }
96 96
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     }
111 111
 
112 112
     foreach ($existingCourses as $existingCourse) {
113
-        if (!in_array($existingCourse['id'], $CourseList)){
113
+        if (!in_array($existingCourse['id'], $CourseList)) {
114 114
             $existingCourse = Database::escape_string($existingCourse['id']);
115 115
             $sql = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user (session_id,c_id,user_id)
116 116
                     VALUES ('$id_session','$existingCourse','$id_user')";
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         WHERE srcru.user_id = $id_user AND session_id = $id_session";
147 147
 
148 148
 //all
149
-$sql_all="SELECT course.id, code, title, visual_code, src.session_id
149
+$sql_all = "SELECT course.id, code, title, visual_code, src.session_id
150 150
         FROM $tbl_course course
151 151
         INNER JOIN $tbl_session_rel_course  as src
152 152
         ON course.id = src.c_id AND session_id = $id_session";
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 
164 164
 foreach ($CoursesAll as $course) {
165 165
     if (in_array($course['id'], $course_temp)) {
166
-        $nosessionCourses[$course['id']] = $course ;
166
+        $nosessionCourses[$course['id']] = $course;
167 167
     } else {
168
-        $sessionCourses[$course['id']] = $course ;
168
+        $sessionCourses[$course['id']] = $course;
169 169
     }
170 170
 }
171 171
 unset($Courses);
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
             <td width="45%" align="center">
185 185
                 <div id="ajax_list_courses_multiple">
186 186
                     <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> <?php
187
-                        foreach($nosessionCourses as $enreg) {
187
+                        foreach ($nosessionCourses as $enreg) {
188 188
                             ?>
189
-                            <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
189
+                            <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES).'"'; if (in_array($enreg['code'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
190 190
                         <?php
191 191
                         }
192 192
                         ?> </select></div> <?php
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
             <td width="45%" align="center">
212 212
                 <select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" style="width:320px;">
213 213
             <?php
214
-            foreach($sessionCourses as $enreg) {
214
+            foreach ($sessionCourses as $enreg) {
215 215
                 ?>
216
-                <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
216
+                <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES); ?>"><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
217 217
             <?php
218 218
             }
219 219
             unset($sessionCourses);
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -186,7 +186,10 @@
 block discarded – undo
186 186
                     <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> <?php
187 187
                         foreach($nosessionCourses as $enreg) {
188 188
                             ?>
189
-                            <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
189
+                            <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) {
190
+    echo 'selected="selected"';
191
+}
192
+?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
190 193
                         <?php
191 194
                         }
192 195
                         ?> </select></div> <?php
Please login to merge, or discard this patch.
main/session/session_course_list.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -30,26 +30,26 @@  discard block
 block discarded – undo
30 30
 $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'");
31 31
 
32 32
 if (!list($session_name)=Database::fetch_row($result)) {
33
-	header('Location: session_list.php');
34
-	exit;
33
+    header('Location: session_list.php');
34
+    exit;
35 35
 }
36 36
 
37 37
 if ($action == 'delete') {
38
-	$idChecked = $_REQUEST['idChecked'];
39
-	if (is_array($idChecked) && count($idChecked)>0) {
40
-		$my_temp = array();
41
-		foreach ($idChecked as $id){
42
-			$my_temp[]= Database::escape_string($id);// forcing the escape_string
43
-		}
44
-		$idChecked = $my_temp;
45
-		$idChecked="'".implode("','", $idChecked)."'";
46
-		$result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)");
47
-		$nbr_affected_rows=Database::affected_rows($result);
48
-		Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)");
49
-		Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'");
50
-	}
51
-	header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort);
52
-	exit();
38
+    $idChecked = $_REQUEST['idChecked'];
39
+    if (is_array($idChecked) && count($idChecked)>0) {
40
+        $my_temp = array();
41
+        foreach ($idChecked as $id){
42
+            $my_temp[]= Database::escape_string($id);// forcing the escape_string
43
+        }
44
+        $idChecked = $my_temp;
45
+        $idChecked="'".implode("','", $idChecked)."'";
46
+        $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)");
47
+        $nbr_affected_rows=Database::affected_rows($result);
48
+        Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)");
49
+        Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'");
50
+    }
51
+    header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort);
52
+    exit();
53 53
 }
54 54
 
55 55
 $limit  = 20;
@@ -82,17 +82,17 @@  discard block
 block discarded – undo
82 82
 $tableCourses = array();
83 83
 
84 84
 foreach ($Courses as $key=>$enreg) {
85
-	$course = array();
86
-	$course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
87
-	$course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
88
-	$course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
89
-	$course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
90
-		Display::return_icon('course_home.gif', get_lang('Course')).'</a>
85
+    $course = array();
86
+    $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
87
+    $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
88
+    $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
89
+    $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
90
+        Display::return_icon('course_home.gif', get_lang('Course')).'</a>
91 91
 			<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.
92
-		Display::return_icon('edit.png', get_lang('Edit')).'</a>
92
+        Display::return_icon('edit.png', get_lang('Edit')).'</a>
93 93
 			<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.
94
-		Display::return_icon('delete.png', get_lang('Delete')).'</a>';
95
-	$tableCourses[] = $course;
94
+        Display::return_icon('delete.png', get_lang('Delete')).'</a>';
95
+    $tableCourses[] = $course;
96 96
 }
97 97
 echo '<form method="post" action="'.api_get_self().'">';
98 98
 Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ());
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 require_once '../inc/global.inc.php';
9 9
 
10 10
 // setting the section (for the tabs)
11
-$this_section=SECTION_PLATFORM_ADMIN;
11
+$this_section = SECTION_PLATFORM_ADMIN;
12 12
 
13 13
 $id_session = intval($_GET['id_session']);
14 14
 SessionManager::protectSession($id_session);
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 // Database Table Definitions
17 17
 $tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
18 18
 $tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
19
-$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
20
-$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
19
+$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
20
+$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
21 21
 
22 22
 if (empty($id_session)) {
23 23
     api_not_allowed();
@@ -25,26 +25,26 @@  discard block
 block discarded – undo
25 25
 
26 26
 $page   = intval($_GET['page']);
27 27
 $action = $_REQUEST['action'];
28
-$sort   = in_array($_GET['sort'],array('title','nbr_users'))?$_GET['sort']:'title';
28
+$sort   = in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title';
29 29
 
30 30
 $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'");
31 31
 
32
-if (!list($session_name)=Database::fetch_row($result)) {
32
+if (!list($session_name) = Database::fetch_row($result)) {
33 33
 	header('Location: session_list.php');
34 34
 	exit;
35 35
 }
36 36
 
37 37
 if ($action == 'delete') {
38 38
 	$idChecked = $_REQUEST['idChecked'];
39
-	if (is_array($idChecked) && count($idChecked)>0) {
39
+	if (is_array($idChecked) && count($idChecked) > 0) {
40 40
 		$my_temp = array();
41
-		foreach ($idChecked as $id){
42
-			$my_temp[]= Database::escape_string($id);// forcing the escape_string
41
+		foreach ($idChecked as $id) {
42
+			$my_temp[] = Database::escape_string($id); // forcing the escape_string
43 43
 		}
44 44
 		$idChecked = $my_temp;
45
-		$idChecked="'".implode("','", $idChecked)."'";
45
+		$idChecked = "'".implode("','", $idChecked)."'";
46 46
 		$result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)");
47
-		$nbr_affected_rows=Database::affected_rows($result);
47
+		$nbr_affected_rows = Database::affected_rows($result);
48 48
 		Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)");
49 49
 		Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'");
50 50
 	}
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 		FROM $tbl_session_rel_course, $tbl_course c
60 60
 		WHERE c_id = c.id AND session_id='$id_session'
61 61
 		ORDER BY $sort
62
-		LIMIT $from,".($limit+1);
63
-$result=Database::query($sql);
64
-$Courses=Database::store_result($result);
65
-$tool_name = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
62
+		LIMIT $from,".($limit + 1);
63
+$result = Database::query($sql);
64
+$Courses = Database::store_result($result);
65
+$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession');
66 66
 
67 67
 //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
68
-$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList'));
69
-$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview'));
68
+$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList'));
69
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('SessionOverview'));
70 70
 
71 71
 Display::display_header($tool_name);
72 72
 echo Display::page_header($tool_name);
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
 foreach ($Courses as $key=>$enreg) {
85 85
 	$course = array();
86 86
 	$course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
87
-	$course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
87
+	$course[] = api_htmlentities($enreg['title'], ENT_QUOTES, $charset);
88 88
 	$course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
89 89
 	$course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
90 90
 		Display::return_icon('course_home.gif', get_lang('Course')).'</a>
91 91
 			<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.
92 92
 		Display::return_icon('edit.png', get_lang('Edit')).'</a>
93
-			<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.
93
+			<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset)).'\')) return false;">'.
94 94
 		Display::return_icon('delete.png', get_lang('Delete')).'</a>';
95 95
 	$tableCourses[] = $course;
96 96
 }
97 97
 echo '<form method="post" action="'.api_get_self().'">';
98
-Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ());
98
+Display :: display_sortable_table($tableHeader, $tableCourses, array(), array());
99 99
 echo '<select name="action">
100 100
 	<option value="delete">'.get_lang('UnsubscribeCoursesFromSession').'</option>
101 101
 	</select>
Please login to merge, or discard this patch.
main/session/session_category_list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 //$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('PlatformAdmin'));
46
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
46
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
47 47
 
48 48
 if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
49 49
     $interbreadcrumb[] = array("url" => 'session_category_list.php', "name" => get_lang('ListSessionCategory'));
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $where .= " AND access_url_id = ".api_get_current_access_url_id()." ";
77 77
     }
78 78
 
79
-    $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
79
+    $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
80 80
     $query = "SELECT sc.*, (
81 81
                 SELECT count(id) FROM $tbl_session s
82 82
                 INNER JOIN $table_access_url_rel_session us
Please login to merge, or discard this patch.