Completed
Push — FVSv2 ( 037b69...1cad04 )
by Patrick
01:48
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,37 +458,37 @@  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 483
         $rowCount = count($rows);
484
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount);
484
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount);
485 485
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
486 486
         $hourCount = count($simpleHours);
487 487
         for($i = 0; $i < $hourCount; $i++)
488 488
         {
489 489
             for($j = 0; $j < $rowCount; $j++)
490 490
             {
491
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
491
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
492 492
                  if($cell->isInMergeRange())
493 493
                  {
494 494
                       continue;
Please login to merge, or discard this patch.