@@ -277,7 +277,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |