@@ -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 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $sql = ("INSERT INTO cr_instruments (name) VALUES ('$neweventtype')"); |
37 | 37 | |
38 | 38 | if (!mysqli_query(db(), $sql)) { |
39 | - die('Error: '.mysqli_error(db())); |
|
39 | + die('Error: ' . mysqli_error(db())); |
|
40 | 40 | } |
41 | 41 | } else { |
42 | 42 | // Otherwise we are dealing with edits, not new stuff |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
69 | 69 | |
70 | 70 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
71 | - echo '<input type="hidden" name="formindex[]" value="'.$row['id'].'" />'; |
|
72 | - echo "<input name='description[]' value='".$row['name']."' />"; |
|
71 | + echo '<input type="hidden" name="formindex[]" value="' . $row['id'] . '" />'; |
|
72 | + echo "<input name='description[]' value='" . $row['name'] . "' />"; |
|
73 | 73 | |
74 | - echo "<a href='bandskills.php?bandskillremove=true&bandskillID=".$row['id']."'><img src='graphics/close.png' /></a><br />"; |
|
74 | + echo "<a href='bandskills.php?bandskillremove=true&bandskillID=" . $row['id'] . "'><img src='graphics/close.png' /></a><br />"; |
|
75 | 75 | } ?> |
76 | 76 | </fieldset> |
77 | 77 | <input type="submit" value="Update band skills" /> |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } else { |
70 | 70 | $roles .= '</ul>'; |
71 | 71 | } |
72 | - $roles .= '<p><strong>'.$groupName.'</strong></p>'; |
|
72 | + $roles .= '<p><strong>' . $groupName . '</strong></p>'; |
|
73 | 73 | $roles .= '<ul>'; |
74 | 74 | } |
75 | - $roles .= '<li>'.$row['roleName'].'</li>'; |
|
75 | + $roles .= '<li>' . $row['roleName'] . '</li>'; |
|
76 | 76 | } |
77 | 77 | $roles .= '</ul>'; |
78 | 78 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | <li> |
120 | 120 | <a class="js-no-link" href="addUser.php?action=edit&user=<?php echo $user->getId() ?>" data-toggle='modal' data-target='#user<?php echo $user->getId() ?>'> |
121 | 121 | <img src="<?php echo getProfileImageUrl($user->getId(), 'large') ?>" alt="User Image"> |
122 | - <span class="users-list-name"><?php echo $user->getFirstName().' '.$user->getLastName() ?></span> |
|
122 | + <span class="users-list-name"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></span> |
|
123 | 123 | </a> |
124 | 124 | <?php if (isAdmin($user->getId())): ?> |
125 | 125 | <span class="label label-warning">Admin</span> |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | <div class="modal-header"> |
141 | 141 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
142 | 142 | <h4 class="modal-title"> |
143 | - <?php echo $user->getFirstName().' '.$user->getLastName() ?> |
|
143 | + <?php echo $user->getFirstName() . ' ' . $user->getLastName() ?> |
|
144 | 144 | <?php if (isAdmin($user->getId())): ?> |
145 | 145 | <span class="label label-warning">Admin</span> |
146 | 146 | <?php endif ?> |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | </h4> |
154 | 154 | </div> |
155 | 155 | <div class="modal-body"> |
156 | - <p><strong>Email address:</strong> <a href="<?php echo $user->getEmail() ? 'mailto:'.$user->getEmail() : '' ?>"><?php echo $user->getEmail() ? $user->getEmail() : 'none' ?></a></p> |
|
156 | + <p><strong>Email address:</strong> <a href="<?php echo $user->getEmail() ? 'mailto:' . $user->getEmail() : '' ?>"><?php echo $user->getEmail() ? $user->getEmail() : 'none' ?></a></p> |
|
157 | 157 | <p><strong>Mobile:</strong> <?php echo $user->getMobile() ? $user->getMobile() : 'none' ?></p> |
158 | 158 | <p><strong>Roles:</strong></p> |
159 | 159 | <?php $userRoles = $user->getUserRoles() ?> |
160 | 160 | <ul> |
161 | - <?php echo $userRoles->count() > 0 ? '' : '<li class="text-red">'.$user->getFirstName().' has no roles</li>' ?> |
|
161 | + <?php echo $userRoles->count() > 0 ? '' : '<li class="text-red">' . $user->getFirstName() . ' has no roles</li>' ?> |
|
162 | 162 | <?php foreach ($userRoles as $userRole): ?> |
163 | 163 | <li> |
164 | 164 | <?php echo $userRole->getRole()->getGroup()->getName() ?>: <?php echo $userRole->getRole()->getName() ?> |
@@ -6,31 +6,31 @@ |
||
6 | 6 | // To help the built-in PHP dev server, check if the request was actually for |
7 | 7 | // something which should probably be served as a static file |
8 | 8 | $url = parse_url($_SERVER['REQUEST_URI']); |
9 | - $file = __DIR__.$url['path']; |
|
9 | + $file = __DIR__ . $url['path']; |
|
10 | 10 | if (is_file($file)) { |
11 | 11 | return false; |
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | -require __DIR__.'/../vendor/autoload.php'; |
|
15 | +require __DIR__ . '/../vendor/autoload.php'; |
|
16 | 16 | |
17 | 17 | // setup Propel (autoload configured though composer) |
18 | -require_once __DIR__.'/../generated-conf/config.php'; |
|
18 | +require_once __DIR__ . '/../generated-conf/config.php'; |
|
19 | 19 | |
20 | 20 | session_start(); |
21 | 21 | |
22 | 22 | // Instantiate the app |
23 | -$settings = require __DIR__.'/../src/settings.php'; |
|
23 | +$settings = require __DIR__ . '/../src/settings.php'; |
|
24 | 24 | $app = new \Slim\App($settings); |
25 | 25 | |
26 | 26 | // Set up dependencies |
27 | -require __DIR__.'/../src/dependencies.php'; |
|
27 | +require __DIR__ . '/../src/dependencies.php'; |
|
28 | 28 | |
29 | 29 | // Register middleware |
30 | -require __DIR__.'/../src/middleware.php'; |
|
30 | +require __DIR__ . '/../src/middleware.php'; |
|
31 | 31 | |
32 | 32 | // Register routes |
33 | -require __DIR__.'/../src/routes.php'; |
|
33 | +require __DIR__ . '/../src/routes.php'; |
|
34 | 34 | |
35 | 35 | // Run app |
36 | 36 | $app->run(); |
@@ -22,16 +22,16 @@ |
||
22 | 22 | } |
23 | 23 | //$acceptedFileExtensions = ['jpg', 'png', 'jpeg', 'gif', 'docx', 'pdf', 'xlsx', 'pptx']; |
24 | 24 | $acceptedFileTypes = ['image/gif', 'image/png', 'image/jpeg', 'application/pdf', 'application/msword', 'application/excel']; |
25 | - $target_dir = __DIR__.'/../documents/'; |
|
25 | + $target_dir = __DIR__ . '/../documents/'; |
|
26 | 26 | $this->setUrl($file->getClientFilename()); |
27 | 27 | //$fileExtension = pathinfo(basename($file->getName()),PATHINFO_EXTENSION); |
28 | 28 | |
29 | 29 | // Allow certain file formats only |
30 | 30 | if (!in_array($file->getClientMediaType(), $acceptedFileTypes)) { |
31 | - throw new InvalidArgumentException('Sorry, only '.implode(', ', $acceptedFileTypes).' files are allowed.'); |
|
31 | + throw new InvalidArgumentException('Sorry, only ' . implode(', ', $acceptedFileTypes) . ' files are allowed.'); |
|
32 | 32 | } |
33 | 33 | $this->save(); |
34 | - $target_file = $target_dir.$this->getId(); |
|
34 | + $target_file = $target_dir . $this->getId(); |
|
35 | 35 | |
36 | 36 | // Check if file already exists |
37 | 37 | if (file_exists($target_file)) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getName() |
79 | 79 | { |
80 | - return $this->firstname.' '.$this->lastname; |
|
80 | + return $this->firstname . ' ' . $this->lastname; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -96,16 +96,16 @@ discard block |
||
96 | 96 | if ($socialAuth->getPlatform() == 'facebook') { |
97 | 97 | switch ($size) { |
98 | 98 | case 'small': // 50px x 50px |
99 | - return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=square'; |
|
99 | + return '//graph.facebook.com/' . $socialAuth->getSocialId() . '/picture?type=square'; |
|
100 | 100 | break; |
101 | 101 | case 'medium': // 200px x 200px |
102 | - return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=large'; |
|
102 | + return '//graph.facebook.com/' . $socialAuth->getSocialId() . '/picture?type=large'; |
|
103 | 103 | break; |
104 | 104 | case 'large': // 200px x 200px |
105 | - return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=large'; |
|
105 | + return '//graph.facebook.com/' . $socialAuth->getSocialId() . '/picture?type=large'; |
|
106 | 106 | break; |
107 | 107 | default: |
108 | - return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture'; |
|
108 | + return '//graph.facebook.com/' . $socialAuth->getSocialId() . '/picture'; |
|
109 | 109 | break; |
110 | 110 | } |
111 | 111 | } elseif ($socialAuth->getPlatform() == 'onebody') { |
@@ -114,16 +114,16 @@ discard block |
||
114 | 114 | $extension = pathinfo($socialAuth->getMeta()['photo-file-name'], PATHINFO_EXTENSION); |
115 | 115 | switch ($size) { |
116 | 116 | case 'small': // 50px x 50px |
117 | - return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/tn/'.$photoFingerprint.'.'.$extension; |
|
117 | + return $baseUrl . '/system/production/people/photos/' . $socialAuth->getSocialId() . '/tn/' . $photoFingerprint . '.' . $extension; |
|
118 | 118 | break; |
119 | 119 | case 'medium': // 150px x 150px |
120 | - return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/small/'.$photoFingerprint.'.'.$extension; |
|
120 | + return $baseUrl . '/system/production/people/photos/' . $socialAuth->getSocialId() . '/small/' . $photoFingerprint . '.' . $extension; |
|
121 | 121 | break; |
122 | 122 | case 'large': // 500px x 500px |
123 | - return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/medium/'.$photoFingerprint.'.'.$extension; |
|
123 | + return $baseUrl . '/system/production/people/photos/' . $socialAuth->getSocialId() . '/medium/' . $photoFingerprint . '.' . $extension; |
|
124 | 124 | break; |
125 | 125 | default: |
126 | - return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/tn/'.$photoFingerprint.'.'.$extension; |
|
126 | + return $baseUrl . '/system/production/people/photos/' . $socialAuth->getSocialId() . '/tn/' . $photoFingerprint . '.' . $extension; |
|
127 | 127 | break; |
128 | 128 | } |
129 | 129 | } |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | |
133 | 133 | switch ($size) { |
134 | 134 | case 'small': // 50px x 50px |
135 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=50&d=mm'; |
|
135 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))) . '?s=50&d=mm'; |
|
136 | 136 | break; |
137 | 137 | case 'medium': // 200px x 200px |
138 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=200&d=mm'; |
|
138 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))) . '?s=200&d=mm'; |
|
139 | 139 | break; |
140 | 140 | case 'large': // 500px x 500px |
141 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=500&d=mm'; |
|
141 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))) . '?s=500&d=mm'; |
|
142 | 142 | break; |
143 | 143 | default: |
144 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=50&d=mm'; |
|
144 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))) . '?s=50&d=mm'; |
|
145 | 145 | break; |
146 | 146 | } |
147 | 147 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include __DIR__.'/../config/database.php'; |
|
3 | +include __DIR__ . '/../config/database.php'; |
|
4 | 4 | $serviceContainer = \Propel\Runtime\Propel::getServiceContainer(); |
5 | 5 | $serviceContainer->checkVersion('2.0.0-dev'); |
6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
9 | 9 | $manager->setConfiguration([ |
10 | 10 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
11 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
12 | 12 | 'user' => $config['db']['user'], |
13 | 13 | 'password' => $config['db']['pass'], |
14 | 14 | 'attributes' => [ |
@@ -38,14 +38,14 @@ |
||
38 | 38 | |
39 | 39 | $id = urlencode($id); |
40 | 40 | |
41 | -$url = 'http://localhost/api/v1/series/'.$id; |
|
41 | +$url = 'http://localhost/api/v1/series/' . $id; |
|
42 | 42 | $response = file_get_contents($url); |
43 | 43 | |
44 | -echo 'URL: '.$url; |
|
44 | +echo 'URL: ' . $url; |
|
45 | 45 | |
46 | 46 | $responseData = json_decode($response, true); |
47 | 47 | $data = $responseData['data']; |
48 | 48 | |
49 | 49 | echo var_dump($responseData); |
50 | 50 | |
51 | -echo 'series '.$id.': id = '.$data['id'].', name = '.$data['name'].', description = '.$data['description']; |
|
51 | +echo 'series ' . $id . ': id = ' . $data['id'] . ', name = ' . $data['name'] . ', description = ' . $data['description']; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function createInDb(Database $db) |
17 | 17 | { |
18 | 18 | if (empty($this->name) || empty($this->description)) { |
19 | - throw new Exception('Series name ('.$this->name.') or description ('.$this->description.') cannot be empty.'); |
|
19 | + throw new Exception('Series name (' . $this->name . ') or description (' . $this->description . ') cannot be empty.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $id = $this->id; |
38 | 38 | } |
39 | 39 | |
40 | - $whereCondition = 'id = '.$id; |
|
40 | + $whereCondition = 'id = ' . $id; |
|
41 | 41 | $where = [ |
42 | 42 | $whereCondition, |
43 | 43 | ]; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'description', |
65 | 65 | ]; |
66 | 66 | |
67 | - $whereCondition = 'id = '.$id; |
|
67 | + $whereCondition = 'id = ' . $id; |
|
68 | 68 | $where = [ |
69 | 69 | $whereCondition, |
70 | 70 | ]; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function createInDb(Database $db) |
17 | 17 | { |
18 | 18 | if (empty($this->name) || empty($this->description)) { |
19 | - throw new Exception('Series name ('.$this->name.') or description ('.$this->description.') cannot be empty.'); |
|
19 | + throw new Exception('Series name (' . $this->name . ') or description (' . $this->description . ') cannot be empty.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $data = [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | throw new Exception('Sub Type id cannot be null'); |
41 | 41 | } |
42 | 42 | |
43 | - $whereCondition = 'id = '.$id; |
|
43 | + $whereCondition = 'id = ' . $id; |
|
44 | 44 | $where = [ |
45 | 45 | $whereCondition, |
46 | 46 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'description', |
68 | 68 | ]; |
69 | 69 | |
70 | - $whereCondition = 'id = '.$id; |
|
70 | + $whereCondition = 'id = ' . $id; |
|
71 | 71 | $where = [ |
72 | 72 | $whereCondition, |
73 | 73 | ]; |