fhiiqm/vertrag_list_autocomplete.php
changeset 1 6288d5685bff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/vertrag_list_autocomplete.php	Wed Aug 31 14:22:19 2011 +0200
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 06/2011
+ *
+ * Autocomplete Vertragssuche
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    $su = array("ä","ö","ü","ß","Ä","Ö","Ü");
+    $er = array("&auml;","&ouml;","&uuml;","&szlig;","&Auml;","&Ouml;","&Uuml;");
+    
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+
+    $sql = "SELECT contract_ID,contract_name,t.vtyp_bezeichnung,contract_begin
+            FROM fhiiqm.Vertrag v LEFT OUTER JOIN fhiiqm.Vertrag_Typ t ON v.vtyp_ID=t.vtyp_ID 
+            WHERE contract_name LIKE '%".$_GET['q']."%' COLLATE latin1_general_ci 
+            ORDER BY contract_name";
+    $result = $dbc ->queryObjectArray($sql);
+    if ($result)
+    {
+        foreach ($result as $row)
+        {
+            $cb = new DateTime($row->contract_begin);
+ 			echo $row->contract_ID . " - " . str_replace($su,$er,$row->contract_name) . " | " . 
+             str_replace($su,$er,$row->vtyp_bezeichnung) . " | VBeginn: " . $cb->format('d.m.Y') . "\n";
+		}
+    }
+    $dbc -> close();
+?>
\ No newline at end of file