@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $sql = "UPDATE eventGroups SET name = '$name', description = '$description' WHERE id = '$editid'"; |
43 | 43 | } |
44 | 44 | if (!mysqli_query(db(), $sql)) { |
45 | - exit('Error: '.mysqli_error(db())); |
|
45 | + exit('Error: ' . mysqli_error(db())); |
|
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | $name = $_POST['seriesName']; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } else { |
57 | 57 | $sql = ("INSERT INTO eventGroups (name, description) VALUES ('$name', '$description')"); |
58 | 58 | if (!mysqli_query(db(), $sql)) { |
59 | - exit('Error: '.mysqli_error(db())); |
|
59 | + exit('Error: ' . mysqli_error(db())); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // After we have inserted the data, we want to head back to the main users page |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | |
100 | 100 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
101 | 101 | $seriesId = $row['id']; |
102 | - echo "<span id='".$seriesId."' class='edit'><strong>".$row['name'].'</strong></span>'; |
|
103 | - echo " <a href='series.php?method=remove&series=".$seriesId."'><i class='fa fa-close'></i></a><br />"; |
|
104 | - echo "<p id='".$seriesId."' class='edit'>".$row['description'].'</p>'; |
|
102 | + echo "<span id='" . $seriesId . "' class='edit'><strong>" . $row['name'] . '</strong></span>'; |
|
103 | + echo " <a href='series.php?method=remove&series=" . $seriesId . "'><i class='fa fa-close'></i></a><br />"; |
|
104 | + echo "<p id='" . $seriesId . "' class='edit'>" . $row['description'] . '</p>'; |
|
105 | 105 | echo '<hr />'; |
106 | 106 | } ?> |
107 | 107 | </div><!-- /.box-body --> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $swapId = filter_var($swapId, FILTER_SANITIZE_NUMBER_INT); |
50 | 50 | |
51 | 51 | switch ($action) { |
52 | - case 'swap': |
|
52 | + case 'swap': |
|
53 | 53 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
54 | 54 | $eventPersonId = $_POST['eventPerson']; |
55 | 55 | $newUserRoleId = $_POST['newUserRole']; |
@@ -63,48 +63,48 @@ discard block |
||
63 | 63 | $err = 'Swap details incorrect, please try again.'; |
64 | 64 | } |
65 | 65 | break; |
66 | - case 'accept': |
|
66 | + case 'accept': |
|
67 | 67 | if (canAcceptSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
68 | 68 | switch (acceptSwap($swapId)) { |
69 | 69 | case '1': |
70 | 70 | $message = 'Swap Successful'; |
71 | - break; |
|
71 | + break; |
|
72 | 72 | case '2': |
73 | 73 | $message = 'Swap already accepted.'; |
74 | - break; |
|
74 | + break; |
|
75 | 75 | case '3': |
76 | 76 | $message = 'Swap already declined.'; |
77 | - break; |
|
77 | + break; |
|
78 | 78 | case '4': |
79 | 79 | $message = 'Swap already reverted.'; |
80 | - break; |
|
80 | + break; |
|
81 | 81 | default: |
82 | 82 | $err = 'Technical issue - please inform system administrator'; |
83 | - break; |
|
84 | - } |
|
83 | + break; |
|
84 | + } |
|
85 | 85 | } else { |
86 | 86 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
87 | 87 | } |
88 | 88 | break; |
89 | - case 'decline': |
|
89 | + case 'decline': |
|
90 | 90 | if (canDeclineSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
91 | 91 | switch (declineSwap($swapId)) { |
92 | 92 | case '1': |
93 | 93 | $message = 'Swap declined'; |
94 | - break; |
|
94 | + break; |
|
95 | 95 | case '2': |
96 | 96 | $message = 'Swap already declined.'; |
97 | - break; |
|
97 | + break; |
|
98 | 98 | default: |
99 | 99 | $err = 'Technical issue - please inform system administrator'; |
100 | - break; |
|
100 | + break; |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | |
107 | - default: |
|
107 | + default: |
|
108 | 108 | // code... |
109 | 109 | break; |
110 | 110 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <section class="content"> |
166 | 166 | |
167 | 167 | <?php |
168 | - if (isset($message)) { ?> |
|
168 | + if (isset($message)) { ?> |
|
169 | 169 | |
170 | 170 | <p><?php echo $message ?></p> |
171 | 171 | |
@@ -226,19 +226,19 @@ discard block |
||
226 | 226 | <label for="newUserRole">Swap To:</label> |
227 | 227 | <select name="newUserRole" class="form-control"> |
228 | 228 | <?php |
229 | - if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
|
230 | - $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | - } else { |
|
232 | - $whereAnd = 'r.id = '.$role->roleId; |
|
233 | - } |
|
234 | - $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
235 | - $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
|
236 | - |
|
237 | - while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
238 | - ?> |
|
229 | + if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
|
230 | + $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | + } else { |
|
232 | + $whereAnd = 'r.id = '.$role->roleId; |
|
233 | + } |
|
234 | + $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
235 | + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
|
236 | + |
|
237 | + while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
238 | + ?> |
|
239 | 239 | <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'].' '.$row['lastName'].' ('.$row['name'].')'; ?></option> |
240 | 240 | <?php |
241 | - } ?> |
|
241 | + } ?> |
|
242 | 242 | </select> |
243 | 243 | </div> |
244 | 244 | </div> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (!empty($eventId)) { |
113 | 113 | // ensure user is logged in before allowing creation of swap |
114 | 114 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
115 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/swap.php?event='.$eventId; |
|
115 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/swap.php?event=' . $eventId; |
|
116 | 116 | header('Location: login.php'); |
117 | 117 | } |
118 | 118 | $createSwap = true; |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | <p> |
189 | 189 | <strong> |
190 | 190 | <s class="text-red"> |
191 | - <?php echo $swap->getOldUserRole()->getUser()->getFirstName().' '.$swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
191 | + <?php echo $swap->getOldUserRole()->getUser()->getFirstName() . ' ' . $swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
192 | 192 | </s> |
193 | 193 | → |
194 | 194 | <span class="text-green"> |
195 | - <?php echo $swap->getNewUserRole()->getUser()->getFirstName().' '.$swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
195 | + <?php echo $swap->getNewUserRole()->getUser()->getFirstName() . ' ' . $swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
196 | 196 | </span> |
197 | 197 | </strong> |
198 | 198 | </p> |
@@ -227,16 +227,16 @@ discard block |
||
227 | 227 | <select name="newUserRole" class="form-control"> |
228 | 228 | <?php |
229 | 229 | if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
230 | - $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
230 | + $whereAnd = 'r.groupId = ' . groupIdWithRole($role->roleId) . ' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | 231 | } else { |
232 | - $whereAnd = 'r.id = '.$role->roleId; |
|
232 | + $whereAnd = 'r.id = ' . $role->roleId; |
|
233 | 233 | } |
234 | - $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
234 | + $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> ' . $role->userId . ' AND ' . $whereAnd . ' ORDER BY lastName, firstName, r.name'; |
|
235 | 235 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
236 | 236 | |
237 | 237 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
238 | 238 | ?> |
239 | - <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'].' '.$row['lastName'].' ('.$row['name'].')'; ?></option> |
|
239 | + <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'] . ' ' . $row['lastName'] . ' (' . $row['name'] . ')'; ?></option> |
|
240 | 240 | <?php |
241 | 241 | } ?> |
242 | 242 | </select> |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | <div class="col-sm-8 col-md-8 col-lg-6"> |
180 | 180 | |
181 | 181 | <?php |
182 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
183 | - // ~~~~~~~~ Events this week ~~~~~~~~ |
|
184 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
185 | - ?> |
|
182 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
183 | + // ~~~~~~~~ Events this week ~~~~~~~~ |
|
184 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
185 | + ?> |
|
186 | 186 | |
187 | 187 | <h2>Events this week:</h2> |
188 | 188 | |
@@ -206,17 +206,17 @@ discard block |
||
206 | 206 | <div class="timeline-header"> |
207 | 207 | <a href="event.php?id=<?php echo $event->getId() ?>"> |
208 | 208 | <h4><?php |
209 | - echo $event->getDate('jS: '); |
|
210 | - $eventPeople = EventPersonQuery::create()->filterByEvent($event)->find(); |
|
211 | - $roles = []; |
|
212 | - foreach ($eventPeople as $eventPerson) { |
|
213 | - if ($eventPerson->getUserRole()->getUserId() == $user->getId()) { |
|
214 | - $roles[] = $eventPerson->getUserRole()->getRole()->getName(); |
|
215 | - } |
|
216 | - } |
|
217 | - $roles = implode(', ', $roles); |
|
218 | - echo $roles != '' ? $roles : 'No involvement'; |
|
219 | - ?> |
|
209 | + echo $event->getDate('jS: '); |
|
210 | + $eventPeople = EventPersonQuery::create()->filterByEvent($event)->find(); |
|
211 | + $roles = []; |
|
212 | + foreach ($eventPeople as $eventPerson) { |
|
213 | + if ($eventPerson->getUserRole()->getUserId() == $user->getId()) { |
|
214 | + $roles[] = $eventPerson->getUserRole()->getRole()->getName(); |
|
215 | + } |
|
216 | + } |
|
217 | + $roles = implode(', ', $roles); |
|
218 | + echo $roles != '' ? $roles : 'No involvement'; |
|
219 | + ?> |
|
220 | 220 | </h4> |
221 | 221 | </a> |
222 | 222 | <a class="label label-default" href="events.php?view=all&filter=<?php echo $event->getEventTypeId() ?>"><?php echo $event->getEventType()->getName() ?></a> |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | <div class="modal-body"> |
272 | 272 | <?php |
273 | 273 | |
274 | - $sqlPeople = "SELECT |
|
274 | + $sqlPeople = "SELECT |
|
275 | 275 | CONCAT(u.firstname, ' ', u.lastname) AS `name`, |
276 | 276 | r.name AS `rolename`, |
277 | 277 | ep.notified AS `notified`, |
@@ -287,47 +287,47 @@ discard block |
||
287 | 287 | AND ep.removed = 0 |
288 | 288 | ORDER BY g.name, r.name"; |
289 | 289 | |
290 | - $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); |
|
291 | - $groupName = ''; |
|
292 | - $groupId = 0; |
|
293 | - $identifier = '1'; |
|
294 | - $firstTime = true; |
|
290 | + $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); |
|
291 | + $groupName = ''; |
|
292 | + $groupId = 0; |
|
293 | + $identifier = '1'; |
|
294 | + $firstTime = true; |
|
295 | 295 | |
296 | - if (mysqli_num_rows($resultPeople) > 0) { |
|
297 | - ?> |
|
296 | + if (mysqli_num_rows($resultPeople) > 0) { |
|
297 | + ?> |
|
298 | 298 | <?php while ($viewPeople = mysqli_fetch_object($resultPeople)) { |
299 | - if ($viewPeople->group == $groupId) { |
|
300 | - // Do nothing, because they are all in the same group |
|
301 | - } else { |
|
302 | - // Update the group heading |
|
303 | - $groupId = $viewPeople->group; |
|
304 | - $groupName = $viewPeople->groupName; |
|
305 | - if ($firstTime) { |
|
306 | - $firstTime = false; |
|
307 | - } else { |
|
308 | - echo '</ul>'; |
|
309 | - } |
|
310 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
311 | - echo '<ul>'; |
|
312 | - } |
|
313 | - |
|
314 | - echo '<li>'; |
|
315 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
316 | - echo $viewPeople->name; |
|
317 | - |
|
318 | - if ($viewPeople->rolename != '') { |
|
319 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
320 | - } else { |
|
321 | - // If there is no skill, we don't need to mention this. |
|
322 | - } |
|
323 | - echo (isset($viewPeople->swap)) ? '</a></s>' : ''; |
|
324 | - |
|
325 | - echo '</li>'; |
|
326 | - } |
|
327 | - echo '</ul>'; |
|
328 | - } else { |
|
329 | - echo '<p>No roles assigned to this event.'; |
|
330 | - } |
|
299 | + if ($viewPeople->group == $groupId) { |
|
300 | + // Do nothing, because they are all in the same group |
|
301 | + } else { |
|
302 | + // Update the group heading |
|
303 | + $groupId = $viewPeople->group; |
|
304 | + $groupName = $viewPeople->groupName; |
|
305 | + if ($firstTime) { |
|
306 | + $firstTime = false; |
|
307 | + } else { |
|
308 | + echo '</ul>'; |
|
309 | + } |
|
310 | + echo '<p><strong>'.$groupName.'</strong></p>'; |
|
311 | + echo '<ul>'; |
|
312 | + } |
|
313 | + |
|
314 | + echo '<li>'; |
|
315 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
316 | + echo $viewPeople->name; |
|
317 | + |
|
318 | + if ($viewPeople->rolename != '') { |
|
319 | + echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
320 | + } else { |
|
321 | + // If there is no skill, we don't need to mention this. |
|
322 | + } |
|
323 | + echo (isset($viewPeople->swap)) ? '</a></s>' : ''; |
|
324 | + |
|
325 | + echo '</li>'; |
|
326 | + } |
|
327 | + echo '</ul>'; |
|
328 | + } else { |
|
329 | + echo '<p>No roles assigned to this event.'; |
|
330 | + } |
|
331 | 331 | ?> |
332 | 332 | </div> |
333 | 333 | <div class="modal-footer"> |
@@ -361,10 +361,10 @@ discard block |
||
361 | 361 | |
362 | 362 | |
363 | 363 | <?php |
364 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
365 | - // ~~~~~~~~~ User's events ~~~~~~~~~~ |
|
366 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
367 | - ?> |
|
364 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
365 | + // ~~~~~~~~~ User's events ~~~~~~~~~~ |
|
366 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
367 | + ?> |
|
368 | 368 | |
369 | 369 | <h2>My events:</h2> |
370 | 370 | |
@@ -389,9 +389,9 @@ discard block |
||
389 | 389 | <div class="timeline-header"> |
390 | 390 | <a href="event.php?id=<?php echo $event->id ?>"> |
391 | 391 | <h4><?php |
392 | - echo date('jS: ', strtotime($event->date)); |
|
393 | - echo $event->roles; |
|
394 | - ?> |
|
392 | + echo date('jS: ', strtotime($event->date)); |
|
393 | + echo $event->roles; |
|
394 | + ?> |
|
395 | 395 | </h4> |
396 | 396 | </a> |
397 | 397 | <a class="label label-default" href="events.php?view=all&filter=<?php echo $event->eventTypeId ?>"><?php echo $event->eventType ?></a> |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | <div class="modal-body"> |
448 | 448 | <?php |
449 | 449 | |
450 | - $sqlPeople = "SELECT |
|
450 | + $sqlPeople = "SELECT |
|
451 | 451 | CONCAT(u.firstname, ' ', u.lastname) AS `name`, |
452 | 452 | r.name AS `rolename`, |
453 | 453 | ep.notified AS `notified`, |
@@ -463,47 +463,47 @@ discard block |
||
463 | 463 | AND ep.removed = 0 |
464 | 464 | ORDER BY g.name, r.name"; |
465 | 465 | |
466 | - $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); |
|
467 | - $groupName = ''; |
|
468 | - $groupId = 0; |
|
469 | - $identifier = '1'; |
|
470 | - $firstTime = true; |
|
466 | + $resultPeople = mysqli_query(db(), $sqlPeople) or exit(mysqli_error(db())); |
|
467 | + $groupName = ''; |
|
468 | + $groupId = 0; |
|
469 | + $identifier = '1'; |
|
470 | + $firstTime = true; |
|
471 | 471 | |
472 | - if (mysqli_num_rows($resultPeople) > 0) { |
|
473 | - ?> |
|
472 | + if (mysqli_num_rows($resultPeople) > 0) { |
|
473 | + ?> |
|
474 | 474 | <?php while ($viewPeople = mysqli_fetch_object($resultPeople)) { |
475 | - if ($viewPeople->group == $groupId) { |
|
476 | - // Do nothing, because they are all in the same group |
|
477 | - } else { |
|
478 | - // Update the group heading |
|
479 | - $groupId = $viewPeople->group; |
|
480 | - $groupName = $viewPeople->groupName; |
|
481 | - if ($firstTime) { |
|
482 | - $firstTime = false; |
|
483 | - } else { |
|
484 | - echo '</ul>'; |
|
485 | - } |
|
486 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
487 | - echo '<ul>'; |
|
488 | - } |
|
489 | - |
|
490 | - echo '<li>'; |
|
491 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
492 | - echo $viewPeople->name; |
|
493 | - |
|
494 | - if ($viewPeople->rolename != '') { |
|
495 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
496 | - } else { |
|
497 | - // If there is no skill, we don't need to mention this. |
|
498 | - } |
|
499 | - echo (isset($viewPeople->swap)) ? '</a></s>' : ''; |
|
500 | - |
|
501 | - echo '</li>'; |
|
502 | - } |
|
503 | - echo '</ul>'; |
|
504 | - } else { |
|
505 | - echo '<p>No roles assigned to this event.'; |
|
506 | - } |
|
475 | + if ($viewPeople->group == $groupId) { |
|
476 | + // Do nothing, because they are all in the same group |
|
477 | + } else { |
|
478 | + // Update the group heading |
|
479 | + $groupId = $viewPeople->group; |
|
480 | + $groupName = $viewPeople->groupName; |
|
481 | + if ($firstTime) { |
|
482 | + $firstTime = false; |
|
483 | + } else { |
|
484 | + echo '</ul>'; |
|
485 | + } |
|
486 | + echo '<p><strong>'.$groupName.'</strong></p>'; |
|
487 | + echo '<ul>'; |
|
488 | + } |
|
489 | + |
|
490 | + echo '<li>'; |
|
491 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
492 | + echo $viewPeople->name; |
|
493 | + |
|
494 | + if ($viewPeople->rolename != '') { |
|
495 | + echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
496 | + } else { |
|
497 | + // If there is no skill, we don't need to mention this. |
|
498 | + } |
|
499 | + echo (isset($viewPeople->swap)) ? '</a></s>' : ''; |
|
500 | + |
|
501 | + echo '</li>'; |
|
502 | + } |
|
503 | + echo '</ul>'; |
|
504 | + } else { |
|
505 | + echo '<p>No roles assigned to this event.'; |
|
506 | + } |
|
507 | 507 | ?> |
508 | 508 | </div> |
509 | 509 | <div class="modal-footer"> |
@@ -538,10 +538,10 @@ discard block |
||
538 | 538 | <div class="col-sm-4 col-md-4 col-lg-6"> |
539 | 539 | |
540 | 540 | <?php |
541 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
542 | - // ~~~~~~~ Remaining events ~~~~~~~~~ |
|
543 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
544 | - ?> |
|
541 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
542 | + // ~~~~~~~ Remaining events ~~~~~~~~~ |
|
543 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
544 | + ?> |
|
545 | 545 | <?php if (isset($remainingEventsInGroups)) { ?> |
546 | 546 | |
547 | 547 | <div class="row"> |
@@ -617,10 +617,10 @@ discard block |
||
617 | 617 | |
618 | 618 | |
619 | 619 | <?php |
620 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
621 | - // ~~~~~~~~~ User details ~~~~~~~~~~~ |
|
622 | - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
623 | - ?> |
|
620 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
621 | + // ~~~~~~~~~ User details ~~~~~~~~~~~ |
|
622 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
623 | + ?> |
|
624 | 624 | |
625 | 625 | <div class="box box-widget widget-user-2"> |
626 | 626 | <div class="widget-user-header bg-yellow"> |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </div><!-- /.timeline-header --> |
224 | 224 | |
225 | 225 | <div class="timeline-body"> |
226 | - <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p> |
|
226 | + <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p> |
|
227 | 227 | <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p> |
228 | 228 | |
229 | 229 | <?php if ($event->getComments()) { ?> |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | INNER JOIN groups g ON g.id = r.groupId |
284 | 284 | INNER JOIN users u ON u.id = ur.userId |
285 | 285 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
286 | - WHERE ep.eventId = '".$event->getId()."' |
|
286 | + WHERE ep.eventId = '".$event->getId() . "' |
|
287 | 287 | AND ep.removed = 0 |
288 | 288 | ORDER BY g.name, r.name"; |
289 | 289 | |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | } else { |
308 | 308 | echo '</ul>'; |
309 | 309 | } |
310 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
310 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
311 | 311 | echo '<ul>'; |
312 | 312 | } |
313 | 313 | |
314 | 314 | echo '<li>'; |
315 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
315 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
316 | 316 | echo $viewPeople->name; |
317 | 317 | |
318 | 318 | if ($viewPeople->rolename != '') { |
319 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
319 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
320 | 320 | } else { |
321 | 321 | // If there is no skill, we don't need to mention this. |
322 | 322 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | </div><!-- /.timeline-header --> |
399 | 399 | |
400 | 400 | <div class="timeline-body"> |
401 | - <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p> |
|
401 | + <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p> |
|
402 | 402 | <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p> |
403 | 403 | |
404 | 404 | <?php if ($event->comment != '') { ?> |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | INNER JOIN groups g ON g.id = r.groupId |
460 | 460 | INNER JOIN users u ON u.id = ur.userId |
461 | 461 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
462 | - WHERE ep.eventId = '".$event->id."' |
|
462 | + WHERE ep.eventId = '".$event->id . "' |
|
463 | 463 | AND ep.removed = 0 |
464 | 464 | ORDER BY g.name, r.name"; |
465 | 465 | |
@@ -483,16 +483,16 @@ discard block |
||
483 | 483 | } else { |
484 | 484 | echo '</ul>'; |
485 | 485 | } |
486 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
486 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
487 | 487 | echo '<ul>'; |
488 | 488 | } |
489 | 489 | |
490 | 490 | echo '<li>'; |
491 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
491 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
492 | 492 | echo $viewPeople->name; |
493 | 493 | |
494 | 494 | if ($viewPeople->rolename != '') { |
495 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
495 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
496 | 496 | } else { |
497 | 497 | // If there is no skill, we don't need to mention this. |
498 | 498 | } |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar"> |
629 | 629 | </div> |
630 | 630 | <!-- /.widget-user-image --> |
631 | - <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3> |
|
631 | + <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3> |
|
632 | 632 | <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5> |
633 | 633 | </div> |
634 | 634 | <div class="box-footer no-padding"> |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $userHasEmail = (strlen($user->getEmail()) > 3); |
653 | 653 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
654 | 654 | ?> |
655 | - Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert().' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
655 | + Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert() . ' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
656 | 656 | </a> |
657 | 657 | </li> |
658 | 658 | <li> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $sql = ("INSERT INTO eventSubTypes (name, description) VALUES ('$name', '$description')"); |
41 | 41 | if (!mysqli_query(db(), $sql)) { |
42 | - exit('Error: '.mysqli_error(db())); |
|
42 | + exit('Error: ' . mysqli_error(db())); |
|
43 | 43 | } |
44 | 44 | } else { |
45 | 45 | // Otherwise we are dealing with edits, not new stuff |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
91 | 91 | |
92 | 92 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
93 | - echo '<input type="hidden" name="formindex[]" value="'.$row['id'].'" />'; |
|
94 | - echo "<input name='name[]' value='".$row['name']."' />"; |
|
93 | + echo '<input type="hidden" name="formindex[]" value="' . $row['id'] . '" />'; |
|
94 | + echo "<input name='name[]' value='" . $row['name'] . "' />"; |
|
95 | 95 | |
96 | - echo " <a href='subTypes.php?method=remove&subType=".$row['id']."'><i class='fa fa-times'></i></a><br />"; |
|
96 | + echo " <a href='subTypes.php?method=remove&subType=" . $row['id'] . "'><i class='fa fa-times'></i></a><br />"; |
|
97 | 97 | } ?> |
98 | 98 | </div><!-- /.box-body --> |
99 | 99 | <div class="box-footer"> |
@@ -342,17 +342,17 @@ |
||
342 | 342 | <label for="skin">Application skin:</label> |
343 | 343 | <select name="skin" id="skin" class="form-control"> |
344 | 344 | <?php $skinOptions = ['skin-blue-light' => 'Blue & Light', |
345 | - 'skin-blue' => 'Blue & Dark', |
|
346 | - 'skin-yellow-light' => 'Yellow & Light', |
|
347 | - 'skin-yellow' => 'Yellow & Dark', |
|
348 | - 'skin-green-light' => 'Green & Light', |
|
349 | - 'skin-green' => 'Green & Dark', |
|
350 | - 'skin-purple-light' => 'Purple & Light', |
|
351 | - 'skin-purple' => 'Purple & Dark', |
|
352 | - 'skin-red-light' => 'Red & Light', |
|
353 | - 'skin-red' => 'Red & Dark', |
|
354 | - 'skin-black-light' => 'Black & Light', |
|
355 | - 'skin-black' => 'Black & Dark', ]; |
|
345 | + 'skin-blue' => 'Blue & Dark', |
|
346 | + 'skin-yellow-light' => 'Yellow & Light', |
|
347 | + 'skin-yellow' => 'Yellow & Dark', |
|
348 | + 'skin-green-light' => 'Green & Light', |
|
349 | + 'skin-green' => 'Green & Dark', |
|
350 | + 'skin-purple-light' => 'Purple & Light', |
|
351 | + 'skin-purple' => 'Purple & Dark', |
|
352 | + 'skin-red-light' => 'Red & Light', |
|
353 | + 'skin-red' => 'Red & Dark', |
|
354 | + 'skin-black-light' => 'Black & Light', |
|
355 | + 'skin-black' => 'Black & Dark', ]; |
|
356 | 356 | |
357 | 357 | foreach ($skinOptions as $skinName => $skinDescription) { ?> |
358 | 358 | <option value="<?php echo $skinName ?>" <?php echo ($skinName == $row['skin']) ? 'selected' : '' ?>><?php echo $skinDescription ?></option> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | exit; |
36 | 36 | } |
37 | 37 | if (!isAdmin()) { |
38 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
38 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
39 | 39 | exit; |
40 | 40 | } |
41 | 41 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | skin='$skin'"; |
168 | 168 | |
169 | 169 | if (!mysqli_query(db(), $sql)) { |
170 | - exit('Error: '.mysqli_error(db())); |
|
170 | + exit('Error: ' . mysqli_error(db())); |
|
171 | 171 | } |
172 | 172 | header('Location: settings.php'); |
173 | 173 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | <!-- Content Header (Page header) --> |
195 | 195 | <section class="content-header"> |
196 | 196 | <h1>Settings |
197 | - <?php echo '<small>v'.$row['version'].'</small>'; ?> |
|
197 | + <?php echo '<small>v' . $row['version'] . '</small>'; ?> |
|
198 | 198 | </h1> |
199 | 199 | <ol class="breadcrumb"> |
200 | 200 | <li><a href="<?php echo siteSettings()->getSiteUrl() ?>"><i class="fa fa-dashboard"></i> Home</a></li> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | case 'approve': |
34 | 34 | $userId = approvePendingUser($id); |
35 | 35 | mailNewUser($userId); |
36 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
36 | + header('Location: addUser.php?action=edit&user=' . $userId); |
|
37 | 37 | break; |
38 | 38 | case 'merge': |
39 | 39 | $existingUserId = $_POST['existingUser']; |
40 | 40 | $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
41 | 41 | mergePendingUserWithUserId($id, $existingUserId); |
42 | 42 | mailNewUser($existingUserId); |
43 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
43 | + header('Location: addUser.php?action=edit&user=' . $existingUserId); |
|
44 | 44 | break; |
45 | 45 | case 'decline': |
46 | 46 | declinePendingUser($id); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | <div class="box box-primary"> |
93 | 93 | <div class="box-header"> |
94 | 94 | <h2 class="box-title"> |
95 | - <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName.' '.$user->lastName ?> |
|
95 | + <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName . ' ' . $user->lastName ?> |
|
96 | 96 | </h2> |
97 | 97 | </div> |
98 | 98 | <div class="box-body"> |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | <?php |
134 | 134 | $users = allUsersNames(); |
135 | 135 | foreach ($users as $existingUser) { ?> |
136 | - <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName.' '.$existingUser->lastName ?></option> |
|
136 | + <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName . ' ' . $existingUser->lastName ?></option> |
|
137 | 137 | <?php } ?> |
138 | 138 | </select> |
139 | 139 | </div> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $sql = "UPDATE locations SET name = '$name' WHERE id = '$editid'"; |
42 | 42 | } |
43 | 43 | if (!mysqli_query(db(), $sql)) { |
44 | - exit('Error: '.mysqli_error(db())); |
|
44 | + exit('Error: ' . mysqli_error(db())); |
|
45 | 45 | } |
46 | 46 | } else { |
47 | 47 | $newlocation = $_POST['newlocation']; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $sql = ("INSERT INTO locations (name) VALUES ('$newlocation')"); |
54 | 54 | if (!mysqli_query(db(), $sql)) { |
55 | - exit('Error: '.mysqli_error(db())); |
|
55 | + exit('Error: ' . mysqli_error(db())); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // After we have inserted the data, we want to head back to the main users page |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
99 | 99 | $locationID = $row['id']; |
100 | - echo "<span id='".$locationID."' class='edit'>".$row['name'].'</span> '; |
|
101 | - echo " <a href='locations.php?locationremove=true&locationID=".$locationID."'><i class='fa fa-close'></i></a><br />"; |
|
100 | + echo "<span id='" . $locationID . "' class='edit'>" . $row['name'] . '</span> '; |
|
101 | + echo " <a href='locations.php?locationremove=true&locationID=" . $locationID . "'><i class='fa fa-close'></i></a><br />"; |
|
102 | 102 | } ?> |
103 | 103 | </div><!-- /.box-body --> |
104 | 104 | </div><!-- /.box --> |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | } else { |
51 | 51 | $urlFilters = ''; |
52 | 52 | if (isset($_SESSION['lastEventsFilter'])) { |
53 | - $urlFilters = '&filter='.$_SESSION['lastEventsFilter']; |
|
53 | + $urlFilters = '&filter=' . $_SESSION['lastEventsFilter']; |
|
54 | 54 | } |
55 | - header('Location: events.php?view=all'.$urlFilters); |
|
55 | + header('Location: events.php?view=all' . $urlFilters); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | session_destroy(); |
73 | 73 | header('Location: login.php'); |
74 | 74 | } else { |
75 | - header('Location: events.php?view='.$sessionUserID); |
|
75 | + header('Location: events.php?view=' . $sessionUserID); |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | } |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | if ($editskillID != '') { |
111 | 111 | $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
112 | 112 | if (!mysqli_query(db(), $sql)) { |
113 | - exit('Error: '.mysqli_error(db())); |
|
113 | + exit('Error: ' . mysqli_error(db())); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // After we have inserted the data, we want to head back to the main page |
117 | - header('Location: index.php#section'.$editeventID); |
|
117 | + header('Location: index.php#section' . $editeventID); |
|
118 | 118 | exit; |
119 | 119 | } |
120 | 120 | |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | |
128 | 128 | $sql = ("INSERT INTO eventPeople (eventId, userRoleId) VALUES ('$editeventID', '$editskillID')"); |
129 | 129 | if (!mysqli_query(db(), $sql)) { |
130 | - exit('Error: '.mysqli_error(db())); |
|
130 | + exit('Error: ' . mysqli_error(db())); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | 134 | // After we have inserted the data, we want to head back to the main page |
135 | - header('Location: index.php#section'.$editeventID); |
|
135 | + header('Location: index.php#section' . $editeventID); |
|
136 | 136 | exit; |
137 | 137 | } |
138 | 138 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $result = mysqli_query(db(), $mysqli_query) or exit(mysqli_error(db())); |
179 | 179 | $row = mysqli_fetch_object($result); |
180 | 180 | |
181 | - echo $row->name.'s'; |
|
181 | + echo $row->name . 's'; |
|
182 | 182 | } elseif ($_SESSION['onlyShowUserEvents'] == '1') { |
183 | 183 | echo 'My Events'; |
184 | 184 | } else { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | <?php if (!empty($pendingSwaps) && $pendingSwaps > 0) { |
206 | 206 | if ($pendingSwaps > 1) { |
207 | - $swapsMessage = $pendingSwaps.' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; |
|
207 | + $swapsMessage = $pendingSwaps . ' swaps are pending approval. Emails have been sent to the people covering to approve the swaps.'; |
|
208 | 208 | } else { |
209 | 209 | $swapsMessage = 'A swap is pending approval. An email has been sent to the person covering to approve the swap.'; |
210 | 210 | } ?> |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | WHERE e.type = '$filter' |
272 | 272 | AND e.date >= DATE(NOW()) |
273 | 273 | AND e.removed = 0 |
274 | - ORDER BY ".$dateOrderBy; |
|
274 | + ORDER BY " . $dateOrderBy; |
|
275 | 275 | } else { |
276 | 276 | $sql = "SELECT |
277 | 277 | DISTINCT e.id AS id, |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | WHERE e.date >= DATE(NOW()) |
299 | 299 | AND ur.userId = '$view' |
300 | 300 | AND e.removed = 0 |
301 | - ORDER BY ".$dateOrderBy; |
|
301 | + ORDER BY " . $dateOrderBy; |
|
302 | 302 | } |
303 | 303 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
304 | 304 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $newMonth = strftime('%B %Y', strtotime($row->sundayDate)); |
317 | 317 | if ($month != $newMonth) { |
318 | 318 | $month = $newMonth; |
319 | - echo '<li class="time-label"><span class="bg-green">'.$month.'</span></li>'; |
|
319 | + echo '<li class="time-label"><span class="bg-green">' . $month . '</span></li>'; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | // Event details?> |
@@ -330,9 +330,9 @@ discard block |
||
330 | 330 | <h4><?php |
331 | 331 | echo date('jS: ', strtotime($row->sundayDate)); |
332 | 332 | if ($eventName != '') { |
333 | - echo '<strong>'.$eventName.'</strong><br />'.$subType.' - <em>'.$type.'</em>'; |
|
333 | + echo '<strong>' . $eventName . '</strong><br />' . $subType . ' - <em>' . $type . '</em>'; |
|
334 | 334 | } else { |
335 | - echo $subType.' - <em>'.$type.'</em>'; |
|
335 | + echo $subType . ' - <em>' . $type . '</em>'; |
|
336 | 336 | } ?> |
337 | 337 | </h4> |
338 | 338 | </a> |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | <?php //<p><strong>Rehearsal:</strong> <?php |
345 | 345 | //echo ($row->rehearsalDateFormatted = "0000-00-00 00:00:00") ? "none" : strftime(siteSettings()->time_format_normal,strtotime($row->rehearsalDateFormatted));</p>?> |
346 | 346 | |
347 | - <p><strong><?php echo $row->eventGroup ? $row->eventGroup.': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '('.$row->bibleVerse.')' : '' ?></p> |
|
347 | + <p><strong><?php echo $row->eventGroup ? $row->eventGroup . ': ' : '' ?></strong><?php echo $row->sermonTitle ?> <?php echo $row->bibleVerse ? '(' . $row->bibleVerse . ')' : '' ?></p> |
|
348 | 348 | |
349 | 349 | <p><strong>Location:</strong> <?php echo $row->eventLocation; ?></p> |
350 | 350 | |
@@ -409,16 +409,16 @@ discard block |
||
409 | 409 | } else { |
410 | 410 | echo '</ul>'; |
411 | 411 | } |
412 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
412 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
413 | 413 | echo '<ul>'; |
414 | 414 | } |
415 | 415 | |
416 | 416 | echo '<li>'; |
417 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
417 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
418 | 418 | echo $viewPeople->name; |
419 | 419 | |
420 | 420 | if ($viewPeople->rolename != '') { |
421 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
421 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
422 | 422 | } else { |
423 | 423 | // If there is no skill, we don't need to mention this. |
424 | 424 | } |
@@ -445,9 +445,9 @@ discard block |
||
445 | 445 | |
446 | 446 | <?php |
447 | 447 | if (isAdmin() || $userisBandAdmin || $userisEventEditor) { |
448 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=".$eventID."'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
449 | - echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=".$eventID."'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
450 | - echo " <a class ='btn btn-primary' href='emailEvent.php?event=".$eventID."'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
448 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=edit&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Edit</span></a> "; /* Edit event */ |
|
449 | + echo " <a class ='btn btn-primary' href='createEvent.php?action=copy&id=" . $eventID . "'><i class='fa fa-pencil'></i><span> Copy</span></a> "; /* Edit event */ |
|
450 | + echo " <a class ='btn btn-primary' href='emailEvent.php?event=" . $eventID . "'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
|
451 | 451 | } |
452 | 452 | if (isAdmin()) { |
453 | 453 | //echo "<a class='btn btn-primary' href='index.php?notifyEveryone=true&eventID=$eventID'><i class='fa fa-envelope-o'></i><span> Send email</span></a> "; /* Send email */ |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | |
457 | 457 | echo "<ul class='dropdown-menu'>"; |
458 | 458 | |
459 | - echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal".$eventID."'>Delete</button></li>"; /* Delete Event */ |
|
459 | + echo "<li><button type='button' class='btn btn-danger btn-block' data-toggle='modal' data-target='#deleteModal" . $eventID . "'>Delete</button></li>"; /* Delete Event */ |
|
460 | 460 | |
461 | 461 | echo '</ul>'; |
462 | 462 | } ?> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if (($userisBandAdmin) || ($userisEventEditor) || (isAdmin())) { |
48 | 48 | // Just continue the code |
49 | 49 | } else { |
50 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
50 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($userisBandAdmin) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $location = $row['location']; |
85 | 85 | $locationname = $row['locationname']; |
86 | 86 | if ($action == 'edit') { |
87 | - $formaction = '?action=edit&id='.$id; |
|
87 | + $formaction = '?action=edit&id=' . $id; |
|
88 | 88 | } else { |
89 | 89 | $formaction = ''; |
90 | 90 | } |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | |
139 | 139 | // convert format of date |
140 | 140 | $date = str_replace('/', '-', $date); // ensure it isn't read as mm/dd/yyyy |
141 | - $date = strftime('%Y-%m-%d', strtotime($date.' 00:00:00')); |
|
142 | - $date = $date.' '.$time.':00'; |
|
141 | + $date = strftime('%Y-%m-%d', strtotime($date . ' 00:00:00')); |
|
142 | + $date = $date . ' ' . $time . ':00'; |
|
143 | 143 | $date = mysqli_real_escape_string(db(), $date); |
144 | 144 | |
145 | 145 | if ($action == 'edit') { |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | //if ($userisBandAdmin) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from skills where groupid=2)"; |
210 | 210 | //if ($userisEventEditor) $delete_all_sql = $delete_all_sql . " and skillID in (select skillID from skills where groupid!=2)"; |
211 | 211 | if ($userisBandAdmin) { |
212 | - $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from skills where groupid in (2,3,4))'; |
|
212 | + $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from skills where groupid in (2,3,4))'; |
|
213 | 213 | } |
214 | 214 | if ($userisEventEditor) { |
215 | - $delete_all_sql = $delete_all_sql.' and skillID in (select skillID from skills where not (groupid in (2,3,4)))'; |
|
215 | + $delete_all_sql = $delete_all_sql . ' and skillID in (select skillID from skills where not (groupid in (2,3,4)))'; |
|
216 | 216 | } |
217 | 217 | mysqli_query(db(), $delete_all_sql) or exit(mysqli_error(db())); |
218 | 218 | } |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | // redirect |
221 | 221 | if (isset($_SESSION['lastEventsFilter'])) { |
222 | 222 | $type = $_SESSION['lastEventsFilter']; |
223 | - header('Location: events.php?view=all&filter='.$type.'#event'.$eventID); |
|
223 | + header('Location: events.php?view=all&filter=' . $type . '#event' . $eventID); |
|
224 | 224 | } else { |
225 | - header('Location: events.php?view=all#event'.$eventID); |
|
225 | + header('Location: events.php?view=all#event' . $eventID); |
|
226 | 226 | } |
227 | 227 | exit; |
228 | 228 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | while ($ob = mysqli_fetch_object($result)) { |
300 | 300 | if (!(isset($type) && $ob->id == $type)) { |
301 | 301 | $defaultTime = strftime('%H:%M', strtotime($ob->defaultTime)); |
302 | - 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>'; |
|
302 | + 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 | 303 | } |
304 | 304 | } ?> |
305 | 305 | </select> |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
326 | 326 | if (isset($subtype) && $row['id'] == $subtype) { |
327 | 327 | } else { |
328 | - echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>'; |
|
328 | + echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>'; |
|
329 | 329 | } |
330 | 330 | } ?> |
331 | 331 | </select> |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
354 | 354 | if (isset($location) && $row['id'] == $location) { |
355 | 355 | } else { |
356 | - echo "<option value='".$row['id']."'>".$row['name'].'</option>'; |
|
356 | + echo "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>'; |
|
357 | 357 | } |
358 | 358 | } ?> |
359 | 359 | </select> |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
485 | 485 | if (isset($type) && $row['id'] == $type) { |
486 | 486 | } else { |
487 | - echo "<option value='".$row['id']."' title='".$row['description']."'>".$row['name'].'</option>'; |
|
487 | + echo "<option value='" . $row['id'] . "' title='" . $row['description'] . "'>" . $row['name'] . '</option>'; |
|
488 | 488 | } |
489 | 489 | } ?> |
490 | 490 | </select> |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | <?php foreach ($role->getUserRoles() as $userRole) { ?> |
555 | 555 | <?php if (!$userRole->getReserve()) { ?> |
556 | 556 | <?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?> |
557 | - <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option> |
|
557 | + <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option> |
|
558 | 558 | <?php } else { ?> |
559 | 559 | <?php $countReserve += 1 ?> |
560 | 560 | <?php } //!userRole->getReserve?> |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | <?php foreach ($role->getUserRoles() as $userRole) { ?> |
566 | 566 | <?php if ($userRole->getReserve()) { ?> |
567 | 567 | <?php $isInEvent = in_array($userRole->getId(), $usersInEvent) ?> |
568 | - <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName().' '.$userRole->getUser()->getLastName() ?></option> |
|
568 | + <option value="<?php echo $userRole->getId() ?>" <?php echo $isInEvent ? 'selected="selected"' : '' ?>><?php echo $userRole->getUser()->getFirstName() . ' ' . $userRole->getUser()->getLastName() ?></option> |
|
569 | 569 | <?php } ?> |
570 | 570 | <?php } //users?> |
571 | 571 | </optgroup> |