Stand v. 31.08.2011
<?php
/**
* @author Bettina Schwarzer, Fritz-Haber-Institut
* @copyright 06/2011
*
* Suche Vertraege und Anzeige Updateformular
*/
error_reporting(E_ALL ^ E_NOTICE);
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
$dbc = new dbconnection();
// $cid = $_POST["con_id"];
$cname = $_POST["conname"];
$cid = trim(substr($cname,0,strpos($cname,"-")));
if (isset($cid) && $cid)
header("Location: http://achilleus/fhiiqm/vertrag_upd.php?uid=$cid");
else
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" />
<link rel="stylesheet" type="text/css" href="css/jquery/jquery.autocomplete.css" />
<!-- <script type="text/javascript" src="js/jquery/jquery.js"></script> -->
<script type="text/javascript" src="js/jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.autocomplete.js"></script>
<style type="text/css">
.ac_input {
width: 400px;
}
.ac_results {
width: 400px;
background: #BCEEFB;
cursor: pointer;
position: absolute;
left: 0;
font-size: 70%;
z-index: 101;
}
.ac_results ul {
width: 400px;
list-style: none;
padding: 0px;
margin: 0px;
border: 1px solid #000;
}
.ac_results li {
width: 400px;
padding: 2px 5px;
}
.ac_results a {
width: 100%;
}
/* thanks udoline: this fixed position error into msie */
.ac_results iframe {
width: 400px;
position: absolute;
}
.ac_loading {
/* background : url('/indicator.gif') right center no-repeat; */
background : url('img/jquery/loading.gif') right center no-repeat;
}
.over {
background: yellow;
color: #FFAA00;
}
</style></head>
<title>Suche Vertrag</title>
</head>
<body onload="document.fcontract.conname.focus();">
<div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></div>
<div align="center">
<h3>Vertragssuche</h3>
<table>
<tr><td class="bigger">Bitte Vertragsbezeichnung oder Teil davon eingeben und dann Vertrag</td></tr>
<tr><td class="bigger">aus angebotener Liste durch Anklicken wählen:</td></tr>
<form name="fcontract" id="fcontract" action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
<!-- <input type="hidden" name="con_id"> -->
<tr><td><input id="conname" name="conname" type="text" value="<?php echo $cname; ?>"/>
</td></tr>
<!-- <input class="button" type="submit" value="zeige" name="service"> -->
</form>
<tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
</table>
<script type="text/javascript">
function selectItem(li) {
// hier Übergabe ID und Verweis auf Seite
document.fcontract.submit();
return false;
}
function pickedcon( li ) {
document.fcontract.con_id.value = li.data;
}
function formatItem(row) {
return row[0] + " | " + row[1] + " | " + row[2];
}
$(document).ready(function() {
$("#conname").autocomplete("vertrag_list_autocomplete.php", {
minChars:2,
matchSubset:1,
matchContains:1,
cacheLength:20,
onItemSelect:selectItem,
// onItemSelect:pickedcon,
formatItem:formatItem,
selectOnly:1
});
});
</script>
</div>
</body>
</html>
<?php
}
?>