fhiiqm/test/partner_list_autocomplete.php
changeset 1 6288d5685bff
child 3 3c49783d0862
equal deleted inserted replaced
0:ef68113ff309 1:6288d5685bff
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * @author Bettina Schwarzer, Fritz-Habet-Institut
       
     5  * @copyright 08/2011
       
     6  *
       
     7  * Autocomplete Partner
       
     8  */
       
     9 
       
    10     error_reporting(E_ALL ^ E_NOTICE);
       
    11     
       
    12     $su = array("ä","ö","ü","ß","Ä","Ö","Ü");
       
    13     $er = array("&auml;","&ouml;","&uuml;","&szlig;","&Auml;","&Ouml;","&Uuml;");
       
    14     
       
    15     $q = strtolower($_GET["term"]);
       
    16     
       
    17 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
       
    18 	$dbc = new dbconnection();
       
    19 
       
    20     $sql = "SELECT part_ID, part_firma FROM Partner 
       
    21             WHERE part_firma LIKE '%".$q."%' COLLATE latin1_general_ci 
       
    22             ORDER BY 2";
       
    23     $result = $dbc ->queryObjectArray($sql);
       
    24     if ($result)
       
    25     {
       
    26         foreach ($result as $row)
       
    27         {
       
    28  			echo $row->part_ID . " - " . str_replace($su,$er,$row->part_firma) . "\n";
       
    29 		}
       
    30     }
       
    31     $dbc -> close();
       
    32 
       
    33 
       
    34 
       
    35 ?>