Bezahlt'; case 4: case 1: return '
In Bearbeitung
'; case 3: case 0: return '
Nicht bezahlt
'; case 6: return '
A
'; default: return ''; } } $svgbezahlt = '
Bezahlt
'; $svgpending = '
In Bearbeitung
'; $svgnichtbezahlt = '
Nicht bezahlt
'; $svg_cart = ''; $disciplines = db_select($mysqli, $tableGeraete, '*', '', [], 'start_index ASC'); $indexedDisciplines = array_column($disciplines, null, 'id'); $vereine_db = db_select($mysqli, $tableVereine, "verein", "", [], "verein ASC"); $vereine = array_column($vereine_db, 'verein'); $current_year = date('Y'); $monat = date('n'); if ($monat > 6) $current_year++; $dbProgramme = db_select($mysqli, $tableProgramme, 'programm', 'aktiv = ?', [1], 'programm ASC'); $programmes = array_column($dbProgramme, 'programm'); $userid = (int)$_SESSION['user_id_trainer'] ?? 0; $arrayfreigaben = []; if ($userid > 0) { $freigabe_json = db_get_var($mysqli, "SELECT freigabe FROM $tableInternUsers WHERE id = ?", [$userid]); if (is_string($freigabe_json) && $freigabe_json !== '') { $arrayfreigaben = json_decode($freigabe_json, true) ?: []; $arrayfreigaben = $arrayfreigaben['freigabenTrainer'] ?? []; } } if (!empty($arrayfreigaben)) { $selectedverein = $_SESSION['selectedFreigabeTrainer'] ?? ''; if (!in_array($selectedverein, $arrayfreigaben)) { $selectedverein = $arrayfreigaben[0]; $_SESSION['selectedFreigabeTrainer'] = $selectedverein; } } $isAdmin = $selectedverein === "admin"; require $baseDir . "/../scripts/trainer/post-handler.php"; $timeZone = new \DateTimeZone('Europe/Zurich'); $formatter = new \IntlDateFormatter( 'de_CH', \IntlDateFormatter::FULL, \IntlDateFormatter::NONE, $timeZone, null, 'd. MMMM YYYY' ); $sortprio = []; $displayLogo = $_SESSION['logoDisplay'] ?? true; $rechnungenPostversand = db_get_variable($mysqli, $tableVar, ['rechnungenPostversand']); $rechnungenPostversandKosten = db_get_variable($mysqli, $tableVar, ['rechnungenPostversandKosten']); $personEinzahl = db_get_variable($mysqli, $tableVar, ['personEinzahl']); if ($personEinzahl === null) $personEinzahl = 'Person'; $personMehrzahl = db_get_variable($mysqli, $tableVar, ['personMehrzahl']); if ($personMehrzahl === null) $personMehrzahl = 'Personen'; ?>

Warenkorb Startgebühren

query("SELECT * FROM `$tableOrders` WHERE user_id = $iduser AND order_status = 0"); if (!$result) { die("Query failed: " . $mysqli->error); } $rows = $result->fetch_all(MYSQLI_ASSOC); $query = "SELECT * FROM `$tableBasketItems` WHERE user_id = $iduser"; $result = $mysqli->query($query); if (!$result) { echo json_encode(['success' => false, 'message' => 'Select failed: ' . $mysqli->error]); exit; } $item_ids = []; $entries = []; $querytudb = ''; $totalprice = 0; while ($row = $result->fetch_assoc()) { $entries[] = $row; if (!in_array($row['item_id'], $item_ids)) { $item_ids[] = $row['item_id']; } if ($querytudb !== '') { $querytudb .= " OR"; } $querytudb .= " id = " . (int)$row['item_id']; } // Step 2: Fetch related data from $table_name_turnerinnen $entriestable = []; if ($querytudb !== '') { $querytu = "SELECT `name`, `vorname`, `verein`, `programm`, id FROM $tableTeilnehmende WHERE $querytudb ORDER BY name DESC"; $resulttu = $mysqli->query($querytu); if (!$resulttu) { echo json_encode(['success' => false, 'message' => 'Select failed: ' . $mysqli->error]); exit; } $arrayprog = []; $queryprogdb = ''; while ($row = $resulttu->fetch_assoc()) { $entriestable[] = $row; if (!in_array($row['programm'], $arrayprog)) { $arrayprog[] = $row['programm']; if ($queryprogdb !== '') { $queryprogdb .= " OR "; } $queryprogdb .= "programm = '" . $mysqli->real_escape_string($row['programm']) . "'"; } } if ($queryprogdb !== '') { $queryprog = "SELECT * FROM $tableProgramme WHERE $queryprogdb ORDER BY programm DESC"; $resultprog = $mysqli->query($queryprog); if (!$resultprog) { echo json_encode(['success' => false, 'message' => 'Select failed: ' . $mysqli->error]); exit; } while ($row = $resultprog->fetch_assoc()) { foreach ($entriestable as &$entry) { if ($row['programm'] === $entry['programm']) { $entry['startgebuer'] = $row['preis']; $totalprice += $row['preis']; } } } unset($entry); // always unset after using & to avoid accidental reuse } } $basketIsEmptyClass = ($entriestable && is_array($entriestable) && count($entriestable) > 0) ? '' : 'hidden'; $basketIsNotEmptyClass = ($entriestable && is_array($entriestable) && count($entriestable) > 0) ? 'hidden' : ''; ?>
0) { foreach ($entriestable as $entry) { echo ''; } } echo ''; ?>
' . $entry['name'] . ', ' . $entry['vorname'] . ' | ' . $entry['programm'] . ' ' . $entry['startgebuer'] . ' Fr.
Total: ' . number_format((float) $totalprice, 2, '.', '') . ' Fr.

Es wurden keine Startgebühren ausgwählt

Trainerpanel

'Automatisch', 3 => 'Nicht bezahlt', 4 => 'In Bearbeitung', 5 => 'Bezahlt' ]; $hasPostBezahlt = isset($_POST['bezahltOverride']) && in_array((int)$_POST['bezahltOverride'], array_keys($araryBezahlt)); $postBezahlt = (int)$_POST['bezahltOverride'] ?? 0; $postStrBezahlt = $araryBezahlt[$postBezahlt]; ?>
    $strBezahltStatus): ?>
Formular leeren

Mehrere hinzufügen

  1. Vorlage herunterladen:
    Vorlage Tabelle
  2. Heruntergeladene Tablle den Anweisungen nach ausfüllen.
  3. Ausgefüllte Vorlage hochladen:
  4. Datensätze importieren:

Eingabetool noch nicht freigeschalten

(Keine aktiven Programme)

Alle :

prepare($sql); if (!$stmt->execute()) { http_response_code(500); exit; } // get result set $result = $stmt->get_result(); // fetch all rows as associative array $entries = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); // Filter for non-admins if (!$isAdmin) { $entries = array_filter($entries, function ($row) use ($selectedverein) { return $row['verein'] === $selectedverein; }); } $grouped = []; foreach ($entries as $entry) { $key = $entry['programm']; $grouped[$key][] = $entry; } $idsEntriesArray = array_column($entries, 'id'); $placeholders = ''; if (!empty($idsEntriesArray)) { $placeholders = implode(', ', array_fill(0, count($idsEntriesArray), '?')); $sqlQuery = "SELECT paf.`person_id`, paf.`geraet_id`, paf.`audiofile_id`, af.`file_name`, af.`file_path` FROM $tableTeilnehmendeAudiofiles paf LEFT JOIN $tableAudiofiles af ON af.`id` = paf.`audiofile_id` WHERE paf.`person_id` IN ($placeholders) "; $stmt = $mysqli->prepare($sqlQuery); $stmt->bind_param(str_repeat('i', count($idsEntriesArray)), ...$idsEntriesArray); $stmt->execute(); $result = $stmt->get_result(); $audiofilesPersonen = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); $indexedAudiofilesPersonen = []; foreach ($audiofilesPersonen as $sAf) { $indexedAudiofilesPersonen[$sAf['person_id']][$sAf['geraet_id']] = ["audiofile_id" => $sAf['audiofile_id'], "file_name" => $sAf['file_name'], "file_path" => $sAf['file_path']]; } } // Sort the grouped keys by defined priority uksort($grouped, function ($a, $b) use ($sortprio) { $a_index = array_search($a, $sortprio); $b_index = array_search($b, $sortprio); $a_index = $a_index === false ? PHP_INT_MAX : $a_index; $b_index = $b_index === false ? PHP_INT_MAX : $b_index; return $a_index <=> $b_index; }); $total_count = 0; $invalidProgrammes = false; if (!empty($grouped)): ?>

Bulk Select:

'Automatisch', 3 => 'Nicht bezahlt', 4 => 'In Bearbeitung', 5 => 'Bezahlt' ]; ?>
  • Programm ändern
  • Bezahlt Status ändern
  • Startgebühren bezahlen
  • Personen löschen
$entries_group): $count = count($entries_group); $total_count += $count; ?>

$sDisc): if ((int)$sDisc['audiofile'] === 1): ?> $sDisc): if ((int)$sDisc['audiofile'] === 1): $hasMusic = isset($indexedAudiofilesPersonen[$row['id']][$sDisc['id']]); $musicClass = $hasMusic ? 'hasMusic' : 'noMusic'; $musicText = $hasMusic ? ($indexedAudiofilesPersonen[$row['id']][$sDisc['id']]['file_name'] ?? 'ERROR') : 'Musik hochladen'; ?>
Name Geburtsdatum Programm Verein Startgebühr Musik Aktionen
, format(new \DateTimeImmutable($row['geburtsdatum'], $timeZone))) ?> >

1) ? $personMehrzahl : $personEinzahl ?>

Gesamtanzahl :

Noch keine Datensätze vorhanden.

displayMsg(' . (int)$_SESSION['form_message_type'] . ', "' . $_SESSION['form_message'] . '");'; unset($_SESSION['form_message']); unset($_SESSION['form_message_type']); } ?>