$_POST["vendornumber"] = false; $rc = saveNeuFirmaStamm($_POST, $_FILES, $Q); if ($rc[0] > 0) { header("location:firmen3.php?Q={$Q}&id=" . $rc[0] . "&edit=1"); } else { $msg = "Fehler beim Sichern (" . $rc[1] . ")"; } $btn1 = ""; $btn2 = ""; $_POST["id"] = ""; vartpl($t, $_POST, $Q, $msg, $btn1, $btn2, 3); } else { if ($_POST["save"]) { if ($_POST["id"]) { $tabelle = $Q == "C" ? "customer" : "vendor"; if (chkTimeStamp($tabelle, $_POST["id"], $_POST["mtime"])) { $rc = saveFirmaStamm($_POST, $_FILES, $Q); if ($rc[0] > 0) { $msg = "Daten gesichert."; $_POST = getFirmenStamm($rc[0], false, $Q); } else { $msg = "Fehler beim Sichern ( " . $rc[1] . " )"; } } else { $msg = "Daten wurden inzwischen modifiert"; $rc[0] = -1; } } else { $rc[0] = -1; $rc[1] = "Kein Bestandskunde"; }
include_once "inc/UserLib.php"; include "inc/persLib.php"; include "inc/FirmenLib.php"; $t = new Template($base); $menu = $_SESSION['menu']; doHeader($t); $Q = isset($_GET["Quelle"]) ? $_GET["Quelle"] : $_POST["Quelle"]; if (isset($_POST["show"])) { header("location:firma2.php?Q={$Q}&id=" . $_POST["PID"]); } else { if ($_POST["save"] || $_POST["neu"]) { if (isset($_POST["neu"])) { $_POST["PID"] = 0; $rc = savePersonStamm($_POST, $_FILES); } else { if (chkTimeStamp("contacts", $_POST["PID"], $_POST["mtime"])) { $rc = savePersonStamm($_POST, $_FILES); } else { $rc = -10; } } if (preg_match('/^[0-9]+$/', $rc)) { $msg = "Daten gesichert."; $daten = getKontaktStamm($_POST["PID"] ? $_POST["PID"] : $rc); $daten["Quelle"] = $Q; $btn3 = "<input type='submit' class='sichern' name='save' value='.:save:. .:update:.' tabindex='25'>"; $btn1 = "<input type='submit' class='anzeige' name='show' value='.:view:.'>"; $btn2 = "<input type='submit' class='sichernneu' name='neu' value='.:save:. .:new:.'>"; vartplP($t, $daten, $msg, $btn1, $btn2, $btn3, "cp_givenname", "white", 0, 3); } else { if ($_POST["PID"]) {