admin: add AJAX fallback for wahl phase count; use ajax in force-zuteilung JS
All checks were successful
Deploy Workshop-Wahlen (DEV / PROD) / deploy (push) Successful in 11s
All checks were successful
Deploy Workshop-Wahlen (DEV / PROD) / deploy (push) Successful in 11s
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
<?php
|
||||
// AJAX endpoint to return wahl details (anzahl_einheiten)
|
||||
add_action('wp_ajax_kc_get_wahl', function(){
|
||||
global $wpdb;
|
||||
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
|
||||
if (!$id) {
|
||||
wp_send_json_error('missing id');
|
||||
}
|
||||
$row = $wpdb->get_row($wpdb->prepare("SELECT id, COALESCE(anzahl_einheiten,1) as anzahl_einheiten FROM {$wpdb->prefix}kc_wahlen WHERE id=%d", $id));
|
||||
if (!$row) wp_send_json_error('not found');
|
||||
wp_send_json_success(['id'=>intval($row->id),'anzahl_einheiten'=>intval($row->anzahl_einheiten)]);
|
||||
});
|
||||
|
||||
/**
|
||||
* Plugin Name: Workshop-Wahlen
|
||||
* Description: Workshop-Wahl-System für Konfi-Castle.com
|
||||
|
||||
Reference in New Issue
Block a user