include "inc/FirmenLib.php"; include 'inc/phpOpenOffice.php'; if ($_GET["Q"] == "C") { $fa = getFirmenStamm($_GET["fid"], true, "C"); $fa["number"] = $fa["customernumber"]; } else { $fa = getFirmenStamm($_GET["fid"], true, "V"); $fa["number"] = $fa["vendornumber"]; $fa["kdtyp"] = $fa["lityp"]; } foreach ($fa as $key => $val) { $fa[$key] = utf8_decode($val); } $var = array(); if ($key == "typrabatt") { $val = $val * 100; } $fa["typrabatt"] = $fa["typrabatt"] * 100; $fa["creditlimit"] = sprintf("%0.2f", $fa["creditlimit"]); $fa["discount"] = sprintf("%0.2f", $fa["discount"] * 100); $fa["itime"] = db2date($fa["itime"]); $fa["mtime"] = db2date($fa["mtime"]); $doc = new phpOpenOffice(); if (file_exists("vorlage/firmenkartei.sxw")) { $doc->loadDocument("vorlage/firmenkartei.sxw"); } else { $doc->loadDocument("vorlage/firmenkartei.odt"); } $doc->parse($fa); $doc->download(""); $doc->clean();
<?php include 'phpOpenOffice.php'; $vars = array(); $vars["NAME"] = "Tux"; $vars["MOBILE"] = "123-4567890"; $vars["URL"] = "http://www.pinasoft.de/projects/phpopenoffice/"; $doc = new phpOpenOffice(); $doc->loadDocument("demo.sxw"); $doc->parse($vars); $doc->download("demodatei"); $doc->clean();
<?php include 'phpOpenOffice.php'; $vars = array(); $vars["NAME"] = "Tux"; $vars["MOBILE"] = "123-4567890"; $vars["URL"] = "http://www.pinasoft.de/projects/phpopenoffice/"; $doc = new phpOpenOffice(); $doc->loadDocument("demo.sxw"); $doc->parse($vars); $doc->savefile("demo_parsed.sxw"); $doc->clean(); echo "Demo-File saved.";
$month = date("m", $x); $startday = date("d", $x); $data = getTermin($startday, date("m", $x), $year, "W"); $vars["JAHR"] = $year; $vars["KW"] = $kw; $usr = getUserStamm($_SESSION["loginCRM"]); $vars["NAME"] = $usr["name"]; for ($i = 0; $i < 7; $i++) { $vars[$drkwt[$i]] = date("d.m.", mktime(0, 0, 0, $month, $tag + $i, $year)); } if ($data) { foreach ($data as $row) { if ($row["termin"] != $lastt || $lastd != $row["tag"]) { $w = date("w", mktime(0, 0, 0, $row["monat"], $row["tag"], $row["jahr"])) - 1; $vars["TERMIN" . $drkwt[$w]] .= ($vars["TERMIN" . $drkwt[$w]] ? "\n" : "") . $row["startzeit"] . " " . utf8_decode($row["cause"]); $lastt = $row["termin"]; $lastd = $row["tag"]; } else { $lastt = 0; } } } $doc = new phpOpenOffice(); if (file_exists("vorlage/kalwoche_" . $usr["login"] . ".sxw")) { $doc->loadDocument("vorlage/kalwoche_" . $usr["login"] . ".sxw"); } else { $doc->loadDocument("vorlage/kalwoche.sxw"); } $doc->parse($vars); $doc->download(""); $doc->clean();
<?php require_once "inc/stdLib.php"; include "inc/FirmenLib.php"; include "inc/wvLib.php"; $rep = suchVertrag($_GET["aid"]); $rep = $rep[0]; //$masch=getVertragMaschinen($rep["contractnumber"]); $masch = getVertragMaschinen($rep["cid"]); $firma = getFirmenStamm($masch["customer_id"]); include 'inc/phpOpenOffice.php'; $doc = new phpOpenOffice(); $doc->loadDocument("vorlage/wv" . $rep["template"]); $vars = array(); $vars["NAME"] = $firma["name"]; $vars["STRASSE"] = $firma["street"]; $vars["PLZ"] = $firma["zipcode"]; $vars["ORT"] = $firma["city"]; $vars["BEMERKUNGEN"] = $rep["bemerkung"]; $vars["NUMMER"] = $rep["aid"]; $vars["DATUM"] = $rep["datum"]; $vars["KNDR"] = $rep["customer_id"]; $vars["EURO"] = $rep["betrag"]; foreach ($masch as $row) { $vars["MASCHINEN"] .= $row["description"] . " #" . $row["serialnumber"] . "\n" . $row["standort"] . "\n"; } $doc->parse($vars); $pre = date("YmdHi"); $doc->prepsave($pre . substr($rep["template"], 0, -4)); $data["CID"] = $masch["customer_id"]; $data["CRMUSER"] = $_SESSION["loginCRM"];