$_URI[3], ':key' => $_URI[4])))) { $event = $eventList[0]; $eventClosingDate = $event->getClosingDate() == '0000-00-00' ? null : new DateTime($event->getClosingDate() . ' 23:59:59'); echo ' Aanmeldingen - ' . $event->getName() . ' - Georganiseerd door de Leidse Reddingsbrigade

Aanmeldingen voor ' . $event->getName() . '

Alle aanmelden van "' . $event->getName() . '".

' . (isset($eventClosingDate) ? '

Aanmelden kan tot en met ' . $eventClosingDate->format('d-m-Y') . '.

' : '') . '
'; $participantCount = 0; $eventGeneralFields = json_decode($event->getGeneralFields(), true); $eventParticipantFields = json_decode($event->getParticipantFields(), true); $registrationList = Registration::dbGetList('`eventID` = :eventID', array(':eventID' => $event->getID()), '`registrationTime` ASC'); foreach ($registrationList as $key => $registration) { $registrationGeneralData = json_decode($registration->getGeneralData(), true); $registrationParticipantData = json_decode($registration->getParticipantData(), true); if ($key == 0) { // First item echo ' ' . HtmlUtil::parseTableHeaders($eventGeneralFields) . ' ' . HtmlUtil::parseTableHeaders($eventParticipantFields) . ' '; } foreach ($registrationParticipantData as $participantKey => $participantValue) { $participantCount++; echo ' '; if ($participantKey == 0) { // First participant echo ' ' . HtmlUtil::parseTableFields($eventGeneralFields, $registrationGeneralData); } else { echo ' '; } echo ' ' . HtmlUtil::parseTableFields($eventParticipantFields, $participantValue); if ($participantKey == 0) { // First participant echo ' '; } else { echo ' '; } echo ' '; } if ($key == count($registrationList) - 1) { // Last item echo ' '; } } echo '
Aanmelding DatumDeelnemerTotale kosten Betaling
#' . ($key + 1) . '
ID: ' . $registration->getID() . '
(' . $registration->getKey() . ')
' . date(FORMAT_DATETIME_NL, $registration->getTime()) . '
' . $registration->getIP() . '
#' . $participantCount . '
ID: ' . $registration->getID() . '-' . ($participantKey + 1) . '
€ ' . number_format($registration->getCosts() / 100, 2, ',', '.') . ' '; $paymentList = Payment::dbGetList('`registrationID` = :registrationID', array(':registrationID' => $registration->getID()), '`registrationID` ASC'); foreach ($paymentList as $payment) { echo ' Mollie ID: ' . $payment->getMollieID() . '
Status: ' . $payment->getStatus() . ' ' . (!$payment->getPaidDate() && !$payment->getCancelledDate() && !$payment->getExpiredDate() ? '
Aangemaakt: ' . date(FORMAT_DATETIME_NL, $payment->getCreatedDate()) : '') . ' ' . ($payment->getPaidDate() ? '
Betaald: ' . date(FORMAT_DATETIME_NL, $payment->getPaidDate()) : '') . ' ' . ($payment->getCancelledDate() ? '
Geannuleerd: ' . date(FORMAT_DATETIME_NL, $payment->getCancelledDate()) : '') . ' ' . ($payment->getExpiredDate() ? '
Verlopen: ' . date(FORMAT_DATETIME_NL, $payment->getExpiredDate()) : ''); } echo '
'; } elseif (isset($_URI[2]) && ($eventList = Event::dbGetList('`eventKey` = :key', array(':key' => $_URI[2])))) { $event = $eventList[0]; if (isset($_POST['number']) && checkRecaptcha($_POST['g-recaptcha-response'])) { $number = intval($_POST['number']) + 1; $fieldCostCheck = null; $fieldsJson = json_decode($event->getParticipantFields(), true); foreach ($fieldsJson['fields'] as $fieldKey => $fieldValue) { if ($fieldValue['id'] == $event->getCostCheck()) { $fieldCostCheck = $fieldKey; break; } } $costsTotal = 0; $costsCurrent = 0; $participantArray = array(); for ($i = 0; $i < $number; $i++) { if (isset($fieldCostCheck) && (($fieldsJson['fields'][$fieldCostCheck]['type'] == 'checkbox' && $_POST['participant'][$i][$event->getCostCheck()]) || ($fieldsJson['fields'][$fieldCostCheck]['type'] != 'checkbox' && $_POST['participant'][$i][$event->getCostCheck()] && (preg_match('/\d{4}/', $_POST['participant'][$i][$event->getCostCheck()]) || ($_POST['participant'][$i][$event->getCostCheck()] == 'Vleespakket') || ($_POST['participant'][$i][$event->getCostCheck()] == 'Vegapakket'))))) { $costsTotal += $event->getCostMember(); $_POST['participant'][$i]['costs'] = $event->getCostMember(); } else { $costsTotal += $event->getCostGuest(); $_POST['participant'][$i]['costs'] = $event->getCostGuest(); } $participantArray[] = $_POST['participant'][$i]; } if ($costsTotal < $event->getCostMinimal()) { $costsTotal = $event->getCostMinimal(); } $uniqueKey = md5(uniqid(rand(), true)); $registration = new Registration(); $registration->setEventID($event->getID()); $registration->setKey($uniqueKey); $registration->setGeneralData(json_encode($_POST['general'], JSON_PRETTY_PRINT)); $registration->setParticipantData(json_encode($participantArray, JSON_PRETTY_PRINT)); $registration->setCosts($costsTotal); $registration->setTime(time()); $registration->setIP($_CURRENT->getIP()); $registration->dbInsert(); if ($costsTotal > 0) { createPayment($event, $registration); } else { header('Location: ' . GLOBAL_URL_SCHEME . '://' . GLOBAL_URL_HOST . FOLDER_PATH . '/' . $event->getKey() . '/' . $registration->getKey() . '/'); } } if (isset($_URI[3]) && ($registrationList = Registration::dbGetList('`eventID` = :id AND `registrationKey` = :key', array(':id' => $event->getID(), ':key' => $_URI[3])))) { $paymentList = Payment::dbGetList('`registrationID` = :id', array(':id' => $registrationList[0]->getID()), '`paymentID` DESC', null, '1'); $currentRegistration = $registrationList[0]; $currentPayment = $paymentList ? $paymentList[0] : null; if (isset($_POST['pay']) && $currentRegistration->getCosts() > 0) { createPayment($event, $currentRegistration); } } echo ' ' . $event->getName() . ' - Georganiseerd door de Leidse Reddingsbrigade

' . $event->getName() . '

' . $event->getDescription() . '
'; $nowDate = new DateTime(); $eventClosingDate = $event->getClosingDate() == '0000-00-00' ? null : new DateTime($event->getClosingDate() . ' 23:59:59'); if (isset($currentRegistration)) { echo '

Status van jouw aanmelding

'; if (isset($currentPayment) && substr($currentPayment->getStatus(), 0, 4) == 'paid') { echo '

We hebben de betaling ontvangen en jouw aanmelding is hiermee definitief.

'; } elseif ($currentRegistration->getCosts() > 0) { echo '

We hebben nog geen betaling ontvangen. Jouw aanmelding is hierdoor nog niet definitief.

Let op: Je aanmelding wordt pas verwerkt als je betaalt via iDEAL!

Druk op onderstaande knop om de betaling alsnog uit te voeren:

'; } else { echo '

Er is geen betaling nodig, dus jouw aanmelding is direct definitief.

'; } echo '
Terug naar het aanmeldformulier Terug naar de homepage
'; } else { if (isset($eventClosingDate) && ($nowDate > $eventClosingDate)) { echo '

Aanmelden voor ' . $event->getName() . ' is niet meer mogelijk

De laatste dag om je in te schrijven was op ' . $eventClosingDate->format('d-m-Y') . '. Volgende keer beter!

'; } elseif ($event->getGeneralFields() || $event->getParticipantFields()) { echo '

Aanmelden voor ' . $event->getName() . '

Velden aangegeven met een * zijn verplicht.

'; if (isset($_POST['number'])) { echo ' '; } if (isset($paymentError) && $paymentError) { echo ' '; } echo '
'; if ($event->getGeneralFields()) { echo '

' . $event->getGeneralTitle() . '

' . HtmlUtil::parseInputFields('general', $event->getGeneralFields()) . '
'; } if ($event->getParticipantMax() <= $event->getParticipantMin()) { echo ' '; } else { echo '
'; } for ($i = 0; $i < $event->getParticipantMax(); $i++) { echo '

' . $event->getParticipantTitle() . ' ' . ($i + 1) . '

' . HtmlUtil::parseInputFields('participant[' . $i . ']', $event->getParticipantFields()) . '
'; } echo '
'; } } echo '
'; } else { echo '

Evenement niet gevonden

Controleer het webadres (URL).

'; }