WKVS v 1.0.0
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
// ========== Form handling logic ==========
|
||||
$form_message = $_SESSION['form_message'] ?? '';
|
||||
unset($_SESSION['form_message']);
|
||||
|
||||
if (isset($_POST['prev_abt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $aktabt;
|
||||
if ($value > 1){
|
||||
$value -= 1;
|
||||
db_update_variable($mysqli, $db_tabelle_var, ['wk_panel_current_abt', $value]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['next_abt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $aktabt;
|
||||
$maxvalue = (int) (db_get_var($mysqli, "SELECT `order_index` FROM $db_tabelle_gruppen ORDER BY `order_index` DESC LIMIT 1") ?? 1);
|
||||
|
||||
if ($value < $maxvalue){
|
||||
$value += 1;
|
||||
db_update_variable($mysqli, $db_tabelle_var, ['wk_panel_current_abt', $value]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['prev_subabt_admin_submit']) && $isAdmin) {
|
||||
verify_csrf();
|
||||
$value = $akt_subabt_admin;
|
||||
if ($value > 1){
|
||||
$value -= 1;
|
||||
db_update_variable($mysqli, $db_tabelle_var, ['wk_panel_current_subabt_admin', $value]);
|
||||
$_SESSION['ws_Message_json'] = json_encode(['type' => 'UPDATE_RANKLIVE_C_SUBABT', 'payload' => []]);
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['next_subabt_admin_submit']) && $isAdmin) {
|
||||
verify_csrf();
|
||||
$value = $akt_subabt_admin;
|
||||
$max_value_admin_subabt = count($disciplines);
|
||||
|
||||
if ($value < $max_value_admin_subabt){
|
||||
$value += 1;
|
||||
db_update_variable($mysqli, $db_tabelle_var, ['wk_panel_current_subabt_admin', $value]);
|
||||
$_SESSION['ws_Message_json'] = json_encode(['type' => 'UPDATE_RANKLIVE_C_SUBABT', 'payload' => []]);
|
||||
}
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($_SESSION['currentsubabt'])){
|
||||
$_SESSION['currentsubabt'] = 1;
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['last_abt'])){
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
}
|
||||
|
||||
if ($_SESSION['last_abt'] !== $aktabt){
|
||||
$_SESSION['currentsubabt'] = 1;
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
}
|
||||
|
||||
if (isset($_POST['prev_subabt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $_SESSION['currentsubabt'];
|
||||
if ($value > 1){
|
||||
$_SESSION['currentsubabt']--;
|
||||
$_SESSION['currentEditId'] = false;
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['next_subabt_submit'])) {
|
||||
verify_csrf();
|
||||
$value = $_SESSION['currentsubabt'];
|
||||
if ($value < $max_subabt){
|
||||
$_SESSION['currentsubabt']++;
|
||||
$_SESSION['currentEditId'] = false;
|
||||
$_SESSION['last_abt'] = $aktabt;
|
||||
}
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['prog_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
|
||||
$_SESSION['view_type_admin'] = 'prog';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['abt_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
|
||||
$_SESSION['view_type_admin'] = 'abt';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['live_view_admin_submit'])) {
|
||||
verify_csrf();
|
||||
|
||||
$_SESSION['view_type_admin'] = 'live';
|
||||
|
||||
header("Location: /intern/kampfrichter");
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user