Completed
Push — FVSv2 ( 1beff5...037b69 )
by Patrick
01:30
created
api/v1/class.DepartmentAPI.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             $timeStr = $start->format('g:i A').' till '.$end->format('g:i A');
278 278
             if(strlen($shifts[$i]['name']) > 0)
279 279
             {
280
-                $timeStr .=' - <i>'.$shifts[$i]['name'].'</i>';
280
+                $timeStr .= ' - <i>'.$shifts[$i]['name'].'</i>';
281 281
             }
282 282
             if(!isset($days[$dateStr]))
283 283
             {
@@ -292,22 +292,22 @@  discard block
 block discarded – undo
292 292
         ksort($days);
293 293
         foreach($days as $dateStr=>$day)
294 294
         {
295
-            $html .='<h2>'.$dateStr.'</h2>';
295
+            $html .= '<h2>'.$dateStr.'</h2>';
296 296
             uksort($day, array($this, 'groupSort'));
297 297
             foreach($day as $shiftStr=>$shifts)
298 298
             {
299 299
                 usort($shifts, array($this, 'shiftSort'));
300
-                $html .='<h3>'.$shiftStr.'</h3>';
301
-                $html .='<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
300
+                $html .= '<h3>'.$shiftStr.'</h3>';
301
+                $html .= '<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
302 302
                 foreach($shifts as $shift)
303 303
                 {
304 304
                     //TODO Volunteer info for shift...
305
-                    $html .='<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
305
+                    $html .= '<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
306 306
                 }
307
-                $html .='</table>';
307
+                $html .= '</table>';
308 308
             }
309 309
         }
310
-        $html .='</body>';
310
+        $html .= '</body>';
311 311
         $pdf->setPDFFromHTML($html);
312 312
         $response = $response->withHeader('Content-Type', 'application/pdf');
313 313
         $response->getBody()->write($pdf->toPDFBuffer());
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         $start = date_parse($str);
357 357
         $lastShift = $shifts[$count - 1];
358 358
         $interval = $lastShift['endTime']->diff($shifts[0]['startTime']);
359
-        $hourCount = ($interval->d*24) + $interval->h;
359
+        $hourCount = ($interval->d * 24) + $interval->h;
360 360
         $simpleHours = array();
361 361
         $militaryHours = array();
362 362
         $hour = $start['hour'];
@@ -458,35 +458,35 @@  discard block
 block discarded – undo
458 458
         {
459 459
             $i = 1;
460 460
             $timeDiff = $originalStartTime->diff($shift['startTime']);
461
-            $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h;
461
+            $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h;
462 462
             $firstRow = array_search($shift['roleID'], $rows);
463
-            $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4);
463
+            $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4);
464 464
             if($cell->isInMergeRange())
465 465
             {
466
-                while($rows[$firstRow+$i] === $shift['roleID'])
466
+                while($rows[$firstRow + $i] === $shift['roleID'])
467 467
                 {
468
-                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i);
468
+                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i);
469 469
                     if(!$cell->isInMergeRange())
470 470
                     {
471 471
                         break;
472 472
                     }
473 473
                     $i++;
474 474
                 }
475
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $hoursFromStart+1+$shift['length'], $firstRow+4+$i);
475
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $hoursFromStart + 1 + $shift['length'], $firstRow + 4 + $i);
476 476
             }
477 477
             else
478 478
             {
479
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4, $hoursFromStart+1+$shift['length'], $firstRow+4);
479
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $hoursFromStart + 1 + $shift['length'], $firstRow + 4);
480 480
             }
481 481
             $shift = array_shift($shifts);
482 482
         }
483
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3+count($rows));
483
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + count($rows));
484 484
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
485 485
         for($i = 0; $i < count($simpleHours); $i++)
486 486
         {
487 487
             for($j = 0; $j < count($rows); $j++)
488 488
             {
489
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
489
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
490 490
                  if($cell->isInMergeRange())
491 491
                  {
492 492
                       continue;
Please login to merge, or discard this patch.
app/VolunteerAutoload.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@
 block discarded – undo
1 1
 <?php
2
-function VolunteerAutoload($classname)
3
-{
2
+function VolunteerAutoload($classname)
3
+{
4 4
     $classname = str_replace('/', '\\', $classname);
5 5
     $classname = ltrim($classname, '\\');
6 6
     $filename  = '';
7 7
     $namespace = '';
8
-    if($lastNsPos = strrpos($classname, '\\'))
9
-    {
8
+    if($lastNsPos = strrpos($classname, '\\'))
9
+    {
10 10
         $namespace = substr($classname, 0, $lastNsPos);
11 11
         $classname = substr($classname, $lastNsPos + 1);
12 12
         $filename  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
13 13
     }
14 14
     $filename = __DIR__.DIRECTORY_SEPARATOR.$filename.'class.'.$classname.'.php'; 
15
-    if(is_readable($filename))
16
-    {
15
+    if(is_readable($filename))
16
+    {
17 17
         require $filename;
18 18
     }
19 19
 }
20 20
 
21
-if(version_compare(PHP_VERSION, '5.3.0', '>='))
22
-{
21
+if(version_compare(PHP_VERSION, '5.3.0', '>='))
22
+{
23 23
     spl_autoload_register('VolunteerAutoload', true, true);
24
-}
25
-else
26
-{
24
+}
25
+else
26
+{
27 27
     spl_autoload_register('VolunteerAutoload');
28 28
 }
29 29
 /* vim: set tabstop=4 shiftwidth=4 expandtab: */
Please login to merge, or discard this patch.