fhiiqm/test/partner_list_autocomplete.php
changeset 1 6288d5685bff
child 3 3c49783d0862
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/partner_list_autocomplete.php	Wed Aug 31 14:22:19 2011 +0200
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Habet-Institut
+ * @copyright 08/2011
+ *
+ * Autocomplete Partner
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    $su = array("ä","ö","ü","ß","Ä","Ö","Ü");
+    $er = array("&auml;","&ouml;","&uuml;","&szlig;","&Auml;","&Ouml;","&Uuml;");
+    
+    $q = strtolower($_GET["term"]);
+    
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+
+    $sql = "SELECT part_ID, part_firma FROM Partner 
+            WHERE part_firma LIKE '%".$q."%' COLLATE latin1_general_ci 
+            ORDER BY 2";
+    $result = $dbc ->queryObjectArray($sql);
+    if ($result)
+    {
+        foreach ($result as $row)
+        {
+ 			echo $row->part_ID . " - " . str_replace($su,$er,$row->part_firma) . "\n";
+		}
+    }
+    $dbc -> close();
+
+
+
+?>
\ No newline at end of file