forked from kivitendo/kivitendo-crm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprtWVertragOOo.php
37 lines (36 loc) · 1.46 KB
/
prtWVertragOOo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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"];
insFormDoc($data,$pre.$rep["template"]); //Wird nur hier benutzt, also unbedingt ändern
//$doc->clean();
//$knopf="Dokument erstellt: <a href='./".$_SESSION["dbname"]."/".$data["CID"]."/".$pre.$rep["template"]."'><shift>+<klick></a>";
$knopf="Dokument erstellt: <a href='tmp/".$pre.$rep["template"]."'><shift>+<klick></a>";
echo $knopf;
?>