<?php //Sourcefile for Autocompletion if (empty($_GET['term'])) { exit; } require_once "../inc/stdLib.php"; if ($_GET['case'] == 'name') { require_once "../inc/crmLib.php"; require_once "../inc/FirmenLib.php"; require_once "../inc/persLib.php"; require_once "../inc/UserLib.php"; $suchwort = mkSuchwort($_GET['term']); $rsC = getAllFirmen($suchwort, true, "C"); $rsV = getAllFirmen($suchwort, true, "V"); $rsK = getAllPerson($suchwort); $rsE = getAllUser($suchwort); $rs = array(); if ($rsC) { foreach ($rsC as $key => $value) { if (count($rs) > 11) { break; } array_push($rs, array('label' => $value['name'], 'category' => '', 'src' => 'C', 'id' => $value['id'])); } } if ($rsV) { foreach ($rsV as $key => $value) { if (count($rs) > 11) { break; }
$t = new Template($base); //doHeader($t); if (isset($_POST["felder"]) && $_POST["felder"] != '') { $rc = doReport($_POST, $Q); $t->set_file(array("fa1" => "companies1.tpl")); if ($rc) { $tmp = "<div style='width:300px'>[<a href='tmp/report_" . $_SESSION["login"] . ".csv'>download Report</a>]</div>"; } else { $tmp = "Sorry, not found"; } $t->set_var(array('report' => $tmp)); leertpl($t, 1, $Q_Array, "", true, true); } 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";
val=document.firmen.Alle.options[nr].value; txt=document.firmen.Alle.options[nr].text; NeuerEintrag = new Option(txt,val,false,true); opener.document.getElementById("istusr").options[opener.document.getElementById("istusr").length] = NeuerEintrag; } //--> </script> <body onLoad="self.focus()"> <center>Gefundene - Einträge:<br><br> <form name="firmen"> <select name="Alle" > <?php $name = strtoupper($_GET["name"]); $pers = getAllPerson(array(1, $name)); $cust = getAllFirmen(array(1, $name), true, "C"); $vend = getAllFirmen(array(1, $name), true, "V"); $daten = array(); if ($pers) { $daten = $pers; } if ($cust) { $daten = array_merge($daten, $cust); } if ($vend) { $daten = array_merge($daten, $vend); } if ($daten) { foreach ($daten as $zeile) { echo "\t<option value='" . $zeile["tab"] . $zeile["id"] . "'>" . $zeile["name"] . "</option>\n"; } }
<center>Gefundene - Einträge:<br><br> <form name="firmen"> <select name="Alle" > <option value=''>nichts markiert</option> <?php if ($konzenname != '') { $name = $konzernname; } if ($name == "EINZELPERSON") { $name = ""; } if ($tab) { $datenC = getAllFirmen(array(1, $name), true, $tab); } else { $datenC = getAllFirmen(array(1, $name), true, "C"); $datenL = getAllFirmen(array(1, $name), true, "V"); } if ($pers) { $datenP = getAllPerson(array(1, $name)); if ($datenP) { foreach ($datenP as $zeile) { echo "\t<option value='P" . $zeile["cp_id"] . "'>" . $zeile["cp_name"] . ", " . $zeile["cp_givenname"] . ", " . $zeile["cp_city"] . " P</option>\n"; } } } if ($datenC) { if ($tab == "V") { $tab = "L"; } else { $tab = "K"; }