git.schokokeks.org
Repositories
Help
Report an Issue
bibweb.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
0b803b2
Branches
Tags
master
bibweb.git
internal
ajax_vorgang_aendern.php
work in progress, Saisonstart 2020
Bernd Wurst
commited
0b803b2
at 2020-09-01 15:20:34
ajax_vorgang_aendern.php
Blame
History
Raw
<?php require_once 'lib/api.php'; require_once 'lib/tools.php'; // some sort of limit?! session_start(); $data = array("handle" => $_GET['handle']); $ret = api_call('vorgang/lesen', $data); if (!isset($ret['vorgang'])) { echo 'error!'; die(); } $vorgang = $ret['vorgang']; switch ($_GET['action']) { case 'delete_gitterbox': if (isset($_GET['id'])) { $id = $_GET['id']; foreach ($vorgang['bestellung'][0]['gitterbox'] as $key => $item) { if ($item['id'] == $id) { unset($vorgang['bestellung'][0]['gitterbox'][$key]); break; } } } else { array_shift($vorgang['bestellung'][0]['gitterbox']); } break; case 'delete_anhaenger': $kennz = $_GET['kennz']; foreach ($vorgang['bestellung'][0]['anhaenger'] as $key => $item) { if ($item['kennz'] == $kennz) { unset($vorgang['bestellung'][0]['anhaenger'][$key]); break; } } break; case 'add_gitterbox': $id = (isset($_GET['id']) ? $_GET['id'] : null); $vorgang['bestellung'][0]['gitterbox'][] = array("id" => $id); break; case 'add_anhaenger': $kennz = (isset($_GET['kennz']) ? $_GET['kennz'] : null); $vorgang['bestellung'][0]['anhaenger'][] = array("kennz" => $kennz); break; case 'neue_aendern': foreach (array("3er", "5er", "10er") as $groesse) { if (isset($_GET[$groesse]) && $_GET[$groesse] != '') { $vorgang['bestellung'][0]['neue'][$groesse] = htmlspecialchars($_GET[$groesse]); } else { unset($vorgang['bestellung'][0]['neue'][$groesse]); } } break; case 'frischsaft': if (isset($_GET["frischsaft"]) && $_GET['frischsaft'] != '') { $vorgang['bestellung'][0]['frischsaft'] = (int) $_GET['frischsaft']; } else { $vorgang['bestellung'][0]['frischsaft'] = null; } break; } $ret = api_call('vorgang/aendern', $vorgang); if (!isset($ret['vorgang'])) { return; } header('Content-Type: application/json'); echo json_encode($ret['vorgang']);