Basic implementation event signup
This commit is contained in:
45
modules/event-participants/Controllers/class-ajaxrouter.php
Normal file
45
modules/event-participants/Controllers/class-ajaxrouter.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
class AjaxRouterController {
|
||||
function __construct() {
|
||||
global $_REQUEST;
|
||||
switch ($_REQUEST['method']) {
|
||||
case 'kompass_print_participant_summary':
|
||||
new MemberSummaryController();
|
||||
break;
|
||||
|
||||
case 'print_kitchen_data':
|
||||
new PrintParticipantListKitchenPdfController();
|
||||
break;
|
||||
|
||||
case 'print_kitchen_allergies_data':
|
||||
new PrintParticipantListKitchenAllergiesPdfController();
|
||||
break;
|
||||
|
||||
case 'print_signup_data':
|
||||
new PrintParticipantListSignupPdfController();
|
||||
break;
|
||||
|
||||
case 'print_medical_data':
|
||||
new PrintParticipantListMedicalPdfController();
|
||||
break;
|
||||
|
||||
case 'print_drink_data':
|
||||
new PrintParticipantListDrinkingPdfController();
|
||||
break;
|
||||
|
||||
case 'print_drink_alcoholic_data':
|
||||
new PrintParticipantListDrinkingAlcoholicPdfController();
|
||||
break;
|
||||
|
||||
case 'print_photo_data':
|
||||
new PrintParticipantListPhotoPdfController();
|
||||
break;
|
||||
|
||||
default:
|
||||
echo 'No "method" specified.';
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class ArchiveEvent {
|
||||
public function __construct() {
|
||||
global $_REQUEST, $dbHandler;
|
||||
|
||||
$dbHandler->updateRows(MainController::KOMPASS_EVENTS_EVENTS, ['signup_allowed' => false, 'archived' => true], ['id' => $_REQUEST['event-id']]);
|
||||
kompass_print_message_box(__('Event archived successfully.', BDP_LV_PLUGIN_SLUG));
|
||||
|
||||
new ListEventsController();
|
||||
}
|
||||
}
|
16
modules/event-participants/Controllers/class-closeevent.php
Normal file
16
modules/event-participants/Controllers/class-closeevent.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class CloseEvent {
|
||||
public function __construct() {
|
||||
global $_REQUEST, $dbHandler;
|
||||
|
||||
$dbHandler->updateRows(MainController::KOMPASS_EVENTS_EVENTS, ['signup_allowed' => false], ['id' => $_REQUEST['event-id']]);
|
||||
kompass_print_message_box(__('Event closed for signup', BDP_LV_PLUGIN_SLUG));
|
||||
|
||||
new ListEventsController();
|
||||
}
|
||||
}
|
41
modules/event-participants/Controllers/class-createevent.php
Normal file
41
modules/event-participants/Controllers/class-createevent.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class CreateEvent {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$use_data = ['event_name', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
|
||||
$post_data = [];
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (in_array($key, $use_data)) {
|
||||
$post_data[$key] = $value;
|
||||
}
|
||||
};
|
||||
|
||||
$post_data['amount_reduced'] = str_replace(',', '.', $_POST['amount_reduced']);
|
||||
$post_data['amount_default'] = str_replace(',', '.', $_POST['amount_default']);
|
||||
$post_data['amount_social'] = str_replace(',', '.', $_POST['amount_social']);
|
||||
|
||||
$post_data['contributing_tribes'] = str_replace( PHP_EOL, ',', $post_data['contributing_tribes'] );
|
||||
|
||||
$new_event_id = $dbHandler->insertRows(
|
||||
'kompass_veranstaltungen_index',
|
||||
$post_data,
|
||||
);
|
||||
kompass_print_message_box(__('Event created successfull.', BDP_LV_PLUGIN_SLUG));
|
||||
|
||||
$pageName = $post_data['event_name'] . ' - ' .__('Registration', BDP_LV_PLUGIN_SLUG);
|
||||
$page_id = wp_insert_post(array(
|
||||
'post_title' => $pageName,
|
||||
'post_content' => '{{event-' . $new_event_id . '}}',
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'page',
|
||||
));
|
||||
|
||||
new ListEventsController();
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class DeleteMemberController {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
$participant = EventParticipant::loadById($_REQUEST['participant-id']);
|
||||
|
||||
$dbHandler->deleteFromDb(MainController::KOMPASS_EVENTS_PARTICIPANTS, ['id' => $participant->id]);
|
||||
|
||||
|
||||
kompass_print_message_box(__('The participant was deleted.', BDP_LV_PLUGIN_SLUG));
|
||||
new ListGroupsAndMembersController($participant->eventId);
|
||||
}
|
||||
}
|
12
modules/event-participants/Controllers/class-editevent.php
Normal file
12
modules/event-participants/Controllers/class-editevent.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event as Event;
|
||||
|
||||
class EditEvent {
|
||||
public function __construct() {
|
||||
global $_GET, $_REQUEST, $dbHandler;
|
||||
kompass_print_event_edit_form($_GET['event-id']);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class EventGroupMailFormController {
|
||||
public function __construct() {
|
||||
global $_REQUEST;
|
||||
$group = $_REQUEST['group'];
|
||||
$recipients = [];
|
||||
foreach (EventParticipant::list_for_event($_REQUEST['event-id']) as $participant) {
|
||||
if ($participant->teilnahme !== $group) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_1) . '>';
|
||||
if (!in_array($recipient, $recipients) && str_contains($participant->email_1, '@')) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
if ('' != $participant->email_2 && str_contains($participant->email_2, '@')) {
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_2) . '>';
|
||||
if (!in_array($recipient, $recipients)) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$recipients = array_unique($recipients);
|
||||
$to = implode(', ', $recipients);
|
||||
kompass_print_mail_compose($to, "[KoPfiLa '24] - ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class EventLocalGroupMailFormController {
|
||||
public function __construct() {
|
||||
global $_REQUEST;
|
||||
$group = $_REQUEST['group'];
|
||||
$recipients = [];
|
||||
foreach (EventParticipant::list_for_event($_REQUEST['event-id']) as $participant) {
|
||||
if ($participant->stamm !== $group) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_1) . '>';
|
||||
if (!in_array($recipient, $recipients) && str_contains($participant->email_1, '@')) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
if ('' != $participant->email_2 && str_contains($participant->email_2, '@')) {
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_2) . '>';
|
||||
if (!in_array($recipient, $recipients)) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$recipients = array_unique($recipients);
|
||||
$to = implode(', ', $recipients);
|
||||
kompass_print_mail_compose($to, "[KoPfiLa '24] - ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class EventMailFormController {
|
||||
public function __construct() {
|
||||
global $_REQUEST;
|
||||
$recipients = [];
|
||||
foreach (EventParticipant::list_for_event($_REQUEST['event-id']) as $participant) {
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_1) . '>';
|
||||
if (!in_array($recipient, $recipients) && str_contains($participant->email_1, '@')) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
if ('' != $participant->email_2 && str_contains($participant->email_2, '@')) {
|
||||
$recipient = $participant->vorname . ' <' . strtolower($participant->email_2) . '>';
|
||||
if (!in_array($recipient, $recipients)) {
|
||||
$recipients[] = $recipient;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$recipients = array_unique($recipients);
|
||||
$to = implode(', ', $recipients);
|
||||
kompass_print_mail_compose($to, "[KoPfiLa '24] - ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
|
||||
class ListGroupsAndMembersController {
|
||||
public function __construct(?int $event_id = null) {
|
||||
if (!isset($_GET['event-id']) && null === $event_id) {
|
||||
wp_die('Invalid url given');
|
||||
}
|
||||
|
||||
if (isset($_GET['event-id'])) {
|
||||
$event_id = $_GET['event-id'];
|
||||
}
|
||||
$active_tab = 'tab1';
|
||||
if (isset($_GET['tab'])) {
|
||||
$active_tab = $_GET['tab'];
|
||||
}
|
||||
|
||||
|
||||
$event = Event::loadById($event_id);
|
||||
|
||||
$admin_link = admin_url('admin.php?page=kompass-events&action=');
|
||||
include dirname(__FILE__) . '/../Templates/Partials/admin/tab-control.php';
|
||||
}
|
||||
}
|
227
modules/event-participants/Controllers/class-main.php
Normal file
227
modules/event-participants/Controllers/class-main.php
Normal file
@ -0,0 +1,227 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Libs\FileAccess;
|
||||
use SearchMemberRequest;
|
||||
|
||||
|
||||
class MainController
|
||||
{
|
||||
public const KOMPASS_EVENTS_EVENTS = 'kompass_veranstaltungen_index';
|
||||
public const KOMPASS_EVENTS_GROUPS = 'kompass_veranstaltungen_gruppen';
|
||||
public const KOMPASS_EVENTS_PARTICIPANTS = 'kompass_veranstaltungen_teilis';
|
||||
|
||||
public static function setup()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$charset = $wpdb->get_charset_collate();
|
||||
$fileReader = new FileAccess();
|
||||
foreach ([self::KOMPASS_EVENTS_EVENTS, self::KOMPASS_EVENTS_GROUPS, self::KOMPASS_EVENTS_PARTICIPANTS] as $table) {
|
||||
$sqlTable = $wpdb->prefix . $table;
|
||||
$sql = "SHOW TABLES LIKE '$sqlTable'";
|
||||
|
||||
$result = $wpdb->get_var( $sql );
|
||||
if ( $result == $sqlTable ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sqlSetup = str_replace(
|
||||
'%tablename%',
|
||||
$sqlTable,
|
||||
$fileReader->get_contents( WP_PLUGIN_DIR . '/' . BDP_LV_PLUGIN_SLUG . '/lib/database/' . $table . '.sql' ) );
|
||||
|
||||
$sqlSetup = str_replace('%charset%', $charset, $sqlSetup);
|
||||
$sqlSetup = str_replace('%prefix%', $wpdb->prefix, $sqlSetup);
|
||||
|
||||
|
||||
|
||||
dbDelta( $sqlSetup );
|
||||
}
|
||||
|
||||
}
|
||||
public function __construct()
|
||||
{
|
||||
global $dbHandler;
|
||||
|
||||
add_menu_page(
|
||||
__('Events', BDP_LV_PLUGIN_SLUG),
|
||||
__('Events', BDP_LV_PLUGIN_SLUG),
|
||||
'send_mails',
|
||||
'kompass-events',
|
||||
[$this, 'router'],
|
||||
'dashicons-tickets-alt',
|
||||
3
|
||||
);
|
||||
|
||||
foreach ($dbHandler->readFromDb( self::KOMPASS_EVENTS_EVENTS, ['archived' => false]) as $currentEvent) {
|
||||
add_submenu_page(
|
||||
'kompass-events',
|
||||
$currentEvent->event_name,
|
||||
$currentEvent->event_name,
|
||||
'show_groups',
|
||||
'kompass-events&action=show-event&event-id=' . $currentEvent->id,
|
||||
[ $this, 'router' ]);
|
||||
}
|
||||
|
||||
add_submenu_page(
|
||||
'kompass-events',
|
||||
__('New Event', BDP_LV_PLUGIN_SLUG),
|
||||
__('New Event', BDP_LV_PLUGIN_SLUG),
|
||||
'show_groups',
|
||||
'kompass-events&action=new-event',
|
||||
[ $this, 'router' ]);
|
||||
}
|
||||
|
||||
|
||||
public function router()
|
||||
{
|
||||
if (isset($_REQUEST['action'])) {
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'show-event':
|
||||
new ListGroupsAndMembersController();
|
||||
break;
|
||||
|
||||
case 'show-participant':
|
||||
if (isset($_REQUEST['save'])) {
|
||||
new UpdateMemberDetailsController();
|
||||
}
|
||||
|
||||
new MemberDetailsController();
|
||||
break;
|
||||
|
||||
case 'delete-participant':
|
||||
new DeleteMemberController();
|
||||
break;
|
||||
|
||||
case 'update-participant-amount':
|
||||
new UpdateMemberAmountController();
|
||||
break;
|
||||
|
||||
case 'open-event':
|
||||
new OpenEvent();
|
||||
break;
|
||||
|
||||
case 'close-event':
|
||||
new CloseEvent();
|
||||
break;
|
||||
|
||||
case 'archive-event':
|
||||
new ArchiveEvent();
|
||||
break;
|
||||
|
||||
case 'edit-event':
|
||||
new EditEvent();
|
||||
break;
|
||||
|
||||
case 'update-event':
|
||||
new UpdateEvent();
|
||||
break;
|
||||
|
||||
case 'new-event':
|
||||
new NewEvent();
|
||||
break;
|
||||
|
||||
case 'create-event':
|
||||
new CreateEvent();
|
||||
break;
|
||||
|
||||
case 'kompass_print_participant_mail_form':
|
||||
new MemberMailFormController();
|
||||
break;
|
||||
|
||||
case 'send-mail-to-all':
|
||||
new EventMailFormController();
|
||||
break;
|
||||
|
||||
case 'send-mail-to-group':
|
||||
new EventGroupMailFormController();
|
||||
break;
|
||||
|
||||
case 'send-mail-to-local-group':
|
||||
new EventLocalGroupMailFormController();
|
||||
break;
|
||||
|
||||
case 'searchmember':
|
||||
$memberList = SearchMemberRequest::listByName($_POST['member_name']);
|
||||
new PrintMemberListController($memberList);
|
||||
break;
|
||||
|
||||
case 'create_group_form':
|
||||
new CreateGroupController();
|
||||
break;
|
||||
|
||||
case 'update-group':
|
||||
\UpdateGroupAction::execute(['gruppen_name' => $_REQUEST['kompass_groups_group_name']],
|
||||
(int)$_REQUEST['group_id']);
|
||||
|
||||
new PrintGroupsController();
|
||||
break;
|
||||
|
||||
case 'create-group':
|
||||
$data = ['gruppen_name' => $_REQUEST['kompass_groups_group_name']];
|
||||
\CreateGroupAction::execute($data);
|
||||
new PrintGroupsController();
|
||||
break;
|
||||
|
||||
case 'new-member':
|
||||
new CreateMemberController();
|
||||
break;
|
||||
|
||||
case 'create-member':
|
||||
$userData = \CreateGroupMemberDataAction::execute($_REQUEST);
|
||||
if (count($userData['errors']) === 0) {
|
||||
$memberId = \CreateGroupMemberAction::execute( $userData['data'] );
|
||||
new PrintMemberController($memberId);
|
||||
} else {
|
||||
kompass_print_message_box(implode('<br />', $userData['errors']), 'error');
|
||||
new CreateMemberController($userData['rawData']);
|
||||
exit;
|
||||
}
|
||||
new PrintGroupsController();
|
||||
break;
|
||||
|
||||
case 'show-members':
|
||||
$memberList = \ListMemberRequest::listForGroup((int)$_REQUEST['group-id']);
|
||||
new PrintMemberListController($memberList);
|
||||
break;
|
||||
|
||||
case 'show-member':
|
||||
new PrintMemberController((int)$_REQUEST['member-id']);
|
||||
break;
|
||||
|
||||
case 'compose-mail':
|
||||
current_user_can('send_mails');
|
||||
break;
|
||||
|
||||
case 'delete-group':
|
||||
if (current_user_can('delete_groups')) {
|
||||
}
|
||||
break;
|
||||
case 'edit-group':
|
||||
if (current_user_can('edit_groups')) {
|
||||
kompass_edit_group_form($_REQUEST['group-id']);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
new ListEventsController();
|
||||
}
|
||||
} else {
|
||||
|
||||
new ListEventsController();
|
||||
}
|
||||
}
|
||||
|
||||
private function listMembers()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function printMembers(array $memberList)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class MemberDetailsController {
|
||||
public function __construct() {
|
||||
if (!isset($_GET['participant'])) {
|
||||
wp_die('Invalid url given');
|
||||
}
|
||||
|
||||
$participant_id = $_GET['participant'];
|
||||
$participant = EventParticipant::loadById($participant_id);
|
||||
|
||||
$admin_link = admin_url('admin.php?page=kompass-events&action=');
|
||||
include dirname(__FILE__) . '/../Templates/participant-details.php';
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class MemberMailFormController {
|
||||
public function __construct() {
|
||||
global $_REQUEST;
|
||||
$participant = EventParticipant::loadById($_REQUEST['participant-id']);
|
||||
if ($participant->email_1 === $participant->email_2) {
|
||||
$participant->email_2 = '';
|
||||
}
|
||||
|
||||
$to = $participant->vorname . ' <' . $participant->email_1 .'>' .
|
||||
('' !== $participant->email_2 ? ', ' . $participant->vorname . ' <' . $participant->email_2 .'>' : '');
|
||||
kompass_print_mail_compose($to, "[KoPfiLa '24] - ");
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class MemberSummaryController {
|
||||
public function __construct() {
|
||||
global $_REQUEST;
|
||||
$participant = EventParticipant::loadById($_REQUEST['participant-id']);
|
||||
include dirname(__FILE__) . '/../Templates/participant-summary.php';
|
||||
}
|
||||
}
|
11
modules/event-participants/Controllers/class-newevent.php
Normal file
11
modules/event-participants/Controllers/class-newevent.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event as Event;
|
||||
|
||||
class NewEvent {
|
||||
public function __construct() {
|
||||
kompass_print_event_edit_form();
|
||||
|
||||
}
|
||||
}
|
16
modules/event-participants/Controllers/class-openevent.php
Normal file
16
modules/event-participants/Controllers/class-openevent.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class OpenEvent {
|
||||
public function __construct() {
|
||||
global $_REQUEST, $dbHandler;
|
||||
|
||||
$dbHandler->updateRows(MainController::KOMPASS_EVENTS_EVENTS, ['signup_allowed' => true], ['id' => $_REQUEST['event-id']]);
|
||||
kompass_print_message_box(__('Event opened for signup', BDP_LV_PLUGIN_SLUG));
|
||||
|
||||
new ListEventsController();
|
||||
}
|
||||
}
|
10
modules/event-participants/Controllers/class-printevents.php
Normal file
10
modules/event-participants/Controllers/class-printevents.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
class ListEventsController {
|
||||
public function __construct() {
|
||||
kompass_print_events_overview();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListDrinkingPdfController {
|
||||
|
||||
private function get_table_header(string $event_name) : string {
|
||||
return '<h1>Getränkeliste (alkoholfrei) 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>Stamm</td>' .
|
||||
'<td>Geburtsdatum</td>' .
|
||||
'<td>Getränke</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 ( $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="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;">' . $tribe . '</td>' .
|
||||
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' .
|
||||
\DateTime::createFromFormat( 'Y-m-d', $participant->geburtsdatum )->format( 'd.m.Y' ) . '<br />' .
|
||||
'(' . $participant->get_age() . ' Jahre)</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 . ' Anmeldeliste.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListDrinkingAlcoholicPdfController {
|
||||
|
||||
private function get_table_header(string $event_name) : string {
|
||||
return '<h1>Getränkeliste (alkoholisch) 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>Stamm</td>' .
|
||||
'<td>Geburtsdatum</td>' .
|
||||
'<td>Anzahl Bier</td>' .
|
||||
'<td>Anzahl Wein</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->get_age() < 16) {
|
||||
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="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;">' . $tribe . '</td>' .
|
||||
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' .
|
||||
\DateTime::createFromFormat( 'Y-m-d', $participant->geburtsdatum )->format( 'd.m.Y' ) . '<br />' .
|
||||
'(' . $participant->get_age() . ' Jahre)</td>' .
|
||||
'<td style="padding-right: 150px; border-style: solid; border-width: 1px;"></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 . ' Anmeldeliste.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\BathRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListKitchenAllergiesPdfController {
|
||||
|
||||
private function get_table_header(string $event_name) : string {
|
||||
return '<h1>Zusatz zur Küchenliste 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>Stamm</td>' .
|
||||
'<td>Allergien</td>' .
|
||||
'<td>Essgewohnheit</td>' .
|
||||
'<td>Anreise</td>' .
|
||||
'<td>Abreise</td>';
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$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->allergien == '') {
|
||||
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="padding-right: 10px; border-style: solid; border-width: 1px;">' . $participant->vorname . '<br /><br /></td>' .
|
||||
'<td style="padding-right: 10px; border-style: solid; border-width: 1px;">' . $participant->nachname . '</td>' .
|
||||
'<td style="padding-right: 10px; border-style: solid; border-width: 1px;">' . $tribe . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .$participant->allergien . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .$participant->essgewohnheit . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .\DateTime::createFromFormat('Y-m-d', $participant->anreise)->format('d.m.Y') . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .\DateTime::createFromFormat('Y-m-d', $participant->abreise)->format('d.m.Y'). '</td></tr>';
|
||||
if ( $i == 13 ) {
|
||||
$output .= '</table>';
|
||||
$i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</table></body></html>';
|
||||
kompass_create_pdf($output,$event->event_name . ' Zusatz Küchenliste.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListKitchenPdfController {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$event = Event::loadById($_REQUEST['event-id']);
|
||||
$participantList = EventParticipant::list_for_event($event->id);
|
||||
|
||||
$output = '<html><body><h1>' . $event->event_name . ' - Küchenübersicht</h1><br />';
|
||||
|
||||
$startDate = \DateTime::createFromFormat('Y-m-d', $event->startdatum);
|
||||
$endDate = \DateTime::createFromFormat('Y-m-d', $event->enddatum);
|
||||
|
||||
$output.='<br /><br /><table style="border-spacing: 0; width: 100%;">' .
|
||||
'<tr>' .
|
||||
'<td rowspan="2" style="text-align: center; font-weight: bold;">Datum</td>' .
|
||||
'<td style="border-style:solid solid none solid; border-width: 1px; text-align: center; font-weight: bold;" colspan="2">Frühstück</td>' .
|
||||
'<td style="border-style:solid solid none none; border-width: 1px; text-align: center; font-weight: bold;" colspan="2">Mittag</td>' .
|
||||
'<td style="border-style:solid solid none none; border-width: 1px; text-align: center; font-weight: bold;" colspan="2">Abend</td></tr><tr>' .
|
||||
'<td style="border-style:none solid none solid; border-width: 1px; text-align: center; font-weight: bold;">vegetarisch</td>' .
|
||||
'<td style="border-style:none solid none none; border-width: 1px; text-align: center; font-weight: bold;">vegan</td>' .
|
||||
'<td style="border-style:none solid none none; border-width: 1px; text-align: center; font-weight: bold;">vegetarisch</td>' .
|
||||
'<td style="border-style:none solid none none; border-width: 1px; text-align: center; font-weight: bold;">vegan</td>' .
|
||||
'<td style="border-style:none solid none none; border-width: 1px; text-align: center; font-weight: bold;">vegetarisch</td>' .
|
||||
'<td style="border-style:none solid none none; border-width: 1px; border-style:none solid none none; border-width: 1px; text-align: center; font-weight: bold;">vegan</td>' .
|
||||
'</tr>';
|
||||
|
||||
for ($curDate = $startDate; $curDate->getTimestamp() <= $endDate->getTimestamp(); $curDate->modify('+1 day')) {
|
||||
|
||||
$vegetarischEssen = EatingRequest::send($participantList,'vegetarisch', $curDate);
|
||||
$veganEssen = EatingRequest::send($participantList,'vegan', $curDate);
|
||||
|
||||
$output .= '<tr style="border-width: 1px; border-style: solid; height: 60px;">';
|
||||
$output .= '<td style="border-width: 1px; border-style: solid;">' . $curDate->format('d.m.Y') . '</td>';
|
||||
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $vegetarischEssen['1'] . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $veganEssen['1'] . '</td>';
|
||||
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $vegetarischEssen['2'] . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $veganEssen['2'] . '</td>';
|
||||
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $vegetarischEssen['3'] . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: solid;">' . $veganEssen['3'] . '</td>';
|
||||
|
||||
$output .= '</tr>';
|
||||
}
|
||||
|
||||
|
||||
$output .= '</table></body></html>';
|
||||
|
||||
kompass_create_pdf($output,$event->event_name . ' Küchenübersicht.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\BathRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListMedicalPdfController {
|
||||
|
||||
private function get_table_header(string $event_name) : string {
|
||||
return '<h1>Erste-Hilfe-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>Stamm</td>' .
|
||||
'<td>Alter</td>' .
|
||||
'<td>Badeerlaubnis</td>' .
|
||||
'<td>Allergien</td>' .
|
||||
'<td>Medikamente</td>' .
|
||||
'<td>Bemerkungen</td>';
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$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 ( $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="padding-right: 10px; border-style: solid; border-width: 1px;">' . $participant->vorname . '<br /><br /></td>' .
|
||||
'<td style="padding-right: 10px; border-style: solid; border-width: 1px;">' . $participant->nachname . '</td>' .
|
||||
'<td style="padding-right: 10px; border-style: solid; border-width: 1px;">' . $tribe . '</td>' .
|
||||
'<td style="padding-right: 10px; border-style: solid; border-width: 1px;">' . $participant->get_age() . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' . BathRequest::send($participant) . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .$participant->allergien . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .$participant->medikamente . '</td>' .
|
||||
'<td style="border-style: solid; border-width: 1px;">' .$participant->anmerkungen . '</td></tr>';
|
||||
if ( $i == 10 ) {
|
||||
$output .= '</table>';
|
||||
$i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</table></body></html>';
|
||||
kompass_create_pdf($output,$event->event_name . ' Saniteam.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListPhotoPdfController {
|
||||
|
||||
private function get_table_header(string $event_name) : string {
|
||||
return '<h1>' . $event_name . ' - Foto-Erlaubnis</h1><br />' .
|
||||
'<br /><br /><table style="border-spacing: 0; width: 100%;page-break-after: always">' .
|
||||
'<tr>' .
|
||||
'<td style="border-style:solid none solid solid; border-width: 1px; text-align: center; font-weight: bold;">Name</td>' .
|
||||
'<td style="border-style:solid none solid solid; border-width: 1px; text-align: center; font-weight: bold;" >Foto-Erlaubnis Social-Media</td>' .
|
||||
'<td style="border-style:solid none solid solid; border-width: 1px; text-align: center; font-weight: bold;" >Foto-Erlaubnis Print-Media</td>' .
|
||||
'<td style="border-style:solid none solid solid; border-width: 1px; text-align: center; font-weight: bold;" >Foto-Erlaubnis Webseite(n)</td>' .
|
||||
'<td style="border-style:solid none solid solid; border-width: 1px; text-align: center; font-weight: bold;" >Foto-Erlaubnis Partner-Mailings</td>' .
|
||||
'<td style="border-style:solid solid solid solid; border-width: 1px; text-align: center; font-weight: bold;" >Foto-Erlaubnis Interne Archive</td>' .
|
||||
'</tr>';
|
||||
}
|
||||
|
||||
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$event = Event::loadById($_REQUEST['event-id']);
|
||||
$participantList = EventParticipant::list_for_event($event->id);
|
||||
|
||||
$output = '<html><body>';
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach ($participantList as $participant) {
|
||||
if ( $i == 0 ) {
|
||||
$output .= $this->get_table_header( $event->event_name );
|
||||
}
|
||||
$i++;
|
||||
$output .= '<tr style="">';
|
||||
$output .= '<td style="height: 60px; border-width: 1px; border-style: none solid solid solid;">' . $participant->vorname . ($participant->pfadiname != '' ? ' (' . $participant->pfadiname . ')' : '') . ' ' . $participant->nachname . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: none solid solid none;">' . ($participant->foto_socialmedia == true ? 'X' : '---') . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: none solid solid none;">' . ($participant->foto_print == true ? 'X' : '---') . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: none solid solid none;">' . ($participant->foto_webseite == true ? 'X' : '---') . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: none solid solid none;">' . ($participant->foto_partner == true ? 'X' : '---') . '</td>';
|
||||
$output .= '<td style="text-align: center; border-width: 1px; border-style: none solid solid none;">' . ($participant->foto_intern == true ? 'X' : '---') . '</td>';
|
||||
|
||||
$output .= '</tr>';
|
||||
if ( $i == 8 ) {
|
||||
$output .= '</table>';
|
||||
$i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</body></html>';
|
||||
|
||||
kompass_create_pdf($output,$event->event_name . ' Foto-Erlaubnis.pdf', 'landscape');
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
|
||||
use Bdp\Modules\EventParticipants\Reqeust\EatingRequest;
|
||||
|
||||
|
||||
class PrintParticipantListSignupPdfController {
|
||||
|
||||
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>Datum</td>' .
|
||||
'<td>Tage</td>' .
|
||||
'<td>Unterschrift</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 ( $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="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' ) . '<br />' .
|
||||
'(' . $participant->get_age() . ' Jahre)</td>' .
|
||||
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' .
|
||||
\DateTime::createFromFormat( 'Y-m-d', $participant->anreise )->format( 'd.m.Y' ) . ' - ' .
|
||||
\DateTime::createFromFormat( 'Y-m-d', $participant->abreise )->format( 'd.m.Y' ) . '</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 . ' Anmeldeliste.pdf', 'landscape');
|
||||
}
|
||||
}
|
78
modules/event-participants/Controllers/class-signup.php
Normal file
78
modules/event-participants/Controllers/class-signup.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Libs\FileAccess;
|
||||
use function Bdp\Modules\EventParticipants\Views\registrationForm;
|
||||
|
||||
class ParticipationSignupController
|
||||
{
|
||||
public static function saveRegistration(array $postedData) : string {
|
||||
global $dbHandler;
|
||||
|
||||
$participation_types = ['other', 'participant', 'volunteer'];
|
||||
if (isset($postedData['foto']) && is_array($postedData['foto'])) {
|
||||
foreach ($postedData['foto'] as $fotoData) {
|
||||
$postedData['foto_' . $fotoData] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($postedData['badeerlaubnis'] == '') {
|
||||
$postedData['badeerlaubnis'] = 'complete';
|
||||
}
|
||||
if (isset($postedData['zusatzbeitrag'])) {
|
||||
(int)$postedData['beitrag'] += (int)$postedData['zusatzbeitrag'];
|
||||
unset($postedData['zusatzbeitrag']);
|
||||
}
|
||||
|
||||
unset($postedData['foto']);
|
||||
unset($postedData['_dsgvo_accept']);
|
||||
$postedData['teilnahme'] = $participation_types[$postedData['gruppe_id']];
|
||||
unset($postedData['gruppe_id']);
|
||||
if (null == $dbHandler->insertRows(MainController::KOMPASS_EVENTS_PARTICIPANTS, $postedData)) {
|
||||
$errorPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/error.webseite.php');
|
||||
$errorPage = sprintf($errorPage,
|
||||
$postedData['vorname']
|
||||
);
|
||||
|
||||
wp_mail('thomas@pfadfinden-halle.de', 'Anmeldung für Pfingstlager fehlerhaft', print_r($postedData, true));
|
||||
|
||||
return $errorPage;
|
||||
}
|
||||
|
||||
|
||||
$successMail = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.email.php');
|
||||
$successMail = sprintf($successMail,
|
||||
$postedData['vorname'],
|
||||
\DateTime::createFromFormat('Y-m-d', $postedData['anreise'])->format('d.m.Y'),
|
||||
\DateTime::createFromFormat('Y-m-d', $postedData['abreise'])->format('d.m.Y'),
|
||||
ucfirst($postedData['essgewohnheit'])
|
||||
);
|
||||
|
||||
|
||||
$successPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.webseite.php');
|
||||
$successPage = sprintf($successPage,
|
||||
$postedData['vorname'],
|
||||
\DateTime::createFromFormat('Y-m-d', $postedData['anreise'])->format('d.m.Y'),
|
||||
\DateTime::createFromFormat('Y-m-d', $postedData['abreise'])->format('d.m.Y'),
|
||||
ucfirst($postedData['essgewohnheit'])
|
||||
);
|
||||
|
||||
$sent = wp_mail(
|
||||
$postedData['email_1'],
|
||||
'Anmeldung zum Pfingstlager 2024 in Taucha',
|
||||
$successMail,
|
||||
['Reply-To: thomas@pfadfinden-halle.de', 'Content-Type: text/html; charset=UTF-8']);
|
||||
|
||||
|
||||
if ('' !== $postedData['email_2']) {
|
||||
$sent = wp_mail(
|
||||
$postedData['email_2'],
|
||||
'Anmeldung zum Pfingstlager 2024 in Taucha',
|
||||
$successMail,
|
||||
['Reply-To: thomas@pfadfinden-halle.de', 'Content-Type: text/html; charset=UTF-8']);
|
||||
}
|
||||
|
||||
return $successPage;
|
||||
}
|
||||
}
|
25
modules/event-participants/Controllers/class-signuppage.php
Normal file
25
modules/event-participants/Controllers/class-signuppage.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Libs\FileAccess;
|
||||
use function Bdp\Modules\EventParticipants\Views\registrationForm;
|
||||
|
||||
class EventSignupPageController
|
||||
{
|
||||
public static function print_signup_page($content) : string {
|
||||
// Der zu ersetzende String
|
||||
$pattern = '/{{event-(\d+)}}/';
|
||||
|
||||
if (preg_match($pattern, $content, $matches)) {
|
||||
if (isset($_POST['eventId'])) {
|
||||
$content = preg_replace($pattern, ParticipationSignupController::saveRegistration($_POST), $content);
|
||||
} else {
|
||||
$eventId = $matches[1];
|
||||
$url = str_replace(get_site_url(), '', get_permalink());
|
||||
$content = preg_replace( $pattern, registrationForm( $eventId, $url ), $content );
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
33
modules/event-participants/Controllers/class-updateevent.php
Normal file
33
modules/event-participants/Controllers/class-updateevent.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class UpdateEvent {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$use_data = ['event_name', 'startdatum', 'enddatum','max_participants', 'max_volunteers', 'amount_reduced', 'amount_default', 'amount_social', 'contributing_tribes'];
|
||||
$post_data = [];
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (in_array($key, $use_data)) {
|
||||
$post_data[$key] = $value;
|
||||
}
|
||||
};
|
||||
|
||||
$post_data['amount_reduced'] = str_replace(',', '.', $_POST['amount_reduced']);
|
||||
$post_data['amount_default'] = str_replace(',', '.', $_POST['amount_default']);
|
||||
$post_data['amount_social'] = str_replace(',', '.', $_POST['amount_social']);
|
||||
|
||||
$post_data['contributing_tribes'] = str_replace( PHP_EOL, ',', $post_data['contributing_tribes'] );
|
||||
|
||||
$dbHandler->updateRows(
|
||||
'kompass_veranstaltungen_index',
|
||||
$post_data,
|
||||
['id' => $_REQUEST['event-id']]
|
||||
);
|
||||
kompass_print_message_box(__('Event data updated successfull.', BDP_LV_PLUGIN_SLUG));
|
||||
new EditEvent();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class UpdateMemberAmountController {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$amount = str_replace(',', '.', $_POST['beitrag_bezahlt']);
|
||||
$dbHandler->updateRows(
|
||||
'kompass_veranstaltungen_teilis',
|
||||
['beitrag_bezahlt' => $amount],
|
||||
['id' => $_POST['participant-id']]
|
||||
);
|
||||
kompass_print_message_box(__('Participation data updated successfull.', BDP_LV_PLUGIN_SLUG));
|
||||
$participant = EventParticipant::loadById($_REQUEST['participant-id']);
|
||||
new ListGroupsAndMembersController($participant->eventId);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Controllers;
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
|
||||
class UpdateMemberDetailsController {
|
||||
public function __construct() {
|
||||
global $_POST, $_REQUEST, $dbHandler;
|
||||
|
||||
$dbHandler->updateRows('kompass_veranstaltungen_teilis', $_POST, ['id' => $_GET['participant']]);
|
||||
|
||||
kompass_print_message_box(__('Participation data updated successfull.', BDP_LV_PLUGIN_SLUG));
|
||||
}
|
||||
}
|
45
modules/event-participants/Models/class-event.php
Normal file
45
modules/event-participants/Models/class-event.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Models;
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
|
||||
class Event extends CommonModel {
|
||||
public static function loadById(int $event_id) : Event {
|
||||
|
||||
|
||||
global $dbHandler;
|
||||
|
||||
$data = $dbHandler->readFromDb('kompass_veranstaltungen_index', ['id' => $event_id]);
|
||||
$class = new Event();
|
||||
$class->groups = ['participant' => [], 'volunteer' => [], 'other' => []];
|
||||
|
||||
|
||||
foreach (get_object_vars($data[0]) as $key => $value) {
|
||||
$class->$key = $value;
|
||||
}
|
||||
|
||||
foreach (EventParticipant::list_for_event($event_id) as $participant) {
|
||||
$class->groups[$participant->teilnahme][] = $participant;
|
||||
}
|
||||
|
||||
|
||||
foreach ($class->groups as $group) {
|
||||
foreach ($group as $participant) {
|
||||
if (!isset($class->tribes[$participant->stamm])) {
|
||||
$class->tribes[$participant->stamm] = [];
|
||||
}
|
||||
$class->tribes[$participant->stamm][] = $participant;
|
||||
}
|
||||
}
|
||||
|
||||
#echo '<pre>';print_r($class);die();
|
||||
return $class;
|
||||
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
$this->_tablename = 'kompass_veranstaltungen_index';
|
||||
$this->groups = [];
|
||||
$this->tribes = [];
|
||||
}
|
||||
}
|
57
modules/event-participants/Models/class-eventgroup.php
Normal file
57
modules/event-participants/Models/class-eventgroup.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Models;
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
|
||||
class EventGroup extends CommonModel {
|
||||
public static function loadById(int $group_id) {
|
||||
global $dbHandler;
|
||||
|
||||
$data = $dbHandler->readFromDb('kompass_veranstaltungen_gruppen', ['id' => $group_id]);
|
||||
$class = new EventGroup();
|
||||
|
||||
foreach (get_object_vars($data[0]) as $key => $value) {
|
||||
$class->$key = $value;
|
||||
}
|
||||
|
||||
foreach (EventParticipant::list_for_group($group_id) as $participant_id) {
|
||||
$class->participants[] = EventParticipant::loadById($participant_id);
|
||||
}
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
public static function list_simple_for_event(int $event_id) : array {
|
||||
global $dbHandler;
|
||||
|
||||
$data = $dbHandler->readFromDb('kompass_veranstaltungen_gruppen', ['eventId' => $event_id]);
|
||||
$return = [];
|
||||
foreach ($data as $group) {
|
||||
$group_class = new EventGroup();
|
||||
foreach (get_object_vars($group) as $key => $value) {
|
||||
$group_class->$key = $value;
|
||||
}
|
||||
|
||||
$return[] = $group_class;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function list_for_event(int $event_id) : array {
|
||||
global $dbHandler;
|
||||
|
||||
$data = $dbHandler->readFromDb('kompass_veranstaltungen_teilis', ['eventId' => $event_id]);
|
||||
$return = [];
|
||||
foreach ($data as $group) {
|
||||
$return[] = $group->id;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
$this->_tablename = 'kompass_veranstaltungen_gruppen';
|
||||
$this->participants = [];
|
||||
}
|
||||
}
|
32
modules/event-participants/Models/class-eventparticipant.php
Normal file
32
modules/event-participants/Models/class-eventparticipant.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Models;
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
use Bdp\Modules\EventParticipants\Controllers\MainController;
|
||||
|
||||
class EventParticipant extends CommonModel {
|
||||
public static function loadById(int $event_id) {
|
||||
return parent::load_by_id('kompass_veranstaltungen_teilis', $event_id);
|
||||
}
|
||||
|
||||
public static function list_for_event(int $event_id) : array {
|
||||
global $dbHandler;
|
||||
|
||||
$data = $dbHandler->readFromDb('kompass_veranstaltungen_teilis', ['eventId' => $event_id]);
|
||||
$return = [];
|
||||
foreach ($data as $participant) {
|
||||
$part = EventParticipant::loadById($participant->id);
|
||||
$return[] = $part;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function get_group() : CommonModel {
|
||||
return EventGroup::load_by_id(MainController::KOMPASS_EVENTS_GROUPS, $this->gruppe_id);
|
||||
}
|
||||
|
||||
public function __construct() {
|
||||
$this->_tablename = 'kompass_veranstaltungen_teilis';
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Reqeust;
|
||||
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class AnwesenheitRequest {
|
||||
public static function send(CommonModel $participant) {
|
||||
$anreise = \DateTime::createFromFormat('Y-m-d', $participant->anreise);
|
||||
$abreise = \DateTime::createFromFormat('Y-m-d', $participant->abreise);
|
||||
|
||||
$cmpd = date_diff($anreise, $abreise);
|
||||
$days = $cmpd->d;
|
||||
|
||||
if ($days== 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return $days;
|
||||
}
|
||||
}
|
13
modules/event-participants/Requests/class-bathrequest.php
Normal file
13
modules/event-participants/Requests/class-bathrequest.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Reqeust;
|
||||
|
||||
|
||||
use Bdp\Libs\CommonModel;
|
||||
|
||||
class BathRequest {
|
||||
public static function send(CommonModel $participant) {
|
||||
return ($participant->badeerlaubnis == 'complete' || kompass_is_fullaged( $participant->geburtsdatum ) )
|
||||
? 'Schwimmer*in' :
|
||||
( $participant->badeerlaubnis == 'partial' ? '<b>Nicht</b>schwimmmer*in' : 'Keine Badeerlaubnis' );
|
||||
}
|
||||
}
|
53
modules/event-participants/Requests/class-eatingrequest.php
Normal file
53
modules/event-participants/Requests/class-eatingrequest.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Reqeust;
|
||||
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventParticipant;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class EatingRequest {
|
||||
public static function send(array $participantList, string $eatingHabit, \DateTime $date) {
|
||||
$participantCount = [ '1' => 0, '2' => 0, '3' => 0 ];
|
||||
|
||||
foreach ($participantList as $participant) {
|
||||
if ( $participant->essgewohnheit !== $eatingHabit ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$anreise = \DateTime::createFromFormat( 'Y-m-d', $participant->anreise );
|
||||
$abreise = \DateTime::createFromFormat( 'Y-m-d', $participant->abreise );
|
||||
|
||||
if ( $anreise->getTimestamp() < $date->getTimestamp() && $abreise->getTimestamp() > $date->getTimestamp() ) {
|
||||
$participantCount['1']++;
|
||||
$participantCount['2']++;
|
||||
$participantCount['3']++;
|
||||
} elseif ( $anreise->getTimestamp() == $date->getTimestamp() ) { // Anreisetag
|
||||
if ( $participant->anreise_essen == 3 ) {
|
||||
$participantCount['1']++;
|
||||
$participantCount['2']++;
|
||||
$participantCount['3']++;
|
||||
} elseif ( $participant->anreise_essen == 2 ) {
|
||||
$participantCount['2']++;
|
||||
$participantCount['3']++;
|
||||
} elseif ( $participant->anreise_essen == 1 ) {
|
||||
$participantCount['3']++;
|
||||
}
|
||||
} elseif ( $abreise->getTimestamp() == $date->getTimestamp() ) { // Abreisetag
|
||||
if ( $participant->abreise_essen == 3 ) {
|
||||
$participantCount['1']++;
|
||||
$participantCount['2']++;
|
||||
$participantCount['3']++;
|
||||
} elseif ( $participant->abreise_essen == 2 ) {
|
||||
$participantCount['1']++;
|
||||
$participantCount['2']++;
|
||||
} elseif ( $participant->abreise_essen == 1 ) {
|
||||
$participantCount['1']++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $participantCount;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>Allergien / Unverträglichkeiten:</td>
|
||||
<td><input type="text" name="allergien" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Medikamente:</td>
|
||||
<td>
|
||||
<input type="text" name="medikamente" />*<br />
|
||||
Medikamente in ausreichender Menge müssen selbst mitgebracht werden.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Essgewohnheiten:</td>
|
||||
<td>
|
||||
<select name="essgewohnheit">
|
||||
<option value="vegetarisch">Vegetarisch</option>
|
||||
<option value="vegan">Vegan</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>Was möchtest du uns noch mitteilen?:</td>
|
||||
<td><textarea rows=15 name="anmerkungen"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="checkbox" name="_dsgvo_accept" id="dsgvo_accept" />
|
||||
<label for="dsgvo_accept" id="dsgvo_text">Ich gebe mein Einverständnis, dass meine hier eingegebenen Daten zum Zweck der Veranstaltungsanmeldung und Abrechnung elektronisch übermittelt und gespeichert werden.</label>
|
||||
<br /><br />
|
||||
<input type="submit" value="Anmeldung durchführen" style="width: 200px;"/>
|
@ -0,0 +1,22 @@
|
||||
<div onclick="showStep(2)" class="altersstufe_td">
|
||||
|
||||
<div>
|
||||
<h3>Mein Kind anmelden</h3>
|
||||
Mein Kind ist noch nicht volljährig, ich möchte mein Kind für die Veranstaltung anmelden.
|
||||
</div>
|
||||
<p class="emblems_selection">
|
||||
<img src="{{BDP_LV_PLUGIN_URL}}/assets/woe.png" style="width: 75px; height: 75px;" />
|
||||
<img src="{{BDP_LV_PLUGIN_URL}}/assets/klilie.png" style="width: 75px; height: 75px;" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div onclick="showStep(3)" class="altersstufe_td">
|
||||
<div>
|
||||
<h3>Mich selbst anmelden</h3>
|
||||
Ich bin volljährig und möchte mich für die Veranstaltung anmelden.
|
||||
</div>
|
||||
<p class="emblems_selection">
|
||||
|
||||
<img src="{{BDP_LV_PLUGIN_URL}}/assets/rr.png" style="width: 75px; height: 75px;" />
|
||||
</p>
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
<table>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>Anreise:</td>
|
||||
<td>
|
||||
<input type="date" name="anreise" id="anreise" value="{{startdate}}" /><br />
|
||||
<select name="anreise_essen">
|
||||
<option value="1" selected>Vor dem Abendessen</option>
|
||||
<option value="2">Vor dem Mittagessen</option>
|
||||
<option value="3">Vor dem Frühstück</option>
|
||||
<option value="4">Zur Abendrunde / Kein Essen am Anreisetag</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>Abreise:</td>
|
||||
<td>
|
||||
<input type="date" name="abreise" id="abreise" value="{{enddate}}" /><br />
|
||||
<select name="abreise_essen">
|
||||
<option value="1">Nach dem Frühstück</option>
|
||||
<option selected value="2">Nach dem Mittagessen</option>
|
||||
<option value="3">Nach dem Abendessen</option>
|
||||
<option value="4">ganz am Morgen / Kein Essen am Abreisetag</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="button" value="Weiter" onclick="checkAnreise()" />
|
@ -0,0 +1,29 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>Name, Vorname:</td>
|
||||
<td><input type="text" name="ansprechpartner" id="ansprechpartner" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Telefon:</td>
|
||||
<td><input type="text" name="telefon_2" id="telefon_2" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>E-Mail:</td>
|
||||
<td><input type="text" name="email_2" id="email_2"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Bade-Erlaubnis:</td>
|
||||
<td>
|
||||
<select name="badeerlaubnis">
|
||||
<option value="none">Keine Badeerlaubnis</option>
|
||||
<option value="partial">Mein kind darf baden, kann aber NICHT SCHWIMMEN</option>
|
||||
<option value="complete">Mein Kind darf baden und kann schwimmen</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="button" value="Weiter" onclick="checkAnsprechpartner()" />
|
@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>Beitrag:</td>
|
||||
<td style="text-align: left;">
|
||||
<input style="width: 20px !important;" type="radio" name="beitrag" value="{{amount_reduced}}" id="beitrag_sozial">
|
||||
<label for="beitrag_sozial">Geförderter Beitrag {{amount_reduced}} Euro <span style="font-size: 10pt; font-weight: bold;">(nach Verfügbarkeit)</span></label><br />
|
||||
<input style="width: 20px !important;" type="radio" value="{{amount_default}}" name="beitrag" id="beitrag_standard" checked>
|
||||
<label for="beitrag_standard">Normalbeitrag {{amount_default}} Euro</label><br />
|
||||
|
||||
<input style="width: 20px !important;" name="zusatzbeitrag" type="checkbox" value="{{amount_social}}" id="zusatzbeitrag">
|
||||
<label for="zusatzbeitrag">Ich unterstütze die Veranstaltung mit einem <b>freiwilligen Zusatzbeitrag</b> von
|
||||
{{amount_social}} Euro</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="button" value="Weiter" onclick="showStep(7)" />
|
@ -0,0 +1,20 @@
|
||||
<h1>Hallo %s,</h1>
|
||||
<p>
|
||||
Deine Anmeldung für das Pfingstlager 2024 in Taucha wurde erfolgreich durchgeführt. Wir haben folgende Daten erfasst:
|
||||
<table>
|
||||
<tr><td>Anreise:</td><td>%s</td></tr>
|
||||
<tr><td>Abreise:</td><td>%s</td></tr>
|
||||
<tr><td>Essenswunsch:</td><td>%s</td></tr>
|
||||
</table>
|
||||
|
||||
Sollte dies nicht korrekt sein, oder wenn du dringende Fragen hast, wende dich bitte an
|
||||
<a href="mailto:thomas@pfadfinden-halle.de?subject=Rückfrage Anmeldung Pfingstlager 2024">thomas@pfadfinden-halle.de</a>
|
||||
</p>
|
||||
<p>
|
||||
Weitere Informationen senden wir dir in Kürze zu, Fragen zur An- und Abreise beantwortet dir deine Stammes- oder Gruppenführung.
|
||||
</p>
|
||||
<p>
|
||||
Liebe Grüße und Gut Pfad,<br />
|
||||
Thomas<br />
|
||||
Lagerleitung
|
||||
</p>
|
@ -0,0 +1,15 @@
|
||||
<h1>Hallo %s,</h1>
|
||||
<p>
|
||||
Deine Anmeldung für das Pfingstlager 2024 in Taucha wurde erfolgreich durchgeführt. Wir haben folgende Daten erfasst:
|
||||
<table>
|
||||
<tr><td>Anreise:</td><td>%s</td></tr>
|
||||
<tr><td>Abreise:</td><td>%s</td></tr>
|
||||
<tr><td>Essenswunsch:</td><td>%s</td></tr>
|
||||
</table>
|
||||
|
||||
Sollte dies nicht korrekt sein, oder wenn du dringende Fragen hast, wende dich bitte an
|
||||
<a href="mailto:thomas@pfadfinden-halle.de?subject=Rückfrage Anmeldung Pfingstlager 2024">thomas@pfadfinden-halle.de</a>
|
||||
</p>
|
||||
<p>
|
||||
Deine Anmeldung wird dir in den nächsten Minuten auch per E-Mail bestätigt.
|
||||
</p>
|
@ -0,0 +1,8 @@
|
||||
<h1>Hallo %s,</h1>
|
||||
<p>
|
||||
Leider konnte deine Anmeldung nicht automatisch verarbeitet werden. Dies ist meistens dann der Fall, wenn das Formular Daten enthält, die nicht automatisch verarbeitet werden können.<br />
|
||||
Die Lagerleitung wurde bereits informiert und versucht, die Anmeldung manuell durchzuführen. Im Anschluss, oder bei Rückfragen, wirst du per E-Mail kontaktiert.<br /><br />
|
||||
Sollte dies nicht innerhalb von 3 Tagen passieren, wende dich bitte per Mail an <a href="mailto:thomas@pfadfinden-halle.de?subject=Anmeldeproblem Pfingstlager 2024">thomas@pfadfinden-halle.de</a>
|
||||
<br /><br /><br />
|
||||
Bitte entschuldige die entstandenen Unannehmlichkeiten.
|
||||
</p>
|
@ -0,0 +1,25 @@
|
||||
<p style="font-weight: bold; font-size: 13pt;">
|
||||
Bitte teile uns noch mit, wofür wir Fotoaufnahmen von dir / deinem Kind anfertigen dürfen.
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" name="foto[]" value="socialmedia" id="foto_socialmedia" />
|
||||
<label for="foto_socialmedia">Soziale Medien (Facebook / Instagram / ...)</label><br />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="checkbox" name="foto[]" value="print" id="foto_print" />
|
||||
<label for="foto_print">Printmedien (Lokale Tageszeitung, BdP - Magazin "Pfade", Postkarten)</label><br />
|
||||
</p>
|
||||
<input type="checkbox" name="foto[]" value="webseite" id="foto_webseite" />
|
||||
<label for="foto_webseite">Webseiten (www.pfadfinden.de / Webseite des eigenen Stammes)</label><br />
|
||||
|
||||
<p>
|
||||
<input type="checkbox" name="foto[]" value="partner" id="foto_partner" />
|
||||
<label for="foto_partner">Partner & Sponsoren (Oftmals in Form von E-Mail)</label><br />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="checkbox" name="foto[]" value="intern" id="foto_intern" />
|
||||
<label for="foto_intern">Interne Zwecke (Stammes-Chronik, geschütztes Landes-Fotoalbum)</label><br />
|
||||
</p>
|
||||
<input type="button" value="Weiter" onclick="showStep(8)" />
|
@ -0,0 +1,13 @@
|
||||
<table>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>Bei der Veranstaltung:</td>
|
||||
<td>
|
||||
<input style="width: 20px;" type="radio" name="gruppe_id" value="2" id="gruppe_2" />
|
||||
<label for="gruppe_2">Ich übernehme hauptsächlich Aufgaben und unterstütze das Team</label><br />
|
||||
<input style="width: 20px;" type="radio" name="gruppe_id" value="1" id="gruppe_1" checked />
|
||||
<label for="gruppe_1">Ich möchte hauptsächlich am Programm teilnehmen</label><br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="button" value="Weiter" onclick="showStep(5)" />
|
@ -0,0 +1,66 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>Vorname:</td>
|
||||
<td><input type="text" name="vorname" id="vorname" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Nachname:</td>
|
||||
<td><input type="text" name="nachname" id="nachname" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pfadi-Name:</td>
|
||||
<td><input type="text" name="pfadiname" id="pfadiname" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Stamm / ABG:</td>
|
||||
<td>
|
||||
<select name="stamm" required placeholder="Bitte wählen">
|
||||
<option value="ANC">Ancalagon</option>
|
||||
<option value="BAN">Bankiva</option>
|
||||
<option value="FEU">Feuerland</option>
|
||||
<option value="LEO">LEO</option>
|
||||
<option value="WM">Wilde Möhre</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Geburtsdatum:</td>
|
||||
<td><input type="date" name="geburtsdatum" id="geburtsdatum" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
Straße, Hausnummer
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="strasse" id="strasse" style="width: 285px;" />
|
||||
<input type="text" name="hausnummer" id="hausnummer" style="width: 50px;" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
PLZ, Wohnort
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="plz" id="plz" style="width: 80px;" />
|
||||
<input type="text" name="ort" id="ort" style="width: 255px;" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Telefon:</td>
|
||||
<td><input type="text" name="telefon_1" id="telefon_1" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>E-Mail:</td>
|
||||
<td><input type="text" name="email_1" id="email_1" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="button" value="Weiter" onclick="checkAddress();" />
|
@ -0,0 +1,49 @@
|
||||
<div style="display: inline-block;">
|
||||
<table style="width:100%;">
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Badeerlaubnis:
|
||||
</td>
|
||||
<td>
|
||||
<?= ($participant->badeerlaubnis == 'complete' || kompass_is_fullaged($participant->geburtsdatum))
|
||||
? 'Badeerlaubnis, kann schwimmen' :
|
||||
($participant->badeerlaubnis == 'partial' ? 'Badeerlaubnis, kann nicht schwimmmen' : 'Keine Badeerlaubnis') ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Essgewohnheiten:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->essgewohnheit == 'all' ?
|
||||
'Tierisch & Pflanzlich' : ($participant->essgewohnheit == 'vegetarisch' ? 'Vegetarisch' : 'Vegan'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Allergien:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->allergien; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Notwendige Medikamente:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->medikamente; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Mitteilung an uns / Kommentare:
|
||||
</td>
|
||||
<td>
|
||||
<?= nl2br($participant->anmerkungen); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,56 @@
|
||||
<div style="display: inline-block;">
|
||||
<table style="width:100%;">
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Badeerlaubnis:
|
||||
</td>
|
||||
<td>
|
||||
<select name="badeerlaubnis" style="width:100%;">
|
||||
<option <?= $participant->badeerlaubnis == 'none' ? 'selected' : '' ?> value="none">Keine Badeerlaubnis</option>
|
||||
<option <?= $participant->badeerlaubnis == 'partial' ? 'selected' : '' ?> value="partial">Badeerlaubnis, kann nicht schwimmmen</option>
|
||||
<option <?= $participant->badeerlaubnis == 'complete' || kompass_is_fullaged($participant->geburtsdatum) ? 'selected' : '' ?> value="complete">Badeerlaubnis, kann schwimmen</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Essgewohnheiten:
|
||||
</td>
|
||||
<td>
|
||||
<select name="essgewohnheit" style="width:100%;">
|
||||
<option <?= $participant->essgewohnheit == 'all' ? 'selected' : '' ?> value="all">Ich esse Fleisch</option>
|
||||
<option <?= $participant->essgewohnheit == 'vegetarisch' ? 'selected' : '' ?> value="vegetarisch">Vegetarisch</option>
|
||||
<option <?= $participant->essgewohnheit == 'vegan' ? 'selected' : '' ?> value="vegan">Vegan</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Allergien:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="allergien" value="<?= $participant->allergien; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Notwendige Medikamente:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="medikamente" value="<?= $participant->medikamente; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Mitteilung an uns / Kommentare:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name=" anmerkungen" rows="5" style="width:100%;"><?= $participant->anmerkungen; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,126 @@
|
||||
<div>
|
||||
<table style="width:100%;">
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Volljährig:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->is_fullaged() ? 'Ja' : 'Nein' ?><br />
|
||||
<?= \DateTime::createFromFormat('Y-m-d', $participant->geburtsdatum)->format('d.m.Y'); ?>
|
||||
(<?= $participant->get_age() ?> Jahre)
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( !kompass_is_fullaged($participant->geburtsdatum) ) {
|
||||
?>
|
||||
<tr>
|
||||
<td>Name des Ansprechpartners:</td>
|
||||
<td><?= $participant->ansprechpartner; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Anschrift:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->strasse . ' ' . $participant->hausnummer; ?><br />
|
||||
<?= $participant->plz . ' ' . $participant->ort; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Stamm:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->stamm ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Anreise:
|
||||
</td>
|
||||
<td>
|
||||
<?= \DateTime::createFromFormat('Y-m-d', $participant->anreise)->format('d.m.Y'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Abreise:
|
||||
</td>
|
||||
<td>
|
||||
<?= \DateTime::createFromFormat('Y-m-d', $participant->abreise)->format('d.m.Y'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
E-Mail:
|
||||
</td>
|
||||
<td>
|
||||
<?= kompass_get_email_link($participant->email_1) . (!kompass_is_fullaged($participant->geburtsdatum) ? ' / ' . kompass_get_email_link($participant->email_2) : '') ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Telefon:
|
||||
</td>
|
||||
<td>
|
||||
<?= kompass_get_telephone_link($participant->telefon_1) .
|
||||
(!kompass_is_fullaged($participant->geburtsdatum) ? (' / ' . kompass_get_telephone_link($participant->telefon_2) ) : '') ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Social Media:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_socialmedia ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Printartikel:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_print ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Webseiten:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_webseite ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Partnermailing:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_partner ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Intern / Archiv:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_intern ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,118 @@
|
||||
<div>
|
||||
<table style="width:100%;">
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Volljährig:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->is_fullaged() ? 'Ja' : 'Nein' ?><br />
|
||||
<input type="date" name="geburtsdatum" value="<?= $participant->geburtsdatum; ?>" />
|
||||
(<?= $participant->get_age() ?> Jahre)
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( !kompass_is_fullaged($participant->geburtsdatum) ) {
|
||||
?>
|
||||
<tr>
|
||||
<td>Name des Ansprechpartners:</td>
|
||||
<td><input type="text" name="ansprechpartner" style="width: 255px;" value="<?= $participant->ansprechpartner; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Anschrift:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="strasse" style="width: 200px;" value="<?= $participant->strasse; ?>">
|
||||
<input type="text" name="hausnummer" style="width: 50px;" value="<?= $participant->hausnummer; ?>"> <br />
|
||||
|
||||
<input type="text" name="plz" style="width: 50px;" value="<?= $participant->plz; ?>">
|
||||
<input type="text" name="ort" style="width: 200px;" value="<?= $participant->ort; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Stamm:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="stamm" style="width: 100px;" value="<?= $participant->stamm; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
E-Mail:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="email_1" style="width: 255px;" value="<?= $participant->email_1; ?>">
|
||||
<?= !kompass_is_fullaged($participant->geburtsdatum) ? '/ <input type="text" name="email_2" style="width: 255px;" value="' . $participant->email_2 .'">' : ''; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Telefon:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="telefon_1" style="width: 255px;" value="<?= $participant->telefon_1; ?>">
|
||||
<?= !kompass_is_fullaged($participant->geburtsdatum) ? '/ <input type="text" name="telefon_2" style="width: 255px;" value="' . $participant->telefon_2 .'">' : ''; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Social Media:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_socialmedia ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Printartikel:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_print ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Webseiten:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_webseite ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Partnermailing:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_partner ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="width: 200px;">
|
||||
Foto-Erlaubnis Intern / Archiv:
|
||||
</td>
|
||||
<td>
|
||||
<?= $participant->foto_intern ? 'Ja' : 'Nein' ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><br />
|
||||
<input class="button" type="submit" value="<?= __('Save', BDP_LV_PLUGIN_SLUG); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,55 @@
|
||||
<p style="width: 100%; text-align: right">
|
||||
<input type="text" id="searchInput"
|
||||
onkeyup="searchTable('gruppe_<?= $gruppen_id; ?>', this)"
|
||||
placeholder="<?=__('Filter participant', BDP_LV_PLUGIN_SLUG); ?>">
|
||||
</p>
|
||||
<table class="wp-list-table widefat fixed striped table-view-list participant_group" id="gruppe_<?= $gruppen_id; ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;" scope="col" class="manage-column column-name"><?= __('Name', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Presence days', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Tribe', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Amount', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Email', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Telephone', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($group as $participant) {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="#" onclick="kompass_load_participant_data('<?= $participant->id ?>');"><?= $participant->vorname; ?>
|
||||
<?= $participant->nachname . ($participant->pfadiname != '' ? ' (' . $participant->pfadiname . ')' : '')?></a><br />
|
||||
<?= kompass_get_age($participant->geburtsdatum); ?> Jahre
|
||||
</td>
|
||||
<td>
|
||||
<?= \DateTime::createFromFormat('Y-m-d', $participant->anreise)->format('d.m.Y') ;?> -
|
||||
<?= \DateTime::createFromFormat('Y-m-d', $participant->abreise)->format('d.m.Y') ;?>
|
||||
</td>
|
||||
<td><?= $participant->stamm ?></td>
|
||||
|
||||
<td style="<?= $participant->beitrag_bezahlt !== $participant->beitrag ? 'background-color: #f8c8c6; color: #ff0000;' : '' ?>"
|
||||
|
||||
|
||||
><?= $participant->beitrag_bezahlt ?> Euro / <?= $participant->beitrag ?> Euro</td>
|
||||
<td><?= $participant->email_1 ?><br /><?= $participant->email_2 ?></td>
|
||||
<td>
|
||||
<?php kompass_print_telephone_link($participant->telefon_1); ?>
|
||||
<br />
|
||||
<?php kompass_print_telephone_link($participant->telefon_2); ?></td>
|
||||
<td>
|
||||
<a href="<?= $admin_link ?>kompass_print_participant_mail_form&participant-id=<?= $participant->id; ?>">Email senden an</a><br />
|
||||
<a href="<?= $admin_link ?>show-participant&participant=<?= $participant->id ?>">Bearbeiten</a><br />
|
||||
<a href="#" style="color: #72b752" onclick="kompass_participant_update_amount('<?= $participant->beitrag; ?>','<?= $participant->vorname . ' ' . $participant->nachname ?>', <?= $participant->id ?>);">Zahlungseingang </a><br />
|
||||
|
||||
<a href="#" style="color: #ff0000;" onclick="kompass_participant_confirm_delete('<?= $participant->vorname . ' ' . $participant->nachname ?>', <?= $participant->id ?>);">Abmelden</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,176 @@
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline">
|
||||
<?= __('Event-Overview', BDP_LV_PLUGIN_SLUG); ?> - <?= $event->event_name ?></h1>
|
||||
<hr class="wp-header-end">
|
||||
<?= kompass_print_event_control_header($event_id, $active_tab); ?>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
$group_name = ['participant' => 'Teili', 'volunteer' => 'Teami', 'other' => 'Sonstige'];
|
||||
$admin_link = 'admin.php?page=kompass-events&action=';
|
||||
|
||||
switch ($active_tab) {
|
||||
case 'tab1':
|
||||
|
||||
foreach ($event->groups as $group_int_name => $group) {
|
||||
$gruppen_id = $group_int_name;
|
||||
if ( count( $group ) === 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$total_amount = 0;
|
||||
foreach ($group as $item ) {
|
||||
$total_amount += $item->beitrag - $item->beitrag_bezahlt;
|
||||
}
|
||||
$total_amount = number_format($total_amount,2,',');
|
||||
|
||||
echo '<h3>' . $group_name[$group_int_name] . ' (' . count( $group ) . ')</h3>';
|
||||
echo '<h4>' . __('Missing amount') . ': ' .$total_amount . ' Euro</h4>';
|
||||
echo '<a href="'. $admin_link . 'send-mail-to-group&event-id=' . $event->id . '&group=' . $group_int_name . '" class="button">Rundmail an alle ' . $group_name[$group_int_name] . '</a>';
|
||||
include dirname( __FILE__ ) . '/list-by-groups.php';
|
||||
}
|
||||
|
||||
break;
|
||||
case 'tab2':
|
||||
foreach ($event->tribes as $tribe => $tmp_group) {
|
||||
$gruppen_id = $tribe;
|
||||
if ( count( $tmp_group ) === 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$count_underaged = 0;
|
||||
$count_fullaged = 0;
|
||||
$total_amount = 0;
|
||||
foreach ($tmp_group as $item ) {
|
||||
$total_amount += $item->beitrag - $item->beitrag_bezahlt;
|
||||
if (kompass_is_fullaged($item->geburtsdatum)) {
|
||||
$count_fullaged++;
|
||||
} else {
|
||||
$count_underaged++;
|
||||
}
|
||||
}
|
||||
|
||||
$total_amount = number_format($total_amount,2,',');
|
||||
|
||||
$group = new stdClass();
|
||||
$group = $tmp_group;
|
||||
echo '<h3>' . $tribe . ' (' . $count_underaged . ' WÖs / Pfadi // ' . $count_fullaged . ' RRs)</h3>';
|
||||
echo '<h4>' . __('Missing amount') . ': ' .$total_amount . ' Euro</h4>';
|
||||
echo '<a href="'. $admin_link . 'send-mail-to-local-group&event-id=' . $event->id . '&group=' . $tribe . '" class="button">Rundmail an alle vom Stamm ' . $tribe . '</a>';
|
||||
include dirname( __FILE__ ) . '/list-by-groups.php';
|
||||
}
|
||||
break;
|
||||
}
|
||||
$admin_link = 'admin.php?page=kompass-events&action=';
|
||||
?>
|
||||
|
||||
</div><br /><br />
|
||||
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_signup_data', 'event-id=<?= $event->id; ?>');" class="button">Teili-Liste als PDF</a>
|
||||
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_photo_data', 'event-id=<?= $event->id; ?>');" class="button">Foto-Erlaubnis</a>
|
||||
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_drink_alcoholic_data', 'event-id=<?= $event->id; ?>');" class="button">Getränkeliste-Liste (alkoholisch) als PDF</a>
|
||||
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_drink_data', 'event-id=<?= $event->id; ?>');" class="button">Getränkeliste-Liste (alkoholfrei) als PDF</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_medical_data', 'event-id=<?= $event->id; ?>');" class="button">Sani-Liste</a>
|
||||
<a href="<?= $admin_link . 'send-mail-to-all&event-id=' . $event->id ?>" class="button">Rundmail an alle</a>
|
||||
</div>
|
||||
|
||||
<div class="overlay" id="kompasss_delete_participant" onclick="document.getElementById('kompasss_delete_participant').style.display='none';">
|
||||
<div class="overlay-content">
|
||||
<h2>Teili abmelden</h2>
|
||||
<form method="post" action="<?= $admin_link; ?>delete-participant">
|
||||
<p>Bist du sicher, dass du den Teili <span style="font-weight: bold;" id="confirm-name"></span> wirklich abmelden möchtest?</p>
|
||||
<b>Die Anmeldedaten werden gelöscht, und der Vorgang kann nicht rückgängig gemacht werden.</b>
|
||||
<input type="hidden" id="confirm-participant-id" name="participant-id"><br><br>
|
||||
<input type="submit" value="Ja, abmelden" class="button-primary" style="background-color: #d79494 !important;">
|
||||
<input type="button" value="Abbrechen" onclick="document.getElementById('kompasss_delete_participant').style.display='none';" class="button">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overlay" id="kompasss_update_amount" onclick="document.getElementById('kompasss_update_amount').style.display='none';">
|
||||
<div class="overlay-content">
|
||||
<h2>Zahlungseingang buchen</h2>
|
||||
<form method="post" action="<?= $admin_link; ?>update-participant-amount">
|
||||
<p>Bitte gib den Gesamtbetrag ein, den <span style="font-weight: bold;" id="name"></span> bisher für die Veranstaltung gezahlt hat:</p>
|
||||
<input type="text" name="beitrag_bezahlt" id="beitrag_bezahlt" /> Euro
|
||||
<input type="hidden" id="payment-participant-id" name="participant-id"><br><br>
|
||||
<input type="submit" value="Speichern" class="button-primary" style="background-color: #d79494 !important;">
|
||||
<input type="button" value="Abbrechen" onclick="document.getElementById('kompasss_update_amount').style.display='none';" class="button">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overlay" id="kompasss_participant_details" onclick="document.getElementById('kompasss_participant_details').style.display='none';">
|
||||
<div class="overlay-content">
|
||||
<div id="kompass_participant_data"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function kompass_load_participant_data(data_id) {
|
||||
kompass_load_ajax_div('EventParticipants', 'kompass_print_participant_summary', 'kompass_participant_data', 'participant-id=' + data_id)
|
||||
document.getElementById('kompasss_participant_details').style.display = 'block';
|
||||
}
|
||||
|
||||
// JavaScript, um das Overlay zu öffnen und das Formular zu übermitteln
|
||||
function kompass_participant_confirm_delete(data_name, data_id) {
|
||||
var name = data_name;
|
||||
var id = data_id;
|
||||
document.getElementById('confirm-name').textContent = name;
|
||||
document.getElementById('confirm-participant-id').value = id;
|
||||
document.getElementById('kompasss_delete_participant').style.display = 'block';
|
||||
}
|
||||
|
||||
function kompass_send_email_to_participant(participant_id) {
|
||||
kompass_load_ajax_div('EventParticipants', 'kompass_print_participant_mail_form', 'kompass_participant_data', 'participant-id=' + participant_id)
|
||||
document.getElementById('kompasss_participant_details').style.display = 'block';
|
||||
}
|
||||
|
||||
function kompass_participant_update_amount(data_amount, data_name, data_id) {
|
||||
var name = data_name;
|
||||
var id = data_id;
|
||||
document.getElementById('beitrag_bezahlt').value = data_amount;
|
||||
document.getElementById('name').textContent = name;
|
||||
document.getElementById('payment-participant-id').value = id;
|
||||
document.getElementById('kompasss_update_amount').style.display = 'block';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
}
|
||||
.overlay-content {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.participant_group thead th:nth-child(3),
|
||||
.participant_group thead th:nth-child(5),
|
||||
.participant_group thead th:nth-child(4),
|
||||
.participant_group td:nth-child(5),
|
||||
.participant_group td:nth-child(3),
|
||||
.participant_group td:nth-child(4) {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,58 @@
|
||||
<div style="display: inline-block; vertical-align: top; width: 40%;">
|
||||
<table style="width: 100%;">
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Anreise:
|
||||
</td>
|
||||
<td>
|
||||
<input type="date" name="anreise" value="<?= $participant->anreise; ?>" required>
|
||||
<select name="anreise_essen" style="width: 50%;">
|
||||
<option <?= $participant->anreise_essen == 1 ? 'selected' : '' ?> value="1">Vor dem Abendessen</option>
|
||||
<option <?= $participant->anreise_essen == 2 ? 'selected' : '' ?> value="2">Vor dem Mittagessen</option>
|
||||
<option <?= $participant->anreise_essen == 3 ? 'selected' : '' ?> value="3">Vor dem Frühstück</option>
|
||||
<option <?= $participant->anreise_essen == 4 ? 'selected' : '' ?> value="4">Zur Abendrunde / Kein Essen am Anreisetag</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Abreise:
|
||||
</td>
|
||||
<td>
|
||||
<input type="date" name="abreise" value="<?= $participant->abreise; ?>" required>
|
||||
<select name="abreise_essen" style="width:50%;">
|
||||
<option <?= $participant->abreise_essen == 1 ? 'selected' : '' ?> value="1">Nach dem Frühstück</option>
|
||||
<option <?= $participant->abreise_essen == 2 ? 'selected' : '' ?> value="2">Nach dem Mittagessen</option>
|
||||
<option <?= $participant->abreise_essen == 3 ? 'selected' : '' ?> value="3">Nach dem Abendessen</option>
|
||||
<option <?= $participant->abreise_essen == 4 ? 'selected' : '' ?> value="4">ganz am Morgen / Kein Essen am Abreisetag</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Teiligruppe:
|
||||
</td>
|
||||
<td>
|
||||
<select name="teilnahme" style="width:100%;">
|
||||
<?php
|
||||
foreach (['participant' => 'Teili', 'volunteer' => 'Teami', 'other' => 'Sontige'] as $group_name => $possible_group) {
|
||||
echo '<option value="' . $group_name . '"' . ($participant->teilnahme == $group_name ? 'selected' : '') . '>' . $possible_group .'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
Beitrag:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="beitrag_bezahlt" value="<?= $participant->beitrag_bezahlt; ?>" style="width:75px;"> Euro /
|
||||
<input type="text" name="beitrag" value="<?= $participant->beitrag; ?>" style="width:75px;"> Euro
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
36
modules/event-participants/Templates/compose-email.php
Normal file
36
modules/event-participants/Templates/compose-email.php
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
<h2>
|
||||
<?= __('Send Email', BDP_LV_PLUGIN_SLUG); ?>
|
||||
</h2>
|
||||
<form method="post" action="admin.php?page=kompass-mail" style="width: 80%; margin: auto">
|
||||
<table style="width: 100%">
|
||||
<input type="hidden" name="action" value="send-email" />
|
||||
<tr>
|
||||
<td><?= __('From: ', BDP_LV_PLUGIN_SLUG); ?></td>
|
||||
<td><input type="text" name="mail-from" style="width: 100%"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('To: ', BDP_LV_PLUGIN_SLUG); ?></td>
|
||||
<td><input type="text" name="mail-to" style="width: 100%"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= __('Subject: ', BDP_LV_PLUGIN_SLUG); ?></td>
|
||||
<td><input type="text" name="mail-subject" style="width: 100%"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
$args = array(
|
||||
'textarea_name' => 'mail-text',
|
||||
'media_buttons' => false,
|
||||
'tinymce' => array(
|
||||
'toolbar1' => 'bold,italic,underline,separator,alignleft,aligncenter,alignright,separator,link,unlink,undo,redo',
|
||||
'toolbar2' => '',
|
||||
'toolbar3' => '',
|
||||
),
|
||||
);
|
||||
|
||||
wp_editor( '', 'kompass-mailcomposer', $args );
|
||||
submit_button(__('Send email', BDP_LV_PLUGIN_SLUG));
|
||||
?>
|
||||
</form>
|
30
modules/event-participants/Templates/participant-details.php
Normal file
30
modules/event-participants/Templates/participant-details.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$admin_link .= 'show-participant&save=true&participant=' . $participant->id;
|
||||
?>
|
||||
<form method="post" action="<?= $admin_link; ?>">
|
||||
<h2>
|
||||
<?= __('Paricipant details', BDP_LV_PLUGIN_SLUG); ?>
|
||||
<input type="text" name="vorname" style="width: 100px;" value="<?= $participant->vorname; ?>">
|
||||
<input type="text" name="nachname" style="width: 100px;" value="<?= $participant->nachname; ?>">
|
||||
</h2>
|
||||
<?php
|
||||
include dirname(__FILE__) . '/Partials/admin/teilidaten.php';
|
||||
include dirname(__FILE__) . '/Partials/admin/allergien.php';
|
||||
include dirname(__FILE__) . '/Partials/admin/kontaktdaten.php';
|
||||
?>
|
||||
</form>
|
||||
<style>
|
||||
table td:nth-child(1) {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 750px) {
|
||||
table td:nth-child(1) {
|
||||
padding-right: 20px; !important;
|
||||
|
||||
}
|
||||
select {
|
||||
width: 200px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
29
modules/event-participants/Templates/participant-summary.php
Normal file
29
modules/event-participants/Templates/participant-summary.php
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
<h2>
|
||||
<?= __('Paricipant details', BDP_LV_PLUGIN_SLUG); ?>
|
||||
<?= $participant->vorname . ' ' . $participant->nachname; ?>
|
||||
</h2>
|
||||
<?php
|
||||
include dirname(__FILE__) . '/Partials/admin/kontaktdaten-printonly.php';
|
||||
include dirname(__FILE__) . '/Partials/admin/allergien-printonly.php';
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
?>
|
||||
<style>
|
||||
table td:nth-child(1) {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 750px) {
|
||||
table td:nth-child(1) {
|
||||
padding-right: 20px; !important;
|
||||
|
||||
}
|
||||
select {
|
||||
width: 200px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
336
modules/event-participants/Templates/register-form.php
Normal file
336
modules/event-participants/Templates/register-form.php
Normal file
@ -0,0 +1,336 @@
|
||||
<form id="registration_form" method="post" action="{{URL}}" onsubmit="return validationCheck()">
|
||||
<input type="hidden" name="eventId" value="{{eventId}}" />
|
||||
<div class="step" id="step1">
|
||||
{{altersstufe}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step2">
|
||||
<h3>Persönliche Daten (Eltern)</h3>
|
||||
{{persönliche daten eltern}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step3">
|
||||
<h3>Persönliche Daten (Teili)</h3>
|
||||
{{persönliche daten}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step4">
|
||||
<h3>Deine Teilnahme</h3>
|
||||
{{gruppe}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step5">
|
||||
<h3>An- und Abreise</h3>
|
||||
{{anreise}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step6">
|
||||
<h3>Beitrag</h3>
|
||||
{{beitrag}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step7">
|
||||
<h3>Foto-Erlaubnis</h3>
|
||||
{{fotoerlaubnis}}
|
||||
</div>
|
||||
|
||||
<div class="step" id="step8">
|
||||
<h3>Besondere Merkmale</h3>
|
||||
{{allergien}}
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<style>
|
||||
.step h3 {
|
||||
margin-bottom: 30px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: auto;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
#registration_form {
|
||||
color: #000000;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#registration_form input[type=button],
|
||||
#registration_form input[type=submit]
|
||||
{
|
||||
background-color: #ffffff;
|
||||
width: 125px;
|
||||
padding: 10px;
|
||||
border-style: solid;
|
||||
border-color: #f0f0f0;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
#registration_form input[type="button"]:hover,
|
||||
#registration_form input[type="submit"]:hover
|
||||
{
|
||||
color: #ffffff;
|
||||
background-color: #394993;
|
||||
}
|
||||
|
||||
#registration_form table {
|
||||
width: 100%;
|
||||
color: #757575;
|
||||
}
|
||||
|
||||
#registration_form table td:nth-child(1) {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#registration_form table td:nth-child(2){
|
||||
width: 80%;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#registration_form table td {
|
||||
|
||||
}
|
||||
|
||||
#registration_form table td input,
|
||||
#registration_form table td select,
|
||||
#registration_form table td textarea
|
||||
{
|
||||
|
||||
width: 350px;
|
||||
background-color: #ffffff;
|
||||
border-color: #c0c0c0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-radius: 5px;
|
||||
font-size: 14pt;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#registration_form label
|
||||
{
|
||||
font-size: 12pt;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#registration_form table td select {
|
||||
width: 363px;
|
||||
}
|
||||
|
||||
.emblems_selection {
|
||||
widh: 100%;
|
||||
margin-top: 50px;
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
border-style: solid none none;
|
||||
border-width: 1px;
|
||||
border-color: #c0c0c0;
|
||||
}
|
||||
|
||||
.altersstufe_td {
|
||||
display: inline-block;
|
||||
box-shadow: 5px 5px 10px #c0c0c0;
|
||||
background-color: #f9f9f9;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
margin-right: 20px;
|
||||
width: 46%;
|
||||
}
|
||||
|
||||
.altersstufe_td div
|
||||
{
|
||||
height: 50px;
|
||||
padding: 0px 10px !important;
|
||||
}
|
||||
|
||||
.dsgvo_error {
|
||||
color: #a94442;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.altersstufe_td {
|
||||
display: block;
|
||||
margin: 0 auto 25px;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
#registration_form table td input,
|
||||
#registration_form table td select,
|
||||
#registration_form table td textarea
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#strasse {
|
||||
width: 70% !important;
|
||||
}
|
||||
|
||||
#ort {
|
||||
width: 608% !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
let currentStep = 1;
|
||||
const form = document.getElementById('multi-step-form');
|
||||
const steps = document.querySelectorAll('.step');
|
||||
|
||||
function checkAnsprechpartner() {
|
||||
var errors = false;
|
||||
|
||||
var ids = ['ansprechpartner', 'telefon_2','email_2'];
|
||||
|
||||
for (var idx = 0; idx < ids.length; idx++) {
|
||||
var currentElement = ids[idx];
|
||||
|
||||
if (document.getElementById(currentElement).value == '') {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#fd9393";
|
||||
document.getElementById(currentElement).style.color = "red";
|
||||
errors = true;
|
||||
} else {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#ffffff";
|
||||
document.getElementById(currentElement).style.color = "#c0c0c0";
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
showStep(3);
|
||||
}
|
||||
}
|
||||
|
||||
function checkAnreise() {
|
||||
var errors = false;
|
||||
|
||||
var ids = ['anreise', 'abreise'];
|
||||
|
||||
for (var idx = 0; idx < ids.length; idx++) {
|
||||
var currentElement = ids[idx];
|
||||
|
||||
if (document.getElementById(currentElement).value == '') {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#fd9393";
|
||||
document.getElementById(currentElement).style.color = "red";
|
||||
errors = true;
|
||||
} else {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#ffffff";
|
||||
document.getElementById(currentElement).style.color = "#c0c0c0";
|
||||
}
|
||||
}
|
||||
|
||||
if (errors)
|
||||
return;
|
||||
|
||||
var anreise = new Date(document.getElementById('anreise').value);
|
||||
var abreise = new Date(document.getElementById('abreise').value);
|
||||
|
||||
if(abreise < anreise) {
|
||||
document.getElementById('anreise').style.backgroundColor = "#fd9393";
|
||||
document.getElementById('anreise').style.color = "red";
|
||||
document.getElementById('abreise').style.backgroundColor = "#fd9393";
|
||||
document.getElementById('abreise').style.color = "red";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(anreise < new Date('{{startdate}}')) {
|
||||
document.getElementById('anreise').style.backgroundColor = "#fd9393";
|
||||
document.getElementById('anreise').style.color = "red";
|
||||
errors = true;
|
||||
} else {
|
||||
document.getElementById('anreise').style.backgroundColor = "#ffffff";
|
||||
document.getElementById('anreise').style.color = "#c0c0c0";
|
||||
}
|
||||
|
||||
if(abreise > new Date('{{enddate}}')) {
|
||||
document.getElementById('abreise').style.backgroundColor = "#fd9393";
|
||||
document.getElementById('abreise').style.color = "red";
|
||||
errors = true;
|
||||
} else {
|
||||
document.getElementById('abreise').style.backgroundColor = "#ffffff";
|
||||
document.getElementById('abreise').style.color = "#c0c0c0";
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
showStep(6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkAddress() {
|
||||
var errors = false;
|
||||
|
||||
var ids = ['vorname', 'nachname','geburtsdatum', 'telefon_1', 'email_1', 'strasse', 'hausnummer', 'plz', 'ort'];
|
||||
|
||||
for (var idx = 0; idx < ids.length; idx++) {
|
||||
var currentElement = ids[idx];
|
||||
|
||||
if (document.getElementById(currentElement).value == '') {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#fd9393";
|
||||
document.getElementById(currentElement).style.color = "red";
|
||||
errors = true;
|
||||
} else {
|
||||
document.getElementById(currentElement).style.backgroundColor = "#ffffff";
|
||||
document.getElementById(currentElement).style.color = "#c0c0c0";
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
showStep(4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showStep(stepNumber) {
|
||||
steps.forEach(step => step.style.display = 'none');
|
||||
document.getElementById(`step${stepNumber}`).style.display = 'block';
|
||||
}
|
||||
|
||||
function nextStep() {
|
||||
if (currentStep < steps.length) {
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
}
|
||||
}
|
||||
|
||||
function validationCheck()
|
||||
{
|
||||
if (!document.getElementById('dsgvo_accept').checked) {
|
||||
document.getElementById('dsgvo_text').classList.add('dsgvo_error');
|
||||
}
|
||||
var ids = ['vorname', 'nachname','geburtsdatum', 'telefon_1', 'email_1', 'anreise', 'abreise', 'strasse', 'hausnummer', 'plz', 'ort'];
|
||||
|
||||
for (var idx = 0; idx < ids.length; idx++) {
|
||||
var currentElement = ids[idx];
|
||||
if (document.getElementById(currentElement).value == '') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var anreise = new Date(document.getElementById('anreise').value);
|
||||
var abreise = new Date(document.getElementById('abreise').value);
|
||||
|
||||
if(anreise < new Date('{{startdate}}')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(abreise > new Date('{{enddate}}')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!document.getElementById('dsgvo_accept').checked) {
|
||||
document.getElementById('dsgvo_text').classList.add('dsgvo_error');
|
||||
}
|
||||
|
||||
return document.getElementById('dsgvo_accept').checked;
|
||||
|
||||
|
||||
}
|
||||
|
||||
showStep(currentStep);
|
||||
</script>
|
101
modules/event-participants/Views/event-edit-form.php
Normal file
101
modules/event-participants/Views/event-edit-form.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
use Bdp\Modules\EventParticipants\Models\Event as Event;
|
||||
|
||||
function kompass_print_event_edit_form(?int $event_id = null)
|
||||
{
|
||||
$event = null;
|
||||
if (null === $event_id) {
|
||||
$page = 'kompass-events&action=create-event';
|
||||
|
||||
} else {
|
||||
$page = 'kompass-events&action=update-event&event-id=' . $event_id;
|
||||
$event = Event::loadById($event_id);
|
||||
}
|
||||
|
||||
$events_settings = BDP_LV_PLUGIN_SLUG . '-events-settings';
|
||||
|
||||
add_settings_section(
|
||||
'events_settings',
|
||||
__('Edit event', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_prepare_form',
|
||||
$events_settings,
|
||||
['page' => $page]
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_1',
|
||||
__('Event Name', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'event_name', 'style' => 'width: 1024px', 'value' => null !== $event ? $event->event_name : '']);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_2',
|
||||
__('Start date', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_datebox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'startdatum', 'style' => 'width: 256px', 'value' => null !== $event ? $event->startdatum : '']);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_3',
|
||||
__('End date', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_datebox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'enddatum', 'style' => 'width: 256px', 'value' => null !== $event ? $event->enddatum : '']);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_7',
|
||||
__('Maximum participants', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'max_participants', 'style' => 'width: 256px', 'type' => 'number', 'value' => null !== $event ? $event->max_participants : 100] );
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_8',
|
||||
__('Maximum volunteers', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'max_volunteers', 'style' => 'width: 256px', 'type' => 'number', 'value' => null !== $event ? $event->max_volunteers : 50] );
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_4',
|
||||
__('Reduced amount', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'amount_reduced', 'style' => 'width: 256px', 'type' => 'number', 'value' => null !== $event ? $event->amount_reduced : 25, 'appendix' => 'Euro']);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_5',
|
||||
__('Default amount', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'amount_default', 'style' => 'width: 256px', 'type' => 'number', 'value' => null !== $event ? $event->amount_default : 60, 'appendix' => 'Euro']);
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_6',
|
||||
__('Additional social amount', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'amount_social', 'style' => 'width: 256px', 'type' => 'number', 'value' => null !== $event ? $event->amount_social : 100, 'appendix' => 'Euro<br />' . __('This amount gets added to the selected amount')] );
|
||||
|
||||
add_settings_field(
|
||||
'event_settings_9',
|
||||
__('Contributing Tribes', BDP_LV_PLUGIN_SLUG),
|
||||
'kompass_print_textbox',
|
||||
$events_settings,
|
||||
'events_settings',
|
||||
['setting' => 'contributing_tribes', 'style' => 'width: 256px', 'lines' => 5, 'value' => str_replace(',', PHP_EOL, null !== $event ? $event->contributing_tribes : ''), 'appendix' => '<br />' . __('Please one line per row', BDP_LV_PLUGIN_SLUG)] );
|
||||
|
||||
do_settings_sections($events_settings);
|
||||
submit_button();
|
||||
echo '</form>';
|
||||
}
|
12
modules/event-participants/Views/event-group-controll.php
Normal file
12
modules/event-participants/Views/event-group-controll.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
function kompass_print_event_control_header(int $event_id, string $active_tab = 'tab1')
|
||||
{
|
||||
$baseUrl = 'admin.php?page=kompass-events&action=show-event&event-id=' . $event_id. '&tab=';
|
||||
return '<h2 class="nav-tab-wrapper">'.
|
||||
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ( $active_tab == 'tab1' ? 'nav-tab-active' : '') . '">' .
|
||||
__('Participants by groups', BDP_LV_PLUGIN_SLUG) .
|
||||
'</a>'.
|
||||
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ( $active_tab == 'tab2' ? 'nav-tab-active' : '') . '">' .
|
||||
__('Participants by tribes', BDP_LV_PLUGIN_SLUG) .
|
||||
'</a></h2>';
|
||||
}
|
53
modules/event-participants/Views/events-overview.php
Normal file
53
modules/event-participants/Views/events-overview.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Bdp\Modules\EventParticipants\Controllers\MainController;
|
||||
|
||||
function kompass_print_events_overview() {
|
||||
global $dbHandler;
|
||||
?>
|
||||
<h2>Veranstaltungsübersicht</h2>
|
||||
<table class="wp-list-table widefat fixed striped table-view-list" id="myTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="manage-column column-name"><?= __('Event Name', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th scope="col" class="manage-column column-name"><?= __('Count participants', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
foreach ($dbHandler->readFromDb( MainController::KOMPASS_EVENTS_EVENTS, ['archived' => false]) as $event_data) {
|
||||
$event = \Bdp\Modules\EventParticipants\Models\Event::loadById($event_data->id);
|
||||
$participant_count = 0;
|
||||
$amount = 0;
|
||||
foreach ($event->groups as $group => $participants) {
|
||||
$participant_count += count($participants);
|
||||
foreach ($participants as $group_participant) {
|
||||
$amount += $group_participant->beitrag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td><a href="' . admin_url('admin.php?page=kompass-events&action=show-event&event-id=' . $event->id ) . '">' . $event->event_name .'</a></td>';
|
||||
echo '<td>' . $participant_count . '<br />' . number_format($amount, 2, ',') . ' Euro<br />';
|
||||
echo number_format($participant_count > 0 ? $amount / $participant_count : 0, 2, ',') . ' Euro / Teili </td>';
|
||||
echo '<td> ' .
|
||||
'<a href="' . admin_url('admin.php?page=kompass-events&action=edit-event&event-id=' . $event->id ) . '">' . __('Edit', BDP_LV_PLUGIN_SLUG) . '</a><br />' .
|
||||
($event->signup_allowed ?
|
||||
'<a href="' . admin_url('admin.php?page=kompass-events&action=close-event&event-id=' . $event->id ) . '">' . __('Deny registration', BDP_LV_PLUGIN_SLUG) . '</a>' :
|
||||
'<a href="' . admin_url('admin.php?page=kompass-events&action=open-event&event-id=' . $event->id ) . '">' . __('Allow registration', BDP_LV_PLUGIN_SLUG) . '</a>') .
|
||||
'<br />' .
|
||||
'<a href="' . admin_url('admin.php?page=kompass-events&action=archive-event&event-id=' . $event->id ) . '">' . __('Move to Archive', BDP_LV_PLUGIN_SLUG) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table><br /><br />
|
||||
|
||||
|
||||
<a class="button" href=" <?= admin_url('admin.php?page=kompass-events') . '&action=new-event'; ?>"><?= __( 'New Event', BDP_LV_PLUGIN_SLUG ); ?></a>
|
||||
|
||||
<?php
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace Bdp\Modules\EventParticipants\Views;
|
||||
|
||||
use Bdp\Libs\FileAccess;
|
||||
use Bdp\Modules\EventParticipants\Controllers\MainController as GruppenController;
|
||||
use Bdp\Modules\EventParticipants\Models\Event;
|
||||
use Bdp\Modules\EventParticipants\Models\EventGroup;
|
||||
|
||||
function registrationForm(int $eventId, string $targetPage) : string
|
||||
{
|
||||
global $dbHandler;
|
||||
|
||||
$event = Event::loadById($eventId);
|
||||
|
||||
if (!$event->signup_allowed) {
|
||||
return '<h2>Derzeit ist keine Anmeldung für diese Veranstaltung möglich.</h2>';
|
||||
}
|
||||
$registerForm = file_get_contents(dirname(__FILE__) . '/../Templates/register-form.php');
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{altersstufe}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/altersstufe.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{persönliche daten eltern}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/ansprechpartner.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{persönliche daten}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/kontaktdaten.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{anreise}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/anreise.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{gruppe}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/gruppe.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{beitrag}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/beitrag.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{fotoerlaubnis}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/fotoerlaubnis.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace(
|
||||
'{{allergien}}',
|
||||
file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/allergien.php'),
|
||||
$registerForm
|
||||
);
|
||||
|
||||
$registerForm = str_replace('{{startdate}}', $event->startdatum, $registerForm);
|
||||
$registerForm = str_replace('{{enddate}}', $event->enddatum, $registerForm);
|
||||
$registerForm = str_replace('{{amount_reduced}}', $event->amount_reduced, $registerForm);
|
||||
$registerForm = str_replace('{{amount_default}}', $event->amount_default, $registerForm);
|
||||
$registerForm = str_replace('{{amount_social}}', $event->amount_social, $registerForm);
|
||||
|
||||
|
||||
$registerForm = str_replace('{{URL}}', $targetPage, $registerForm);
|
||||
$registerForm = str_replace('{{eventId}}', $eventId, $registerForm);
|
||||
$registerForm = str_replace('{{BDP_LV_PLUGIN_URL}}', BDP_LV_PLUGIN_URL, $registerForm);
|
||||
return $registerForm;
|
||||
|
||||
}
|
Reference in New Issue
Block a user