sendApiRequest threw an exception: ; Result from the request:
An Error Occurred: Internal Server Error
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred.
We will fix it as soon as possible. Sorry for any inconvenience caused.
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
/var/www/vhosts/bonifatius-lingen.de/httpdocs/classes/conevents-api/BaseApiClient.php #74
#1 : <?php #2 : require_once 'classes/conevents-api/BaseApiClient.php'; #3 : require_once 'classes/conevents-api/ApiClient.php'; #4 : setlocale(LC_TIME, "de_DE.UTF-8"); #5 : global $connConfig; #6 : global $event; #7 : global $requiredSpecialFields; #8 : #9 : if (!function_exists('generateAndUpdateCaptcha')) { #10 : function generateAndUpdateCaptcha(): void #11 : { #12 : $_SESSION['co'] = substr(str_shuffle(str_repeat('abcdefghjkmnpqrstuvwxyz23456789', 5)), 0, 5); #13 : } #14 : } #15 : #16 : $conEventsConfig = $connConfig->events->api; #17 : #18 : $eventId = $_GET["eventId"]; #19 : #20 : $api = new \Connectiv\ConEvents\Frontend\Standalone\Api\ApiClient( #21 : $conEventsConfig->url, #22 : $conEventsConfig->username, #23 : $conEventsConfig->password, #24 : $conEventsConfig->clientid, #25 : $conEventsConfig->clientsecret #26 : ); #27 : #28 : if (!empty($eventId)) { #29 : $event = $api->getEvent($eventId); #30 : $instructors = []; #31 : #32 : foreach ($event->entry->instructors as $key => $instructor) { #33 : $instructors[] = $api->getInstructor($instructor->instructorId); #34 : } #35 : } #36 : #37 : if (!isset($_SESSION['co'])) { #38 : generateAndUpdateCaptcha(); #39 : } #40 : #41 : if (isset($_POST['action'])) { #42 : if ($_POST['captcha'] !== $_SESSION['co']) { #43 : MessageStack::AddMessage('error', 'Der eingegebene Captcha ist nicht korrekt.'); #44 : #45 : System::redirect($_SERVER['REQUEST_URI']); #46 : } #47 : #48 : $result = $api->registerParticipant($_POST); #49 : #50 : generateAndUpdateCaptcha(); #51 : #52 : if ($result->error === 0) { #53 : MessageStack::AddMessage("ok", $result->resultMessage); #54 : } else { #55 : MessageStack::AddMessage("error", $result->errorMessage); #56 : } #57 : #58 : System::redirect($_SERVER['REQUEST_URI']); #59 : } #60 : #61 : // Jede Kursart soll unterschiedliche Pflichfelder haben. Hierzu wird das Kürzel am Anfang der Kursnummer ausgelesen. #62 : $requiredSpecialFields = [ #63 : 'healthInsurance' => ['BS', 'OR', 'PEKIP'], #64 : 'pregnancyWeek' => ['V', 'WGMo', 'WGMi', 'YS', 'IAGE', 'IARG'], #65 : 'estimatedDeliveryDate' => ['V', 'WGMo', 'WGMi', 'YS', 'IAGE', 'IARG', 'PEKIP'], #66 : 'deliveryDate' => ['BS', 'E', 'GE', 'OR', 'T', 'PEKIP', 'SC'], #67 : 'childName' => ['PEKIP', 'BS', 'OR', 'T'] #68 : ]; #69 : $checkIfRequired = static function($field) { #70 : global $event, $requiredSpecialFields; #71 : $courseNum = $event->entry->texts[0]->courseNumber; #72 : $required = ''; #73 : #74 : foreach ($requiredSpecialFields as $key => $values) { #75 : if ($field === $key) { #76 : foreach ($values as $value) { #77 : if (strpos($courseNum, $value) === 0) { #78 : $required = "required"; #79 : } #80 : } #81 : } #82 : } #83 : return $required; #84 : }; #85 : #86 : $formFields = [ #87 : 'salutation' => [ #88 : 'type' => 'select', #89 : 'label' => 'Anrede', #90 : 'required' => 'required', #91 : 'options' => [ #92 : 'mr' => 'Herr', #93 : 'ms' => 'Frau' #94 : ] #95 : ], #96 : 'lastName' => [ #97 : 'type' => 'text', #98 : 'label' => 'Nachname', #99 : 'required' => 'required' #100 : ], #101 : 'firstName' => [ #102 : 'type' => 'text', #103 : 'label' => 'Vorname', #104 : 'required' => 'required' #105 : ], #106 : 'streetNr' => [ #107 : 'type' => 'text', #108 : 'label' => 'Straße und Nr.', #109 : 'required' => 'required' #110 : ], #111 : 'postcode' => [ #112 : 'type' => 'text', #113 : 'label' => 'PLZ', #114 : 'required' => 'required' #115 : ], #116 : 'city' => [ #117 : 'type' => 'text', #118 : 'label' => 'Ort', #119 : 'required' => 'required' #120 : ], #121 : 'birthdate' => [ #122 : 'type' => 'date', #123 : 'label' => 'Geburtstag des Teilnehmers', #124 : 'required' => 'required' #125 : ], #126 : 'phoneNumber' => [ #127 : 'type' => 'text', #128 : 'label' => 'Handynummer', #129 : 'required' => 'required' #130 : ], #131 : 'email' => [ #132 : 'type' => 'email', #133 : 'label' => 'E-Mail-Adresse', #134 : 'required' => 'required' #135 : ], #136 : 'healthInsurance' => [ #137 : 'type' => 'text', #138 : 'label' => 'Krankenkasse', #139 : 'required' => $checkIfRequired("healthInsurance") #140 : ], #141 : 'pregnancyWeek' => [ #142 : 'type' => 'text', #143 : 'label' => 'Schwangerschaftswoche', #144 : 'required' => $checkIfRequired("pregnancyWeek") #145 : ], #146 : 'childName' => [ #147 : 'type' => 'text', #148 : 'label' => 'Name des Kindes', #149 : 'required' => $checkIfRequired("childName") #150 : ], #151 : 'estimatedDeliveryDate' => [ #152 : 'type' => 'date', #153 : 'label' => 'Voraussichtliches Entbindungsdatum', #154 : 'required' => $checkIfRequired("estimatedDeliveryDate") #155 : ], #156 : 'deliveryDate' => [ #157 : 'type' => 'date', #158 : 'label' => 'Geburtsdatum des Kindes', #159 : 'required' => $checkIfRequired("deliveryDate") #160 : ], #161 : 'questions' => [ #162 : 'type' => 'textarea', #163 : 'label' => 'Offene Fragen / Ihre Nachricht an uns', #164 : 'required' => '' #165 : ], #166 : 'captcha' => [ #167 : 'type' => 'captcha', #168 : 'label' => 'Bitte geben Sie den Code ein', #169 : 'required' => 'required', #170 : ], #171 : 'paymentViaCashTransfer' => [ #172 : 'type' => 'checkbox', #173 : 'label' => 'Bezahlung per Überweisung (Zahlungsdaten erhalten Sie in der Bestätigungsmail)', #174 : 'required' => 'required' #175 : ] #176 : ]; #177 : ?> #178 : #179 : <a href="<?php echo generate_link(1, 1261,1272); ?>">zurück zur Übersicht</a> #180 : <hr> #181 : <?= MessageStack::BuildMessageStack() ?> #182 : #183 : <?php if (isset($event)) { ?> #184 : <h1> #185 : <span><?= $event->entry->texts[0]->title ?></span> #186 : <?php if ($event->entry->texts[0]->courseNumber) { ?> #187 : <br><span>(Kurs-Nr.: <?php echo $event->entry->texts[0]->courseNumber; ?>)</span> #188 : <?php } ?> #189 : </h1> #190 : <div class="list-show"> #191 : <?php if (count($event->entry->images) !== 0) { ?> #192 : <div class="event-image-carousel" style="overflow: hidden;"> #193 : <?php foreach ($event->entry->images as $imageItem) { #194 : if ($imageItem->isDefaultImage) { ?> #195 : <img class="list-show__img" #196 : src="https://events.bonifatius-lingen.de/static/img/event/<?php echo $event->entry->id; ?>/<?php echo $imageItem->image; ?>" alt="<?php echo $imageItem->text; ?>"> #197 : <?php } #198 : } ?> #199 : <?php foreach ($event->entry->images as $imageItem) { #200 : if (!$imageItem->isDefaultImage) { ?> #201 : <img class="list-show__img" #202 : src="https://events.bonifatius-lingen.de/static/img/event/<?php echo $event->entry->id; ?>/<?php echo $imageItem->image; ?>" alt="<?php echo $imageItem->text; ?>"> #203 : <?php } #204 : } ?> #205 : </div> #206 : <?php } else { ?> #207 : <img alt="<?php echo $event->texts[0]->title; ?>" #208 : class="img-responsive event-list-item__image" #209 : src="https://www.bonifatius-hospital-lingen.de/images/elternschule/testbild.jpg"> #210 : <?php } ?> #211 : <div class="list-show__info"> #212 : <table class="table"> #213 : <tbody> #214 : <tr> #215 : <th scope="row"><strong>Kursbeschreibung</strong></th> #216 : <td><span><?php echo $event->entry->texts[0]->description; ?></span></td> #217 : </tr> #218 : <tr> #219 : <th scope="row"><strong>Ort</strong></th> #220 : <td> #221 : <span> #222 : <?php echo $event->entry->venue->texts[0]->title; ?><br> #223 : <?php echo $event->entry->venue->streetNr; ?><br> #224 : <?php echo $event->entry->venue->city; ?> #225 : </span> #226 : </td> #227 : </tr> #228 : <tr> #229 : <th scope="row"><strong>Dozent(en)</strong></th> #230 : <td> #231 : <?php if (isset($instructors)) { #232 : foreach ($instructors as $instructor) { #233 : ?> #234 : <span><?php echo $instructor->entry->firstName . " " . $instructor->entry->lastName; ?></span> #235 : <?php if ($instructor->entry->texts[0]->description !== "") { ?> #236 : <span>(<?php echo $instructor->entry->texts[0]->description; ?>)</span> #237 : <?php } ?> #238 : <br> #239 : <?php #240 : } #241 : } #242 : ?> #243 : </td> #244 : </tr> #245 : <tr> #246 : <th scope="row"><strong>Kosten</strong></th> #247 : <td> #248 : <span><?php echo $event->entry->price . " € ". $event->entry->texts[0]->priceInfo; ?></span><br> #249 : <span><?php echo $event->entry->texts[0]->priceDescription; ?></span> #250 : </td> #251 : </tr> #252 : <tr> #253 : <th scope="row"><strong>Plätze</strong></th> #254 : <td> #255 : <?php $availablePlaces = $event->entry->allowedAmountOfParticipants - $event->entry->amountOfParticipants; ?> #256 : <span>Maximale Teilnehmeranzahl: <?php echo $event->entry->allowedAmountOfParticipants; ?></span><br> #257 : <strong>Noch verfügbare Plätze: <?php echo $availablePlaces < 0 ? "0" : $availablePlaces; ?></strong> #258 : </td> #259 : </tr> #260 : <tr> #261 : <th scope="row"><strong>Kurstermine</strong></th> #262 : <td> #263 : <?php if (count($event->entry->dates) !== 0) { #264 : foreach ($event->entry->dates as $dateItem) { #265 : $startDateTimestamp = strtotime($dateItem->startDateTime->date); #266 : $endDateTimestamp = strtotime($dateItem->endDateTime->date); ?> #267 : <div class="list-show-dateitem"> #268 : <span><?php echo strftime("%d. %B %Y", $startDateTimestamp); ?></span><br> #269 : <span><?php echo strftime("%H:%M", $startDateTimestamp); ?> - <?php echo strftime("%H:%M", $endDateTimestamp); ?> Uhr<br></span> #270 : </div> #271 : <?php #272 : } #273 : } else { #274 : echo "Noch nicht festgelegt"; #275 : } ?> #276 : </td> #277 : </tr> #278 : </tbody> #279 : </table> #280 : </div> #281 : <div class="list-show__registration"> #282 : <h1>Anmeldung für diesen Kurs</h1> #283 : <?php if ($availablePlaces <= 0) { ?> #284 : <p>Leider sind alle Plätze ausgebucht. Bitte melden Sie sich telefonisch unter <a href="tel:+495919101199">0591 910-1199</a> oder per E-Mail an <a href="mailto:elternschule@hospital-lingen.de">elternschule@hospital-lingen.de</a>, wenn wir Sie auf die Warteliste setzen dürfen.</p> #285 : <?php } else { ?> #286 : <form name="eventRegister" action="<?=htmlentities($_SERVER['REQUEST_URI'])?>" method="post" enctype="multipart/form-data"> #287 : <input type="hidden" name="action" value="send" /> #288 : <input type="hidden" name="eventId" value="<?= $event->entry->id; ?>" /> #289 : <div class="list-show__form-box"> #290 : <div class="row"> #291 : <?php foreach ($formFields as $key => $field) { ?> #292 : <?php if ($field['type'] === 'checkbox') { ?> #293 : <div class="col-md-12"> #294 : <div class="form-group"> #295 : <input class="form-check-input" type="<?= $field['type'] ?>" id="<?= $key ?>" name="<?= $key ?>" value="true" <?= $field['required'] ?>> #296 : <label class="form-check-label" for="<?= $key ?>"><?= $field['label'] ?><?= ($field['required'] === 'required') ? '*' : '' ?></label> #297 : </div> #298 : </div> #299 : <?php } elseif($field['type'] === 'select') { ?> #300 : <div class="col-md-6"> #301 : <div class="form-group"> #302 : <label class="list-show__label" for="<?= $key ?>"><?= $field['label'] ?><?= ($field['required'] === 'required') ? '*' : '' ?></label> #303 : <select class="list-show__input" id="<?= $key ?>" name="<?= $key ?>" <?= $field['required'] ?>> #304 : <?php foreach($field['options'] as $index => $option) { ?> #305 : <option value="<?= $index ?>"><?= $option ?></option> #306 : <?php } ?> #307 : </select> #308 : </div> #309 : </div> #310 : <?php } elseif($field['type'] === 'textarea') { ?> #311 : <div class="col-md-12"> #312 : <div class="form-group"> #313 : <label class="list-show__label" for="<?= $key ?>"><?= $field['label'] ?><?= ($field['required'] === 'required') ? '*' : '' ?></label> #314 : <textarea class="list-show__textarea" id="<?= $key ?>" name="<?= $key ?>" <?= $field['required'] ?>></textarea> #315 : </div> #316 : </div> #317 : <?php } elseif ($field['type'] === 'captcha') { ?> #318 : <div class="col-md-12"> #319 : <div class="form-group"> #320 : <label for="captcha_input" class="list-show__label"><?= $field['label'] ?><?= ($field['required'] === 'required') ? '*' : '' ?></label> #321 : #322 : <div style="display: flex; flex-direction: row; gap: 10px;"> #323 : <input type="text" name="captcha" id="captcha_input" class="list-show__input" style="margin-bottom: 0;" required> #324 : #325 : <div style="background: url('captcha.php') no-repeat; height: 30px; align-self: center;"> #326 : <img src="captcha/ani.gif" width="100" height="30"> #327 : </div> #328 : </div> #329 : </div> #330 : </div> #331 : <?php } else { ?> #332 : <div class="col-md-6"> #333 : <div class="form-group"> #334 : <label class="list-show__label" for="<?= $key ?>"><?= $field['label'] ?><?= ($field['required'] === 'required') ? '*' : '' ?></label> #335 : <input class="list-show__input" type="<?= $field['type'] ?>" id="<?= $key ?>" name="<?= $key ?>" <?= $field['required'] ?>> #336 : </div> #337 : </div> #338 : <?php } ?> #339 : <?php } ?> #340 : <div class="col-md-12"> #341 : <div class="form-group"> #342 : <input class="form-check-input" type="checkbox" id="agreement" name="agreement" required="required" value="true"> #343 : <label class="form-check-label" for="agreement">Mit Absenden der Daten erkläre ich mich mit den <a class="list-show__link" href="https://www.bonifatius-hospital-lingen.de/datenschutz/datenschutz.html">AGBs</a> und der <a class="list-show__link" href="https://www.bonifatius-hospital-lingen.de/datenschutz/datenschutz.html">Datenschutzerklärung</a> einverstanden*</label> #344 : </div> #345 : </div> #346 : <div class="col-md-12"> #347 : <span class="list-show__border">*Pflichtfelder</span> #348 : <div style="text-align: right"> #349 : <input class="list-show__btn" type="submit" value="Jetzt anmelden"> #350 : </div> #351 : </div> #352 : </div> #353 : </div> #354 : </form> #355 : <?php } ?> #356 : </div> #357 : </div> #358 : <?php } ?> #359 : #360 : <script> #361 : $(document).ready(function() { #362 : var eventImageCarousel = $(".event-image-carousel"); #363 : #364 : eventImageCarousel.owlCarousel({ #365 : singleItem: true, #366 : autoHeight: true #367 : }); #368 : #369 : $('form[name="eventRegister"]').submit(function() { #370 : $('form[name="eventRegister"] input[type=submit]').attr("disabled", "disabled"); #371 : #372 : return true; #373 : }); #374 : }); #375 : </script> #376 :