@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | // Returns a `Facebook\FacebookResponse` object |
| 42 | 42 | $response = $fb->get('/me?fields=id,name,email', $accessToken); |
| 43 | 43 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 44 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 44 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 45 | 45 | exit; |
| 46 | 46 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 47 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 47 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 48 | 48 | exit; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | <label class="fa fa-envelope-o" for="email"><span class="hidden">Email address</span></label> |
| 92 | 92 | <input name="email" id="email" type="text" class="form__input" placeholder="Email address" value="<?php echo $user->getEmail(); ?>" required> |
| 93 | 93 | </div> |
| 94 | - <?php if (!empty($message)): echo '<p>'.$message.'</p>'; endif; ?> |
|
| 94 | + <?php if (!empty($message)): echo '<p>' . $message . '</p>'; endif; ?> |
|
| 95 | 95 | <div class="form__field"> |
| 96 | 96 | <input type="submit" value="Request access"> |
| 97 | 97 | </div> |
@@ -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 |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | if ($subscribe == 'true') { |
| 54 | 54 | subscribeto($userID, $areaid, 0); |
| 55 | - header('Location: discussion.php?categoryid='.$areaid); |
|
| 55 | + header('Location: discussion.php?categoryid=' . $areaid); |
|
| 56 | 56 | } elseif ($subscribe == 'false') { |
| 57 | 57 | unsubscribefrom($subscription); |
| 58 | - header('Location: discussion.php?categoryid='.$areaid); |
|
| 58 | + header('Location: discussion.php?categoryid=' . $areaid); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // If the form has been sent, we need to handle the data. |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $sql = ("INSERT INTO cr_discussionCategories(name, description, parent) VALUES ('$categoryname', '$categorydescription', '$categoryparent')"); |
| 68 | 68 | if (!mysqli_query(db(), $sql)) { |
| 69 | - die('Error: '.mysqli_error(db())); |
|
| 69 | + die('Error: ' . mysqli_error(db())); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // After we have inserted the data, we want to head back to the main page |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $categoryName = $row['name']; |
| 91 | 91 | |
| 92 | 92 | // The following function lists the parents here to save a SQL query later |
| 93 | - $listParents = $listParents."<option value='".$categoryID."'>".$categoryName.'</option>'; ?> |
|
| 93 | + $listParents = $listParents . "<option value='" . $categoryID . "'>" . $categoryName . '</option>'; ?> |
|
| 94 | 94 | <div class="elementBackground highlight"> |
| 95 | 95 | <h2><a href="discussion.php?categoryid=<?php echo $categoryID; ?>"><?php echo $row['name']; ?></a> <?php |
| 96 | 96 | if (isAdmin()) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } else { |
| 111 | 111 | $topicName = $row['topicName']; |
| 112 | 112 | } ?> |
| 113 | - <p><strong>Latest post:</strong> <?php echo $topicName.' <strong>by</strong> '.$row['firstName']; ?></p> |
|
| 113 | + <p><strong>Latest post:</strong> <?php echo $topicName . ' <strong>by</strong> ' . $row['firstName']; ?></p> |
|
| 114 | 114 | <?php |
| 115 | 115 | } ?> |
| 116 | 116 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | <div class="elementBackground"> |
| 145 | 145 | <h2><a href="discussiontopic.php?id=<?php echo $row['id']; ?>&parentid=<?php echo $categoryID; ?>"><?php echo $row['topicName']; ?></a> |
| 146 | 146 | <?php if (isAdmin()) { |
| 147 | - echo "<a href='discussion.php?discussionremove=true&categoryid=".$row['id']."'><img src='graphics/close.png' /></a>"; |
|
| 147 | + echo "<a href='discussion.php?discussionremove=true&categoryid=" . $row['id'] . "'><img src='graphics/close.png' /></a>"; |
|
| 148 | 148 | } ?></h2> |
| 149 | 149 | <p><strong>Posted:</strong> <?php echo $row['dateFormatted']; ?> <strong>by</strong> <?php echo $row['name']; ?></p> |
| 150 | 150 | <?php |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | while ($latestpostrow = mysqli_fetch_array($latestpostresult, MYSQLI_ASSOC)) { |
| 163 | 163 | ?> |
| 164 | - <p><strong>Latest post:</strong> <?php echo $latestpostrow['firstName'].' <strong>on</strong> '.$latestpostrow['topicDate']; ?></p> |
|
| 164 | + <p><strong>Latest post:</strong> <?php echo $latestpostrow['firstName'] . ' <strong>on</strong> ' . $latestpostrow['topicDate']; ?></p> |
|
| 165 | 165 | <?php |
| 166 | 166 | } ?> |
| 167 | 167 | </div> |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($isSubscribed != '') { |
| 181 | - $subscribe = '<div class="item"><a href="discussion.php?subscribe=false&subscription='.$isSubscribed.'&categoryid='. |
|
| 182 | - $areaid.'">Unsubscribe from this area</a></div>'; |
|
| 181 | + $subscribe = '<div class="item"><a href="discussion.php?subscribe=false&subscription=' . $isSubscribed . '&categoryid=' . |
|
| 182 | + $areaid . '">Unsubscribe from this area</a></div>'; |
|
| 183 | 183 | } else { |
| 184 | - $subscribe = '<div class="item"><a href="discussion.php?subscribe=true&categoryid='.$areaid.'">Subscribe to this area</a></div>'; |
|
| 184 | + $subscribe = '<div class="item"><a href="discussion.php?subscribe=true&categoryid=' . $areaid . '">Subscribe to this area</a></div>'; |
|
| 185 | 185 | } |
| 186 | 186 | } ?> |
| 187 | 187 | <?php |
@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | $accessToken = $helper->getAccessToken(); |
| 27 | 27 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 28 | 28 | // When Graph returns an error |
| 29 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 29 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 30 | 30 | exit; |
| 31 | 31 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 32 | 32 | // When validation fails or other local issues |
| 33 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 33 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 34 | 34 | exit; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | if (!isset($accessToken)) { |
| 38 | 38 | if ($helper->getError()) { |
| 39 | 39 | header('HTTP/1.0 401 Unauthorized'); |
| 40 | - echo 'Error: '.$helper->getError()."\n"; |
|
| 41 | - echo 'Error Code: '.$helper->getErrorCode()."\n"; |
|
| 42 | - echo 'Error Reason: '.$helper->getErrorReason()."\n"; |
|
| 43 | - echo 'Error Description: '.$helper->getErrorDescription()."\n"; |
|
| 40 | + echo 'Error: ' . $helper->getError() . "\n"; |
|
| 41 | + echo 'Error Code: ' . $helper->getErrorCode() . "\n"; |
|
| 42 | + echo 'Error Reason: ' . $helper->getErrorReason() . "\n"; |
|
| 43 | + echo 'Error Description: ' . $helper->getErrorDescription() . "\n"; |
|
| 44 | 44 | } else { |
| 45 | 45 | header('HTTP/1.0 400 Bad Request'); |
| 46 | 46 | echo 'Bad request'; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | try { |
| 66 | 66 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
| 67 | 67 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 68 | - echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n"; |
|
| 68 | + echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n"; |
|
| 69 | 69 | exit; |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } else { |
| 79 | 79 | $redirUrl = 'fb-signup.php'; |
| 80 | 80 | } |
| 81 | -header('Location: '.$redirUrl); |
|
| 81 | +header('Location: ' . $redirUrl); |
|
| 82 | 82 | |
| 83 | 83 | // User is logged in with a long-lived access token. |
| 84 | 84 | // You can redirect them to a members-only page. |
@@ -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 --> |
@@ -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 |
@@ -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); |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | if ($first) { |
| 181 | 181 | $first = false; |
| 182 | 182 | $fields .= $item['field']; |
| 183 | - $valuesPlaceholder .= ':'.$item['field']; |
|
| 183 | + $valuesPlaceholder .= ':' . $item['field']; |
|
| 184 | 184 | } else { |
| 185 | - $fields .= ', '.$item['field']; |
|
| 186 | - $valuesPlaceholder .= ', :'.$item['field']; |
|
| 185 | + $fields .= ', ' . $item['field']; |
|
| 186 | + $valuesPlaceholder .= ', :' . $item['field']; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | if ($item['type'] == 's' || $item['type'] == 'string') { |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - $statement = $this->db_connection->prepare('INSERT INTO '.$table.' ('.$fields.') VALUES ('.$valuesPlaceholder.')'); |
|
| 204 | + $statement = $this->db_connection->prepare('INSERT INTO ' . $table . ' (' . $fields . ') VALUES (' . $valuesPlaceholder . ')'); |
|
| 205 | 205 | foreach ($data as $item) { |
| 206 | - $statement->bindParam(':'.$item['field'], $item['value']); |
|
| 206 | + $statement->bindParam(':' . $item['field'], $item['value']); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if ($statement->execute()) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | private function addPrefix($table) |
| 250 | 250 | { |
| 251 | - $table = $this->db_prefix.$table; |
|
| 251 | + $table = $this->db_prefix . $table; |
|
| 252 | 252 | |
| 253 | 253 | return $table; |
| 254 | 254 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | public function count($table, $column, $where = null) |
| 273 | 273 | { |
| 274 | 274 | $columns = [ |
| 275 | - 'COUNT('.$column.') AS count', |
|
| 275 | + 'COUNT(' . $column . ') AS count', |
|
| 276 | 276 | ]; |
| 277 | 277 | $statement = $this->selectStatement($table, $columns, $where); |
| 278 | 278 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | foreach ($rehersals as $rehersal) { |
| 110 | 110 | if (!is_a($rehersal, 'Rehersal')) { |
| 111 | - throw new Exception('Rehersal is not a Rehersal object: '.$rehersal, 1); |
|
| 111 | + throw new Exception('Rehersal is not a Rehersal object: ' . $rehersal, 1); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | $this->rehersals = $rehersals; |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | public function createInDb(Database $db) |
| 118 | 118 | { |
| 119 | 119 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->subType) || empty($this->location)) { |
| 120 | - $message = 'Series name ('.$this->name.')'; |
|
| 121 | - $message .= ' or date ('.$this->datetime.')'; |
|
| 122 | - $message .= ' or series ('.$this->series.')'; |
|
| 123 | - $message .= ' or type ('.$this->type.')'; |
|
| 124 | - $message .= ' or sub_type ('.$this->subType.')'; |
|
| 125 | - $message .= ' or location ('.$this->location.')'; |
|
| 120 | + $message = 'Series name (' . $this->name . ')'; |
|
| 121 | + $message .= ' or date (' . $this->datetime . ')'; |
|
| 122 | + $message .= ' or series (' . $this->series . ')'; |
|
| 123 | + $message .= ' or type (' . $this->type . ')'; |
|
| 124 | + $message .= ' or sub_type (' . $this->subType . ')'; |
|
| 125 | + $message .= ' or location (' . $this->location . ')'; |
|
| 126 | 126 | $message .= ' cannot be empty.'; |
| 127 | 127 | |
| 128 | 128 | throw new Exception($message); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ]; |
| 181 | 181 | |
| 182 | 182 | $where = [ |
| 183 | - 'id = '.$id, |
|
| 183 | + 'id = ' . $id, |
|
| 184 | 184 | ]; |
| 185 | 185 | |
| 186 | 186 | $result = $db->selectSingle('Event', $this->db_table, $columns, $where); |