fhiiqm/vertrag_search.php
changeset 1 6288d5685bff
child 4 d6f58d4dbb06
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  * Suche Vertraege und Anzeige Updateformular
       
     8  */
       
     9 
       
    10     error_reporting(E_ALL ^ E_NOTICE);
       
    11     
       
    12 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
       
    13 	$dbc = new dbconnection();
       
    14 
       
    15 //    $cid = $_POST["con_id"];
       
    16     $cname = $_POST["conname"];
       
    17     $cid = trim(substr($cname,0,strpos($cname,"-")));
       
    18     if (isset($cid) && $cid) 
       
    19         header("Location: http://achilleus/fhiiqm/vertrag_upd.php?uid=$cid");
       
    20     else
       
    21     {
       
    22 ?>
       
    23         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       
    24         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
       
    25         
       
    26         <head>
       
    27         	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
       
    28            	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
       
    29             <link rel="stylesheet" type="text/css" href="css/jquery/jquery.autocomplete.css" /> 
       
    30             
       
    31 <!--            <script type="text/javascript" src="js/jquery/jquery.js"></script>  -->
       
    32             <script type="text/javascript" src="js/jquery/jquery-1.6.2.min.js"></script>
       
    33             <script type="text/javascript" src="js/jquery/jquery.autocomplete.js"></script>
       
    34              
       
    35             <style type="text/css">
       
    36             .ac_input {
       
    37             	width: 400px;
       
    38             }
       
    39             .ac_results {
       
    40             	width: 400px;
       
    41             	background: #BCEEFB;
       
    42             	cursor: pointer;
       
    43             	position: absolute;
       
    44             	left: 0;
       
    45             	font-size: 70%;
       
    46             	z-index: 101;
       
    47             }
       
    48             .ac_results ul {
       
    49             	width: 400px;
       
    50             	list-style: none;
       
    51             	padding: 0px;
       
    52             	margin: 0px;
       
    53             	border: 1px solid #000;
       
    54             }
       
    55             .ac_results li {
       
    56             	width: 400px;
       
    57             	padding: 2px 5px;
       
    58             }
       
    59             .ac_results a {
       
    60             	width: 100%;
       
    61             }
       
    62             /* thanks udoline: this fixed position error into msie */
       
    63             .ac_results iframe {
       
    64             	width: 400px;
       
    65             	position: absolute;
       
    66             }
       
    67             .ac_loading {
       
    68 /*            	background : url('/indicator.gif') right center no-repeat; */
       
    69             	background : url('img/jquery/loading.gif') right center no-repeat;
       
    70             }
       
    71             .over {
       
    72             	background: yellow;
       
    73             	color: #FFAA00;
       
    74             }
       
    75             </style></head>
       
    76         
       
    77         	<title>Suche Vertrag</title>
       
    78         </head>
       
    79         
       
    80         <body onload="document.fcontract.conname.focus();">
       
    81         <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></div>
       
    82         <div align="center">
       
    83         <h3>Vertragssuche</h3>
       
    84     	       <table>   
       
    85         		<tr><td class="bigger">Bitte Vertragsbezeichnung oder Teil davon eingeben und dann Vertrag</td></tr> 
       
    86                 <tr><td class="bigger">aus angebotener Liste durch Anklicken w&auml;hlen:</td></tr>   
       
    87             	<form name="fcontract" id="fcontract" action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
       
    88                 <!-- <input type="hidden" name="con_id">  -->
       
    89                 <tr><td><input id="conname" name="conname" type="text" value="<?php echo $cname; ?>"/>
       
    90         		</td></tr>
       
    91         		<!-- <input class="button" type="submit" value="zeige" name="service"> -->
       
    92             	</form> 
       
    93                 <tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
       
    94         	   </table>
       
    95         	 
       
    96         	<script type="text/javascript">
       
    97         	function selectItem(li) {
       
    98         		// hier Übergabe ID und Verweis auf Seite
       
    99         		document.fcontract.submit();
       
   100         		return false;
       
   101         	}
       
   102         	
       
   103         	function pickedcon( li ) {
       
   104         	  document.fcontract.con_id.value = li.data;
       
   105         	}
       
   106         	
       
   107         	function formatItem(row) {
       
   108         		return row[0] + " | " + row[1] + " | " + row[2];
       
   109         	}
       
   110         	
       
   111         	$(document).ready(function() {
       
   112         		$("#conname").autocomplete("vertrag_list_autocomplete.php", { 
       
   113         			minChars:2, 
       
   114         			matchSubset:1, 
       
   115         			matchContains:1, 
       
   116         			cacheLength:20, 
       
   117         			onItemSelect:selectItem, 
       
   118         	//		onItemSelect:pickedcon, 
       
   119         			formatItem:formatItem, 
       
   120         			selectOnly:1 
       
   121         		});
       
   122         	});
       
   123         	</script>
       
   124         </div>
       
   125         </body>
       
   126         </html>
       
   127 <?php        
       
   128     }
       
   129 ?>