$doc->loadDocument("./vorlage/" . $docdata["document"]["file"]); $vars = array(); if ($docdata["felder"]) { foreach ($docdata["felder"] as $zeile) { $value = $zeile["platzhalter"]; $name = strtoupper($value); if (ini_get("default_charset") == 'utf-8') { $vars[$name] = utf8_decode($_POST[$value]); } else { $vars[$name] = $_POST[$value]; } } } $doc->parse($vars); $name = date("YmdHi") . $fname; $doc->prepsave("{$name}"); $pfad = $_POST['pfad']; copy('tmp/' . $name, "dokumente/" . $_SESSION["dbname"] . "{$pfad}/{$name}"); $dbfile = new document(); $dbfile->setDocData("descript", "Dokumentvorlage: " . $docdata["document"]["vorlage"] . "\n" . $docdata["document"]["beschreibung"]); $dbfile->setDocData("name", $name); $dbfile->setDocData("pfad", $pfad); $rc = $dbfile->saveDocument(); //$doc->clean(); $cdata["id"] = mknewTelCall(); $cdata["Datum"] = date("d.m.Y"); $cdata["Date"] = date("d.m.Y"); $cdata["Zeit"] = date("H:i"); $cdata["Time"] = date("H:i"); $cdata["datei"] = 1; $cdata["cause"] = $docdata["document"]["vorlage"];