Basic steps for registration of participants

This commit is contained in:
Thomas Günther 2024-07-22 21:27:53 +02:00
parent c7b3072e59
commit b9307c2f5a
3 changed files with 70 additions and 0 deletions

View File

@ -38,6 +38,10 @@ class AjaxRouterController {
new PrintParticipantListPhotoPdfController(); new PrintParticipantListPhotoPdfController();
break; break;
case 'print_invoice_data':
new PrintParticipantListInvoicePdfController();
die();
default: default:
echo 'No "method" specified.'; echo 'No "method" specified.';
} }

View File

@ -0,0 +1,65 @@
<?php
namespace Bdp\Modules\EventParticipants\Controllers;
use Bdp\Modules\EventParticipants\Models\Event;
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
class PrintParticipantListInvoicePdfController {
private function get_table_header(string $event_name) : string {
return '<h1>Teili-Liste für ' . $event_name . '</h1><br /><br /><br /><br /><table style="border-spacing: 0; width: 100%;page-break-after: always">' .
'<tr>' .
'<td>Vorname</td>' .
'<td>Nachname</td>' .
'<td>Teili-Gruppe</td>' .
'<td>Stamm</td>' .
'<td>Geburtsdatum</td>' .
'<td>Beitrag</td>' .
'<td>Tage</td>' .
'<td>Notizen</td>';
}
public function __construct() {
global $_POST, $_REQUEST, $dbHandler;
$group_name = ['participant' => 'Teili', 'volunteer' => 'Teami', 'other' => 'Sonstige'];
$event = Event::loadById( $_REQUEST['event-id'] );
$output = '';
$i = 0;
foreach ( $event->tribes as $tribe => $participants ) {
if ( count( $participants ) == 0 ) {
continue;
}
foreach ( $participants as $participant ) {
if ($participant->beitrag == 0) {
continue;
}
if ( $i == 0 ) {
$output .= $this->get_table_header( $event->event_name );
}
$i ++;
$output .= '<tr style="min-height: 80px; height: 80px; border-style: solid; border-width: 1px;">' .
'<td style="min-height: 40px; height: 40px; width: 150px; border-style: solid; border-width: 1px;">' . $participant->vorname .
('' != $participant->pfadiname ? '<br /> (' . $participant->pfadiname . ')' : '') . '</td>' .
'<td style="width: 150px; border-style: solid; border-width: 1px;">' . $participant->nachname . '</td>' .
'<td style="padding-right: 100px; border-style: solid; border-width: 1px;">' . $group_name[$participant->teilnahme] . '</td>' .
'<td style="padding-right: 100px; border-style: solid; border-width: 1px;">' . $tribe . '</td>' .
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' . \DateTime::createFromFormat( 'Y-m-d', $participant->geburtsdatum )->format( 'd.m.Y' ) . '</td>' .
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' . str_replace('.', ',', $participant->beitrag) . ' Euro</td>' .
'<td style="border-style: solid; border-width: 1px;">' . AnwesenheitRequest::send($participant) . '</td>' .
'<td style="padding-right: 150px; border-style: solid; border-width: 1px;"></td></tr>';
if ( $i == 12 ) {
$output .= '</table>';
$i = 0;
}
}
}
$output .= '</table></body></html>';
kompass_create_pdf($output,$event->event_name . ' Beitragsliste.pdf', 'landscape');
}
}

View File

@ -72,6 +72,7 @@
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_allergies_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste (Allergien)</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_allergies_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste (Allergien)</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_medical_data', 'event-id=<?= $event->id; ?>');" class="button">Sani-Liste</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_medical_data', 'event-id=<?= $event->id; ?>');" class="button">Sani-Liste</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_invoice_data', 'event-id=<?= $event->id; ?>');" class="button">Beitrags-Liste</a>
<a href="<?= $admin_link . 'send-mail-to-all&event-id=' . $event->id ?>" class="button">Rundmail an alle</a> <a href="<?= $admin_link . 'send-mail-to-all&event-id=' . $event->id ?>" class="button">Rundmail an alle</a>
</div> </div>