예제 #1
0
$maske = substr($owner, 0, 1);
$t = new Template($base);
if ($_POST["save"]) {
    saveFelder($_POST);
}
if ($_POST["suche"]) {
    $daten = suchFelder($_POST);
    if (count($daten) == 1 && $daten != false) {
        if ($maske == "P") {
            header("location:kontakt.php?id=" . $daten[0]["cp_id"]);
        } else {
            header("location:firma1.php?Q={$maske}&id=" . $daten[0]["id"]);
        }
    } else {
        if (count($daten) > 1) {
            clearCSVData();
            if ($maske == "P") {
                $t->set_file(array("fa1" => "personen1L.tpl"));
                insertCSVData(array("ANREDE", "TITEL", "NAME1", "NAME2", "LAND", "PLZ", "ORT", "STRASSE", "TEL", "FAX", "EMAIL", "FIRMA", "FaID", "GESCHLECHT", "ID"), -1);
            } else {
                $t->set_file(array("fa1" => "firmen1L.tpl"));
                insertCSVData(array("ANREDE", "NAME1", "NAME2", "LAND", "PLZ", "ORT", "STRASSE", "TEL", "FAX", "EMAIL", "KONTAKT", "ID", "KDNR", "USTID", "STEUERNR", "KTONR", "BANK", "BLZ", "LANG", "KDTYP"), -1);
            }
            $t->set_block("fa1", "Liste", "Block");
            $t->set_var(array('CRMCSS' => $head['CRMCSS'], 'FAART' => $Q == "C" ? "Customer" : "Vendor", 'msg' => $msg));
            $i = 0;
            if ($maske == "P") {
                foreach ($daten as $zeile) {
                    if ($zeile["cp_gender"] == "f") {
                        if ($zeile["language_id"]) {
                            $zeile["cp_greeting"] = $anredenFrau[$zeile["language_id"]];
예제 #2
0
} else {
    if ((isset($_POST["suche"]) and $_POST["suche"] != "") || isset($_POST["first"])) {
        if (isset($_POST["first"])) {
            $daten = getAllFirmen(array(1, $_POST["first"]), false, $Q);
        } else {
            $daten = suchFirma($_POST, $Q);
        }
        if (count($daten) == 1 && $daten != false) {
            echo '<script> showD("' . $Q . '","' . $daten[0]["id"] . '");</script>';
        } else {
            if (count($daten) > 1) {
                $t->set_file(array("fa1" => "companies1Result.tpl"));
                $t->set_block("fa1", "Liste", "Block");
                $t->set_var(array('FAART' => $Q == "C" ? "Customer" : "Vendor"));
                $i = 0;
                $rc = clearCSVData();
                $header = array('ANREDE', 'NAME1', 'NAME2', 'LAND', 'PLZ', 'ORT', 'STRASSE', 'TEL', 'FAX', 'EMAIL', 'KONTAKT', 'ID', 'KDNR', 'USTID', 'STEUERNR', 'KTONR', 'BANK', 'BLZ', 'LANG', 'KDTYP');
                if (isset($_POST['umsatz']) and $_POST['umsatz'] != '') {
                    $header[] = "UMSATZ";
                }
                $sql = "select name from custom_variable_configs where module = 'CT'";
                $rs = $_SESSION['db']->getAll($sql);
                if ($rs) {
                    $cvar = 0;
                    foreach ($rs as $row) {
                        $cvheader[] = "vc_cvar_" . $row["name"];
                        $header[] = "VC_CVAR_" . strtoupper($row["name"]);
                        $cvar++;
                    }
                } else {
                    $cvar = false;