<?php require_once "inc/stdLib.php"; include "crmLib.php"; include "FirmenLib.php"; require_once "documents.php"; include "template.inc"; include "persLib.php"; $t = new Template($base); doHeader($t); $pid = $_GET["pid"] ? $_GET["pid"] : $_POST["pid"]; $fid = $_GET["fid"] ? $_GET["fid"] : $_POST["fid"]; $did = $_GET["did"] ? $_GET["did"] : $_POST["did"]; $tab = $_GET["tab"] ? $_GET["tab"] : $_POST["tab"]; if ($_POST['erstellen']) { $docdata = getDOCvorlage($_POST["did"]); if ($docdata["document"]["applikation"] == "O") { include 'inc/phpOpenOffice.php'; $doc = new phpOpenOffice(); } else { if ($docdata["document"]["applikation"] == "R") { include 'inc/phpRtf.php'; $doc = new phpRTF(); } else { if ($docdata["document"]["applikation"] == "T") { include 'inc/phpTex.php'; $doc = new phpTex(); } else { if ($docdata["document"]["applikation"] == "B") { require 'inc/phpBIN.php'; $doc = new phpBIN();
foreach ($vars as $hit) { $data['feldname'] = $hit; $data['platzhalter'] = $hit; $data['position'] = $p; insDocFld($data); $p++; } } $msg = ''; } else { $msg = 'Falsches Dateiformat'; } } else { if ($_POST["del"]) { $did = delDocVorlage($_POST); } } $link2 = "dokument2.php?did=" . $_GET["did"]; if ($did) { $link3 = "dokument3.php?docid=" . $did; } else { $link3 = ""; } if ($did) { $docdata = getDOCvorlage($did); } $t = new Template($base); doHeader($t); $t->set_file(array("doc" => "dokument2.tpl")); $t->set_var(array(Link2 => $link2, Link3 => $link3, vorlage => $docdata["document"]["vorlage"], beschreibung => $docdata["document"]["beschreibung"], file => $docdata["document"]["file"], did => $did, msg => $msg)); $t->pparse("out", array("doc"));