@@ -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 == '') { |
@@ -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++) { |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | function facebook() |
17 | 17 | { |
18 | 18 | $fb = new Facebook\Facebook([ |
19 | - 'app_id' => siteConfig()['auth']['facebook']['appId'], |
|
20 | - 'app_secret' => siteConfig()['auth']['facebook']['appSecret'], |
|
21 | - 'default_graph_version' => 'v2.2', |
|
22 | - ]); |
|
19 | + 'app_id' => siteConfig()['auth']['facebook']['appId'], |
|
20 | + 'app_secret' => siteConfig()['auth']['facebook']['appSecret'], |
|
21 | + 'default_graph_version' => 'v2.2', |
|
22 | + ]); |
|
23 | 23 | |
24 | 24 | return $fb; |
25 | 25 | } |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | $tokenMetadata = $oAuth2Client->debugToken($accessToken); |
67 | 67 | |
68 | 68 | // Validation (these will throw FacebookSDKException's when they fail) |
69 | - $tokenMetadata->validateAppId($config['auth']['facebook']['appId']); // Replace {app-id} with your app id |
|
70 | - // If you know the user ID this access token belongs to, you can validate it here |
|
71 | - //$tokenMetadata->validateUserId('123'); |
|
72 | - $tokenMetadata->validateExpiration(); |
|
69 | + $tokenMetadata->validateAppId($config['auth']['facebook']['appId']); // Replace {app-id} with your app id |
|
70 | + // If you know the user ID this access token belongs to, you can validate it here |
|
71 | + //$tokenMetadata->validateUserId('123'); |
|
72 | + $tokenMetadata->validateExpiration(); |
|
73 | 73 | |
74 | 74 | if (!$accessToken->isLongLived()) { |
75 | 75 | // Exchanges a short-lived access token for a long-lived one |
@@ -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; |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $statusMessage = 'Sent successfully'; |
54 | 54 | } else { |
55 | 55 | foreach ($sent as $errorMessage) { |
56 | - $statusMessage .= '<p>'.$errorMessage.'</p>'; |
|
56 | + $statusMessage .= '<p>' . $errorMessage . '</p>'; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | if (!isAdmin()) { |
17 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
17 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if ($role && $assignTo) { |
35 | 35 | $sql = "UPDATE cr_roles r SET r.groupId = '$assignTo' WHERE r.id = '$role'"; |
36 | 36 | if (!mysqli_query(db(), $sql)) { |
37 | - die('Error: '.mysqli_error(db())); |
|
37 | + die('Error: ' . mysqli_error(db())); |
|
38 | 38 | } |
39 | 39 | header('Location: roles.php'); |
40 | 40 | exit; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $sql = "INSERT INTO cr_roles (name, description, rehersalId, groupId) |
71 | 71 | VALUES ('$newrole', '$newrole', $rehersal, $groupId)"; |
72 | 72 | if (!mysqli_query(db(), $sql)) { |
73 | - die('Error: '.mysqli_error(db())); |
|
73 | + die('Error: ' . mysqli_error(db())); |
|
74 | 74 | } |
75 | 75 | } elseif ($method == 'newgroup') { |
76 | 76 | $groupId = $_POST['groups']; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $sql = "INSERT INTO cr_groups (name, description) |
87 | 87 | VALUES ('$newgroup', '$newgroup')"; |
88 | 88 | if (!mysqli_query(db(), $sql)) { |
89 | - die('Error: '.mysqli_error(db())); |
|
89 | + die('Error: ' . mysqli_error(db())); |
|
90 | 90 | } |
91 | 91 | } else { |
92 | 92 | // Handle renaming of the roles |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $i = 1; |
120 | 120 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
121 | 121 | if ($type == 'option') { |
122 | - $list = $list."<option value='".$row['id']."'>".$row['name'].'</option>'; |
|
122 | + $list = $list . "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>'; |
|
123 | 123 | } elseif ($type == 'li') { |
124 | - $list = $list.'<li>'.$row['name'].'</li>'; |
|
124 | + $list = $list . '<li>' . $row['name'] . '</li>'; |
|
125 | 125 | } elseif ($type == 'li-a') { |
126 | - $list = $list."<li><a href='roles.php?role=".$roleId.'&assignto='.$row['id']."'>".$row['name'].'</a></li>'; |
|
126 | + $list = $list . "<li><a href='roles.php?role=" . $roleId . '&assignto=' . $row['id'] . "'>" . $row['name'] . '</a></li>'; |
|
127 | 127 | } |
128 | 128 | $i++; |
129 | 129 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $group = $row['groupId']; |
190 | 190 | $down = $group + 1; |
191 | 191 | $up = $group - 1; |
192 | - echo '<div><strong>'.$groupname.'</strong><br />'; |
|
192 | + echo '<div><strong>' . $groupname . '</strong><br />'; |
|
193 | 193 | } |
194 | 194 | // Print text input box if a role exists for the group. |
195 | 195 | // Allows user to update role names and move roles between groups |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // After we have inserted the data, we want to head back to the main users page |
57 | - header('Location: locations.php'); // Move to the home page of the admin section |
|
58 | - exit; |
|
57 | + header('Location: locations.php'); // Move to the home page of the admin section |
|
58 | + exit; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | </form> |
122 | 122 | </div><!-- /.box --> |
123 | 123 | <?php |
124 | - if (isAdmin()) { |
|
125 | - ?> |
|
124 | + if (isAdmin()) { |
|
125 | + ?> |
|
126 | 126 | <div id="right"> |
127 | 127 | <div class="item"><a href="settings.php">Back to settings</a></div> |
128 | 128 | <?php |
129 | - } ?> |
|
129 | + } ?> |
|
130 | 130 | <?php include 'includes/footer.php'; ?> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | if (!isAdmin()) { |
17 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
17 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $sql = "UPDATE cr_locations SET name = '$name' WHERE id = '$editid'"; |
40 | 40 | } |
41 | 41 | if (!mysqli_query(db(), $sql)) { |
42 | - die('Error: '.mysqli_error(db())); |
|
42 | + die('Error: ' . mysqli_error(db())); |
|
43 | 43 | } |
44 | 44 | } else { |
45 | 45 | $newlocation = $_POST['newlocation']; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | $sql = ("INSERT INTO cr_locations (name) VALUES ('$newlocation')"); |
52 | 52 | if (!mysqli_query(db(), $sql)) { |
53 | - die('Error: '.mysqli_error(db())); |
|
53 | + die('Error: ' . mysqli_error(db())); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // After we have inserted the data, we want to head back to the main users page |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | |
96 | 96 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
97 | 97 | $locationID = $row['id']; |
98 | - echo "<span id='".$locationID."' class='edit'>".$row['name'].'</span> '; |
|
99 | - echo " <a href='locations.php?locationremove=true&locationID=".$locationID."'><i class='fa fa-close'></i></a><br />"; |
|
98 | + echo "<span id='" . $locationID . "' class='edit'>" . $row['name'] . '</span> '; |
|
99 | + echo " <a href='locations.php?locationremove=true&locationID=" . $locationID . "'><i class='fa fa-close'></i></a><br />"; |
|
100 | 100 | } ?> |
101 | 101 | </div><!-- /.box-body --> |
102 | 102 | </div><!-- /.box --> |
@@ -29,11 +29,11 @@ |
||
29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
30 | 30 | // indexes |
31 | 31 | $columns = [ |
32 | - ['db' => 'id', 'dt' => 0], |
|
33 | - ['db' => 'firstname', 'dt' => 1], |
|
34 | - ['db' => 'surname', 'dt' => 2], |
|
35 | - ['db' => 'zip', 'dt' => 3], |
|
36 | - ['db' => 'country', 'dt' => 4], |
|
32 | + ['db' => 'id', 'dt' => 0], |
|
33 | + ['db' => 'firstname', 'dt' => 1], |
|
34 | + ['db' => 'surname', 'dt' => 2], |
|
35 | + ['db' => 'zip', 'dt' => 3], |
|
36 | + ['db' => 'country', 'dt' => 4], |
|
37 | 37 | ]; |
38 | 38 | |
39 | 39 | // SQL server connection information |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } else { |
34 | 34 | $notificationId = getQueryStringForKey('id'); |
35 | 35 | $referer = getQueryStringForKey('click'); |
36 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/notification.php?id='.$notificationId.'&click='.$referer; |
|
36 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/notification.php?id=' . $notificationId . '&click=' . $referer; |
|
37 | 37 | header('Location: login.php'); |
38 | 38 | exit; |
39 | 39 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // redir if notification has URL |
61 | 61 | $redir = notificationLink($notificationId); |
62 | 62 | if (!empty($redir)) { |
63 | - header('Location: '.$redir); |
|
63 | + header('Location: ' . $redir); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // find notification |
@@ -28,13 +28,13 @@ |
||
28 | 28 | $currentTimestamp = $date = strftime('%F %T', time()); |
29 | 29 | |
30 | 30 | $data = [ |
31 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
31 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
32 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
33 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
34 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
35 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
36 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
37 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | if (isset($this->notes)) { |
@@ -24,12 +24,12 @@ |
||
24 | 24 | public function createInDb(Database $db) |
25 | 25 | { |
26 | 26 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->sub_type) || empty($this->location)) { |
27 | - $message = 'Series name ('.$this->name.')'; |
|
28 | - $message .= ' or date ('.$this->datetime.')'; |
|
29 | - $message .= ' or series ('.$this->series.')'; |
|
30 | - $message .= ' or type ('.$this->type.')'; |
|
31 | - $message .= ' or sub_type ('.$this->sub_type.')'; |
|
32 | - $message .= ' or location ('.$this->location.')'; |
|
27 | + $message = 'Series name (' . $this->name . ')'; |
|
28 | + $message .= ' or date (' . $this->datetime . ')'; |
|
29 | + $message .= ' or series (' . $this->series . ')'; |
|
30 | + $message .= ' or type (' . $this->type . ')'; |
|
31 | + $message .= ' or sub_type (' . $this->sub_type . ')'; |
|
32 | + $message .= ' or location (' . $this->location . ')'; |
|
33 | 33 | $message .= ' cannot be empty.'; |
34 | 34 | |
35 | 35 | throw new Exception($message); |