コード例 #1
0
ファイル: karte.php プロジェクト: vanloswang/kivitendo-crm
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();
コード例 #2
0
<?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();
コード例 #3
0
ファイル: prtwkal.php プロジェクト: vanloswang/kivitendo-crm
$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();
コード例 #4
0
ファイル: prttkal.php プロジェクト: vanloswang/kivitendo-crm
                $row["startzeit"] = "00:00";
            }
            $tmp = explode(":", $row["startzeit"]);
            $v = mktime($tmp[0], $tmp[1], 0, $month, $day, $year);
            $tmp = explode(":", $row["stopzeit"]);
            $b = mktime($tmp[0], $tmp[1], 0, $month, $day, $year);
            $grund = utf8_decode($row["cause"]);
            $tid = $row["termid"];
            for ($v; $v <= $b; $v += 1800) {
                if (date("G", $v) >= $_SESSION["termbegin"] && date("G", $v) <= $_SESSION["termend"]) {
                    $vars["TERMIN" . date("Hi", $v)] .= $grund;
                    $grund = "|| ";
                    $tid = 0;
                } else {
                    $grund = utf8_decode($row["cause"]);
                    $tid = $row["termid"];
                }
            }
            $tlist[] = $row["id"];
        }
    }
}
$doc = new phpOpenOffice();
if (file_exists("vorlage/kaltag_" . $usr["login"] . ".sxw")) {
    $doc->loadDocument("vorlage/kaltag_" . $usr["login"] . ".sxw");
} else {
    $doc->loadDocument("vorlage/kaltag.sxw");
}
$doc->parse($vars);
$doc->download("");
$doc->clean();
コード例 #5
0
ファイル: prtmkal.php プロジェクト: vanloswang/kivitendo-crm
        $vars["KW{$wo}"] = $woche;
    }
}
// show days of the next month
if (date("w", mktime(0, 0, 0, $month + 1, 1, $year)) != 1) {
    $tg = 1;
    $start = date("w", mktime(0, 0, 0, $month + 1, $tg, $year));
    while ($start > 1 and $start < 8) {
        //$vars[$kaltg[$start].$wo]=$tg;
        $vars[$kaltg[$start] . $wo] = "";
        $tg++;
        $start++;
    }
}
$x = mondaykw($kw, $year);
$tag = date("d", $x);
$startday = date("d", $x);
$data = getTermin($startday, date("m", $x), $year, "W");
$vars["KW"] = $kw;
for ($i = 0; $i < 7; $i++) {
    $vars[$drkwt[$i]] = date("d.m.", mktime(0, 0, 0, $month, $tag + $i, $year));
}
$doc = new phpOpenOffice();
if (file_exists("vorlage/kalmonat_" . $usr["login"] . ".sxw")) {
    $doc->loadDocument("vorlage/kalmonat_" . $usr["login"] . ".sxw");
} else {
    $doc->loadDocument("vorlage/kalmonat.sxw");
}
$doc->parse($vars);
$doc->download("");
$doc->clean();
コード例 #6
0
<?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"];