Neuer Kurs

' . htmlspecialchars($errors[$name]) . '

' : ''; if($type === 'textarea') { return << {$errorMessage} HTML; } return << {$errorMessage} HTML; } echo '
'; foreach ($labels as $name => $label) { if($name === "|") { echo '
'; echo '
'; } else { echo createInputField($label, $name, $errors, $validData, $type = $name === 'beschreibung' ? 'textarea' : 'input'); } } echo '
'; ?>
getMyCourses(); $doc = new DOMDocument('1.0', 'UTF-8'); if (!empty($courses)) { echo '
'; foreach ($courses as $kurs) { $courseCard = $doc->createElement('div'); $courseCard->setAttribute('class', 'course-card'); $courseImage = $doc->createElement('div'); $courseImage->setAttribute('class', 'course-image'); $courseCard->appendChild($courseImage); $courseContent = $doc->createElement('div'); $courseContent->setAttribute('class', 'course-content'); $courseCard->appendChild($courseContent); $courseLeft = $doc->createElement('div'); $courseLeft->setAttribute('class', 'course-left'); $courseContent->appendChild($courseLeft); $note = $doc->createElement('div', htmlspecialchars($kurs['note'] ?? 'Keine Bewertung') . ' ★'); $courseLeft->appendChild($note); $name = $doc->createElement('div', htmlspecialchars($kurs['name'])); $courseLeft->appendChild($name); $address = $doc->createElement('div', htmlspecialchars($kurs['strasse'] . ', ' . $kurs['stadt'] . ' ' . $kurs['plz'])); $courseLeft->appendChild($address); $courseRight = $doc->createElement('div'); $courseRight->setAttribute('class', 'course-right'); $courseContent->appendChild($courseRight); $price = $doc->createElement('div', htmlspecialchars($kurs['preis']) . ' €'); $courseRight->appendChild($price); $category = $doc->createElement('div', htmlspecialchars($kurs['kategorie'] ?? 'Keine Kategorie')); $courseRight->appendChild($category); echo $doc->saveHTML($courseCard); } echo '
'; } else { echo '

Keine Kurse gefunden.

'; } ?>