@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $sql = ("INSERT INTO cr_eventPeople (eventId, userRoleId) VALUES ('$eventId', '$userRoleId')"); |
15 | 15 | |
16 | 16 | if (!mysqli_query(db(), $sql)) { |
17 | - die('Error: '.mysqli_error(db())); |
|
17 | + die('Error: ' . mysqli_error(db())); |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $sql = "DELETE FROM cr_eventPeople WHERE eventId = '$id' AND userRoleId = '$userRoleId'"; |
31 | 31 | if (!mysqli_query(db(), $sql)) { |
32 | - die('Error: '.mysqli_error(db())); |
|
32 | + die('Error: ' . mysqli_error(db())); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -170,40 +170,40 @@ discard block |
||
170 | 170 | |
171 | 171 | $ob = mysqli_fetch_object($result); |
172 | 172 | |
173 | - $subject = 'Swap requested: '.$ob->newUserName.' - '.$ob->eventDate; |
|
174 | - $message = "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
175 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
176 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
177 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n". |
|
178 | - "Accept:\t\t ".$ob->siteurl.'/swap.php?action='.'accept&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n". |
|
179 | - "Decline:\t\t ".$ob->siteurl.'/swap.php?action='.'decline&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n"; |
|
173 | + $subject = 'Swap requested: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
174 | + $message = "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
175 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
176 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
177 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n" . |
|
178 | + "Accept:\t\t " . $ob->siteurl . '/swap.php?action=' . 'accept&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n" . |
|
179 | + "Decline:\t\t " . $ob->siteurl . '/swap.php?action=' . 'decline&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n"; |
|
180 | 180 | |
181 | 181 | $from = $ob->siteadmin; |
182 | 182 | |
183 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
183 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
184 | 184 | |
185 | 185 | $sessionUserId = $_SESSION['userid']; |
186 | 186 | |
187 | 187 | if ($sessionUserId == $ob->oldUserId) { // if old user requests swap |
188 | 188 | // notify new user |
189 | - $notificationMessage = $ob->oldUserFirstName.' requested a swap'; |
|
189 | + $notificationMessage = $ob->oldUserFirstName . ' requested a swap'; |
|
190 | 190 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
191 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
191 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
192 | 192 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
193 | 193 | } elseif ($sessionUserId == $ob->newUserId) { // if new user requests swap |
194 | 194 | // notify old user |
195 | - $notificationMessage = $ob->newUserFirstName.' requested a swap'; |
|
195 | + $notificationMessage = $ob->newUserFirstName . ' requested a swap'; |
|
196 | 196 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
197 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
197 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
198 | 198 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
199 | 199 | } else { // notify both users |
200 | 200 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
201 | - $notificationMessageOldUser = $sessionUserFirstName.' requested a swap for '.$ob->newUserFirstName; |
|
202 | - $notificationMessageNewUser = $sessionUserFirstName.' requested a swap for '.$ob->oldUserFirstName; |
|
201 | + $notificationMessageOldUser = $sessionUserFirstName . ' requested a swap for ' . $ob->newUserFirstName; |
|
202 | + $notificationMessageNewUser = $sessionUserFirstName . ' requested a swap for ' . $ob->oldUserFirstName; |
|
203 | 203 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
204 | 204 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
205 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessageOldUser); |
|
206 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessageNewUser); |
|
205 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessageOldUser); |
|
206 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessageNewUser); |
|
207 | 207 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
208 | 208 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
209 | 209 | } |
@@ -233,60 +233,60 @@ discard block |
||
233 | 233 | |
234 | 234 | $ob = mysqli_fetch_object($result); |
235 | 235 | |
236 | - $subject = 'Swap accepted: '.$ob->newUserName.' - '.$ob->eventDate; |
|
237 | - $message = "The following swap has been accepted\r\n\r\n". |
|
238 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
239 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
240 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
241 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
236 | + $subject = 'Swap accepted: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
237 | + $message = "The following swap has been accepted\r\n\r\n" . |
|
238 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
239 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
240 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
241 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
242 | 242 | $from = $ob->siteadmin; |
243 | 243 | |
244 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
244 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
245 | 245 | |
246 | 246 | $sessionUserId = $_SESSION['userid']; |
247 | 247 | |
248 | 248 | if ($sessionUserId == $ob->oldUserId) { // if old user accepted swap |
249 | 249 | // notify new user |
250 | - $notificationMessage = $ob->oldUserFirstName.' accepted a swap'; |
|
250 | + $notificationMessage = $ob->oldUserFirstName . ' accepted a swap'; |
|
251 | 251 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
252 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
252 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
253 | 253 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
254 | 254 | } elseif ($sessionUserId == $ob->newUserId) { // if new user accepted swap |
255 | 255 | // notify old user |
256 | - $notificationMessage = $ob->newUserFirstName.' accepted a swap'; |
|
256 | + $notificationMessage = $ob->newUserFirstName . ' accepted a swap'; |
|
257 | 257 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
258 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
258 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
259 | 259 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
260 | 260 | } elseif (isset($_GET['token'])) { // if accepted by email URL with token |
261 | 261 | // notify whoever requested swap |
262 | 262 | if ($ob->newUserId == $ob->requestedBy) { |
263 | - $notificationMessage = 'Swap accepted with '.$ob->oldUserFirstName; |
|
263 | + $notificationMessage = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
264 | 264 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
265 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
265 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
266 | 266 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
267 | 267 | } elseif ($ob->oldUserId == $ob->requestedBy) { |
268 | - $notificationMessage = 'Swap accepted with '.$ob->newUserFirstName; |
|
268 | + $notificationMessage = 'Swap accepted with ' . $ob->newUserFirstName; |
|
269 | 269 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
270 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
270 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
271 | 271 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
272 | 272 | } else { // notify both |
273 | - $notificationMessageOldUser = 'Swap accepted with '.$ob->newUserFirstName; |
|
274 | - $notificationMessageNewUser = 'Swap accepted with '.$ob->oldUserFirstName; |
|
273 | + $notificationMessageOldUser = 'Swap accepted with ' . $ob->newUserFirstName; |
|
274 | + $notificationMessageNewUser = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
275 | 275 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
276 | 276 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
277 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
278 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
277 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
278 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
279 | 279 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
280 | 280 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
281 | 281 | } |
282 | 282 | } else { // notify both users |
283 | 283 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
284 | - $notificationMessageOldUser = $sessionUserFirstName.' accepted a swap for '.$ob->newUserFirstName; |
|
285 | - $notificationMessageNewUser = $sessionUserFirstName.' accepted a swap for '.$ob->oldUserFirstName; |
|
284 | + $notificationMessageOldUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->newUserFirstName; |
|
285 | + $notificationMessageNewUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->oldUserFirstName; |
|
286 | 286 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
287 | 287 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
288 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
289 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
288 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
289 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
290 | 290 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
291 | 291 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
292 | 292 | } |
@@ -315,39 +315,39 @@ discard block |
||
315 | 315 | |
316 | 316 | $ob = mysqli_fetch_object($result); |
317 | 317 | |
318 | - $subject = 'Swap declined: '.$ob->newUserName.' - '.$ob->eventDate; |
|
319 | - $message = "The following swap has been declined\r\n\r\n". |
|
320 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
321 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
322 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
323 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
318 | + $subject = 'Swap declined: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
319 | + $message = "The following swap has been declined\r\n\r\n" . |
|
320 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
321 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
322 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
323 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
324 | 324 | |
325 | 325 | $from = $ob->siteadmin; |
326 | 326 | |
327 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
327 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
328 | 328 | |
329 | 329 | $sessionUserId = $_SESSION['userid']; |
330 | 330 | |
331 | 331 | if ($sessionUserId == $ob->oldUserId) { // if old user declines swap |
332 | 332 | // notify new user |
333 | - $notificationMessage = $ob->oldUserFirstName.' declined a swap'; |
|
333 | + $notificationMessage = $ob->oldUserFirstName . ' declined a swap'; |
|
334 | 334 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
335 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
335 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
336 | 336 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
337 | 337 | } elseif ($sessionUserId == $ob->newUserId) { // if new user declines swap |
338 | 338 | // notify old user |
339 | - $notificationMessage = $ob->newUserFirstName.' declined a swap'; |
|
339 | + $notificationMessage = $ob->newUserFirstName . ' declined a swap'; |
|
340 | 340 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
341 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
341 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
342 | 342 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
343 | 343 | } else { // notify both users |
344 | 344 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
345 | - $notificationMessageOldUser = $sessionUserFirstName.' declined a swap for '.$ob->newUserFirstName; |
|
346 | - $notificationMessageNewUser = $sessionUserFirstName.' declined a swap for '.$ob->oldUserFirstName; |
|
345 | + $notificationMessageOldUser = $sessionUserFirstName . ' declined a swap for ' . $ob->newUserFirstName; |
|
346 | + $notificationMessageNewUser = $sessionUserFirstName . ' declined a swap for ' . $ob->oldUserFirstName; |
|
347 | 347 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
348 | 348 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
349 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
350 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
349 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
350 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
351 | 351 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
352 | 352 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
353 | 353 | } |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | |
497 | 497 | $sql = "UPDATE cr_eventGroups SET archived = true WHERE id = '$seriesId'"; |
498 | 498 | if (!mysqli_query(db(), $sql)) { |
499 | - die('Error: '.mysqli_error(db())); |
|
499 | + die('Error: ' . mysqli_error(db())); |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
@@ -505,13 +505,13 @@ discard block |
||
505 | 505 | $sql = "INSERT INTO cr_bandMembers (bandId, userRoleId) VALUES ('$bandId', '$userRoleId')"; |
506 | 506 | |
507 | 507 | if (!mysqli_query(db(), $sql)) { |
508 | - die('Error: '.mysqli_error(db())); |
|
508 | + die('Error: ' . mysqli_error(db())); |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | 512 | function getEventUrl($eventId) |
513 | 513 | { |
514 | - return 'event.php?id='.$eventId; |
|
514 | + return 'event.php?id=' . $eventId; |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | function getEventDetails($eventID, $separator, $type = 4, $apprev_description = true, $prefix = '') |
@@ -551,9 +551,9 @@ discard block |
||
551 | 551 | e.id = $eventID "; |
552 | 552 | |
553 | 553 | if ($type == 1) { |
554 | - $sql = $sql."AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
554 | + $sql = $sql . "AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
555 | 555 | } |
556 | - $sql = $sql.'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
556 | + $sql = $sql . 'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
557 | 557 | |
558 | 558 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
559 | 559 | |
@@ -571,32 +571,32 @@ discard block |
||
571 | 571 | |
572 | 572 | $firstname = $row['firstname']; |
573 | 573 | if ($firstname != 'Team') { |
574 | - $firstname = ltrim(substr($firstname, 0, 1).'.', '.'); |
|
574 | + $firstname = ltrim(substr($firstname, 0, 1) . '.', '.'); |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | $lastname = $row['lastname']; |
578 | 578 | |
579 | - $returnValue = $returnValue.$separator; |
|
579 | + $returnValue = $returnValue . $separator; |
|
580 | 580 | switch ($type) { |
581 | 581 | case 0: |
582 | 582 | //all persons of event |
583 | 583 | //break; -> no special handling, fallthrough to case 1 |
584 | 584 | case 1: |
585 | 585 | //only persons with groupID in 10,11,2 -> handled in sql query |
586 | - $returnValue = $returnValue.$prefix.ltrim($group.': '); |
|
587 | - $returnValue = $returnValue.trim($firstname.' '.$lastname); |
|
586 | + $returnValue = $returnValue . $prefix . ltrim($group . ': '); |
|
587 | + $returnValue = $returnValue . trim($firstname . ' ' . $lastname); |
|
588 | 588 | break; |
589 | 589 | case 2: |
590 | 590 | //only event date and event type |
591 | - $returnValue = $returnValue.strftime($time_format_normal, strtotime($eventDate)); |
|
592 | - $returnValue = $returnValue.$separator; |
|
593 | - $returnValue = $returnValue.$eventType; |
|
591 | + $returnValue = $returnValue . strftime($time_format_normal, strtotime($eventDate)); |
|
592 | + $returnValue = $returnValue . $separator; |
|
593 | + $returnValue = $returnValue . $eventType; |
|
594 | 594 | |
595 | 595 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
596 | 596 | break; |
597 | 597 | case 4: |
598 | 598 | //only event type |
599 | - $returnValue = $returnValue.$eventType; |
|
599 | + $returnValue = $returnValue . $eventType; |
|
600 | 600 | |
601 | 601 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
602 | 602 | break; |
@@ -119,7 +119,7 @@ |
||
119 | 119 | |
120 | 120 | <div class="box box-primary"> |
121 | 121 | <div class="box-header"> |
122 | - <h2 class="box-title">Change password - <?php echo $firstname.' '.$lastname.'<br>'; ?></h2> |
|
122 | + <h2 class="box-title">Change password - <?php echo $firstname . ' ' . $lastname . '<br>'; ?></h2> |
|
123 | 123 | </div><!-- /.box-header --> |
124 | 124 | <div class="box-body"> |
125 | 125 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $token = createCalendarToken($sessionUserId, $format, $description); |
52 | - $url = siteSettings()->getSiteUrl()."/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
52 | + $url = siteSettings()->getSiteUrl() . "/calendar.php?user=$sessionUserId&format=$format&token=$token"; |
|
53 | 53 | break; |
54 | 54 | } |
55 | 55 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | <?php echo empty($calendars) ? '<p>none</p>' : '' ?> |
129 | 129 | <?php foreach ($calendars as $calendar): ?> |
130 | 130 | <?php echo $calendar->revoked ? '<s>' : '' ?> |
131 | - <p><?php echo $calendar->description.' ('.$calendar->format.')'; ?></p> |
|
131 | + <p><?php echo $calendar->description . ' (' . $calendar->format . ')'; ?></p> |
|
132 | 132 | <?php if (!$calendar->revoked): ?> |
133 | 133 | <form action="#" method="post"> |
134 | 134 | <input type="hidden" name="method" value="revoke" /> |
@@ -25,6 +25,6 @@ |
||
25 | 25 | $helper = $fb->getRedirectLoginHelper(); |
26 | 26 | |
27 | 27 | $permissions = ['email']; // Optional permissions |
28 | -$loginUrl = $helper->getLoginUrl(siteSettings()->getSiteUrl().'/fb-callback.php', $permissions); |
|
28 | +$loginUrl = $helper->getLoginUrl(siteSettings()->getSiteUrl() . '/fb-callback.php', $permissions); |
|
29 | 29 | |
30 | -header('Location: '.$loginUrl); |
|
30 | +header('Location: ' . $loginUrl); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | exit; |
36 | 36 | } |
37 | 37 | if (!isAdmin()) { |
38 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
38 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
39 | 39 | exit; |
40 | 40 | } |
41 | 41 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($editskillID != '') { |
72 | 72 | $sql = ("INSERT INTO cr_eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); |
73 | 73 | if (!mysqli_query(db(), $sql)) { |
74 | - die('Error: '.mysqli_error(db())); |
|
74 | + die('Error: ' . mysqli_error(db())); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // After we have inserted the data, we want to head back to the main page |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $sql = ("INSERT INTO cr_eventPeople (eventID, skillID) VALUES ('$editeventID', '$editskillID')"); |
90 | 90 | if (!mysqli_query(db(), $sql)) { |
91 | - die('Error: '.mysqli_error(db())); |
|
91 | + die('Error: ' . mysqli_error(db())); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | break; |
48 | 48 | case 'unlink': |
49 | 49 | removeSocialAuthFromUserWithId($id, $platform); |
50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
50 | + createNotificationForUser($id, ucfirst($platform) . ' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | 51 | break; |
52 | 52 | |
53 | 53 | default: |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | </div><!-- /.timeline-header --> |
223 | 223 | |
224 | 224 | <div class="timeline-body"> |
225 | - <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p> |
|
225 | + <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p> |
|
226 | 226 | <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p> |
227 | 227 | |
228 | 228 | <?php if ($event->getComment() != ''): ?> |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | INNER JOIN cr_groups g ON g.id = r.groupId |
281 | 281 | INNER JOIN cr_users u ON u.id = ur.userId |
282 | 282 | INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id |
283 | - WHERE ep.eventId = '".$event->getId()."' |
|
283 | + WHERE ep.eventId = '".$event->getId() . "' |
|
284 | 284 | AND ep.removed = 0 |
285 | 285 | ORDER BY g.name, r.name"; |
286 | 286 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | } else { |
306 | 306 | echo '</ul>'; |
307 | 307 | } |
308 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
308 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
309 | 309 | echo '<ul>'; |
310 | 310 | } |
311 | 311 | |
312 | 312 | echo '<li>'; |
313 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
313 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
314 | 314 | echo $viewPeople->name; |
315 | 315 | |
316 | 316 | if ($viewPeople->rolename != '') { |
317 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
317 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
318 | 318 | } else { |
319 | 319 | // If there is no skill, we don't need to mention this. |
320 | 320 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | </div><!-- /.timeline-header --> |
397 | 397 | |
398 | 398 | <div class="timeline-body"> |
399 | - <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p> |
|
399 | + <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p> |
|
400 | 400 | <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p> |
401 | 401 | |
402 | 402 | <?php if ($event->comment != ''): ?> |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | INNER JOIN cr_groups g ON g.id = r.groupId |
458 | 458 | INNER JOIN cr_users u ON u.id = ur.userId |
459 | 459 | INNER JOIN cr_eventPeople ep ON ep.userRoleId = ur.id |
460 | - WHERE ep.eventId = '".$event->id."' |
|
460 | + WHERE ep.eventId = '".$event->id . "' |
|
461 | 461 | AND ep.removed = 0 |
462 | 462 | ORDER BY g.name, r.name"; |
463 | 463 | |
@@ -482,16 +482,16 @@ discard block |
||
482 | 482 | } else { |
483 | 483 | echo '</ul>'; |
484 | 484 | } |
485 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
485 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
486 | 486 | echo '<ul>'; |
487 | 487 | } |
488 | 488 | |
489 | 489 | echo '<li>'; |
490 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
490 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
491 | 491 | echo $viewPeople->name; |
492 | 492 | |
493 | 493 | if ($viewPeople->rolename != '') { |
494 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
494 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
495 | 495 | } else { |
496 | 496 | // If there is no skill, we don't need to mention this. |
497 | 497 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | "> |
563 | 563 | <?php echo timeInWordsWithTense($event->getDate()) ?> |
564 | 564 | </span> |
565 | - <?php else: ?> |
|
565 | + <?php else : ?> |
|
566 | 566 | <span class="pull-right badge bg-red"> |
567 | 567 | never |
568 | 568 | </span> |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar"> |
628 | 628 | </div> |
629 | 629 | <!-- /.widget-user-image --> |
630 | - <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3> |
|
630 | + <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3> |
|
631 | 631 | <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5> |
632 | 632 | </div> |
633 | 633 | <div class="box-footer no-padding"> |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | $userHasEmail = (strlen($user->getEmail()) > 3); |
652 | 652 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
653 | 653 | ?> |
654 | - Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert().' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
654 | + Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert() . ' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
655 | 655 | </a> |
656 | 656 | </li> |
657 | 657 | <li> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | // ensure user is logged in |
11 | 11 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
12 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/termCard.php'; |
|
12 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/termCard.php'; |
|
13 | 13 | header('Location: login.php'); |
14 | 14 | } |
15 | 15 | |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | |
43 | 43 | while ($ob = mysqli_fetch_object($result)) { |
44 | 44 | echo '<tr>'; |
45 | - echo '<td>'.date('j F', strtotime($ob->eventDate)).'</td>'; |
|
46 | - echo '<td>'.date('g:i a', strtotime($ob->eventDate)).'</td>'; |
|
47 | - echo '<td>'.$ob->eventName.'</td>'; |
|
48 | - echo '<td>'.$ob->eventSubType.'</td>'; |
|
49 | - echo '<td>'.$ob->sermonTitle; |
|
50 | - echo $ob->bibleVerse ? ' ('.$ob->bibleVerse.')</td>' : ''; |
|
45 | + echo '<td>' . date('j F', strtotime($ob->eventDate)) . '</td>'; |
|
46 | + echo '<td>' . date('g:i a', strtotime($ob->eventDate)) . '</td>'; |
|
47 | + echo '<td>' . $ob->eventName . '</td>'; |
|
48 | + echo '<td>' . $ob->eventSubType . '</td>'; |
|
49 | + echo '<td>' . $ob->sermonTitle; |
|
50 | + echo $ob->bibleVerse ? ' (' . $ob->bibleVerse . ')</td>' : ''; |
|
51 | 51 | echo '</tr>'; |
52 | 52 | } |
53 | 53 | echo '</table>'; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | session_start(); |
9 | 9 | |
10 | 10 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
11 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/addUser.php?'.$_SERVER['QUERY_STRING']; |
|
11 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/addUser.php?' . $_SERVER['QUERY_STRING']; |
|
12 | 12 | header('Location: login.php'); |
13 | 13 | exit; |
14 | 14 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $userRole = UserRoleQuery::create()->filterByUser($user)->filterByRoleId($roleId)->findOne(); |
57 | 57 | $userRole->setReserve(false); |
58 | 58 | $userRole->save(); |
59 | - header('Location: addUser.php?action=edit&user='.$user->getId()); |
|
59 | + header('Location: addUser.php?action=edit&user=' . $user->getId()); |
|
60 | 60 | exit; |
61 | 61 | |
62 | 62 | break; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $userRole = UserRoleQuery::create()->filterByUser($user)->filterByRoleId($roleId)->findOne(); |
68 | 68 | $userRole->setReserve(true); |
69 | 69 | $userRole->save(); |
70 | - header('Location: addUser.php?action=edit&user='.$user->getId()); |
|
70 | + header('Location: addUser.php?action=edit&user=' . $user->getId()); |
|
71 | 71 | exit; |
72 | 72 | break; |
73 | 73 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | } |
178 | 178 | if (isAdmin()) { |
179 | - header('Location: users.php#section'.$userId); |
|
179 | + header('Location: users.php#section' . $userId); |
|
180 | 180 | exit; |
181 | 181 | } |
182 | 182 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // ordered in this way to build the page with contact details before permissions |
262 | 262 | if (!isAdmin()) { |
263 | 263 | if ($userId == $sessionUserID) { |
264 | - echo $firstname.' '.$lastname; |
|
264 | + echo $firstname . ' ' . $lastname; |
|
265 | 265 | $isCompromised = false; |
266 | 266 | } else { |
267 | 267 | notifyAttack(__FILE__, 'Impersonating Attack', $sessionUserID); |