Stand 17.02.2023
This commit is contained in:
38
controller/admin_erfassen.php
Normal file
38
controller/admin_erfassen.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
require_once("../config.inc.php");
|
||||
$function = $_POST['function'];
|
||||
|
||||
|
||||
if($function == 'delete'){
|
||||
$tabelle = $_POST['tabelle'];
|
||||
$spalte = $_POST['spalte'];
|
||||
$id = $_POST['id'];
|
||||
$stmt = $db->query("DELETE FROM $tabelle WHERE $spalte = $id");
|
||||
if($stmt){
|
||||
echo "success";
|
||||
}else{
|
||||
echo -1;
|
||||
}
|
||||
}
|
||||
|
||||
if($function == 'deleteQuestion'){
|
||||
|
||||
$id2 = $_POST['id2'];
|
||||
|
||||
$stmt1 = $db->query("DELETE FROM jumi_umfragen_antworten WHERE ufid = $id2");
|
||||
$stmt2 = $db->query("DELETE FROM jumi_umfragen_fragen WHERE ufid = $id2");
|
||||
# ggf. bereis Abstimmergebnisse löschen
|
||||
|
||||
# Sonst werden keine neue Fragen erfasst
|
||||
# unset($_SESSION["umfrageerf_ufid"]);
|
||||
|
||||
|
||||
if($stmt1 and $stmt2){
|
||||
echo "DELETE FROM jumi_umfragen_antworten WHERE ufid = $id2 | DELETE FROM jumi_umfragen_fragen WHERE ufid = $id2";
|
||||
}else{
|
||||
echo "Nicht geklappt";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
12
controller/reihenfolge.ajax.php
Normal file
12
controller/reihenfolge.ajax.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
require_once("../config.inc.php");
|
||||
|
||||
if(isset($_REQUEST['action']) and $_REQUEST['action']=="updateSortedRows"){
|
||||
$newOrder = explode(",",$_REQUEST['sortOrder']);
|
||||
$n = '0';
|
||||
foreach($newOrder as $id){
|
||||
$db->query('UPDATE jumi_umfragen_antworten SET userorder="'.$n.'" WHERE uaid="'.$id.'" ');
|
||||
$n++;
|
||||
}
|
||||
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Reihenfolge angepasst!</div>|***|update';
|
||||
}
|
Reference in New Issue
Block a user