@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if (!empty($eventId)) { |
| 111 | 111 | // ensure user is logged in before allowing creation of swap |
| 112 | 112 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
| 113 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/swap.php?event='.$eventId; |
|
| 113 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/swap.php?event=' . $eventId; |
|
| 114 | 114 | header('Location: login.php'); |
| 115 | 115 | } |
| 116 | 116 | $createSwap = true; |
@@ -186,11 +186,11 @@ discard block |
||
| 186 | 186 | <p> |
| 187 | 187 | <strong> |
| 188 | 188 | <s class="text-red"> |
| 189 | - <?php echo $swap->getOldUserRole()->getUser()->getFirstName().' '.$swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
| 189 | + <?php echo $swap->getOldUserRole()->getUser()->getFirstName() . ' ' . $swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
| 190 | 190 | </s> |
| 191 | 191 | → |
| 192 | 192 | <span class="text-green"> |
| 193 | - <?php echo $swap->getNewUserRole()->getUser()->getFirstName().' '.$swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
| 193 | + <?php echo $swap->getNewUserRole()->getUser()->getFirstName() . ' ' . $swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
| 194 | 194 | </span> |
| 195 | 195 | </strong> |
| 196 | 196 | </p> |
@@ -225,16 +225,16 @@ discard block |
||
| 225 | 225 | <select name="newUserRole" class="form-control"> |
| 226 | 226 | <?php |
| 227 | 227 | if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
| 228 | - $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
| 228 | + $whereAnd = 'r.groupId = ' . groupIdWithRole($role->roleId) . ' AND r.allowRoleSwaps IS NOT FALSE'; |
|
| 229 | 229 | } else { |
| 230 | - $whereAnd = 'r.id = '.$role->roleId; |
|
| 230 | + $whereAnd = 'r.id = ' . $role->roleId; |
|
| 231 | 231 | } |
| 232 | - $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM cr_users u INNER JOIN cr_userRoles ur ON ur.userId = u.id INNER JOIN cr_roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
| 232 | + $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM cr_users u INNER JOIN cr_userRoles ur ON ur.userId = u.id INNER JOIN cr_roles r ON r.id = ur.roleId WHERE u.id <> ' . $role->userId . ' AND ' . $whereAnd . ' ORDER BY lastName, firstName, r.name'; |
|
| 233 | 233 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 234 | 234 | |
| 235 | 235 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 236 | 236 | ?> |
| 237 | - <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'].' '.$row['lastName'].' ('.$row['name'].')'; ?></option> |
|
| 237 | + <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'] . ' ' . $row['lastName'] . ' (' . $row['name'] . ')'; ?></option> |
|
| 238 | 238 | <?php |
| 239 | 239 | } ?> |
| 240 | 240 | </select> |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | METHOD:PUBLISH |
| 69 | 69 | VERSION:2.0 |
| 70 | 70 | PRODID:-//Church Rota//Church Rota//EN |
| 71 | -X-WR-CALNAME:'.siteSettings()->getOwner()." Rota |
|
| 71 | +X-WR-CALNAME:'.siteSettings()->getOwner() . " Rota |
|
| 72 | 72 | CALSCALE:GREGORIAN |
| 73 | 73 | BEGIN:VTIMEZONE |
| 74 | 74 | TZID:Europe/London |
@@ -94,16 +94,16 @@ discard block |
||
| 94 | 94 | foreach ($events as $event): |
| 95 | 95 | $output .= |
| 96 | 96 | 'BEGIN:VEVENT |
| 97 | -SUMMARY:'.$event->role.($event->name ? ' | '.$event->name.' ('.$event->type.')' : ' ('.$event->type.')').' |
|
| 98 | -DESCRIPTION:'.ical_split('DESCRIPTION:', $event->series.':\n'.$event->sermonTitle.' ('.$event->bibleVerse.')\n\nIf you are unable to do '.$event->role.' at this event, please request a swap:\n'.siteSettings()->getSiteUrl().'/swap.php?event='.$event->id.'\n\nOnce the swap is accepted, this event will be removed from your calendar.\nPlease be aware that changes may take up to 24 hours or longer to be reflected. This is due to your calendar, not on the rota system.').' |
|
| 99 | -UID:ROTA'.$event->id.' |
|
| 100 | -ORGANIZER;CN="'.siteSettings()->getOwner().'":MAILTO:'.siteSettings()->getAdminEmailAddress().' |
|
| 101 | -STATUS:'.'CONFIRMED'.' |
|
| 102 | -DTSTART;TZID="Europe/London":'.date(DATE_ICAL, strtotime($event->date)).' |
|
| 103 | -DTEND;TZID="Europe/London":'.date(DATE_ICAL, strtotime($event->date) + HOUR).' |
|
| 104 | -LAST-MODIFIED:'.date(DATE_ICAL, strtotime($event->updated)).'Z |
|
| 105 | -LOCATION:'.ical_split('LOCATION:', $event->locationName.', '.$event->locationAddress).' |
|
| 106 | -URL:'.siteSettings()->getSiteUrl().'/event.php?id='.$event->id." |
|
| 97 | +SUMMARY:'.$event->role . ($event->name ? ' | ' . $event->name . ' (' . $event->type . ')' : ' (' . $event->type . ')') . ' |
|
| 98 | +DESCRIPTION:'.ical_split('DESCRIPTION:', $event->series . ':\n' . $event->sermonTitle . ' (' . $event->bibleVerse . ')\n\nIf you are unable to do ' . $event->role . ' at this event, please request a swap:\n' . siteSettings()->getSiteUrl() . '/swap.php?event=' . $event->id . '\n\nOnce the swap is accepted, this event will be removed from your calendar.\nPlease be aware that changes may take up to 24 hours or longer to be reflected. This is due to your calendar, not on the rota system.') . ' |
|
| 99 | +UID:ROTA'.$event->id . ' |
|
| 100 | +ORGANIZER;CN="'.siteSettings()->getOwner() . '":MAILTO:' . siteSettings()->getAdminEmailAddress() . ' |
|
| 101 | +STATUS:'.'CONFIRMED' . ' |
|
| 102 | +DTSTART;TZID="Europe/London":'.date(DATE_ICAL, strtotime($event->date)) . ' |
|
| 103 | +DTEND;TZID="Europe/London":'.date(DATE_ICAL, strtotime($event->date) + HOUR) . ' |
|
| 104 | +LAST-MODIFIED:'.date(DATE_ICAL, strtotime($event->updated)) . 'Z |
|
| 105 | +LOCATION:'.ical_split('LOCATION:', $event->locationName . ', ' . $event->locationAddress) . ' |
|
| 106 | +URL:'.siteSettings()->getSiteUrl() . '/event.php?id=' . $event->id . " |
|
| 107 | 107 | BEGIN:VALARM |
| 108 | 108 | ACTION:DISPLAY |
| 109 | 109 | DESCRIPTION:Reminder for Rota |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | exit; |
| 34 | 34 | } |
| 35 | 35 | if (!isAdmin()) { |
| 36 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 36 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 37 | 37 | exit; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -57,20 +57,20 @@ discard block |
||
| 57 | 57 | if ($action == 'update') { |
| 58 | 58 | //if ($language='de-de') |
| 59 | 59 | if ($rowSettings['lang_locale'] == 'en_GB') { |
| 60 | - executeDbSql("update cr_settings set lang_locale = 'de_DE'"); // de_DE |
|
| 60 | + executeDbSql("update cr_settings set lang_locale = 'de_DE'"); // de_DE |
|
| 61 | 61 | executeDbSql("update cr_settings set time_format_long = '%A, %e. %B %Y, %R Uhr, KW%V'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V |
| 62 | 62 | executeDbSql("update cr_settings set time_format_normal = '%d.%m.%Y %H:%M '"); // de_DE: %d.%m.%Y %H:%M |
| 63 | - executeDbSql("update cr_settings set time_format_short = '%a, <strong>%e. %b</strong>, %R'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
| 63 | + executeDbSql("update cr_settings set time_format_short = '%a, <strong>%e. %b</strong>, %R'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
| 64 | 64 | executeDbSql("update cr_settings set time_zone = 'Europe/Berlin'"); //de_DE: Europe/Berlin |
| 65 | 65 | executeDbSql("update cr_settings set google_group_calendar = ''"); |
| 66 | 66 | executeDbSql("update cr_settings set overviewemail = '{{Gottesdienst-Planung [MONTH] [YEAR]}}\r\nHallo zusammen,\r\n\r\nanbei die Gottesdienst-Planung fuer [MONTH] [YEAR]\r\n\r\n[OVERVIEW]\r\n\r\nBitte fruehzeitig Bescheid geben, wenn etwas NICHT passt, ansonsten gehe ich davon aus, dass ihr wie geplant koennt.\r\n\r\nAlles Gute und Gottes Segen f�r Euch und Euren Dienst.\r\nEuer Gottesdienst Orga-Team'"); |
| 67 | 67 | } |
| 68 | 68 | //else |
| 69 | 69 | if ($rowSettings['lang_locale'] == 'de_DE') { |
| 70 | - executeDbSql("update cr_settings set lang_locale = 'en_GB'"); // de_DE |
|
| 70 | + executeDbSql("update cr_settings set lang_locale = 'en_GB'"); // de_DE |
|
| 71 | 71 | executeDbSql("update cr_settings set time_format_long = '%A, %B %e @ %I:%M %p'"); // de_DE: %A, %e. %B %Y, %R Uhr, KW%V |
| 72 | 72 | executeDbSql("update cr_settings set time_format_normal = '%m/%d/%y %I:%M %p'"); // de_DE: %d.%m.%Y %H:%M |
| 73 | - executeDbSql("update cr_settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
| 73 | + executeDbSql("update cr_settings set time_format_short = '%a, <strong>%b %e</strong>, %I:%M %p'"); // de_DE: %a, <strong>%e. %b</strong>, KW%V |
|
| 74 | 74 | executeDbSql("update cr_settings set time_zone = 'Europe/London'"); //de_DE: Europe/Berlin |
| 75 | 75 | executeDbSql("update cr_settings set google_group_calendar = ''"); |
| 76 | 76 | executeDbSql("update cr_settings set overviewemail = 'Hello,\r\n\r\nIn this email you find the Rota for [MONTH] [YEAR].\r\n\r\n[OVERVIEW]\r\n\r\nPlease inform us as soon as possible, if you are not able to serve as scheduled.\r\n\r\nBe blessed.\r\nChurch Support Stuff'"); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $resultSettings = mysqli_query(db(), $sqlSettings) or die(mysqli_error(db())); |
| 83 | 83 | $rowSettings = mysqli_fetch_array($resultSettings, MYSQLI_ASSOC); |
| 84 | 84 | |
| 85 | - $updateNotification = 'Settings updated successfully to: '.$rowSettings['lang_locale'].' <br> <br>'; |
|
| 85 | + $updateNotification = 'Settings updated successfully to: ' . $rowSettings['lang_locale'] . ' <br> <br>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $formatting = 'true'; |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | <hr> |
| 95 | 95 | This page has only beta status. <br>Please do only use it in testing environments! |
| 96 | 96 | <hr> |
| 97 | - <?php echo 'Your web browser identifies your language as: '.$language; ?><br> |
|
| 98 | - <?php echo 'Church Rota is set to use: '.$rowSettings['lang_locale']; ?><br> <br> |
|
| 97 | + <?php echo 'Your web browser identifies your language as: ' . $language; ?><br> |
|
| 98 | + <?php echo 'Church Rota is set to use: ' . $rowSettings['lang_locale']; ?><br> <br> |
|
| 99 | 99 | |
| 100 | 100 | <?php |
| 101 | 101 | if ($updateNotification == '') { |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Facebook; |
| 6 | 6 | |
| 7 | -ini_set('display_errors', false); // set on for development, off for production |
|
| 7 | +ini_set('display_errors', false); // set on for development, off for production |
|
| 8 | 8 | ini_set('log_errors', true); |
| 9 | 9 | error_reporting(E_ALL); |
| 10 | 10 | |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | // Returns a `Facebook\FacebookResponse` object |
| 38 | 38 | $response = $fb->get('/me?fields=id,name,email', $accessToken); |
| 39 | 39 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 40 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 40 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 41 | 41 | exit; |
| 42 | 42 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 43 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 43 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 44 | 44 | exit; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | if (($userisBandAdmin) || ($userisEventEditor) || (isAdmin())) { |
| 46 | 46 | // Just continue the code |
| 47 | 47 | } else { |
| 48 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 48 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if ($userisBandAdmin) { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $location = $row['location']; |
| 83 | 83 | $locationname = $row['locationname']; |
| 84 | 84 | if ($action == 'edit') { |
| 85 | - $formaction = '?action=edit&id='.$id; |
|
| 85 | + $formaction = '?action=edit&id=' . $id; |
|
| 86 | 86 | } else { |
| 87 | 87 | $formaction = ''; |
| 88 | 88 | } |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // convert format of date |
| 141 | 141 | $date = str_replace('/', '-', $date); // ensure it isn't read as mm/dd/yyyy |
| 142 | - $date = strftime('%Y-%m-%d', strtotime($date.' 00:00:00')); |
|
| 143 | - $date = $date.' '.$time.':00'; |
|
| 142 | + $date = strftime('%Y-%m-%d', strtotime($date . ' 00:00:00')); |
|
| 143 | + $date = $date . ' ' . $time . ':00'; |
|
| 144 | 144 | $date = mysqli_real_escape_string(db(), $date); |
| 145 | 145 | |
| 146 | 146 | if ($action == 'edit') { |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | //if ($userisBandAdmin) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from cr_skills where groupid=2)"; |
| 211 | 211 | //if ($userisEventEditor) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from cr_skills where groupid!=2)"; |
| 212 | 212 | if ($userisBandAdmin) { |
| 213 | - $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from cr_skills where groupid in (2,3,4))'; |
|
| 213 | + $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from cr_skills where groupid in (2,3,4))'; |
|
| 214 | 214 | } |
| 215 | 215 | if ($userisEventEditor) { |
| 216 | - $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from cr_skills where not (groupid in (2,3,4)))'; |
|
| 216 | + $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from cr_skills where not (groupid in (2,3,4)))'; |
|
| 217 | 217 | } |
| 218 | 218 | mysqli_query(db(), $delete_all_sql) or die(mysqli_error(db())); |
| 219 | 219 | } |
@@ -221,9 +221,9 @@ discard block |
||
| 221 | 221 | // redirect |
| 222 | 222 | if (isset($_SESSION['lastEventsFilter'])) { |
| 223 | 223 | $type = $_SESSION['lastEventsFilter']; |
| 224 | - header('Location: events.php?view=all&filter='.$type.'#event'.$eventID); |
|
| 224 | + header('Location: events.php?view=all&filter=' . $type . '#event' . $eventID); |
|
| 225 | 225 | } else { |
| 226 | - header('Location: events.php?view=all#event'.$eventID); |
|
| 226 | + header('Location: events.php?view=all#event' . $eventID); |
|
| 227 | 227 | } |
| 228 | 228 | exit; |
| 229 | 229 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | while ($ob = mysqli_fetch_object($result)) { |
| 301 | 301 | if (!(isset($type) && $ob->id == $type)) { |
| 302 | 302 | $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime)); |
| 303 | - echo "<option value='".$ob->id."' title='".$ob->description."' data-time='".($defaultTime == '00:00' ? '' : $defaultTime)."' data-location='".(is_null($ob->defaultLocationId) ? '' : $ob->defaultLocationId)."'>".$ob->name.'</option>'; |
|
| 303 | + echo "<option value='" . $ob->id . "' title='" . $ob->description . "' data-time='" . ($defaultTime == '00:00' ? '' : $defaultTime) . "' data-location='" . (is_null($ob->defaultLocationId) ? '' : $ob->defaultLocationId) . "'>" . $ob->name . '</option>'; |
|
| 304 | 304 | } |
| 305 | 305 | } ?> |
| 306 | 306 | </select> |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 327 | 327 | if (isset($subtype) && $row['id'] == $subtype) { |
| 328 | 328 | } else { |
| 329 | - echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>'; |
|
| 329 | + echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>'; |
|
| 330 | 330 | } |
| 331 | 331 | } ?> |
| 332 | 332 | </select> |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 355 | 355 | if (isset($location) && $row['id'] == $location) { |
| 356 | 356 | } else { |
| 357 | - echo "<option value='".$row['id']."'>".$row['name'].'</option>'; |
|
| 357 | + echo "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>'; |
|
| 358 | 358 | } |
| 359 | 359 | } ?> |
| 360 | 360 | </select> |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 498 | 498 | if (isset($type) && $row['id'] == $type) { |
| 499 | 499 | } else { |
| 500 | - echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>'; |
|
| 500 | + echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>'; |
|
| 501 | 501 | } |
| 502 | 502 | } ?> |
| 503 | 503 | </select> |
@@ -567,8 +567,8 @@ discard block |
||
| 567 | 567 | <?php foreach ($role->getUserRoles() as $userRole): ?> |
| 568 | 568 | <?php if (!$userRole->getReserve()): ?> |
| 569 | 569 | <?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?> |
| 570 | - <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option> |
|
| 571 | - <?php else: ?> |
|
| 570 | + <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option> |
|
| 571 | + <?php else : ?> |
|
| 572 | 572 | <?php $countReserve += 1 ?> |
| 573 | 573 | <?php endif //!userRole->getReserve?> |
| 574 | 574 | <?php endforeach //users?> |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | <?php foreach ($role->getUserRoles() as $userRole): ?> |
| 579 | 579 | <?php if ($userRole->getReserve()): ?> |
| 580 | 580 | <?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?> |
| 581 | - <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option> |
|
| 581 | + <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option> |
|
| 582 | 582 | <?php endif ?> |
| 583 | 583 | <?php endforeach //users?> |
| 584 | 584 | </optgroup> |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | FROM cr_eventTypes et |
| 112 | 112 | WHERE id IN (SELECT e.type |
| 113 | 113 | FROM cr_events e |
| 114 | - WHERE '.$whereTwoMonth.' |
|
| 114 | + WHERE '.$whereTwoMonth . ' |
|
| 115 | 115 | AND e.removed = 0) |
| 116 | 116 | ORDER BY name'; |
| 117 | 117 | $result = mysqli_query(db(), $filter_sql) or die(mysqli_error(db())); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | <tr> |
| 133 | 133 | <td ><strong>Event</strong></td> |
| 134 | 134 | <?php |
| 135 | - $sql = 'SELECT * FROM cr_groups g ORDER BY '.$group_sorting_name; |
|
| 135 | + $sql = 'SELECT * FROM cr_groups g ORDER BY ' . $group_sorting_name; |
|
| 136 | 136 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 137 | 137 | |
| 138 | 138 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | if ($filter == '') { |
| 165 | 165 | $sql .= ' |
| 166 | - AND '.$whereTwoMonth.' |
|
| 166 | + AND '.$whereTwoMonth . ' |
|
| 167 | 167 | ORDER BY |
| 168 | 168 | e.date'; |
| 169 | 169 | } elseif ($filter == 'all') { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } elseif ($filter != '') { |
| 174 | 174 | $sql .= " |
| 175 | 175 | AND e.type = '$filter' |
| 176 | - AND ".$whereTwoMonth.' |
|
| 176 | + AND " . $whereTwoMonth . ' |
|
| 177 | 177 | ORDER BY |
| 178 | 178 | e.date'; |
| 179 | 179 | } |
@@ -188,34 +188,34 @@ discard block |
||
| 188 | 188 | echo '<tr>'; |
| 189 | 189 | echo '<td >'; |
| 190 | 190 | setlocale(LC_TIME, $lang_locale); //de_DE |
| 191 | - echo '<a href="event.php?id='.$row['id'].'">'; |
|
| 191 | + echo '<a href="event.php?id=' . $row['id'] . '">'; |
|
| 192 | 192 | echo strftime($time_format_short, strtotime($row['sundayDate'])); // %a, <strong>%e. %b</strong>, KW%V |
| 193 | 193 | echo '</a>'; |
| 194 | 194 | |
| 195 | 195 | //$row['sundayDate'] |
| 196 | 196 | if (!empty($row['eventType'])) { |
| 197 | - echo '<br /><em> '.$row['eventType'].'</em>'; |
|
| 197 | + echo '<br /><em> ' . $row['eventType'] . '</em>'; |
|
| 198 | 198 | } |
| 199 | 199 | if (!empty($row['eventSubType'])) { |
| 200 | - echo ' - <em>'.$row['eventSubType'].'</em>'; |
|
| 200 | + echo ' - <em>' . $row['eventSubType'] . '</em>'; |
|
| 201 | 201 | } |
| 202 | 202 | if (!empty($row['eventLocation'])) { |
| 203 | - echo '<br /><em> '.$row['eventLocation'].'</em>'; |
|
| 203 | + echo '<br /><em> ' . $row['eventLocation'] . '</em>'; |
|
| 204 | 204 | } |
| 205 | 205 | if (!empty($row['name'])) { |
| 206 | - echo '<br /><em> '.$row['name'].'</em>'; |
|
| 206 | + echo '<br /><em> ' . $row['name'] . '</em>'; |
|
| 207 | 207 | } |
| 208 | 208 | if (!empty($row['eventGroup'])) { |
| 209 | - echo '<br /><strong> '.$row['eventGroup'].'</strong>'; |
|
| 209 | + echo '<br /><strong> ' . $row['eventGroup'] . '</strong>'; |
|
| 210 | 210 | } |
| 211 | 211 | if (!empty($row['sermonTitle'])) { |
| 212 | - echo ': '.$row['sermonTitle']; |
|
| 212 | + echo ': ' . $row['sermonTitle']; |
|
| 213 | 213 | } |
| 214 | 214 | if (!empty($row['bibleVerse'])) { |
| 215 | - echo ' <em>('.$row['bibleVerse'].')</em>'; |
|
| 215 | + echo ' <em>(' . $row['bibleVerse'] . ')</em>'; |
|
| 216 | 216 | } |
| 217 | 217 | if (!empty($row['comment'])) { |
| 218 | - echo '<br /><em> ('.$row['comment'].')</em>'; |
|
| 218 | + echo '<br /><em> (' . $row['comment'] . ')</em>'; |
|
| 219 | 219 | } |
| 220 | 220 | echo '</td>'; |
| 221 | 221 | |
@@ -247,16 +247,16 @@ discard block |
||
| 247 | 247 | if ($previousName == '') { |
| 248 | 248 | // new name |
| 249 | 249 | echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : ''; |
| 250 | - echo $name.' <em>('.$viewPeople['role']; |
|
| 250 | + echo $name . ' <em>(' . $viewPeople['role']; |
|
| 251 | 251 | } elseif ($previousName != $name) { |
| 252 | 252 | echo ')</em>'; |
| 253 | 253 | echo ($viewPeople['userId'] != $sessionUserId) ? '</strong>' : ''; |
| 254 | 254 | echo '<br />'; // line break from previous name |
| 255 | 255 | // new name |
| 256 | 256 | echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : ''; |
| 257 | - echo $name.' <em>('.$viewPeople['role']; |
|
| 257 | + echo $name . ' <em>(' . $viewPeople['role']; |
|
| 258 | 258 | } else { |
| 259 | - echo ', '.$viewPeople['role']; |
|
| 259 | + echo ', ' . $viewPeople['role']; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $peopleInEvent = true; |
@@ -42,12 +42,12 @@ |
||
| 42 | 42 | |
| 43 | 43 | $ret = ''; |
| 44 | 44 | |
| 45 | - $chars = 26 * 2 + 10; //26 (a-z) + 26 (A-Z) + 10 (0-9) |
|
| 45 | + $chars = 26 * 2 + 10; //26 (a-z) + 26 (A-Z) + 10 (0-9) |
|
| 46 | 46 | //a-z = 97-122 |
| 47 | 47 | //A-Z = 65-90 |
| 48 | 48 | //0-9 = 48-57 |
| 49 | 49 | |
| 50 | - srand(make_seed()); //Seed with microseconds |
|
| 50 | + srand(make_seed()); //Seed with microseconds |
|
| 51 | 51 | //if you don't need this, you can just use srand(time()); |
| 52 | 52 | |
| 53 | 53 | for ($i = 1; $i <= $length; $i++) { |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | echo var_dump($accessToken); |
| 39 | 39 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 40 | 40 | // When Graph returns an error |
| 41 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 41 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 42 | 42 | exit; |
| 43 | 43 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 44 | 44 | // When validation fails or other local issues |
| 45 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 45 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 46 | 46 | exit; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (!isset($accessToken)) { |
| 50 | 50 | if ($helper->getError()) { |
| 51 | 51 | header('HTTP/1.0 401 Unauthorized'); |
| 52 | - echo 'Error: '.$helper->getError()."\n"; |
|
| 53 | - echo 'Error Code: '.$helper->getErrorCode()."\n"; |
|
| 54 | - echo 'Error Reason: '.$helper->getErrorReason()."\n"; |
|
| 55 | - echo 'Error Description: '.$helper->getErrorDescription()."\n"; |
|
| 52 | + echo 'Error: ' . $helper->getError() . "\n"; |
|
| 53 | + echo 'Error Code: ' . $helper->getErrorCode() . "\n"; |
|
| 54 | + echo 'Error Reason: ' . $helper->getErrorReason() . "\n"; |
|
| 55 | + echo 'Error Description: ' . $helper->getErrorDescription() . "\n"; |
|
| 56 | 56 | } else { |
| 57 | 57 | header('HTTP/1.0 400 Bad Request'); |
| 58 | 58 | echo 'Bad request'; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | try { |
| 77 | 77 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
| 78 | 78 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 79 | - echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n"; |
|
| 79 | + echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n"; |
|
| 80 | 80 | exit; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | - $sendNotif = $fb->post('/'.$facebookUserId.'/notifications', ['href' => $url, 'template' => $message], $appAccessToken); |
|
| 123 | + $sendNotif = $fb->post('/' . $facebookUserId . '/notifications', ['href' => $url, 'template' => $message], $appAccessToken); |
|
| 124 | 124 | |
| 125 | 125 | if ($sendNotif->getHttpStatusCode() == 200) { |
| 126 | 126 | return true; |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $dbMailId = mailToDb($to, $subject, $message, $from, $bcc); |
| 29 | 29 | |
| 30 | - $subject = '[rota] '.$subject; |
|
| 30 | + $subject = '[rota] ' . $subject; |
|
| 31 | 31 | |
| 32 | 32 | $message .= "\n\n"; |
| 33 | - $message .= siteSettings()->getOwner()."\n"; |
|
| 34 | - $message .= 'Mail generated with ChurchRota V.'.siteSettings()->getVersion()."\n"; |
|
| 35 | - $message .= siteSettings()->getSiteUrl()."\n"; |
|
| 33 | + $message .= siteSettings()->getOwner() . "\n"; |
|
| 34 | + $message .= 'Mail generated with ChurchRota V.' . siteSettings()->getVersion() . "\n"; |
|
| 35 | + $message .= siteSettings()->getSiteUrl() . "\n"; |
|
| 36 | 36 | |
| 37 | 37 | $mailSentOk = false; |
| 38 | 38 | |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
| 77 | 77 | //spaces to suppress automatic removal of "unnecessary linefeeds" in outlook 2003 |
| 78 | 78 | $crlf = " \n"; |
| 79 | - $message = str_replace("\r\n", $crlf, $message); //replace crlf's |
|
| 79 | + $message = str_replace("\r\n", $crlf, $message); //replace crlf's |
|
| 80 | 80 | |
| 81 | 81 | //-------------------------------------------------------------------------------- |
| 82 | - $headers = 'From: '.$from.$crlf. |
|
| 83 | - 'Reply-To: '.$from.$crlf. |
|
| 84 | - 'Mime-Version: 1.0'.$crlf. |
|
| 85 | - 'Content-Type: text/plain; charset=ISO-8859-1'.$crlf; |
|
| 86 | - 'Content-Transfer-Encoding: quoted-printable'.$crlf; |
|
| 82 | + $headers = 'From: ' . $from . $crlf . |
|
| 83 | + 'Reply-To: ' . $from . $crlf . |
|
| 84 | + 'Mime-Version: 1.0' . $crlf . |
|
| 85 | + 'Content-Type: text/plain; charset=ISO-8859-1' . $crlf; |
|
| 86 | + 'Content-Transfer-Encoding: quoted-printable' . $crlf; |
|
| 87 | 87 | $headerSimple = $headers; |
| 88 | 88 | |
| 89 | 89 | //-------------------------------------------------------------------------------- |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | $to = str_replace(';', ',', $to); |
| 93 | 93 | |
| 94 | 94 | if ($mail_dbg) { |
| 95 | - $subject = ' - Mail Debug: '.$subject; //debug output |
|
| 96 | - $message .= $crlf.'To: '.$to.$crlf; //debug move to to end of message |
|
| 95 | + $subject = ' - Mail Debug: ' . $subject; //debug output |
|
| 96 | + $message .= $crlf . 'To: ' . $to . $crlf; //debug move to to end of message |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | //-------------------------------------------------------------------------------- |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | foreach ($teile as $adr) { |
| 106 | 106 | if (preg_replace("/([a-zA-Z0-9._%+-]+)(@)([a-zA-Z0-9.-]+)(\.)([a-zA-Z]+)/i", '# # #', trim($adr)) == '# # #') { |
| 107 | 107 | if ($mail_dbg) { |
| 108 | - $message .= 'Bcc: '.trim($adr).$crlf; |
|
| 108 | + $message .= 'Bcc: ' . trim($adr) . $crlf; |
|
| 109 | 109 | } else { |
| 110 | - $headers .= 'Bcc: '.trim($adr).$crlf; |
|
| 110 | + $headers .= 'Bcc: ' . trim($adr) . $crlf; |
|
| 111 | 111 | } |
| 112 | 112 | $i = $i + 1; |
| 113 | 113 | } else { |
| 114 | - $bcc_err .= $adr.$crlf; |
|
| 114 | + $bcc_err .= $adr . $crlf; |
|
| 115 | 115 | $err .= +1; |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | if ($mailOk) { |
| 145 | 145 | //mail($from, "[ChurchRota] Mail status - OK", "address ok: " . $i, $headerSimple); |
| 146 | 146 | } else { |
| 147 | - mail($from, '[Rota] Mail status - ERROR', 'to: '.$to.$crlf.'address ok: '.$i.$crlf.'address errors: '.$err.$crlf.$bcc_err, $headerSimple); |
|
| 147 | + mail($from, '[Rota] Mail status - ERROR', 'to: ' . $to . $crlf . 'address ok: ' . $i . $crlf . 'address errors: ' . $err . $crlf . $bcc_err, $headerSimple); |
|
| 148 | 148 | |
| 149 | 149 | return false; |
| 150 | - logFailedMailWithId($dbMailId, 'address ok: '.$i.$crlf.'address errors: '.$err.$crlf.$bcc_err, $headerSimple); |
|
| 150 | + logFailedMailWithId($dbMailId, 'address ok: ' . $i . $crlf . 'address errors: ' . $err . $crlf . $bcc_err, $headerSimple); |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -204,9 +204,9 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | $categoryname = $row['categoryname']; |
| 206 | 206 | $to = $row['email']; |
| 207 | - $subject = 'New post: '.$objectname; |
|
| 207 | + $subject = 'New post: ' . $objectname; |
|
| 208 | 208 | |
| 209 | - $finalmessage = 'Dear '.$postname."\n \n".$message.$objectname."\n \n". |
|
| 209 | + $finalmessage = 'Dear ' . $postname . "\n \n" . $message . $objectname . "\n \n" . |
|
| 210 | 210 | 'To see the post, please login using your username and password'; |
| 211 | 211 | |
| 212 | 212 | sendMail($to, $subject, $finalmessage, $row['siteadmin']); |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $message = siteSettings()->getNewUserMessage(); |
| 228 | 228 | |
| 229 | - $name = $user->firstName.' '.$user->lastName; |
|
| 229 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 230 | 230 | $message = str_replace('[name]', $name, $message); |
| 231 | 231 | $message = str_replace('[username]', $user->username, $message); |
| 232 | 232 | $message = str_replace('[password]', $password, $message); |
| 233 | 233 | $message = str_replace('[siteurl]', siteSettings()->getSiteUrl(), $message); |
| 234 | 234 | |
| 235 | - $subject = 'Account created for '.$name; |
|
| 235 | + $subject = 'Account created for ' . $name; |
|
| 236 | 236 | |
| 237 | - $to = $name.' <'.$user->email.'>'; |
|
| 238 | - $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>'; |
|
| 237 | + $to = $name . ' <' . $user->email . '>'; |
|
| 238 | + $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>'; |
|
| 239 | 239 | |
| 240 | 240 | sendMail($to, $subject, $message, $from); |
| 241 | - sendMail($from, 'ADMIN COPY: '.$subject, $message, $from); |
|
| 241 | + sendMail($from, 'ADMIN COPY: ' . $subject, $message, $from); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | function parseEmailTemplate($message, $values) |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $values['siteemail'] = siteSettings()->getAdminEmailAddress(); |
| 250 | 250 | |
| 251 | 251 | foreach ($values as $template_field => $value) { |
| 252 | - $message = str_ireplace('['.$template_field.']', trim($value), $message); |
|
| 252 | + $message = str_ireplace('[' . $template_field . ']', trim($value), $message); |
|
| 253 | 253 | } |
| 254 | 254 | $message = trim($message); |
| 255 | 255 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $message = str_replace('[rehearsal]', $rehearsal, $message); |
| 266 | 266 | if (is_array($rotaoutput)): |
| 267 | 267 | foreach ($rotaoutput as $key => $skill): |
| 268 | - $skillfinal = $skillfinal.$skill.' '; |
|
| 268 | + $skillfinal = $skillfinal . $skill . ' '; |
|
| 269 | 269 | endforeach; else: |
| 270 | 270 | $skillfinal = $rotaoutput; |
| 271 | 271 | endif; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | function notifyIndividual($userID, $eventID, $skillID) |
| 284 | 284 | { |
| 285 | 285 | notifyEveryoneForEvent($eventID, $skillID, $userID); |
| 286 | - $eventID = 0; //disables following code through empty sql result |
|
| 286 | + $eventID = 0; //disables following code through empty sql result |
|
| 287 | 287 | |
| 288 | 288 | $sql = "SELECT *, |
| 289 | 289 | (SELECT CONCAT(`firstname`, ' ', `lastname`) FROM cr_users WHERE `cr_users`.id = `cr_skills`.`userID` ORDER BY `cr_users`.firstname) AS `name`, |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | if (($row['eventRehearsal'] == '0') or ($row['eventRehearsalChange'] == '1')) { |
| 325 | 325 | $rehearsal = $row['norehearsalemail']; |
| 326 | 326 | } else { |
| 327 | - $rehearsal = $row['yesrehearsal'].' on '.$rehearsaldate.' at '.$location; |
|
| 327 | + $rehearsal = $row['yesrehearsal'] . ' on ' . $rehearsaldate . ' at ' . $location; |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $skill = $row['category']; |
| 332 | 332 | if ($row['joinedskill'] != '') { |
| 333 | - $skill = $skill.' - '.$row['joinedskill']; |
|
| 333 | + $skill = $skill . ' - ' . $row['joinedskill']; |
|
| 334 | 334 | } else { |
| 335 | 335 | // If there is no skill, then we don't need to mention this fact. |
| 336 | 336 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $location = $row['eventLocationFormatted']; |
| 347 | 347 | $rotaoutput = $skill; |
| 348 | 348 | $to = $row['email']; |
| 349 | - $subject = 'Rota reminder: '.$date; |
|
| 349 | + $subject = 'Rota reminder: ' . $date; |
|
| 350 | 350 | |
| 351 | 351 | $message = emailTemplate($message, $name, $date, $location, $rehearsal, $rotaoutput, $username, $siteurl); |
| 352 | 352 | |
@@ -421,9 +421,9 @@ discard block |
||
| 421 | 421 | $comment = '-'; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - $eventdetails = $eventrow['eventGroup'].': '.$eventrow['sermonTitle']; |
|
| 424 | + $eventdetails = $eventrow['eventGroup'] . ': ' . $eventrow['sermonTitle']; |
|
| 425 | 425 | if (!empty($eventrow['bibleVerse'])) { |
| 426 | - $eventdetails .= ' ('.$eventrow['bibleVerse'].')'; |
|
| 426 | + $eventdetails .= ' (' . $eventrow['bibleVerse'] . ')'; |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | while ($roleRow = mysqli_fetch_array($roleResult, MYSQLI_ASSOC)) { |
| 447 | 447 | if (($roleRow['name'] == '') || ($roleRow['name'] == $roleRow['description'])): |
| 448 | 448 | $roles[] = $roleRow['description']; else: |
| 449 | - $roles[] = $roleRow['description'].' - '.$roleRow['name']; |
|
| 449 | + $roles[] = $roleRow['description'] . ' - ' . $roleRow['name']; |
|
| 450 | 450 | endif; |
| 451 | 451 | } |
| 452 | 452 | |
@@ -466,11 +466,11 @@ discard block |
||
| 466 | 466 | $message = siteSettings()->getNotificationEmail(); |
| 467 | 467 | $rotaoutput = implode(', ', $roles); |
| 468 | 468 | |
| 469 | - $to = $ob->name.' <'.$ob->email.'>'; |
|
| 470 | - $from = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>'; |
|
| 469 | + $to = $ob->name . ' <' . $ob->email . '>'; |
|
| 470 | + $from = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>'; |
|
| 471 | 471 | |
| 472 | 472 | //$subject = "Rota reminder: " . $date; |
| 473 | - $subject = 'Reminder: '.implode(', ', $roles).' - '.$type.': '.$date; |
|
| 473 | + $subject = 'Reminder: ' . implode(', ', $roles) . ' - ' . $type . ': ' . $date; |
|
| 474 | 474 | |
| 475 | 475 | $rotadetails = getEventDetails($eventId, "\r\n", 0, false, "\t"); |
| 476 | 476 | |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | ep.notified = 1 |
| 507 | 507 | WHERE |
| 508 | 508 | ep.eventId = '$eventId' |
| 509 | - AND ur.userId IN (".implode(', ', $countarray).')'; |
|
| 509 | + AND ur.userId IN (" . implode(', ', $countarray) . ')'; |
|
| 510 | 510 | |
| 511 | 511 | mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 512 | 512 | } |
@@ -535,14 +535,14 @@ discard block |
||
| 535 | 535 | $user = mysqli_fetch_object($result); |
| 536 | 536 | |
| 537 | 537 | if (!$user->email) { |
| 538 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 538 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | if (!$user->recieveReminderEmails) { |
| 542 | - return $user->firstName.' '.$user->lastName.' opted not to recieve reminder emails'; |
|
| 542 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve reminder emails'; |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | - $name = $user->firstName.' '.$user->lastName; |
|
| 545 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 546 | 546 | |
| 547 | 547 | //line seperator for mails |
| 548 | 548 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | $eventDetails .= ' - '; |
| 577 | 577 | $eventDetails .= "\r\n"; |
| 578 | 578 | $eventDetails .= $event->type; |
| 579 | - $eventDetails .= $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')'; |
|
| 579 | + $eventDetails .= $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')'; |
|
| 580 | 580 | $eventDetails .= "\r\n"; |
| 581 | - $eventDetails .= 'Notes: '.$event->comment; |
|
| 581 | + $eventDetails .= 'Notes: ' . $event->comment; |
|
| 582 | 582 | $eventDetails .= "\r\n"; |
| 583 | 583 | $eventDetails .= "\r\n"; |
| 584 | 584 | |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | 'event.location' => $event->location, |
| 604 | 604 | 'event.comment' => $event->comment, |
| 605 | 605 | |
| 606 | - 'event.sermon' => $event->eventGroup.': '.$event->sermonTitle.' ('.$event->bibleVerse.')', |
|
| 606 | + 'event.sermon' => $event->eventGroup . ': ' . $event->sermonTitle . ' (' . $event->bibleVerse . ')', |
|
| 607 | 607 | 'event.sermon.name' => $event->sermonTitle, |
| 608 | 608 | 'event.sermon.series' => $event->eventGroup, |
| 609 | 609 | 'event.sermon.verse' => $event->bibleVerse, |
@@ -617,8 +617,8 @@ discard block |
||
| 617 | 617 | |
| 618 | 618 | //$message = str_replace("\r\n",$crlf,$message); |
| 619 | 619 | |
| 620 | - $to = $name.' <'.$user->email.'>'; |
|
| 621 | - $from = siteSettings()->getOwner().' <'.$siteSettings()->getAdminEmailAddress().'>'; |
|
| 620 | + $to = $name . ' <' . $user->email . '>'; |
|
| 621 | + $from = siteSettings()->getOwner() . ' <' . $siteSettings()->getAdminEmailAddress() . '>'; |
|
| 622 | 622 | |
| 623 | 623 | $sent = false; |
| 624 | 624 | $sent = sendMail($to, $subject, $message, $from); |
@@ -626,10 +626,10 @@ discard block |
||
| 626 | 626 | if ($sent == true) { |
| 627 | 627 | return true; |
| 628 | 628 | } else { |
| 629 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 629 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 632 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | function getEventEmailSubject($eventId) |
@@ -676,16 +676,16 @@ discard block |
||
| 676 | 676 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 677 | 677 | $groupNames = ''; |
| 678 | 678 | while ($group = mysqli_fetch_object($result)) { |
| 679 | - $groupNames .= $group->name.', '; |
|
| 679 | + $groupNames .= $group->name . ', '; |
|
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | if (isset($errors)) { |
| 683 | - createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames.' groups with errors: '.implode(', ', $errors), 'email'); |
|
| 683 | + createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . ' groups with errors: ' . implode(', ', $errors), 'email'); |
|
| 684 | 684 | |
| 685 | 685 | return $errors; |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | - createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email'); |
|
| 688 | + createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email'); |
|
| 689 | 689 | |
| 690 | 690 | return $true; |
| 691 | 691 | } |
@@ -737,16 +737,16 @@ discard block |
||
| 737 | 737 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 738 | 738 | $groupNames = ''; |
| 739 | 739 | while ($group = mysqli_fetch_object($result)) { |
| 740 | - $groupNames .= $group->name.', '; |
|
| 740 | + $groupNames .= $group->name . ', '; |
|
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | if (isset($errors)) { |
| 744 | - createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to '.$groupNames." groups with errors: \n- ".implode("\n- ", $errors), 'email'); |
|
| 744 | + createNotificationForUser($_SESSION['userid'], 'Email sent with warnings', 'Email sent to ' . $groupNames . " groups with errors: \n- " . implode("\n- ", $errors), 'email'); |
|
| 745 | 745 | |
| 746 | 746 | return $errors; |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to '.$groupNames, 'email'); |
|
| 749 | + createNotificationForUser($_SESSION['userid'], 'Group email sent', 'Email sent successfully to ' . $groupNames, 'email'); |
|
| 750 | 750 | |
| 751 | 751 | return $true; |
| 752 | 752 | } |
@@ -762,14 +762,14 @@ discard block |
||
| 762 | 762 | $user = mysqli_fetch_object($result); |
| 763 | 763 | |
| 764 | 764 | if (!$user->email) { |
| 765 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 765 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | if (!$user->isOverviewRecipient) { |
| 769 | - return $user->firstName.' '.$user->lastName.' opted not to recieve group emails'; |
|
| 769 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails'; |
|
| 770 | 770 | } |
| 771 | 771 | |
| 772 | - $name = $user->firstName.' '.$user->lastName; |
|
| 772 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 773 | 773 | |
| 774 | 774 | //line seperator for mails |
| 775 | 775 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | |
| 817 | 817 | $eventDetails .= $ob->roles; |
| 818 | 818 | $eventDetails .= "\r\n"; |
| 819 | - $eventDetails .= 'Notes: '.$ob->comment; |
|
| 819 | + $eventDetails .= 'Notes: ' . $ob->comment; |
|
| 820 | 820 | $eventDetails .= "\r\n"; |
| 821 | 821 | $eventDetails .= "\r\n"; |
| 822 | 822 | |
@@ -835,8 +835,8 @@ discard block |
||
| 835 | 835 | |
| 836 | 836 | //$message = str_replace("\r\n",$crlf,$message); |
| 837 | 837 | |
| 838 | - $to = $name.' <'.$user->email.'>'; |
|
| 839 | - $from = siteSettings()->getOwner().' <'.$siteadmin.'>'; |
|
| 838 | + $to = $name . ' <' . $user->email . '>'; |
|
| 839 | + $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>'; |
|
| 840 | 840 | |
| 841 | 841 | $sent = false; |
| 842 | 842 | $sent = sendMail($to, $subject, $message, $from); |
@@ -844,10 +844,10 @@ discard block |
||
| 844 | 844 | if ($sent == true) { |
| 845 | 845 | return true; |
| 846 | 846 | } else { |
| 847 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 847 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 850 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | // returns either true, or error message string |
@@ -860,14 +860,14 @@ discard block |
||
| 860 | 860 | $user = mysqli_fetch_object($result); |
| 861 | 861 | |
| 862 | 862 | if (!$user->email) { |
| 863 | - return 'No email address present for '.$user->firstName.' '.$user->lastName; |
|
| 863 | + return 'No email address present for ' . $user->firstName . ' ' . $user->lastName; |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | if (!$user->isOverviewRecipient) { |
| 867 | - return $user->firstName.' '.$user->lastName.' opted not to recieve group emails'; |
|
| 867 | + return $user->firstName . ' ' . $user->lastName . ' opted not to recieve group emails'; |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | - $name = $user->firstName.' '.$user->lastName; |
|
| 870 | + $name = $user->firstName . ' ' . $user->lastName; |
|
| 871 | 871 | |
| 872 | 872 | //line seperator for mails |
| 873 | 873 | //rfc sais \r\n, but this makes trouble in outlook. several spaces plus \n works fine in outlook and thunderbird. |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if (!isset($events)) { |
| 903 | - return $name.' has no events in the upcoming rota'; |
|
| 903 | + return $name . ' has no events in the upcoming rota'; |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | $events = implode(', ', $events); |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | |
| 956 | 956 | $eventDetails .= $row['joinedskills']; |
| 957 | 957 | $eventDetails .= "\r\n"; |
| 958 | - $eventDetails .= 'Notes: '.$row['comment']; |
|
| 958 | + $eventDetails .= 'Notes: ' . $row['comment']; |
|
| 959 | 959 | $eventDetails .= "\r\n"; |
| 960 | 960 | $eventDetails .= "\r\n"; |
| 961 | 961 | } |
@@ -971,8 +971,8 @@ discard block |
||
| 971 | 971 | |
| 972 | 972 | //$message = str_replace("\r\n",$crlf,$message); |
| 973 | 973 | |
| 974 | - $to = $name.' <'.$user->email.'>'; |
|
| 975 | - $from = siteSettings()->getOwner().' <'.$siteadmin.'>'; |
|
| 974 | + $to = $name . ' <' . $user->email . '>'; |
|
| 975 | + $from = siteSettings()->getOwner() . ' <' . $siteadmin . '>'; |
|
| 976 | 976 | |
| 977 | 977 | $sent = false; |
| 978 | 978 | $sent = sendMail($to, $subject, $message, $from); |
@@ -980,10 +980,10 @@ discard block |
||
| 980 | 980 | if ($sent == true) { |
| 981 | 981 | return true; |
| 982 | 982 | } else { |
| 983 | - return 'Error while sending mail to '.$user->firstName.' '.$user->lastName; |
|
| 983 | + return 'Error while sending mail to ' . $user->firstName . ' ' . $user->lastName; |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | - return 'Unknown error for '.$user->firstName.' '.$user->lastName; |
|
| 986 | + return 'Unknown error for ' . $user->firstName . ' ' . $user->lastName; |
|
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | function notifyAttack($fileName, $attackType, $attackerID) |
@@ -998,10 +998,10 @@ discard block |
||
| 998 | 998 | |
| 999 | 999 | while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) { |
| 1000 | 1000 | $subject = 'SECURITY-ALERT - Attack blocked successfully'; |
| 1001 | - $message = "Type:\t\t ".$attackType."<br>\r\n". |
|
| 1002 | - "Attacker:\t ".$row[name]."<br>\r\n". |
|
| 1003 | - "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n". |
|
| 1004 | - "Script:\t\t ".$fileName."\r\n "."<br>\r\n"; |
|
| 1001 | + $message = "Type:\t\t " . $attackType . "<br>\r\n" . |
|
| 1002 | + "Attacker:\t " . $row[name] . "<br>\r\n" . |
|
| 1003 | + "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" . |
|
| 1004 | + "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n"; |
|
| 1005 | 1005 | |
| 1006 | 1006 | //$headers = 'From: ' . $row['siteadmin'] . "\r\n" . |
| 1007 | 1007 | //'Reply-To: ' . $row['siteadmin'] . "\r\n"; |
@@ -1011,8 +1011,8 @@ discard block |
||
| 1011 | 1011 | //mail($to, $subject, strip_tags($message), $headers); |
| 1012 | 1012 | sendMail($to, $subject, strip_tags($message), $to); |
| 1013 | 1013 | |
| 1014 | - echo $subject.'<br><br>'; |
|
| 1015 | - echo $message.'<br>'; |
|
| 1014 | + echo $subject . '<br><br>'; |
|
| 1015 | + echo $message . '<br>'; |
|
| 1016 | 1016 | echo 'An email about this incident was sent to administrator!'; |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
@@ -1027,11 +1027,11 @@ discard block |
||
| 1027 | 1027 | $userresult = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 1028 | 1028 | |
| 1029 | 1029 | while ($row = mysqli_fetch_array($userresult, MYSQLI_ASSOC)) { |
| 1030 | - $subject = 'Info - '.$infoMsg.' - '.$row[name]; |
|
| 1031 | - $message = "Type:\t\t ".$infoMsg."<br>\r\n". |
|
| 1032 | - "User:\t\t ".$row[name]."<br>\r\n". |
|
| 1033 | - "Date:\t\t ".date('Y-m-d H:i:s')."<br>\r\n". |
|
| 1034 | - "Script:\t\t ".$fileName."\r\n "."<br>\r\n"; |
|
| 1030 | + $subject = 'Info - ' . $infoMsg . ' - ' . $row[name]; |
|
| 1031 | + $message = "Type:\t\t " . $infoMsg . "<br>\r\n" . |
|
| 1032 | + "User:\t\t " . $row[name] . "<br>\r\n" . |
|
| 1033 | + "Date:\t\t " . date('Y-m-d H:i:s') . "<br>\r\n" . |
|
| 1034 | + "Script:\t\t " . $fileName . "\r\n " . "<br>\r\n"; |
|
| 1035 | 1035 | |
| 1036 | 1036 | //$headers = 'From: ' . $row['siteadmin'] . "\r\n" . |
| 1037 | 1037 | //'Reply-To: ' . $row['siteadmin'] . "\r\n"; |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | if (preg_match("/(\{\{)((.)+){1}(\}\})/", $message, $matches) == 1) { |
| 1049 | 1049 | $defaultSubject = $matches[2]; |
| 1050 | 1050 | //$subject = str_replace(array("{{","}}"),"",$matches[0]); |
| 1051 | - $message = str_replace($matches[1].$matches[2].$matches[4], '', $message); |
|
| 1051 | + $message = str_replace($matches[1] . $matches[2] . $matches[4], '', $message); |
|
| 1052 | 1052 | //$message = $matches[4]; |
| 1053 | 1053 | |
| 1054 | 1054 | //$message = $message . "\r\n\r\n"; |