Skip to content

Commit

Permalink
Adjusted data exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
koencaerels committed Jan 26, 2024
1 parent eaa5239 commit 5f647e7
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public function exportMembersForLocation(int $locationId): Spreadsheet
$sheet->setCellValue([7, $rowCounter], 'Adres');
$sheet->setCellValue([8, $rowCounter], 'Postcode');
$sheet->setCellValue([9, $rowCounter], 'Gemeente');
$sheet->setCellValue([10, $rowCounter], 'Email');
$sheet->setCellValue([11, $rowCounter], 'Telefoon');

// -- data -----------------------------------------------------------------
++$rowCounter;
Expand All @@ -126,6 +128,9 @@ public function exportMembersForLocation(int $locationId): Spreadsheet
$sheet->setCellValue([7, $rowCounter], $member->getAddressStreet().' '.$member->getAddressNumber().' '.$member->getAddressBox());
$sheet->setCellValue([8, $rowCounter], $member->getAddressZip());
$sheet->setCellValue([9, $rowCounter], $member->getAddressCity());
$sheet->setCellValue([10, $rowCounter], $member->getContactEmail());
$sheet->setCellValue([11, $rowCounter], $member->getContactPhone());

++$rowCounter;
}

Expand Down Expand Up @@ -154,6 +159,7 @@ public function renderMembersForLocation(int $locationId): bool
'members' => $members,
'generatedOn' => $generatedOn,
'locationName' => $location->getName(),
'locationCode' => $location->getCode(),
]);

$options = new Options();
Expand All @@ -164,7 +170,7 @@ public function renderMembersForLocation(int $locationId): bool
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();

$fileName = $generatedOn->format('YmdHis').'_YoshiKan_Leden_'.$locationCode.'.pdf';
$fileName = $generatedOn->format('Ymd').'_YoshiKan_Leden_'.$locationCode.'.pdf';
$dompdf->stream($fileName, ['Attachment' => false]);

exit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
@page {
margin: 20mm;
margin: 10mm;
}
pre {
Expand Down Expand Up @@ -110,10 +110,10 @@

{# ------------------------------------------------------------------------------------------------------------------ #}
<header>
Leden lijst Yoshi-Kan vzw - {{ locationName }}
Leden lijst Yoshi-Kan - {{ locationName }}
</header>
<footer>
Leden lijst Yoshi-Kan vzw - {{ locationName }} - generated on {{ generatedOn |date('d/m/Y H:i:s') }}
Leden lijst Yoshi-Kan - {{ locationName }} - generated on {{ generatedOn |date('d/m/Y H:i:s') }}
</footer>

{# ------------------------------------------------------------------------------------------------------------------ #}
Expand All @@ -126,12 +126,17 @@
<th>Ref.</th>
<th>Naam</th>
<th>Voornaam</th>
<th>Geslacht</th>
{% if locationCode !== 'HEIST-OP-DEN-BERG' %}
<th>Geslacht</th>
{% endif %}
<th>Geboortedatum</th>
<th>Leeftijd</th>
<th>Adres</th>
<th>Postcode</th>
<th>Gemeente</th>
{% if locationCode === 'HEIST-OP-DEN-BERG' %}
<th>Telefoon</th>
{% endif %}
</tr>
</thead>
<tbody>
Expand All @@ -142,10 +147,15 @@
{% set dateDiffYears = dateDiff / (60 * 60 * 24 * 365.25) %}

<tr>
<td>YK-{{ member.id }}</td>
<td>
{% if locationCode !== 'HEIST-OP-DEN-BERG' %}YK-{% endif %}
{{ member.id }}
</td>
<td>{{ member.lastname }}</td>
<td>{{ member.firstname }}</td>
<td align="center">{{ member.gender.value }}</td>
{% if locationCode !== 'HEIST-OP-DEN-BERG' %}
<td align="center">{{ member.gender.value }}</td>
{% endif %}
<td>{{ dateOfBirth | date('d / m / Y') }}</td>
<td align="center">
{% if dateDiffYears > 18 %}
Expand All @@ -157,6 +167,9 @@
<td>{{ member.addressStreet }} {{ member.addressNumber }} {{ member.addressBox }}</td>
<td>{{ member.addressZip }}</td>
<td>{{ member.addressCity }}</td>
{% if locationCode === 'HEIST-OP-DEN-BERG' %}
<td>{{ member.contactPhone }}</td>
{% endif %}
</tr>
{% endfor %}

Expand Down
Loading

0 comments on commit 5f647e7

Please sign in to comment.