Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
plugin/buycourses/src/paymentsetup.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             Display::return_message(get_lang('ItemRemoved'), 'success')
29 29
         );
30 30
 
31
-        header('Location: ' . api_get_self());
31
+        header('Location: '.api_get_self());
32 32
         exit;
33 33
     }
34 34
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         Display::return_message(get_lang('Saved'), 'success')
47 47
     );
48 48
 
49
-    header('Location:' . api_get_self());
49
+    header('Location:'.api_get_self());
50 50
     exit;
51 51
 }
52 52
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     }
79 79
 }
80 80
 
81
-$currencyForm->addTextarea('terms_and_conditions', [ get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce') ], '');
81
+$currencyForm->addTextarea('terms_and_conditions', [get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce')], '');
82 82
 $currencyForm->addButtonSave(get_lang('Save'));
83 83
 $currencyForm->setDefaults($plugin->getGlobalParameters());
84 84
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         Display::return_message(get_lang('Saved'), 'success')
96 96
     );
97 97
 
98
-    header('Location:' . api_get_self());
98
+    header('Location:'.api_get_self());
99 99
     exit;
100 100
 }
101 101
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         Display::return_message(get_lang('Saved'), 'success')
135 135
     );
136 136
 
137
-    header('Location:' . api_get_self());
137
+    header('Location:'.api_get_self());
138 138
     exit;
139 139
 }
140 140
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         Display::return_message(get_lang('Saved'), 'success')
161 161
     );
162 162
 
163
-    header('Location:' . api_get_self());
163
+    header('Location:'.api_get_self());
164 164
     exit;
165 165
 }
166 166
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         Display::return_message(get_lang('Saved'), 'success')
200 200
     );
201 201
 
202
-    header('Location:' . api_get_self());
202
+    header('Location:'.api_get_self());
203 203
     exit;
204 204
 }
205 205
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
 // breadcrumbs
223 223
 $interbreadcrumb[] = [
224
-    'url' => api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php',
224
+    'url' => api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php',
225 225
     'name' => $plugin->get_lang('plugin_title')
226 226
 ];
227 227
 
Please login to merge, or discard this patch.
plugin/buycourses/src/process_confirm.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
             $sale['price'],
49 49
             $currency['iso_code'],
50 50
             'paypal',
51
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/success.php',
52
-            api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/error.php',
51
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/success.php',
52
+            api_get_path(WEB_PLUGIN_PATH).'buycourses/src/error.php',
53 53
             $extra
54 54
         );
55 55
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
                 unset($_SESSION['bc_sale_id']);
96 96
 
97
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
97
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
98 98
                 exit;
99 99
             }
100 100
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             );
132 132
 
133 133
             unset($_SESSION['bc_sale_id']);
134
-            header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/course_catalog.php');
134
+            header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/course_catalog.php');
135 135
             exit;
136 136
         }
137 137
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                     )
204 204
                 );
205 205
 
206
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
206
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
207 207
                 exit;
208 208
             }
209 209
         }
Please login to merge, or discard this patch.
plugin/buycourses/src/service_process_confirm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
         // purchase-specific fields are ignored. This little condition handle this fact.
43 43
         $itemPrice = $serviceSale['price'];
44 44
 
45
-        $returnUrl = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_success.php';
46
-        $cancelUrl = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_error.php';
45
+        $returnUrl = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_success.php';
46
+        $cancelUrl = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_error.php';
47 47
 
48 48
         // The extra params for handle the hard job, this var is VERY IMPORTANT !!
49 49
         $extra = '';
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
             $plugin->cancelServiceSale(intval($serviceSale['id']));
77 77
 
78
-            header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
78
+            header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
79 79
             exit;
80 80
         }
81 81
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 Display::addFlash(
113 113
                     Display::return_message($plugin->get_lang('OrderCancelled'), 'error', false)
114 114
                 );
115
-                header('Location: '. api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
115
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
116 116
                 exit;
117 117
             }
118 118
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             );
152 152
 
153 153
             unset($_SESSION['bc_service_sale_id']);
154
-            header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
154
+            header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
155 155
             exit;
156 156
         }
157 157
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                     )
202 202
                 );
203 203
 
204
-                header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
204
+                header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
205 205
                 exit;
206 206
             }
207 207
         }
Please login to merge, or discard this patch.
plugin/buycourses/src/buy_course_plugin.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             return false;
111 111
         }
112 112
 
113
-        require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php';
113
+        require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php';
114 114
     }
115 115
 
116 116
     /**
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
             $item = $this->getItemByProduct(intval($productId), $productType);
159 159
             $return['html'] = '<div class="buycourses-price">';
160 160
             if ($item) {
161
-                $return['html'] .= '<span class="label label-primary"><b>'. $item['iso_code'] .' ' . $item['price'] . '</b></span>';
161
+                $return['html'] .= '<span class="label label-primary"><b>'.$item['iso_code'].' '.$item['price'].'</b></span>';
162 162
                 $return['verificator'] = true;
163 163
             } else {
164
-                $return['html'] .= '<span class="label label-primary"><b>'. $this->get_lang('Free'). '</b></span>';
164
+                $return['html'] .= '<span class="label label-primary"><b>'.$this->get_lang('Free').'</b></span>';
165 165
                 $return['verificator'] = false;
166 166
             }
167 167
             $return['html'] .= '</div>';
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
      * @return string $html
180 180
      */
181 181
     public function returnBuyCourseButton($productId, $productType) {
182
-        $url = api_get_path(WEB_PLUGIN_PATH) .
183
-            'buycourses/src/process.php?i=' .
184
-            intval($productId) .
185
-            '&t=' .
182
+        $url = api_get_path(WEB_PLUGIN_PATH).
183
+            'buycourses/src/process.php?i='.
184
+            intval($productId).
185
+            '&t='.
186 186
             $productType
187 187
         ;
188 188
 
189
-        $html = ' <a class="btn btn-success btn-sm" title="' . $this->get_lang('Buy') . '" href="' . $url . '">' .
190
-            Display::returnFontAwesomeIcon('fa fa-shopping-cart') . '</a>';
189
+        $html = ' <a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
190
+            Display::returnFontAwesomeIcon('fa fa-shopping-cart').'</a>';
191 191
 
192 192
         return $html;
193 193
     }
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
         );
734 734
 
735 735
         if (!empty($sessionImage)) {
736
-            $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value'];
736
+            $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value'];
737 737
         }
738 738
 
739 739
         $sessionCourses = $session->getCourses();
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
         $str = '';
1191 1191
 
1192
-        srand((double)microtime() * 1000000);
1192
+        srand((double) microtime() * 1000000);
1193 1193
 
1194 1194
         for ($i = 0; $i < $length; $i++) {
1195 1195
             $numbers = rand(0, strlen($salt) - 1);
@@ -1536,8 +1536,8 @@  discard block
 block discarded – undo
1536 1536
      */
1537 1537
     public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false)
1538 1538
     {
1539
-        $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : '';
1540
-        $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : '';
1539
+        $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : '';
1540
+        $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : '';
1541 1541
         $typeResult = ($condition) ? 'first' : 'all';
1542 1542
         $payoutsTable = Database::get_main_table(BuyCoursesPlugin::TABLE_PAYPAL_PAYOUTS);
1543 1543
         $saleTable = Database::get_main_table(BuyCoursesPlugin::TABLE_SALE);
@@ -1564,14 +1564,14 @@  discard block
 block discarded – undo
1564 1564
             INNER JOIN $saleTable s ON s.id = p.sale_id
1565 1565
             INNER JOIN $currencyTable c ON s.currency_id = c.id
1566 1566
             LEFT JOIN  $extraFieldValues efv ON p.user_id = efv.item_id 
1567
-            AND field_id = " . intval($paypalExtraField['id']) . "
1567
+            AND field_id = ".intval($paypalExtraField['id'])."
1568 1568
         ";
1569 1569
 
1570 1570
         $payouts = Database::select(
1571 1571
             "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code",
1572 1572
             "$payoutsTable p $innerJoins",
1573 1573
             [
1574
-                'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status]
1574
+                'where' => ['p.status = ? '.$condition.' '.$condition2 => $status]
1575 1575
             ],
1576 1576
             $typeResult
1577 1577
         );
@@ -1635,7 +1635,7 @@  discard block
 block discarded – undo
1635 1635
         $platformCommission = $this->getPlatformCommission();
1636 1636
 
1637 1637
         $sale = $this->getSale($saleId);
1638
-        $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2);
1638
+        $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2);
1639 1639
 
1640 1640
 
1641 1641
         $beneficiaries = $this->getBeneficiariesBySale($saleId);
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
                     'payout_date' => getdate(),
1648 1648
                     'sale_id' => intval($saleId),
1649 1649
                     'user_id' => $beneficiary['user_id'],
1650
-                    'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2),
1650
+                    'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2),
1651 1651
                     'status' => self::PAYOUT_STATUS_PENDING
1652 1652
                 ]
1653 1653
             );
@@ -2229,17 +2229,17 @@  discard block
 block discarded – undo
2229 2229
      */
2230 2230
     public function getPath($var)
2231 2231
     {
2232
-        $pluginPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/';
2232
+        $pluginPath = api_get_path(WEB_PLUGIN_PATH).'buycourses/';
2233 2233
         $paths = [
2234
-            'SERVICE_IMAGES' => $pluginPath . 'uploads/services/images/',
2235
-            'SRC' => $pluginPath . 'src/',
2236
-            'VIEW' => $pluginPath . 'view/',
2237
-            'UPLOADS' => $pluginPath . 'uploads/',
2238
-            'LANGUAGES' => $pluginPath . 'lang/',
2239
-            'RESOURCES' => $pluginPath . 'resources/',
2240
-            'RESOURCES_IMG' => $pluginPath . 'resources/img/',
2241
-            'RESOURCES_CSS' => $pluginPath . 'resources/css/',
2242
-            'RESOURCES_JS' => $pluginPath . 'resources/js/',
2234
+            'SERVICE_IMAGES' => $pluginPath.'uploads/services/images/',
2235
+            'SRC' => $pluginPath.'src/',
2236
+            'VIEW' => $pluginPath.'view/',
2237
+            'UPLOADS' => $pluginPath.'uploads/',
2238
+            'LANGUAGES' => $pluginPath.'lang/',
2239
+            'RESOURCES' => $pluginPath.'resources/',
2240
+            'RESOURCES_IMG' => $pluginPath.'resources/img/',
2241
+            'RESOURCES_CSS' => $pluginPath.'resources/css/',
2242
+            'RESOURCES_JS' => $pluginPath.'resources/js/',
2243 2243
         ];
2244 2244
 
2245 2245
         return $paths[$var];
Please login to merge, or discard this patch.
plugin/buycourses/src/buycourses.ajax.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@  discard block
 block discarded – undo
58 58
 
59 59
         $userInfo = api_get_user_info($sale['user_id']);
60 60
 
61
-        $html = '<h2>' . $sale['product_name'] .'</h2>';
61
+        $html = '<h2>'.$sale['product_name'].'</h2>';
62 62
         $html .= '<div class="row">';
63 63
         $html .= '<div class="col-sm-6 col-md-6">';
64 64
         $html .= '<ul>';
65
-        $html .= '<li><b>'. $plugin->get_lang('OrderPrice') . ':</b> '. $sale['price'] . '</li>';
66
-        $html .= '<li><b>'. $plugin->get_lang('CurrencyType') . ':</b> '. $currency['iso_code'] . '</li>';
67
-        $html .= '<li><b>'. $plugin->get_lang('ProductType') . ':</b> '. $productType . '</li>';
68
-        $html .= '<li><b>'. $plugin->get_lang('OrderDate') . ':</b> '. api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H) . '</li>';
69
-        $html .= '<li><b>'. $plugin->get_lang('Buyer') . ':</b> '. $userInfo['complete_name'] . '</li>';
70
-        $html .= '<li><b>'. $plugin->get_lang('PaymentMethods') . ':</b> '. $paymentType . '</li>';
65
+        $html .= '<li><b>'.$plugin->get_lang('OrderPrice').':</b> '.$sale['price'].'</li>';
66
+        $html .= '<li><b>'.$plugin->get_lang('CurrencyType').':</b> '.$currency['iso_code'].'</li>';
67
+        $html .= '<li><b>'.$plugin->get_lang('ProductType').':</b> '.$productType.'</li>';
68
+        $html .= '<li><b>'.$plugin->get_lang('OrderDate').':</b> '.api_format_date($sale['date'], DATE_TIME_FORMAT_LONG_24H).'</li>';
69
+        $html .= '<li><b>'.$plugin->get_lang('Buyer').':</b> '.$userInfo['complete_name'].'</li>';
70
+        $html .= '<li><b>'.$plugin->get_lang('PaymentMethods').':</b> '.$paymentType.'</li>';
71 71
         $html .= '</ul>';
72 72
         $html .= '</div>';
73 73
         $html .= '<div class="col-sm-6 col-md-6">';
74
-        $html .= '<img class="thumbnail" src="'. $productImage .'" >';
74
+        $html .= '<img class="thumbnail" src="'.$productImage.'" >';
75 75
         $html .= '</div>';
76 76
         $html .= '</div>';
77 77
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
         $html = '<div class="row">'
120 120
         . '<p>'
121 121
             . '<ul>'
122
-                . '<li>'. get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin") .' <b>'. $stats['completed_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['completed_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
123
-                . '<li>'. get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin") .' <b>'. $stats['pending_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['pending_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
124
-                . '<li>'. get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin") .' <b>'. $stats['canceled_count'] .'</b> - '. get_plugin_lang("TotalAmount", "BuyCoursesPlugin") .' <b>'. $stats['canceled_total_amount'] .' '. $currency['iso_code'] . '</b></li>'
122
+                . '<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b></li>'
123
+                . '<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b></li>'
124
+                . '<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b></li>'
125 125
             . '</ul>'
126 126
         . '</p>';
127 127
         $html .= '</div>';
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 
162 162
         $isoCode = $currentCurrency['iso_code'];
163 163
 
164
-        $html .= '<p>'. get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin") .'</p>';
164
+        $html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
165 165
         $html .= ''
166 166
         . '<p>'
167 167
             . '<ul>'
168
-                . '<li>'. get_plugin_lang("TotalAcounts", "BuyCoursesPlugin") .' <b>'. $totalAccounts .'</b></li>'
169
-                . '<li>'. get_plugin_lang("TotalPayout", "BuyCoursesPlugin") .' <b>'. $isoCode .' '. $totalPayout .'</b></li>'
168
+                . '<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
169
+                . '<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
170 170
             . '</ul>'
171 171
         . '</p>';
172
-        $html .= '<p>'. get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin") .'</p>';
172
+        $html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
173 173
         $html .= '<br /><br />';
174 174
         $html .= '<div id="spinner" class="text-center"></div>';
175 175
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
         } else {
225 225
 
226
-            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
226
+            echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'.$result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
227 227
 
228 228
         }
229 229
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
             echo json_encode($cargo);
314 314
 
315
-        } catch(Exception $e) {
315
+        } catch (Exception $e) {
316 316
 
317 317
             $cargo = json_decode($e->getMessage(), true);
318 318
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 
412 412
             echo json_encode($cargo);
413 413
 
414
-        } catch(Exception $e) {
414
+        } catch (Exception $e) {
415 415
 
416 416
             $cargo = json_decode($e->getMessage(), true);
417 417
 
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
             break;
452 452
         }
453 453
 
454
-        $ajaxCallFile = $plugin->getPath('SRC') . 'buycourses.ajax.php';
454
+        $ajaxCallFile = $plugin->getPath('SRC').'buycourses.ajax.php';
455 455
 
456
-        $serviceImg = $plugin->getPath('SERVICE_IMAGES') . $serviceSale['service']['image'];
456
+        $serviceImg = $plugin->getPath('SERVICE_IMAGES').$serviceSale['service']['image'];
457 457
         $html = "<img class='img-responsive text-center' src='$serviceImg'>";
458 458
         $html .= "<br />";
459 459
         $html .= "<legend>{$plugin->get_lang('ServiceInformation')}</legend>";
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         }
474 474
         $html .= "<li><b>{$plugin->get_lang('AppliesTo')}:</b> $nodeType</li> ";
475 475
         $html .= "<li><b>{$plugin->get_lang('Price')}:</b> {$serviceSale['service']['price']} {$serviceSale['currency']}</li> ";
476
-        $duration = $serviceSale['service']['duration_days'] . ' ' . $plugin->get_lang('Days');
476
+        $duration = $serviceSale['service']['duration_days'].' '.$plugin->get_lang('Days');
477 477
         $html .= "</ul>";
478 478
         $html .= "<legend>{$plugin->get_lang('SaleInfo')}</legend>";
479 479
         $html .= "<ul>";
@@ -555,10 +555,10 @@  discard block
 block discarded – undo
555 555
                 'success'
556 556
             );
557 557
         } else {
558
-            $html .= Display::return_message('Error - ' . $plugin->get_lang('ErrorContactPlatformAdmin'), 'error');
558
+            $html .= Display::return_message('Error - '.$plugin->get_lang('ErrorContactPlatformAdmin'), 'error');
559 559
         }
560 560
 
561
-        $html .= "<a id='finish-button' class='btn btn-primary'>" . $plugin->get_lang('ClickHereToFinish') . "</a>";
561
+        $html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>";
562 562
         $html .= "</div>";
563 563
         $html .= "<script>";
564 564
         $html .= "$('#finish-button').click(function() {";
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
                 'warning'
585 585
             );
586 586
         } else {
587
-            $html .= Display::return_message('Error - ' . $plugin->get_lang('ErrorContactPlatformAdmin'), 'error');
587
+            $html .= Display::return_message('Error - '.$plugin->get_lang('ErrorContactPlatformAdmin'), 'error');
588 588
         }
589 589
 
590
-        $html .= "<a id='finish-button' class='btn btn-primary'>" . $plugin->get_lang('ClickHereToFinish') . "</a>";
590
+        $html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>";
591 591
         $html .= "</div>";
592 592
         $html .= "<script>";
593 593
         $html .= "$('#finish-button').click(function() {";
Please login to merge, or discard this patch.
main/inc/lib/agenda.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3151,12 +3151,12 @@
 block discarded – undo
3151 3151
                     $end->format('e')
3152 3152
                 );
3153 3153
                 $title = api_convert_encoding(
3154
-                    (string)$event->summary,
3154
+                    (string) $event->summary,
3155 3155
                     $charset,
3156 3156
                     'UTF-8'
3157 3157
                 );
3158 3158
                 $description = api_convert_encoding(
3159
-                    (string)$event->description,
3159
+                    (string) $event->description,
3160 3160
                     $charset,
3161 3161
                     'UTF-8'
3162 3162
                 );
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
         $accessUrlId = api_get_current_access_url_id();
74 74
         $customLogoPath = "themes/$theme/images/header-logo-custom$accessUrlId.png";
75 75
 
76
-        if (file_exists(api_get_path(SYS_PUBLIC_PATH) . "css/$customLogoPath")) {
77
-            return api_get_path(WEB_CSS_PATH) . $customLogoPath;
76
+        if (file_exists(api_get_path(SYS_PUBLIC_PATH)."css/$customLogoPath")) {
77
+            return api_get_path(WEB_CSS_PATH).$customLogoPath;
78 78
         }
79 79
 
80 80
         $originalLogoPath = "themes/$theme/images/header-logo.png";
81 81
 
82
-        if (file_exists(api_get_path(SYS_CSS_PATH) . $originalLogoPath)) {
83
-            return api_get_path(WEB_CSS_PATH) . $originalLogoPath;
82
+        if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPath)) {
83
+            return api_get_path(WEB_CSS_PATH).$originalLogoPath;
84 84
         }
85 85
 
86 86
         return null;
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
         $siteName = api_get_setting('siteName');
101 101
 
102 102
         if ($logoPath === null) {
103
-            $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH) . 'index.php');
103
+            $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH).'index.php');
104 104
 
105 105
             if (!empty($institutionUrl) && !empty($institution)) {
106
-                $headerLogo .= ' - ' . \Display::url($institution, $institutionUrl);
106
+                $headerLogo .= ' - '.\Display::url($institution, $institutionUrl);
107 107
             }
108 108
 
109 109
             $courseInfo = api_get_course_info();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         $image = \Display::img($logoPath, $institution, $imageAttributes);
129 129
 
130
-        return \Display::url($image, api_get_path(WEB_PATH) . 'index.php');
130
+        return \Display::url($image, api_get_path(WEB_PATH).'index.php');
131 131
     }
132 132
 
133 133
     /**
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
     public static function stripGivenTags($string, $tags)
140 140
     {
141 141
         foreach ($tags as $tag) {
142
-            $string2 = preg_replace('#</' . $tag . '[^>]*>#i', ' ', $string);
142
+            $string2 = preg_replace('#</'.$tag.'[^>]*>#i', ' ', $string);
143 143
             if ($string2 != $string) {
144
-                $string = preg_replace('/<' . $tag . '[^>]*>/i', ' ', $string2);
144
+                $string = preg_replace('/<'.$tag.'[^>]*>/i', ' ', $string2);
145 145
             }
146 146
         }
147 147
         return $string;
Please login to merge, or discard this patch.
main/inc/lib/system_announcements.lib.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
         $tbl_announcement_group = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS);
23 23
         $userGroup = new UserGroup();
24 24
 
25
-        $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(),0);
25
+        $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(), 0);
26 26
         $groups = array();
27 27
         foreach ($temp_user_groups as $user_group) {
28 28
             $groups = array_merge($groups, array($user_group['id']));
29 29
             $groups = array_merge($groups, $userGroup->get_parent_groups($user_group['id']));
30 30
         }
31 31
 
32
-        $groups_string = '('.implode($groups,',').')';
32
+        $groups_string = '('.implode($groups, ',').')';
33 33
         $now = api_get_utc_datetime();
34 34
         $sql = "SELECT *, DATE_FORMAT(date_start,'%d-%m-%Y %h:%i:%s') AS display_date
35 35
                 FROM  $db_table
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
      * @param string $user_id
105 105
      * @return string
106 106
      */
107
-    public static function display_all_announcements($visible, $id = -1, $start = 0,$user_id='')
107
+    public static function display_all_announcements($visible, $id = -1, $start = 0, $user_id = '')
108 108
     {
109 109
         $user_selected_language = api_get_interface_language();
110 110
         $start = intval($start);
111 111
         $userGroup = new UserGroup();
112 112
         $tbl_announcement_group = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS);
113
-        $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(),0);
113
+        $temp_user_groups = $userGroup->get_groups_by_user(api_get_user_id(), 0);
114 114
         $groups = array();
115 115
         foreach ($temp_user_groups as $user_group) {
116 116
             $groups = array_merge($groups, array($user_group['id']));
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
         }
119 119
 
120 120
         // Checks if tables exists to not break platform not updated
121
-        $groups_string = '('.implode($groups,',').')';
121
+        $groups_string = '('.implode($groups, ',').')';
122 122
 
123 123
         $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS);
124
-        $now  = api_get_utc_datetime();
124
+        $now = api_get_utc_datetime();
125 125
 
126 126
         $sql = "SELECT * FROM ".$db_table."
127 127
                 WHERE
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         if (!isset($_GET['start']) || $_GET['start'] == 0) {
156 156
             $sql .= " ORDER BY date_start DESC LIMIT ".$start.",20";
157 157
         } else {
158
-            $sql .= " ORDER BY date_start DESC LIMIT ".($start+1).",20";
158
+            $sql .= " ORDER BY date_start DESC LIMIT ".($start + 1).",20";
159 159
         }
160 160
         $announcements = Database::query($sql);
161 161
         $content = '';
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
      */
205 205
     public static function display_arrow($user_id)
206 206
     {
207
-        $start = (int)$_GET['start'];
207
+        $start = (int) $_GET['start'];
208 208
         $nb_announcement = SystemAnnouncementManager :: count_nb_announcement($start, $user_id);
209
-        $next = ((int)$_GET['start']+19);
210
-        $prev = ((int)$_GET['start']-19);
209
+        $next = ((int) $_GET['start'] + 19);
210
+        $prev = ((int) $_GET['start'] - 19);
211 211
         $content = '';
212 212
         if (!isset($_GET['start']) || $_GET['start'] == 0) {
213 213
             if ($nb_announcement > 20) {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
                 $sendEmailTest
568 568
             );
569 569
         } else {
570
-            if ($send_mail==1) {
570
+            if ($send_mail == 1) {
571 571
                 SystemAnnouncementManager::send_system_announcement_by_email(
572 572
                     $title,
573 573
                     $content,
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
         $language = null,
679 679
         $sendEmailTest = false
680 680
     ) {
681
-        $content = str_replace(array('\r\n', '\n', '\r'),'', $content);
681
+        $content = str_replace(array('\r\n', '\n', '\r'), '', $content);
682 682
         $now = api_get_utc_datetime();
683 683
 
684 684
         if ($sendEmailTest) {
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 					WHERE status = '5' ";
705 705
 		}
706 706
 
707
-		if ($teacher<> 0 && $student <> 0) {
707
+		if ($teacher <> 0 && $student <> 0) {
708 708
 			$sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition 
709 709
 					WHERE 1 = 1 ";
710 710
 		}
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 
738 738
         $message_sent = false;
739 739
 
740
-		while ($row = Database::fetch_array($result,'ASSOC')) {
740
+		while ($row = Database::fetch_array($result, 'ASSOC')) {
741 741
             MessageManager::send_message_simple($row['user_id'], $title, $content);
742 742
             $message_sent = true;
743 743
 		}
Please login to merge, or discard this patch.
main/mySpace/myStudents.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -87,52 +87,52 @@  discard block
 block discarded – undo
87 87
 if (isset($_GET['details'])) {
88 88
     if ($origin === 'user_course') {
89 89
         if (empty($cidReq)) {
90
-            $interbreadcrumb[] = array (
91
-                "url" => api_get_path(WEB_COURSE_PATH) . $courseInfo['directory'],
90
+            $interbreadcrumb[] = array(
91
+                "url" => api_get_path(WEB_COURSE_PATH).$courseInfo['directory'],
92 92
                 'name' => $courseInfo['title']
93 93
             );
94 94
         }
95
-        $interbreadcrumb[] = array (
96
-            "url" => "../user/user.php?cidReq=" . $course_code,
95
+        $interbreadcrumb[] = array(
96
+            "url" => "../user/user.php?cidReq=".$course_code,
97 97
             "name" => get_lang("Users")
98 98
         );
99 99
     } else {
100 100
         if ($origin === 'tracking_course') {
101
-            $interbreadcrumb[] = array (
102
-                "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session=' . api_get_session_id(),
101
+            $interbreadcrumb[] = array(
102
+                "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session='.api_get_session_id(),
103 103
                 "name" => get_lang("Tracking")
104 104
             );
105 105
         } else {
106 106
             if ($origin === 'resume_session') {
107
-                $interbreadcrumb[] = array (
107
+                $interbreadcrumb[] = array(
108 108
                     'url' => "../session/session_list.php",
109 109
                     "name" => get_lang('SessionList')
110 110
                 );
111
-                $interbreadcrumb[] = array (
112
-                    'url' => "../session/resume_session.php?id_session=" . $sessionId,
111
+                $interbreadcrumb[] = array(
112
+                    'url' => "../session/resume_session.php?id_session=".$sessionId,
113 113
                     "name" => get_lang('SessionOverview')
114 114
                 );
115 115
             } else {
116
-                $interbreadcrumb[] = array (
117
-                    "url" => api_is_student_boss()?"#":"index.php",
116
+                $interbreadcrumb[] = array(
117
+                    "url" => api_is_student_boss() ? "#" : "index.php",
118 118
                     "name" => get_lang('MySpace')
119 119
                 );
120 120
                 if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
121
-                    $interbreadcrumb[] = array (
122
-                        "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
121
+                    $interbreadcrumb[] = array(
122
+                        "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']),
123 123
                         "name" => get_lang("CoachStudents")
124 124
                     );
125
-                    $interbreadcrumb[] = array (
126
-                        "url" => "myStudents.php?student=" . $student_id. '&id_coach=' . Security :: remove_XSS($_GET['id_coach']),
125
+                    $interbreadcrumb[] = array(
126
+                        "url" => "myStudents.php?student=".$student_id.'&id_coach='.Security :: remove_XSS($_GET['id_coach']),
127 127
                         "name" => get_lang("StudentDetails")
128 128
                     );
129 129
                 } else {
130
-                    $interbreadcrumb[] = array (
130
+                    $interbreadcrumb[] = array(
131 131
                         "url" => "student.php",
132 132
                         "name" => get_lang("MyStudents")
133 133
                     );
134
-                    $interbreadcrumb[] = array (
135
-                        "url" => "myStudents.php?student=" . $student_id,
134
+                    $interbreadcrumb[] = array(
135
+                        "url" => "myStudents.php?student=".$student_id,
136 136
                         "name" => get_lang("StudentDetails")
137 137
                     );
138 138
                 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     $nameTools = get_lang("DetailsStudentInCourse");
143 143
 } else {
144 144
     if ($origin == 'resume_session') {
145
-        $interbreadcrumb[] = array (
145
+        $interbreadcrumb[] = array(
146 146
             'url' => "../session/session_list.php",
147 147
             "name" => get_lang('SessionList')
148 148
         );
@@ -153,19 +153,19 @@  discard block
 block discarded – undo
153 153
             );
154 154
         }
155 155
     } else {
156
-        $interbreadcrumb[] = array (
157
-            "url" => api_is_student_boss()?"#":"index.php",
156
+        $interbreadcrumb[] = array(
157
+            "url" => api_is_student_boss() ? "#" : "index.php",
158 158
             "name" => get_lang('MySpace')
159 159
         );
160 160
         if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
161 161
             if ($sessionId) {
162 162
                 $interbreadcrumb[] = array(
163
-                    "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $sessionId,
163
+                    "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach'])."&id_session=".$sessionId,
164 164
                     "name" => get_lang("CoachStudents")
165 165
                 );
166 166
             } else {
167 167
                 $interbreadcrumb[] = array(
168
-                    "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
168
+                    "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']),
169 169
                     "name" => get_lang("CoachStudents")
170 170
                 );
171 171
             }
@@ -350,28 +350,28 @@  discard block
 block discarded – undo
350 350
     // Actions bar
351 351
     echo '<div class="actions">';
352 352
     echo '<a href="javascript: window.history.go(-1);">'.
353
-            Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
353
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
354 354
 
355 355
     echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
356
-            Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
356
+            Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
357 357
 
358
-    echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.
359
-            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
358
+    echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=csv">'.
359
+            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a> ';
360 360
 
361
-    echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=xls">'.
362
-    Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> ';
361
+    echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=xls">'.
362
+    Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a> ';
363 363
 
364 364
     if (!empty ($user_info['email'])) {
365 365
         $send_mail = '<a href="mailto:'.$user_info['email'].'">'.
366
-            Display :: return_icon('mail_send.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM).'</a>';
366
+            Display :: return_icon('mail_send.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM).'</a>';
367 367
     } else {
368
-        $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM);
368
+        $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM);
369 369
     }
370 370
     echo $send_mail;
371 371
     if (!empty($student_id) && !empty($course_code)) {
372 372
         // Only show link to connection details if course and student were defined in the URL
373
-        echo '<a href="access_details.php?student=' . $student_id . '&course=' . $course_code . '&origin=' . $origin. '&cidReq='.$course_code.'&id_session='.$sessionId.'">'.
374
-            Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>';
373
+        echo '<a href="access_details.php?student='.$student_id.'&course='.$course_code.'&origin='.$origin.'&cidReq='.$course_code.'&id_session='.$sessionId.'">'.
374
+            Display :: return_icon('statistics.png', get_lang('AccessDetails'), '', ICON_SIZE_MEDIUM).'</a>';
375 375
     }
376 376
     if (api_can_login_as($student_id)) {
377 377
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&user_id='.$student_id.'&sec_token='.$token.'">'.
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     if (api_is_platform_admin(false, true) || api_is_student_boss()) {
382 382
         echo Display::url(
383 383
             Display::return_icon('skill-badges.png', get_lang('AssignSkill'), null, ICON_SIZE_MEDIUM),
384
-            api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $student_id])
384
+            api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $student_id])
385 385
         );
386 386
     }
387 387
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     $csv_content[] = array(
443 443
         get_lang('Information')
444 444
     );
445
-    $csv_content[] = array (
445
+    $csv_content[] = array(
446 446
         get_lang('Name'),
447 447
         get_lang('Email'),
448 448
         get_lang('Tel')
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
         strip_tags($first_connection_date),
471 471
         strip_tags($last_connection_date),
472 472
         $time_spent_on_the_course,
473
-        $avg_student_progress . '%',
473
+        $avg_student_progress.'%',
474 474
         $avg_student_score
475 475
     );
476 476
 
@@ -500,19 +500,19 @@  discard block
 block discarded – undo
500 500
             </thead>
501 501
             <tbody>
502 502
             <tr>
503
-                <td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td>
503
+                <td><?php echo get_lang('Name').' : '.$user_info['complete_name']; ?></td>
504 504
             </tr>
505 505
             <tr>
506
-                <td><?php echo get_lang('Email') . ' : ';
506
+                <td><?php echo get_lang('Email').' : ';
507 507
                     if (!empty ($user_info['email'])) {
508
-                        echo '<a href="mailto:' . $user_info['email'] . '">' . $user_info['email'] . '</a>';
508
+                        echo '<a href="mailto:'.$user_info['email'].'">'.$user_info['email'].'</a>';
509 509
                     } else {
510 510
                         echo get_lang('NoEmail');
511 511
                     } ?>
512 512
                 </td>
513 513
             </tr>
514 514
             <tr>
515
-                <td> <?php echo get_lang('Tel') . ' : ';
515
+                <td> <?php echo get_lang('Tel').' : ';
516 516
                     if (!empty ($user_info['phone'])) {
517 517
                         echo $user_info['phone'];
518 518
                     } else {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                 </td>
523 523
             </tr>
524 524
             <tr>
525
-                <td> <?php echo get_lang('OfficialCode') . ' : ';
525
+                <td> <?php echo get_lang('OfficialCode').' : ';
526 526
                     if (!empty ($user_info['official_code'])) {
527 527
                         echo $user_info['official_code'];
528 528
                     } else {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                 </td>
533 533
             </tr>
534 534
             <tr>
535
-                <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
535
+                <td><?php echo get_lang('OnLine').' : '.$online; ?> </td>
536 536
             </tr>
537 537
             <?php
538 538
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
             if ($timezone !== null) {
547 547
                 ?>
548 548
                 <tr>
549
-                    <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
549
+                    <td> <?php echo get_lang('Timezone').' : '.$timezone; ?> </td>
550 550
                 </tr>
551 551
             <?php
552 552
             }
@@ -693,9 +693,9 @@  discard block
 block discarded – undo
693 693
                 }
694 694
 
695 695
                 if (!empty($access_start_date) && !empty($access_end_date)) {
696
-                    $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date;
696
+                    $date_session = get_lang('From').' '.$access_start_date.' '.get_lang('Until').' '.$access_end_date;
697 697
                 }
698
-                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
698
+                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session ? ' ('.$date_session.')' : '');
699 699
             }
700 700
 
701 701
             // Courses
@@ -757,16 +757,16 @@  discard block
 block discarded – undo
757 757
                         $scoretotal = array();
758 758
                         if (isset($cats) && isset($cats[0])) {
759 759
                             if (!empty($sId)) {
760
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
760
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
761 761
                             } else {
762
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem);
762
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem);
763 763
                             }
764 764
                         }
765 765
 
766 766
                         $scoretotal_display = '0/0 (0%)';
767 767
                         if (!empty($scoretotal) && !empty($scoretotal[1])) {
768 768
                             $scoretotal_display =
769
-                                round($scoretotal[0], 1 ).'/'.
769
+                                round($scoretotal[0], 1).'/'.
770 770
                                 round($scoretotal[1], 1).
771 771
                                 ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)';
772 772
                         }
@@ -797,9 +797,9 @@  discard block
 block discarded – undo
797 797
                         );
798 798
 
799 799
                         echo '<tr>
800
-                        <td ><a href="' .$courseInfoItem['course_public_url'] .'?id_session=' . $sId . '">'.
800
+                        <td ><a href="' .$courseInfoItem['course_public_url'].'?id_session='.$sId.'">'.
801 801
                             $courseInfoItem['title'].'</a></td>
802
-                        <td >'.$time_spent_on_course .'</td>
802
+                        <td >'.$time_spent_on_course.'</td>
803 803
                         <td >'.$progress.'</td>
804 804
                         <td >'.$score.'</td>
805 805
                         <td >'.$attendances_faults_avg.'</td>
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                 <table class="table table-striped table-hover">
876 876
                 <thead>
877 877
                 <tr>
878
-                    <th><?php echo get_lang('LearningPath');?></th>
878
+                    <th><?php echo get_lang('LearningPath'); ?></th>
879 879
                     <th>
880 880
                         <?php
881 881
                         echo get_lang('Time').' ';
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
                     if (!empty($start_time)) {
979 979
                         $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
980 980
                     } else {
981
-                        $start_time =  '-';
981
+                        $start_time = '-';
982 982
                     }
983 983
 
984 984
                     if (!empty($total_time)) {
@@ -1015,8 +1015,8 @@  discard block
 block discarded – undo
1015 1015
                     $csv_content[] = array(
1016 1016
                         api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset),
1017 1017
                         api_time_to_hms($total_time),
1018
-                        $score . '%',
1019
-                        $score_latest . '%',
1018
+                        $score.'%',
1019
+                        $score_latest.'%',
1020 1020
                         $progress.'%',
1021 1021
                         $start_time
1022 1022
                     );
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
                     if ($any_result === true) {
1055 1055
                         $from = '';
1056 1056
                         if ($from_myspace) {
1057
-                            $from ='&from=myspace';
1057
+                            $from = '&from=myspace';
1058 1058
                         }
1059 1059
                         $link = Display::url(
1060 1060
                             Display::return_icon('2rightarrow.png', get_lang('Details')),
@@ -1067,14 +1067,14 @@  discard block
 block discarded – undo
1067 1067
                         echo '<td>';
1068 1068
                         if ($any_result === true) {
1069 1069
                             echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&cidReq='.$course_code.'&course='.$course_code.'&details='.Security::remove_XSS($_GET['details']).'&origin='.$origin.'&lp_id='.$learnpath->getId().'&student='.$user_info['user_id'].'&details=true&id_session='.$sessionId.'">';
1070
-                            echo Display::return_icon('clean.png', get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
1070
+                            echo Display::return_icon('clean.png', get_lang('Clean'), '', ICON_SIZE_SMALL).'</a>';
1071 1071
                             echo '</a>';
1072 1072
                         }
1073 1073
                         echo '</td>';
1074 1074
                         echo '</tr>';
1075 1075
                     }
1076 1076
                     $data_learnpath[$i][] = $lp_name;
1077
-                    $data_learnpath[$i][] = $progress . '%';
1077
+                    $data_learnpath[$i][] = $progress.'%';
1078 1078
                 }
1079 1079
                 ?>
1080 1080
                 </tbody>
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         <thead>
1091 1091
         <tr>
1092 1092
             <th><?php echo get_lang('Exercises'); ?></th>
1093
-            <th><?php echo get_lang('LearningPath');?></th>
1093
+            <th><?php echo get_lang('LearningPath'); ?></th>
1094 1094
             <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
1095 1095
             <th><?php echo get_lang('Attempts'); ?></th>
1096 1096
             <th><?php echo get_lang('LatestAttempt'); ?></th>
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
             'quiz.session_id'
1117 1117
         );
1118 1118
 
1119
-        $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
1119
+        $sql = "SELECT quiz.title, id FROM ".$t_quiz." AS quiz
1120 1120
                 WHERE
1121 1121
                     quiz.c_id = ".$courseInfo['real_id']." AND
1122 1122
                     active IN (0, 1)
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
                 echo '<td>';
1182 1182
 
1183 1183
                 if ($count_attempts > 0) {
1184
-                    echo $score_percentage . '%';
1184
+                    echo $score_percentage.'%';
1185 1185
                 } else {
1186 1186
                     echo '-';
1187 1187
                     $score_percentage = 0;
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
                 echo '<td>'.$count_attempts.'</td>';
1192 1192
                 echo '<td>';
1193 1193
 
1194
-                $sql = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
1194
+                $sql = 'SELECT exe_id FROM '.$tbl_stats_exercices.'
1195 1195
                          WHERE
1196 1196
                             exe_exo_id = "'.$exercise_id.'" AND
1197 1197
                             exe_user_id ="'.$student_id.'" AND
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
                 if (Database :: num_rows($result_last_attempt) > 0) {
1205 1205
                     $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
1206 1206
                     if ($count_attempts > 0)
1207
-                        echo '<a href="../exercise/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
1207
+                        echo '<a href="../exercise/exercise_show.php?id='.$id_last_attempt.'&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin) ? 'tracking' : $origin).'">
1208 1208
                         '.Display::return_icon('quiz.png').'
1209 1209
                      </a>';
1210 1210
                 }
@@ -1212,11 +1212,11 @@  discard block
 block discarded – undo
1212 1212
 
1213 1213
                 echo '<td>';
1214 1214
                 $all_attempt_url = "../exercise/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$sessionId";
1215
-                echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );
1215
+                echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url);
1216 1216
 
1217 1217
                 echo '</td></tr>';
1218 1218
                 $data_exercices[$i][] = $exercices['title'];
1219
-                $data_exercices[$i][] = $score_percentage . '%';
1219
+                $data_exercices[$i][] = $score_percentage.'%';
1220 1220
                 $data_exercices[$i][] = $count_attempts;
1221 1221
 
1222 1222
                 $csv_content[] = array(
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
             $survey_list = SurveyManager::get_surveys($course_code, $sessionId);
1245 1245
 
1246 1246
             $survey_data = array();
1247
-            foreach($survey_list as $survey) {
1247
+            foreach ($survey_list as $survey) {
1248 1248
                 $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $courseInfo['real_id']);
1249 1249
                 $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
1250 1250
                 if (in_array($student_id, $user_list)) {
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
                         $column = 0;
1270 1270
                         $table->setCellContents($row, $column, $data);
1271 1271
                         $class = 'class="row_odd"';
1272
-                        if($row % 2) {
1272
+                        if ($row % 2) {
1273 1273
                             $class = 'class="row_even"';
1274 1274
                         }
1275 1275
                         $table->setRowAttributes($row, $class, true);
Please login to merge, or discard this patch.