if ($detail_id != '') { // Update $bestell_detail->load($detail_id); $tags_detail = explode(";", $_POST["detail_tag_{$i}"]); $help_detailtags = new tags(); $help_detailtags->bestelldetail_id = $detail_id; $help_detailtags->deleteBestelldetailTag($tags_detail); foreach ($tags_detail as $det) { $detail_tag = new tags(); $detail_tag->tag = trim($det); $detail_tag->bestelldetail_id = $detail_id; $detail_tag->insertvon = $user; $detail_tag->insertamum = date('Y-m-d H:i:s'); if (!$detail_tag->TagExists()) { $detail_tag->saveTag(); $detail_tag->saveBestelldetailTag(); } else { if (!$detail_tag->BestelldetailTagExists()) { $detail_tag->saveBestelldetailTag(); } } } $menge = $_POST["menge_{$i}"]; if ($menge == '') { $menge = '0'; } $bestell_detail->position = $_POST["pos_{$i}"]; if ($_POST["sort_{$i}"] != '') { $bestell_detail->sort = $_POST["sort_{$i}"]; } else { $bestell_detail->sort = $_POST["pos_{$i}"];