@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | <!-- Menu toggle button --> |
297 | 297 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
298 | 298 | <i class="fa fa-bell-o"></i> |
299 | - <?php echo $unseen >= 1 ? '<span class="label label-warning">'.$unseen.'</span>' : '' ?> |
|
299 | + <?php echo $unseen >= 1 ? '<span class="label label-warning">' . $unseen . '</span>' : '' ?> |
|
300 | 300 | </a> |
301 | 301 | <ul class="dropdown-menu"> |
302 | 302 | <li class="header">You have <?php echo $unseen >= 1 ? $unseen : 'no' ?> new notifications</li> |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | <?php foreach ($notifications as $n): ?> |
307 | 307 | <li><!-- start notification --> |
308 | 308 | <a href="notification.php?click=notifications-panel&id=<?php echo $n->id ?>"> |
309 | - <i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>'.$n->summary.'</strong>' ?> |
|
309 | + <i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>' . $n->summary . '</strong>' ?> |
|
310 | 310 | <small><?php echo timeAgoInWords($n->timestamp) ?></small> |
311 | 311 | </a> |
312 | 312 | </li><!-- end notification --> |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | <!-- User Account Menu --> |
362 | 362 | <li class="dropdown user user-menu"> |
363 | 363 | <?php |
364 | - $sql = 'SELECT u.created FROM users u WHERE id = '.$_SESSION['userid']; |
|
364 | + $sql = 'SELECT u.created FROM users u WHERE id = ' . $_SESSION['userid']; |
|
365 | 365 | $stmt = mysqli_prepare(db(), $sql); |
366 | 366 | mysqli_stmt_bind_param($stmt, 'i', $_SESSION['userid']); |
367 | 367 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | mysqli_stmt_bind_param($stmt, 'ii', $eventId, $userRoleId); |
17 | 17 | |
18 | 18 | if (!mysqli_stmt_execute($stmt)) { |
19 | - die('Error: '.mysqli_error(db())); |
|
19 | + die('Error: ' . mysqli_error(db())); |
|
20 | 20 | } |
21 | 21 | mysqli_stmt_close($stmt); |
22 | 22 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | mysqli_stmt_bind_param($stmt, 'ii', $id, $userRoleId); |
36 | 36 | |
37 | 37 | if (!mysqli_stmt_execute($stmt)) { |
38 | - die('Error: '.mysqli_error(db())); |
|
38 | + die('Error: ' . mysqli_error(db())); |
|
39 | 39 | } |
40 | 40 | mysqli_stmt_close($stmt); |
41 | 41 | } |
@@ -185,40 +185,40 @@ discard block |
||
185 | 185 | |
186 | 186 | $verificationCode = verificationCodeForSwap($swapId); |
187 | 187 | |
188 | - $subject = 'Swap requested: '.$ob->newUserName.' - '.$ob->eventDate; |
|
189 | - $message = "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
190 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
191 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
192 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n". |
|
193 | - "Accept:\t\t ".$ob->siteurl.'/swap.php?action='.'accept&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n". |
|
194 | - "Decline:\t\t ".$ob->siteurl.'/swap.php?action='.'decline&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n"; |
|
188 | + $subject = 'Swap requested: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
189 | + $message = "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
190 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
191 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
192 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n" . |
|
193 | + "Accept:\t\t " . $ob->siteurl . '/swap.php?action=' . 'accept&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n" . |
|
194 | + "Decline:\t\t " . $ob->siteurl . '/swap.php?action=' . 'decline&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n"; |
|
195 | 195 | |
196 | 196 | $from = $ob->siteadmin; |
197 | 197 | |
198 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
198 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
199 | 199 | |
200 | 200 | $sessionUserId = $_SESSION['userid']; |
201 | 201 | |
202 | 202 | if ($sessionUserId == $ob->oldUserId) { // if old user requests swap |
203 | 203 | // notify new user |
204 | - $notificationMessage = $ob->oldUserFirstName.' requested a swap'; |
|
204 | + $notificationMessage = $ob->oldUserFirstName . ' requested a swap'; |
|
205 | 205 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
206 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
206 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
207 | 207 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
208 | 208 | } elseif ($sessionUserId == $ob->newUserId) { // if new user requests swap |
209 | 209 | // notify old user |
210 | - $notificationMessage = $ob->newUserFirstName.' requested a swap'; |
|
210 | + $notificationMessage = $ob->newUserFirstName . ' requested a swap'; |
|
211 | 211 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
212 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
212 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
213 | 213 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
214 | 214 | } else { // notify both users |
215 | 215 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
216 | - $notificationMessageOldUser = $sessionUserFirstName.' requested a swap for '.$ob->newUserFirstName; |
|
217 | - $notificationMessageNewUser = $sessionUserFirstName.' requested a swap for '.$ob->oldUserFirstName; |
|
216 | + $notificationMessageOldUser = $sessionUserFirstName . ' requested a swap for ' . $ob->newUserFirstName; |
|
217 | + $notificationMessageNewUser = $sessionUserFirstName . ' requested a swap for ' . $ob->oldUserFirstName; |
|
218 | 218 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
219 | 219 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
220 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessageOldUser); |
|
221 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessageNewUser); |
|
220 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessageOldUser); |
|
221 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessageNewUser); |
|
222 | 222 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
223 | 223 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
224 | 224 | } |
@@ -251,60 +251,60 @@ discard block |
||
251 | 251 | |
252 | 252 | $verificationCode = verificationCodeForSwap($swapId); |
253 | 253 | |
254 | - $subject = 'Swap accepted: '.$ob->newUserName.' - '.$ob->eventDate; |
|
255 | - $message = "The following swap has been accepted\r\n\r\n". |
|
256 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
257 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
258 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
259 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
254 | + $subject = 'Swap accepted: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
255 | + $message = "The following swap has been accepted\r\n\r\n" . |
|
256 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
257 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
258 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
259 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
260 | 260 | $from = $ob->siteadmin; |
261 | 261 | |
262 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
262 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
263 | 263 | |
264 | 264 | $sessionUserId = $_SESSION['userid']; |
265 | 265 | |
266 | 266 | if ($sessionUserId == $ob->oldUserId) { // if old user accepted swap |
267 | 267 | // notify new user |
268 | - $notificationMessage = $ob->oldUserFirstName.' accepted a swap'; |
|
268 | + $notificationMessage = $ob->oldUserFirstName . ' accepted a swap'; |
|
269 | 269 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
270 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
270 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
271 | 271 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
272 | 272 | } elseif ($sessionUserId == $ob->newUserId) { // if new user accepted swap |
273 | 273 | // notify old user |
274 | - $notificationMessage = $ob->newUserFirstName.' accepted a swap'; |
|
274 | + $notificationMessage = $ob->newUserFirstName . ' accepted a swap'; |
|
275 | 275 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
276 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
276 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
277 | 277 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
278 | 278 | } elseif (isset($_GET['token'])) { // if accepted by email URL with token |
279 | 279 | // notify whoever requested swap |
280 | 280 | if ($ob->newUserId == $ob->requestedBy) { |
281 | - $notificationMessage = 'Swap accepted with '.$ob->oldUserFirstName; |
|
281 | + $notificationMessage = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
282 | 282 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
283 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
283 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
284 | 284 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
285 | 285 | } elseif ($ob->oldUserId == $ob->requestedBy) { |
286 | - $notificationMessage = 'Swap accepted with '.$ob->newUserFirstName; |
|
286 | + $notificationMessage = 'Swap accepted with ' . $ob->newUserFirstName; |
|
287 | 287 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
288 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
288 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
289 | 289 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
290 | 290 | } else { // notify both |
291 | - $notificationMessageOldUser = 'Swap accepted with '.$ob->newUserFirstName; |
|
292 | - $notificationMessageNewUser = 'Swap accepted with '.$ob->oldUserFirstName; |
|
291 | + $notificationMessageOldUser = 'Swap accepted with ' . $ob->newUserFirstName; |
|
292 | + $notificationMessageNewUser = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
293 | 293 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
294 | 294 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
295 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
296 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
295 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
296 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
297 | 297 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
298 | 298 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
299 | 299 | } |
300 | 300 | } else { // notify both users |
301 | 301 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
302 | - $notificationMessageOldUser = $sessionUserFirstName.' accepted a swap for '.$ob->newUserFirstName; |
|
303 | - $notificationMessageNewUser = $sessionUserFirstName.' accepted a swap for '.$ob->oldUserFirstName; |
|
302 | + $notificationMessageOldUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->newUserFirstName; |
|
303 | + $notificationMessageNewUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->oldUserFirstName; |
|
304 | 304 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
305 | 305 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
306 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
307 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
306 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
307 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
308 | 308 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
309 | 309 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
310 | 310 | } |
@@ -336,39 +336,39 @@ discard block |
||
336 | 336 | |
337 | 337 | $verificationCode = verificationCodeForSwap($swapId); |
338 | 338 | |
339 | - $subject = 'Swap declined: '.$ob->newUserName.' - '.$ob->eventDate; |
|
340 | - $message = "The following swap has been declined\r\n\r\n". |
|
341 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
342 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
343 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
344 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
339 | + $subject = 'Swap declined: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
340 | + $message = "The following swap has been declined\r\n\r\n" . |
|
341 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
342 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
343 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
344 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
345 | 345 | |
346 | 346 | $from = $ob->siteadmin; |
347 | 347 | |
348 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
348 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
349 | 349 | |
350 | 350 | $sessionUserId = $_SESSION['userid']; |
351 | 351 | |
352 | 352 | if ($sessionUserId == $ob->oldUserId) { // if old user declines swap |
353 | 353 | // notify new user |
354 | - $notificationMessage = $ob->oldUserFirstName.' declined a swap'; |
|
354 | + $notificationMessage = $ob->oldUserFirstName . ' declined a swap'; |
|
355 | 355 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
356 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
356 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
357 | 357 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
358 | 358 | } elseif ($sessionUserId == $ob->newUserId) { // if new user declines swap |
359 | 359 | // notify old user |
360 | - $notificationMessage = $ob->newUserFirstName.' declined a swap'; |
|
360 | + $notificationMessage = $ob->newUserFirstName . ' declined a swap'; |
|
361 | 361 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
362 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
362 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
363 | 363 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
364 | 364 | } else { // notify both users |
365 | 365 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
366 | - $notificationMessageOldUser = $sessionUserFirstName.' declined a swap for '.$ob->newUserFirstName; |
|
367 | - $notificationMessageNewUser = $sessionUserFirstName.' declined a swap for '.$ob->oldUserFirstName; |
|
366 | + $notificationMessageOldUser = $sessionUserFirstName . ' declined a swap for ' . $ob->newUserFirstName; |
|
367 | + $notificationMessageNewUser = $sessionUserFirstName . ' declined a swap for ' . $ob->oldUserFirstName; |
|
368 | 368 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
369 | 369 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
370 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
371 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
370 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
371 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
372 | 372 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
373 | 373 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
374 | 374 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $stmt = mysqli_prepare(db(), $sql); |
544 | 544 | mysqli_stmt_bind_param($stmt, 'i', $seriesId); |
545 | 545 | if (!mysqli_stmt_execute($stmt)) { |
546 | - die('Error: '.mysqli_error(db())); |
|
546 | + die('Error: ' . mysqli_error(db())); |
|
547 | 547 | } |
548 | 548 | mysqli_stmt_close($stmt); |
549 | 549 | } |
@@ -555,14 +555,14 @@ discard block |
||
555 | 555 | mysqli_stmt_bind_param($stmt, 'ii', $bandId, $userRoleId); |
556 | 556 | |
557 | 557 | if (!mysqli_stmt_execute($stmt)) { |
558 | - die('Error: '.mysqli_error(db())); |
|
558 | + die('Error: ' . mysqli_error(db())); |
|
559 | 559 | } |
560 | 560 | mysqli_stmt_close($stmt); |
561 | 561 | } |
562 | 562 | |
563 | 563 | function getEventUrl($eventId) |
564 | 564 | { |
565 | - return 'event.php?id='.$eventId; |
|
565 | + return 'event.php?id=' . $eventId; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | function getEventDetails($eventID, $separator, $type = 4, $apprev_description = true, $prefix = '') |
@@ -602,9 +602,9 @@ discard block |
||
602 | 602 | e.id = ? "; |
603 | 603 | |
604 | 604 | if ($type == 1) { |
605 | - $sql = $sql."AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
605 | + $sql = $sql . "AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
606 | 606 | } |
607 | - $sql = $sql.'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
607 | + $sql = $sql . 'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
608 | 608 | |
609 | 609 | $stmt = mysqli_prepare(db(), $sql); |
610 | 610 | mysqli_stmt_bind_param($stmt, 'i', $eventID); |
@@ -625,32 +625,32 @@ discard block |
||
625 | 625 | |
626 | 626 | $firstname = $row['firstname']; |
627 | 627 | if ($firstname != 'Team') { |
628 | - $firstname = ltrim(substr($firstname, 0, 1).'.', '.'); |
|
628 | + $firstname = ltrim(substr($firstname, 0, 1) . '.', '.'); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $lastname = $row['lastname']; |
632 | 632 | |
633 | - $returnValue = $returnValue.$separator; |
|
633 | + $returnValue = $returnValue . $separator; |
|
634 | 634 | switch ($type) { |
635 | 635 | case 0: |
636 | 636 | //all persons of event |
637 | 637 | //break; -> no special handling, fallthrough to case 1 |
638 | 638 | case 1: |
639 | 639 | //only persons with groupID in 10,11,2 -> handled in sql query |
640 | - $returnValue = $returnValue.$prefix.ltrim($group.': '); |
|
641 | - $returnValue = $returnValue.trim($firstname.' '.$lastname); |
|
640 | + $returnValue = $returnValue . $prefix . ltrim($group . ': '); |
|
641 | + $returnValue = $returnValue . trim($firstname . ' ' . $lastname); |
|
642 | 642 | break; |
643 | 643 | case 2: |
644 | 644 | //only event date and event type |
645 | - $returnValue = $returnValue.strftime($time_format_normal, strtotime($eventDate)); |
|
646 | - $returnValue = $returnValue.$separator; |
|
647 | - $returnValue = $returnValue.$eventType; |
|
645 | + $returnValue = $returnValue . strftime($time_format_normal, strtotime($eventDate)); |
|
646 | + $returnValue = $returnValue . $separator; |
|
647 | + $returnValue = $returnValue . $eventType; |
|
648 | 648 | |
649 | 649 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
650 | 650 | break; |
651 | 651 | case 4: |
652 | 652 | //only event type |
653 | - $returnValue = $returnValue.$eventType; |
|
653 | + $returnValue = $returnValue . $eventType; |
|
654 | 654 | |
655 | 655 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
656 | 656 | break; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | // create username and remove all whitespace |
38 | - $username = $firstNameLower.'.'.$lastNameLower; |
|
38 | + $username = $firstNameLower . '.' . $lastNameLower; |
|
39 | 39 | $username = preg_replace('/\s+/', '', $username); |
40 | 40 | |
41 | 41 | $sql = "INSERT INTO users (firstName, lastName, username, email, mobile, password, created, updated) |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $id = mysqli_insert_id(db()); |
49 | 49 | |
50 | 50 | $notificationMessage = "Welcome to your new account on the rota system.\n |
51 | -If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress().'](mailto:'.siteSettings()->getAdminEmailAddress().").\n |
|
51 | +If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress() . '](mailto:' . siteSettings()->getAdminEmailAddress() . ").\n |
|
52 | 52 | ---\n |
53 | 53 | **Sync to digital calendar**\n |
54 | 54 | You may wish to link the rota to your digital calendar on your computer and phone. To do so, generate a [calendar token](calendarTokens.php) which will present you with your unique URL. Follow instructions from your digital calendar provider for exact details on how import an iCal feed, or get in touch and we may be able to help.\n"; |
55 | 55 | |
56 | - createNotificationForUser($id, 'Welcome '.$firstName, $notificationMessage, 'feature'); |
|
56 | + createNotificationForUser($id, 'Welcome ' . $firstName, $notificationMessage, 'feature'); |
|
57 | 57 | createNotificationForUser($id, 'Change your password', 'Please change your password to something unique and memorable.', 'account', 'editPassword.php'); |
58 | 58 | |
59 | 59 | return $id; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | "DELETE FROM users WHERE id = ?" |
98 | 98 | ]; |
99 | 99 | |
100 | - foreach($queries as $sql) { |
|
100 | + foreach ($queries as $sql) { |
|
101 | 101 | $stmt = mysqli_prepare(db(), $sql); |
102 | 102 | mysqli_stmt_bind_param($stmt, 'i', $id); |
103 | 103 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | function updatePermissions($id, $isAdmin, $isBandAdmin, $isEventEditor, $isOverviewRecipient) |
124 | 124 | { |
125 | 125 | $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
126 | - $isAdmin = (bool)$isAdmin; |
|
127 | - $isOverviewRecipient = (bool)$isOverviewRecipient; |
|
128 | - $isBandAdmin = (bool)$isBandAdmin; |
|
129 | - $isEventEditor = (bool)$isEventEditor; |
|
126 | + $isAdmin = (bool) $isAdmin; |
|
127 | + $isOverviewRecipient = (bool) $isOverviewRecipient; |
|
128 | + $isBandAdmin = (bool) $isBandAdmin; |
|
129 | + $isEventEditor = (bool) $isEventEditor; |
|
130 | 130 | |
131 | 131 | $sql = "UPDATE users |
132 | 132 | SET isAdmin = ?, |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $result = mysqli_stmt_get_result($stmt); |
151 | 151 | $ob = mysqli_fetch_object($result); |
152 | 152 | mysqli_stmt_close($stmt); |
153 | - $name = $ob->firstName.' '.$ob->lastName; |
|
153 | + $name = $ob->firstName . ' ' . $ob->lastName; |
|
154 | 154 | |
155 | 155 | return $name; |
156 | 156 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | mysqli_stmt_bind_param($stmt, 'ssi', $hashedPassword, $currentTimestamp, $userId); |
243 | 243 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
244 | 244 | mysqli_stmt_close($stmt); |
245 | - insertStatistics('user', __FILE__, 'password force changed for user '.getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']); |
|
245 | + insertStatistics('user', __FILE__, 'password force changed for user ' . getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | function hashPassword($plainTextPassword) |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if ($loginFailures < $numberOfAllowedAttempts) { |
289 | 289 | return true; |
290 | 290 | } else { |
291 | - insertStatistics('user', __FILE__, 'Login attempts exceeded for username: '.$username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
291 | + insertStatistics('user', __FILE__, 'Login attempts exceeded for username: ' . $username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
292 | 292 | |
293 | 293 | return false; |
294 | 294 | } |
@@ -376,11 +376,11 @@ discard block |
||
376 | 376 | $pendingId = mysqli_insert_id(db()); |
377 | 377 | mysqli_stmt_close($stmt); |
378 | 378 | |
379 | - $linkToApprove = 'pendingAccounts.php?id='.$pendingId; |
|
379 | + $linkToApprove = 'pendingAccounts.php?id=' . $pendingId; |
|
380 | 380 | |
381 | - $email = siteSettings()->getOwner().'<'.siteSettings()->getAdminEmailAddress().'>'; |
|
382 | - $subject = $firstName.' requested an account'; |
|
383 | - $message = $subject.' through '.$source.".\nApprove or decline: ".siteSettings()->getSiteUrl().'/'.$linkToApprove; |
|
381 | + $email = siteSettings()->getOwner() . '<' . siteSettings()->getAdminEmailAddress() . '>'; |
|
382 | + $subject = $firstName . ' requested an account'; |
|
383 | + $message = $subject . ' through ' . $source . ".\nApprove or decline: " . siteSettings()->getSiteUrl() . '/' . $linkToApprove; |
|
384 | 384 | |
385 | 385 | sendMail($email, $subject, $message, $email); |
386 | 386 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | addSocialAuthToUserWithId($userId, $pendingUser->socialId, $pendingUser->source); |
473 | 473 | updateUser($userId, $pendingUser->firstName, $pendingUser->lastName, $pendingUser->email, null); |
474 | 474 | |
475 | - createNotificationForUser($userId, 'Social Login added: '.$pendingUser->source, 'Your social media login details for '.$pendingUser->source.' have been added to your existing account', 'account'); |
|
475 | + createNotificationForUser($userId, 'Social Login added: ' . $pendingUser->source, 'Your social media login details for ' . $pendingUser->source . ' have been added to your existing account', 'account'); |
|
476 | 476 | createFacebookNotificationForUser($userId, 'login.php', 'Your account request has been approved. You can now login via Facebook.'); |
477 | 477 | |
478 | 478 | return true; |
@@ -587,25 +587,25 @@ discard block |
||
587 | 587 | if ($user->socialId) { |
588 | 588 | switch ($size) { |
589 | 589 | case 'small': // 50px x 50px |
590 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=square'; |
|
590 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=square'; |
|
591 | 591 | break; |
592 | 592 | case 'large': // 200px x 200px |
593 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=large'; |
|
593 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=large'; |
|
594 | 594 | break; |
595 | 595 | default: |
596 | - return '//graph.facebook.com/'.$user->socialId.'/picture'; |
|
596 | + return '//graph.facebook.com/' . $user->socialId . '/picture'; |
|
597 | 597 | break; |
598 | 598 | } |
599 | 599 | } else { |
600 | 600 | switch ($size) { |
601 | 601 | case 'small': // 50px x 50px |
602 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
602 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
603 | 603 | break; |
604 | 604 | case 'large': // 200px x 200px |
605 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=200&d=mm'; |
|
605 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=200&d=mm'; |
|
606 | 606 | break; |
607 | 607 | default: |
608 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
608 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
609 | 609 | break; |
610 | 610 | } |
611 | 611 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $_SESSION['db_is_logged_in'] = true; |
22 | 22 | $_SESSION['isAdmin'] = $row['isAdmin']; // Set the admin status to be carried across this session |
23 | 23 | $_SESSION['userid'] = $row['id']; |
24 | - $_SESSION['name'] = $row['firstName'].' '.$row['lastName']; |
|
24 | + $_SESSION['name'] = $row['firstName'] . ' ' . $row['lastName']; |
|
25 | 25 | $_SESSION['isBandAdmin'] = $row['isBandAdmin']; // Set the band admin status to be carried across this session |
26 | 26 | $_SESSION['isEventEditor'] = $row['isEventEditor']; // Set the event editor status to be carried across this session |
27 | 27 | $_SESSION['onlyShowUserEvents'] = $users_start_with_myevents; // 1 if users_start_with_myevents is set in settings, can be changed by user during session |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // admin section |
35 | 35 | if ($_SESSION['isAdmin'] == 1) { |
36 | - updateDatabase(); //check for db updates |
|
36 | + updateDatabase(); //check for db updates |
|
37 | 37 | //$_SESSION['onlyShowUserEvents'] = '0'; //show all events for admin, regardless what settings say |
38 | 38 | } |
39 | 39 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $redirectFromSession = strip_tags($_SESSION['redirectUrl']); |
52 | 52 | unset($_SESSION['redirectUrl']); |
53 | 53 | // check is url is on same domain and prevents redirecting to logout page |
54 | - if (strncmp(strtolower(siteSettings()->getSiteUrl().'/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) { |
|
54 | + if (strncmp(strtolower(siteSettings()->getSiteUrl() . '/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) { |
|
55 | 55 | $redirectUrl = $redirectFromSession; |
56 | 56 | } |
57 | 57 | } |
58 | - header('Location: '.$redirectUrl); |
|
58 | + header('Location: ' . $redirectUrl); |
|
59 | 59 | exit; |
60 | 60 | } |
61 | 61 | } |
@@ -142,10 +142,10 @@ |
||
142 | 142 | </form> |
143 | 143 | </div><!-- /.box --> |
144 | 144 | <?php |
145 | - if (isAdmin()) { |
|
146 | - ?> |
|
145 | + if (isAdmin()) { |
|
146 | + ?> |
|
147 | 147 | <div id="right"> |
148 | 148 | <div class="item"><a href="settings.php">Back to settings</a></div> |
149 | 149 | <?php |
150 | - } ?> |
|
150 | + } ?> |
|
151 | 151 | <?php include 'includes/footer.php'; ?> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
99 | 99 | $locationID = $row['id']; |
100 | - echo "<span id='".$locationID."' class='edit'>".$row['name'].'</span> '; |
|
101 | - echo " <a href='locations.php?locationremove=true&locationID=".$locationID."'><i class='fa fa-close'></i></a><br />"; |
|
100 | + echo "<span id='" . $locationID . "' class='edit'>" . $row['name'] . '</span> '; |
|
101 | + echo " <a href='locations.php?locationremove=true&locationID=" . $locationID . "'><i class='fa fa-close'></i></a><br />"; |
|
102 | 102 | } ?> |
103 | 103 | </div><!-- /.box-body --> |
104 | 104 | </div><!-- /.box --> |