<?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["conbez"];
$cid = trim(substr($cname,0,strpos($cname,"-")));
// echo "cname = $cname, cid = $cid<br />\n";
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 type="text/css" href="/fhiiqm/css/db.css" rel="Stylesheet" />
<link type="text/css" href="/fhiiqm/css/jquery/ui-lightness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="/fhiiqm/js/jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="/fhiiqm/js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
<title>Suche Vertrag</title>
</head>
<body>
<div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></div>
<script>
$(document).ready(function() {
$("#conbez").autocomplete({
minLength: 2,
source: "vertrag_list_autocomplete1.php",
/* select:(function(event,ui){
if(ui.item)
{
$('#conbez').val(ui.item.value);
$(this).parents('form').submit();
return false; // Liste wird ausgeblendet
}
// $("#fcontract").submit();
}),
*/
close: (function(event,ui){
$("#fcontract").submit();})
});
$("input").filter("long20").addClass("long20");
$("input").filter("long30").addClass("long30");
$("input").filter("long50").addClass("long50");
});
</script>
<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">
<tr><td><div class="ui-widget">
<input class="long50" id="conbez" name="conbez" type="text" value="<?php echo $cname; ?>"/>
</div></td></tr>
</form>
<tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
</table>
</div>
</body>
</html>
<?php
}
?>