Systemerweiterungen
This commit is contained in:
@ -3,34 +3,27 @@ require_once("../config.inc.php");
|
||||
$function = $_POST['function'];
|
||||
|
||||
if ($function == 'saveParameter') {
|
||||
|
||||
$query2 = "SELECT pid
|
||||
FROM jumi_parameter
|
||||
ORDER BY pid ASC";
|
||||
$result2 = $db->query( $query2)
|
||||
or die ("Cannot execute query2");
|
||||
|
||||
while ($row2 = $result2->fetch_array()){
|
||||
$pid = $row2['pid'];
|
||||
$pid_value = $_POST[$pid];
|
||||
|
||||
|
||||
$sql1 = $db->query( "UPDATE jumi_parameter
|
||||
SET wert = '$pid_value'
|
||||
WHERE pid = $pid
|
||||
" );
|
||||
}
|
||||
|
||||
if(!$sql1){
|
||||
echo "Success";
|
||||
}else{
|
||||
echo "Error: PDATE jumi_parameter
|
||||
SET wert = '$pid_value'
|
||||
WHERE pid = $pid";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$inputs = $_POST['inputs'];
|
||||
$inputs = json_decode(stripslashes($_POST['inputs']),true);
|
||||
|
||||
$error = 0;
|
||||
foreach($inputs as $parameters){
|
||||
$pid = $parameters['name'];
|
||||
$wert = $parameters['value'];
|
||||
|
||||
$sql1 = $db->query( "UPDATE jumi_parameter
|
||||
SET wert = '$wert'
|
||||
WHERE pid = $pid
|
||||
" );
|
||||
if(!$sql1){
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if($error == 0){
|
||||
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Parameter wurden aktualisiert.</div>|***|success';
|
||||
}else{
|
||||
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Parameter wurde nicht aktualisiert.</div>|***|success';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user