fhiiqm/vertrag_list_autocomplete.php
changeset 1 6288d5685bff
equal deleted inserted replaced
0:ef68113ff309 1:6288d5685bff
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * @author Bettina Schwarzer, Fritz-Haber-Institut
       
     5  * @copyright 06/2011
       
     6  *
       
     7  * Autocomplete Vertragssuche
       
     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 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
       
    16 	$dbc = new dbconnection();
       
    17 
       
    18     $sql = "SELECT contract_ID,contract_name,t.vtyp_bezeichnung,contract_begin
       
    19             FROM fhiiqm.Vertrag v LEFT OUTER JOIN fhiiqm.Vertrag_Typ t ON v.vtyp_ID=t.vtyp_ID 
       
    20             WHERE contract_name LIKE '%".$_GET['q']."%' COLLATE latin1_general_ci 
       
    21             ORDER BY contract_name";
       
    22     $result = $dbc ->queryObjectArray($sql);
       
    23     if ($result)
       
    24     {
       
    25         foreach ($result as $row)
       
    26         {
       
    27             $cb = new DateTime($row->contract_begin);
       
    28  			echo $row->contract_ID . " - " . str_replace($su,$er,$row->contract_name) . " | " . 
       
    29              str_replace($su,$er,$row->vtyp_bezeichnung) . " | VBeginn: " . $cb->format('d.m.Y') . "\n";
       
    30 		}
       
    31     }
       
    32     $dbc -> close();
       
    33 ?>