-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathkarte.php
34 lines (32 loc) · 1.03 KB
/
karte.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
<?php
require("inc/stdLib.php");
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();
?>