fhiiqm/vertrag_search.php
changeset 4 d6f58d4dbb06
parent 1 6288d5685bff
child 10 f538f73ebc37
equal deleted inserted replaced
3:3c49783d0862 4:d6f58d4dbb06
    11     
    11     
    12 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
    12 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
    13 	$dbc = new dbconnection();
    13 	$dbc = new dbconnection();
    14 
    14 
    15 //    $cid = $_POST["con_id"];
    15 //    $cid = $_POST["con_id"];
    16     $cname = $_POST["conname"];
    16     $cname = $_POST["conbez"];
    17     $cid = trim(substr($cname,0,strpos($cname,"-")));
    17     $cid = trim(substr($cname,0,strpos($cname,"-")));
       
    18 //    echo "cname = $cname, cid = $cid<br />\n";
    18     if (isset($cid) && $cid) 
    19     if (isset($cid) && $cid) 
    19         header("Location: http://achilleus/fhiiqm/vertrag_upd.php?uid=$cid");
    20         header("Location: http://achilleus/fhiiqm/vertrag_upd.php?uid=$cid");
    20     else
    21     else
    21     {
    22     {
    22 ?>
    23 ?>
    23         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    24         <!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         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    25         
    26         
    26         <head>
    27         <head>
    27         	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    28         	<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 type="text/css" href="/fhiiqm/css/db.css" rel="Stylesheet" />	
    29             <link rel="stylesheet" type="text/css" href="css/jquery/jquery.autocomplete.css" /> 
    30             <link type="text/css" href="/fhiiqm/css/jquery/ui-lightness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />	
    30             
    31             <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-1.6.2.min.js"></script>
    31 <!--            <script type="text/javascript" src="js/jquery/jquery.js"></script>  -->
    32             <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-ui-1.8.16.custom.min.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>
    33         	<title>Suche Vertrag</title>
       
    34 
    78         </head>
    35         </head>
    79         
    36         
    80         <body onload="document.fcontract.conname.focus();">
    37         <body>
    81         <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></div>
    38         <div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></div>
       
    39         <script>
       
    40           $(document).ready(function() {
       
    41             $("#conbez").focus();
       
    42             $("#conbez").autocomplete({
       
    43         			minLength: 2,
       
    44                     source: "/fhiiqm/inc/vertrag_list_ac.inc.php",
       
    45 /*                    select:(function(event,ui){
       
    46                                 if(ui.item)
       
    47                                 {
       
    48                                     $('#conbez').val(ui.item.value);
       
    49                                     $(this).parents('form').submit();
       
    50                                     return false; // Liste wird ausgeblendet
       
    51                                 }
       
    52 //                                $("#fcontract").submit();
       
    53                             }),
       
    54 */
       
    55                     close: (function(event,ui){
       
    56                                 $("#fcontract").submit();})
       
    57         		});
       
    58             $("input").filter("long20").addClass("long20");
       
    59             $("input").filter("long30").addClass("long30");
       
    60             $("input").filter("long50").addClass("long50");
       
    61             });
       
    62         </script>
    82         <div align="center">
    63         <div align="center">
    83         <h3>Vertragssuche</h3>
    64         <h3>Vertragssuche</h3>
    84     	       <table>   
    65     	       <table>   
    85         		<tr><td class="bigger">Bitte Vertragsbezeichnung oder Teil davon eingeben und dann Vertrag</td></tr> 
    66         		<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>   
    67                 <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">
    68             	<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">  -->
    69                 
    89                 <tr><td><input id="conname" name="conname" type="text" value="<?php echo $cname; ?>"/>
    70                     <tr><td><div class="ui-widget">
    90         		</td></tr>
    71                         <input class="long50" id="conbez" name="conbez" type="text" value="<?php echo $cname; ?>"/>
    91         		<!-- <input class="button" type="submit" value="zeige" name="service"> -->
    72             		</div></td></tr>
       
    73                 
    92             	</form> 
    74             	</form> 
    93                 <tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
    75                 <tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
    94         	   </table>
    76         	   </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>
    77         </div>
   125         </body>
    78         </body>
   126         </html>
    79         </html>
   127 <?php        
    80 <?php        
   128     }
    81     }