Überarbeitete Version der 1. Version. Es bestehen noch grosse Feher in einzelnen Skripten.
This commit is contained in:
@@ -53,11 +53,13 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
$reldirbase = "/../";
|
||||
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
session_start();
|
||||
}
|
||||
require_once $baseDir . '/../scripts/session_functions.php';
|
||||
|
||||
$access_granted_kampfrichter = $_SESSION['access_granted_kampfrichter'] ?? false;
|
||||
ini_wkvs_session(true);
|
||||
|
||||
$csrf_token = $_SESSION['csrf_token'] ?? '';
|
||||
|
||||
$access_granted_kampfrichter = check_user_permission('kampfrichter', true) ?? false;
|
||||
|
||||
if (!$access_granted_kampfrichter) :
|
||||
|
||||
@@ -72,7 +74,6 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require $baseDir . '/../scripts/db/db-functions.php';
|
||||
require $baseDir . '/../scripts/db/db-tables.php';
|
||||
require $baseDir . '/../scripts/csrf_functions.php';
|
||||
require $baseDir . '/../scripts/websocket/ws-create-token.php';
|
||||
|
||||
|
||||
@@ -106,7 +107,9 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
$sortprio = ['ep', 'p1', 'p1 kader', 'p2', 'p2 kader'];
|
||||
|
||||
$programmes = db_select($mysqli, $tableProgramme, 'programm', 'aktiv = ?', ['1']);
|
||||
$programmes = db_select($mysqli, $tableProgramme, 'programm, `id`', 'aktiv = ?', ['1']);
|
||||
|
||||
$indexedProgrammes = array_column($programmes, 'id', 'programm');
|
||||
|
||||
$focus_view_admin = $_SESSION['abtViewAdmin'] ?? false;
|
||||
$aktabtdb = db_get_var($mysqli, "SELECT value FROM $tableVar WHERE name = ?", ['wk_panel_current_abt']);
|
||||
@@ -117,6 +120,8 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
$notenConfig = $res->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$indexedNotenNames = array_column($notenConfig, 'name', 'id');
|
||||
|
||||
// var_dump($notenConfig);
|
||||
|
||||
//$dbprogramme = db_select($mysqli, $tableTurnerinnen, '*', 'abteilung = ? AND (bezahlt = ? OR bezahlt = ?)', [$aktabt, '2', '5'], 'id ASC');
|
||||
@@ -223,26 +228,20 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
<div class="gruppennav">
|
||||
<p>Aktuelle Abt. </p>
|
||||
<form action="/intern/kampfrichter" method="post" >
|
||||
<input type="hidden" name="csrf_token" id="prev_abt_nonce" value="<?= $csrf_token ?>">
|
||||
<input type="hidden" name="prev_abt" value="-1">
|
||||
<input type="submit" style="<?php echo $minstyle; ?>" name="prev_abt_submit" class="button_gruppe" value="<">
|
||||
</form>
|
||||
<p><?php echo $aktabt;?></p>
|
||||
<form action="/intern/kampfrichter" method="post">
|
||||
<input type="hidden" name="csrf_token" id="next_abt_nonce" value="<?= $csrf_token ?>">
|
||||
<input type="hidden" name="next_abt" value="1">
|
||||
<input type="submit" style="<?php echo $maxstyle; ?>" name="next_abt_submit" class="button_gruppe" value=">">
|
||||
</form>
|
||||
<p> / <?php echo $maxvalue; ?></p>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
/*<form method="post" style="margin-bottom: 1em;">
|
||||
<input type="hidden" name="csrf_token" id="toggle_advanced_mode_nonce" value="<?php echo csrf_token(); ?>">
|
||||
<?php //wp_nonce_field('toggle_advanced_mode_action', 'toggle_advanced_mode_nonce'); ?>
|
||||
<input type="hidden" name="togle_advanced_mode" value="-1">
|
||||
<input class="buttonNewAdminStyle" type="submit" style="<?php echo $styletogglemode; ?>" name="togle_advanced_mode_submit" class="button button-secondary" value="<?php echo $valuetogglemode;?>">
|
||||
</form>*/
|
||||
|
||||
} else {
|
||||
<?php } else {
|
||||
$aktsubabt = $_SESSION['currentsubabt'];
|
||||
$maxstyle = ($aktsubabt == $maxsubabt) ? 'background-color: rgba(68, 68, 68, 0.27) !important; pointer-events:none !important;': '';
|
||||
$minstyle = ($aktsubabt == 1) ? 'background-color: rgba(68, 68, 68, 0.27) !important; pointer-events:none !important;': '';
|
||||
@@ -252,11 +251,13 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
echo '<p>Aktuelle Gruppe </p>';
|
||||
?>
|
||||
<form action="/intern/kampfrichter" method="post" >
|
||||
<input type="hidden" name="csrf_token" id="prev_subabt_nonce" value="<?= $csrf_token ?>">
|
||||
<input type="hidden" name="prev_subabt" value="-1">
|
||||
<input type="submit" style="<?php echo $minstyle; ?>" name="prev_subabt_submit" class="button_gruppe" value="<">
|
||||
</form>
|
||||
<p><?php echo $aktsubabt;?></p>
|
||||
<form action="/intern/kampfrichter" method="post">
|
||||
<input type="hidden" name="csrf_token" id="next_subabt_nonce" value="<?= $csrf_token ?>">
|
||||
<input type="hidden" name="next_subabt" value="1">
|
||||
<input type="submit" style="<?php echo $maxstyle; ?>" name="next_subabt_submit" class="button_gruppe" value=">">
|
||||
</form>
|
||||
@@ -309,7 +310,7 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
}
|
||||
}
|
||||
|
||||
$kampfrichter = db_select($mysqli, $tableInternUsers, 'id, username, freigabe', '', [], 'username ASC' );
|
||||
$kampfrichter = db_select($mysqli, $tableInternUsers, 'id, name_person, freigabe', '', [], 'name_person ASC' );
|
||||
|
||||
$filteredKampfrichter = [];
|
||||
|
||||
@@ -340,11 +341,11 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
data-user="' . $selecteduser . '">';
|
||||
echo '<option hidden selected>---</option>';
|
||||
foreach ($filteredKampfrichter as $person) {
|
||||
$selected = $selectedKampfrichter[$i] === $person['username']
|
||||
$selected = $selectedKampfrichter[$i] === $person['name_person']
|
||||
? 'selected'
|
||||
: '';
|
||||
|
||||
echo '<option id="'.$selectedKampfrichter[$i].'" value="'.$person['username'].'" '.$selected.'>'.$person['username'].'</option>';
|
||||
echo '<option id="'.$selectedKampfrichter[$i].'" value="'.$person['name_person'].'" '.$selected.'>'.$person['name_person'].'</option>';
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
@@ -356,13 +357,16 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
if ($selecteduser === 'admin'){
|
||||
$valuetogglemodeadmin = ($focus_view_admin == true) ? 'nach Programmen sortieren (Admin)' : 'nach Abteilungen sortieren (Admin)';
|
||||
$styletoggleadmin = ($focus_view_admin == true) ? 'background-color: #003;' : 'background-color: #030;';
|
||||
|
||||
?>
|
||||
|
||||
echo '<form method="post" style="margin-bottom: 1em;">';
|
||||
echo '<input type="hidden" name="csrf_token" id="toggle_advanced_mode_admin_nonce" value="'.csrf_token().'">';
|
||||
//wp_nonce_field('toggle_advanced_mode_admin_action', 'toggle_advanced_mode_admin_nonce');
|
||||
echo '<input type="hidden" name="togle_advanced_mode_admin" value="-1">';
|
||||
echo '<input type="submit" style="'.$styletoggleadmin.'" name="togle_advanced_mode_admin_submit" class="buttonNewAdminStyle" value="'.$valuetogglemodeadmin.'">';
|
||||
echo '</form>';
|
||||
<form method="post" style="margin-bottom: 1em;">
|
||||
<input type="hidden" name="csrf_token" id="toggle_advanced_mode_admin_nonce" value="<?= $csrf_token ?>">
|
||||
<input type="hidden" name="togle_advanced_mode_admin" value="-1">
|
||||
<input type="submit" style="<?= $styletoggleadmin ?>" name="togle_advanced_mode_admin_submit" class="buttonNewAdminStyle" value="<?= $valuetogglemodeadmin ?>">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
if ($selecteduser !== 'admin'){
|
||||
echo '<p class="text_akt_abt">Aktuelle Abteilung '.$aktabt.' von '.$maxvalue.' ('.htmlspecialchars(strtoupper($allprogrammeabtstrcleared)).')</p><a class="text_akt_abt" href="https://www.gymnastics.sport/publicdir/rules/files/en_1.1.%20WAG%20Code%20of%20Points%202025-2028.pdf" target="_blank">CoP 2025-2028</a><a class="text_akt_abt" href="https://www.stv-fsg.ch/fileadmin/user_upload/Wettkampfprogramm_2025-2028_13.11.2025.pdf" target="_blank">STV 2025-2028</a>';
|
||||
@@ -630,12 +634,13 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
$arrayNameMap = array_change_key_case(array_column($disciplines, 'id', 'name'), CASE_LOWER);
|
||||
$itemsToLoop[] = ['name' => $selecteduser, 'id' => $arrayNameMap[$selecteduser] ?? null];
|
||||
}
|
||||
// var_dump($itemsToLoop);
|
||||
|
||||
$indexedDisciplines = array_column($disciplines, 'name', 'id');
|
||||
?>
|
||||
|
||||
<div class="div_edit_values_user_outer">
|
||||
<div class="div_edit_values_user" style="display: none;">
|
||||
<h3 class="heading_fv_selturnerin">
|
||||
<h3 class="heading_fv_selturnerin" tabindex="-1">
|
||||
Aktuelle Turnerin:
|
||||
<span class="current-turnerin-name"></span>
|
||||
</h3>
|
||||
@@ -647,38 +652,40 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
<?php if (isAdmin()) : ?>
|
||||
<h4><?= $d['name'] ?></h4>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($notenConfig as $nc) :
|
||||
$isProGeraet = (intval($nc['pro_geraet']) === 1);
|
||||
$allowedGeraete = !empty($nc['geraete_json']) ? json_decode($nc['geraete_json'], true) : [];
|
||||
|
||||
if (!$isProGeraet && !in_array($d['id'], $allowedGeraete)) { continue; }
|
||||
|
||||
$disabled = ($nc['type'] === 'berechnung') ? 'disabled' : '';
|
||||
?>
|
||||
<div class="allNotentable">
|
||||
<div class="singleNotentable">
|
||||
<?php foreach ($notenConfig as $nc) :
|
||||
$isProGeraet = (intval($nc['pro_geraet']) === 1);
|
||||
$allowedGeraete = !empty($nc['geraete_json']) ? json_decode($nc['geraete_json'], true) : [];
|
||||
|
||||
if (!$isProGeraet && !in_array($d['id'], $allowedGeraete)) { continue; }
|
||||
|
||||
$disabled = ($nc['type'] === 'berechnung') ? 'disabled' : '';
|
||||
?>
|
||||
|
||||
<table class="titleWidthNormalInput editkampfrichter_user note-container" data-note-id="<?= $nc['id'] ?>" data-runs-config='<?= htmlspecialchars($nc['anzahl_laeufe_json'] ?? '{"default":1}') ?>'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="<?= $nc['id'] ?>-field-th note-name-header"><?= $nc['name'] ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="inputs-row">
|
||||
<td class="nopadding input-cell-run-1">
|
||||
<input type="number" class="ajax-input fullinput changebleValue"
|
||||
data-person-id=""
|
||||
data-field-type-id="<?= $nc['id'] ?>"
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
data-run="1"
|
||||
value=""
|
||||
min="0" max="20" step="0.005" <?= $disabled ?>>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endforeach ?>
|
||||
|
||||
<table class="titleWidthNormalInput editkampfrichter_user note-container" data-note-id="<?= $nc['id'] ?>" data-runs-config='<?= htmlspecialchars($nc['anzahl_laeufe_json'] ?? '{"default":1}') ?>'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="<?= $nc['id'] ?>-field-th note-name-header"><?= $nc['name'] ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="inputs-row">
|
||||
<td class="nopadding input-cell-run-1">
|
||||
<input type="number" class="ajax-input fullinput changebleValue"
|
||||
data-person-id=""
|
||||
data-field-type-id="<?= $nc['id'] ?>"
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
data-run="1"
|
||||
value=""
|
||||
min="0" max="20" step="0.005" <?= $disabled ?>>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!isAdmin()) : ?>
|
||||
<p class="editkampfrichter_user_text">Die Endnote wird wie folgt automatisch berrechnet: Endnote <?= $d['name'] ?> = 10 - E<sub>Ø</sub> Note + D Note - Neutrale Abzüge</p>
|
||||
<?php endif; ?>
|
||||
@@ -687,13 +694,27 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
data-person-id=""
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
value="Turnerin anzeigen">
|
||||
<input type="button" class="submit-display-start"
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
value="Start freigeben">
|
||||
<input type="button" class="submit-display-result"
|
||||
data-person-id=""
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
value="Ergebnis anzeigen">
|
||||
|
||||
<div class="div-submit-display-start">
|
||||
<input type="button" class="submit-display-start start"
|
||||
data-person-id=""
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
data-type="1"
|
||||
value="Startfreigabe erteilen">
|
||||
<input type="button" class="submit-display-start stopp"
|
||||
data-person-id=""
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
data-type="0"
|
||||
value="Startfreigabe enziehen">
|
||||
</div>
|
||||
|
||||
<div class="div-submit-display-result">
|
||||
<input type="button" class="submit-display-result"
|
||||
data-person-id=""
|
||||
data-geraet-id="<?= $d['id'] ?>"
|
||||
data-run="1"
|
||||
value="Ergebnis anzeigen">
|
||||
</div>
|
||||
|
||||
<?php if (strtolower($d["name"]) === 'boden') : ?>
|
||||
<div class="playcontrolDiv">
|
||||
@@ -761,6 +782,14 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
|
||||
// Extended Disciplines, contains the 0 disc
|
||||
|
||||
$disciplinesExtended = array_merge(
|
||||
[["id" => 0, "name" => "None"]],
|
||||
$disciplines
|
||||
);
|
||||
|
||||
foreach ($grouped as $abteilung => $entries_group) :
|
||||
// ... (PDF path and H3 tag)
|
||||
|
||||
@@ -822,6 +851,56 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
$entries_to_display = $entries_group;
|
||||
}
|
||||
|
||||
// Table Header creator with run columns
|
||||
|
||||
$arrayIndexedNoten = [];
|
||||
$arrayIndexedNotenHeader = [];
|
||||
$uidN = 0;
|
||||
|
||||
foreach ($entries_group as $row) :
|
||||
foreach ($disciplinesExtended as $discipline) :
|
||||
|
||||
// Check if the current user/admin is allowed to see this specific discipline
|
||||
if ($discipline['id'] === 0 || $selecteduser === strtolower($discipline['name']) || $selecteduser === 'admin') :
|
||||
|
||||
// 2. Now iterate through the scoring configurations for this discipline
|
||||
foreach ($notenConfig as $snC) {
|
||||
$showAdmin = isAdmin() && intval($snC['zeige_in_tabelle_admin']) === 1;
|
||||
$showPublic = !isAdmin() && intval($snC['zeige_in_tabelle']) === 1;
|
||||
|
||||
if (!($showAdmin || $showPublic)) { continue; }
|
||||
|
||||
if (intval($snC['pro_geraet']) === 1 && intval($discipline['id']) === 0) { continue; }
|
||||
|
||||
if (intval($snC['pro_geraet']) !== 1) {
|
||||
$allowedGeraete = !empty($snC['geraete_json']) ? json_decode($snC['geraete_json'], true) : [];
|
||||
if (!in_array($discipline['id'], $allowedGeraete)) { continue; }
|
||||
}
|
||||
|
||||
$mobile = (intval($snC['zeige_in_tabelle_mobile']) === 1) ? "" : "notMobile";
|
||||
|
||||
// Logic to fetch and format the value
|
||||
$defaultValue = $snC['default_value'] ?? 0;
|
||||
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
$runs = $runsJSON[$discipline['id']][$indexedProgrammes[$row['programm'] ?? ''] ?? ''] ?? $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++) :
|
||||
$note = $notenIndexed[$row['id']][$discipline['id']][$snC['id']][$r] ?? $defaultValue;
|
||||
$normalizedNote = number_format($note, $snC['nullstellen'] ?? 2);
|
||||
|
||||
$arrayIndexedNoten[intval($row['id'])][intval($discipline['id'])][intval($snC['id'])][intval($r)] = ["value" => $normalizedNote, "mobile" => $mobile];
|
||||
$arrayIndexedNotenHeader[intval($discipline['id'])][intval($snC['id'])][intval($r)] = ["mobile" => $mobile];
|
||||
|
||||
$uidN++;
|
||||
endfor;
|
||||
}
|
||||
endif;
|
||||
endforeach;
|
||||
endforeach;
|
||||
|
||||
|
||||
$localPath = $_SERVER['DOCUMENT_ROOT'] . "/wp-content/ergebnisse/KTBB_Ergebnisse_" . $abteilung . "_" . $current_year . ".pdf";
|
||||
echo '<div class="singleAbtDiv">';
|
||||
if ($selecteduser === 'admin') echo '<h2 class="titleSingleAbt">'. strtoupper($abteilung);
|
||||
@@ -835,12 +914,9 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
echo '<th>'.$textheadingrang.'</th>';
|
||||
}
|
||||
|
||||
if ($focus_view_admin == true){
|
||||
if (!isAdmin() || $focus_view_admin == true){
|
||||
echo '<th>RF</th>';
|
||||
}
|
||||
if ($selecteduser !== 'admin'){
|
||||
echo '<th></th>';
|
||||
} ?>
|
||||
}?>
|
||||
<th>Name</th>
|
||||
<?php if ($selecteduser === 'admin') { echo '<th>Jg.</th>'; } ?>
|
||||
<th class="notMobile">Verein</th>
|
||||
@@ -848,7 +924,23 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
<?php if ($selecteduser === 'admin' || $selecteduser === 'boden'){ ?>
|
||||
<th class="notMobile">Musik Boden</th>
|
||||
<?php }
|
||||
// 1. Iterate through disciplines first
|
||||
|
||||
foreach ($arrayIndexedNotenHeader as $dis => $aNtypes) :
|
||||
foreach ($aNtypes as $nType => $aRuns) :
|
||||
$displayRunType = count($aRuns) > 1;
|
||||
foreach ($aRuns as $run => $cArray) :
|
||||
$displayRunString = $displayRunType ? '<sup>' . $run . '</sup>' : '';
|
||||
$displayDisciplinesString = isset($indexedDisciplines[$dis]) ? ' ' . $indexedDisciplines[$dis] : '';
|
||||
?>
|
||||
<th class="<?= $cArray["mobile"] ?>">
|
||||
<?= $indexedNotenNames[$nType] ?><?= $displayRunString ?><?= $displayDisciplinesString ?>
|
||||
</th>
|
||||
<?php endforeach;
|
||||
endforeach;
|
||||
endforeach;
|
||||
|
||||
|
||||
/*// 1. Iterate through disciplines first
|
||||
foreach ($disciplines as $discipline) {
|
||||
$lowdiscipline = strtolower($discipline['name']);
|
||||
|
||||
@@ -864,14 +956,35 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
if (intval($snC['pro_geraet']) !== 1) {
|
||||
$allowedGeraete = !empty($snC['geraete_json']) ? json_decode($snC['geraete_json'], true) : [];
|
||||
if (!in_array($discipline['id'], $allowedGeraete)) { continue; }
|
||||
}
|
||||
}
|
||||
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
if (isset($runsJSON[$discipline['id']])) {
|
||||
$runs = $runsJSON[$discipline['id']];
|
||||
|
||||
foreach ($runs as $r) : ?>
|
||||
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] . ' ' . ucfirst($lowdiscipline) ?>
|
||||
</th>
|
||||
|
||||
<?php endforeach;
|
||||
} else {
|
||||
$runs = $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++) : ?>
|
||||
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] . ' ' . ucfirst($lowdiscipline) ?>
|
||||
</th>
|
||||
|
||||
<?php endfor;
|
||||
}
|
||||
|
||||
$mobile = (intval($snC['zeige_in_tabelle_mobile']) === 1) ? "" : "notMobile";
|
||||
?>
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] . ' ' . ucfirst($lowdiscipline) ?>
|
||||
</th>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
endif;
|
||||
}
|
||||
@@ -887,13 +1000,34 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
$allowedGeraete = !empty($snC['geraete_json']) ? json_decode($snC['geraete_json'], true) : [];
|
||||
if (!in_array(0, $allowedGeraete)) { continue; }
|
||||
$mobile = (intval($snC['zeige_in_tabelle_mobile']) === 1) ? "" : "notMobile";
|
||||
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
if (isset($runsJSON[0][$snC['id']])) {
|
||||
$runs = $runsJSON[0][$snC['id']];
|
||||
|
||||
foreach ($runs as $r) : ?>
|
||||
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] ?>
|
||||
</th>
|
||||
|
||||
<?php endforeach;
|
||||
} else {
|
||||
$runs = $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++) : ?>
|
||||
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] ?>
|
||||
</th>
|
||||
|
||||
<?php endfor;
|
||||
}
|
||||
?>
|
||||
<th class="<?= $mobile ?>">
|
||||
<?= $snC['name'] ?>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
?>
|
||||
<th>Edit</th>
|
||||
@@ -938,7 +1072,29 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
$notMobileNotAdmin = ($selecteduser !== 'admin') ? 'notMobile' : '';
|
||||
|
||||
|
||||
foreach ($disciplines as $discipline) {
|
||||
|
||||
foreach ($arrayIndexedNotenHeader as $dis => $aNtypes) :
|
||||
foreach ($aNtypes as $nType => $aRuns) :
|
||||
foreach ($aRuns as $run => $cArray) :
|
||||
if (isset($arrayIndexedNoten[intval($row['id'])][intval($dis)][intval($nType)][intval($run)])) : ?>
|
||||
<td class="<?= $cArray["mobile"] ?> changebleValue"
|
||||
data-field-type-id="<?= $nType ?>"
|
||||
data-geraet-id="<?= $dis ?>"
|
||||
data-person-id="<?= $row["id"] ?>"
|
||||
data-run="<?= $run ?>">
|
||||
<?= $arrayIndexedNoten[intval($row['id'])][intval($dis)][intval($nType)][intval($run)]["value"] ?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class="<?= $cArray["mobile"] ?>">
|
||||
---
|
||||
</td>
|
||||
<?php endif;
|
||||
endforeach;
|
||||
endforeach;
|
||||
endforeach;
|
||||
|
||||
|
||||
/*foreach ($disciplines as $discipline) {
|
||||
$lowdiscipline = strtolower($discipline['name']);
|
||||
|
||||
// Check if the current user/admin is allowed to see this specific discipline
|
||||
@@ -960,18 +1116,26 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
// Logic to fetch and format the value
|
||||
$defaultValue = $snC['default_value'] ?? 0;
|
||||
$note = $notenIndexed[$row['id']][$discipline['id']][$snC['id']][1] ?? $defaultValue;
|
||||
$normalizedNote = number_format($note, $snC['nullstellen'] ?? 2);
|
||||
?>
|
||||
|
||||
|
||||
<td class="<?= $mobile ?> changebleValue"
|
||||
data-field-type-id="<?= intval($snC['id']) ?>"
|
||||
data-geraet-id="<?= intval($discipline['id']) ?>"
|
||||
data-person-id="<?= intval($row['id']) ?>">
|
||||
<?= $normalizedNote ?>
|
||||
</td>
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
<?php
|
||||
$runs = $runsJSON[$discipline['id']][$indexedProgrammes[$row['programm'] ?? ''] ?? ''] ?? $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++) :
|
||||
$note = $notenIndexed[$row['id']][$discipline['id']][$snC['id']][$r] ?? $defaultValue;
|
||||
$normalizedNote = number_format($note, $snC['nullstellen'] ?? 2);
|
||||
?>
|
||||
|
||||
<td class="<?= $mobile ?> changebleValue"
|
||||
data-field-type-id="<?= intval($snC['id']) ?>"
|
||||
data-geraet-id="<?= intval($discipline['id']) ?>"
|
||||
data-person-id="<?= intval($row['id']) ?>"
|
||||
data-run="<?= intval($r) ?>">
|
||||
<?= $normalizedNote ?>
|
||||
</td>
|
||||
|
||||
<?php endfor;
|
||||
}
|
||||
endif;
|
||||
}
|
||||
@@ -988,19 +1152,27 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
// Logic to fetch and format the value
|
||||
$defaultValue = $snC['default_value'] ?? 0;
|
||||
$note = $notenIndexed[$row['id']][0][$snC['id']][1] ?? $defaultValue;
|
||||
$normalizedNote = number_format($note, $snC['nullstellen'] ?? 2);
|
||||
?>
|
||||
|
||||
<td class="<?= $mobile ?> changebleValue"
|
||||
data-field-type-id="<?= intval($snC['id']) ?>"
|
||||
data-geraet-id="0"
|
||||
data-person-id="<?= intval($row['id']) ?>">
|
||||
<?= $normalizedNote ?>
|
||||
</td>
|
||||
<?php
|
||||
$runsJSON = !empty($snC['anzahl_laeufe_json']) ? json_decode($snC['anzahl_laeufe_json'], true) : [];
|
||||
|
||||
$runs = $runsJSON[0][$indexedProgrammes[$row['programm'] ?? ''] ?? ''] ?? $runsJSON["default"] ?? 1;
|
||||
|
||||
for ($r = 1; $r <= $runs; $r++) :
|
||||
$note = $notenIndexed[$row['id']][0][$snC['id']][1] ?? $defaultValue;
|
||||
$normalizedNote = number_format($note, $snC['nullstellen'] ?? 2);
|
||||
?>
|
||||
|
||||
<td class="<?= $mobile ?> changebleValue"
|
||||
data-field-type-id="<?= intval($snC['id']) ?>"
|
||||
data-geraet-id="0"
|
||||
data-person-id="<?= intval($row['id']) ?>"
|
||||
data-run="<?= intval($r) ?>">
|
||||
<?= $normalizedNote ?>
|
||||
</td>
|
||||
|
||||
<?php endfor;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
/*if ($selecteduser === 'admin') {
|
||||
@@ -1072,22 +1244,7 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
if ($selecteduser === 'admin'){
|
||||
echo '<p style="font-weight:600; margin: 0px;">Gesamt: '.$total_count.' '.$mehrzahl.'</p>';
|
||||
}
|
||||
if ($selecteduser === 'admin' && $focus_view_admin == false) : ?>
|
||||
<div class="admin-kampfrichter-berechnung-container">
|
||||
<form method="post" style="margin-top:20px;">
|
||||
<?php //wp_nonce_field('recalculate_all_scores', 'recalculate_nonce');
|
||||
echo '<input type="hidden" name="csrf_token" id="recalculate_nonce" value="'.csrf_token().'">';
|
||||
?>
|
||||
<input class="admin-kampfrichter-berechnung-button buttonNewAdminStyle" type="submit" name="recalculate_scores" value="Gesamtpunktzahl für alle Einträge berechnen">
|
||||
</form>
|
||||
<form method="post" style="margin-top:20px;">
|
||||
<?php //wp_nonce_field('reset_all_scores', 'reset_nonce');
|
||||
echo '<input type="hidden" name="csrf_token" id="reset_nonce" value="'.csrf_token().'">';
|
||||
?>
|
||||
<input class="admin-kampfrichter-berechnung-reset-button buttonNewAdminStyle" type="submit" name="reset_scores" value="Ränge Zurücksetzten">
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
?>
|
||||
</div>
|
||||
<div class="noKampfrichterDiv"><h1>Keine Kampfrichterinnen ausgewählt</h1></div>
|
||||
<?php else : ?>
|
||||
@@ -1095,7 +1252,6 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
<?php endif;?>
|
||||
<div class="divLiveSyncronisation"><h2 class="heading-pannel flexRow" id="wsInfo">Live Synchronsation: <span class="fullHeightRectangle" id="wsInfoRectangle"></span></h2></div>
|
||||
</section>
|
||||
<div class="msgDiv"></div>
|
||||
|
||||
<?php
|
||||
$topBg = '#424242';
|
||||
@@ -1147,7 +1303,7 @@ $baseDir = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
<script>
|
||||
window.FREIGABE = "<?php echo $selectedfreigabe; ?>";
|
||||
window.CSDR_TOKEN = "<?php echo $_SESSION['csrf_token'] ?? csrf_token(); ?>";
|
||||
window.CSDR_TOKEN = "<?= $csrf_token; ?>";
|
||||
window.WS_ACCESS_TOKEN = "<?= generateWSToken('kampfrichter') ?>";
|
||||
window.AKTUELLES_JAHR = "<?= $current_year ?>";
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user