+ Anlage Pruefung, Anlage Risiko, Menue anpassen
authorBettina Schwarzer <schwarzer@fhi-berlin.mpg.de>
Fri, 09 Dec 2011 14:33:22 +0100
changeset 19 33ee23fafd4d
parent 18 d0aa14180761
child 20 5877137431e4
+ Anlage Pruefung, Anlage Risiko, Menue anpassen
fhiiqm/alpruef_ed.php
fhiiqm/alpruef_flist.php
fhiiqm/alrisk_ed.php
fhiiqm/alrisk_flist.php
fhiiqm/anlage_ed.php
fhiiqm/anlage_flist.php
fhiiqm/css/db.css
fhiiqm/css/db_print.css
fhiiqm/form/alpruef_form.inc.php
fhiiqm/form/alrisk_form.inc.php
fhiiqm/form/anlage_form.inc.php
fhiiqm/form/login_form.inc.php
fhiiqm/form/recht_form.inc.php
fhiiqm/img/details.gif
fhiiqm/img/fire.png
fhiiqm/img/rotate_01.png
fhiiqm/img/weihnachtsmann.gif
fhiiqm/inc/al_list_ac.inc.php
fhiiqm/inc/anlage_dat_show.inc.php
fhiiqm/inc/file_upload.inc.php
fhiiqm/inc/func_lib.inc.php
fhiiqm/inc/menu.inc.php
fhiiqm/recht_ed.php
fhiiqm/start.php
fhiiqm/vertrag_flist1.php
fhiiqm/vertrag_flist2.php
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/alpruef_ed.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,273 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+    include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+    if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+?>
+
+<!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>Anlage Pruefung</title>
+ </head>
+ 
+ <body>
+
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+?>
+
+    <div align='center'>
+
+    <script>
+      $(document).ready(function() {
+        $("#albez").focus();
+        $("#albez").autocomplete({
+                source: "/fhiiqm/inc/al_list_ac.inc.php",
+    			minLength: 2,
+                select: function(event,ui){$("#alid").val(ui.item.id);}
+    		});
+        $("#alpdat").datepicker({
+            dateFormat: 'yy-mm-dd 00:00:00', //damit kann auch Uhrzeit angegeben werden
+            yearRange: '2000:2020',
+            changeMonth: true,
+			changeYear: true,
+            firstDay: 1,
+            dayNamesMin: ['So','Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa' ],
+            monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'] 
+        });
+        $("input").albez("long20").addClass("long20");
+        $("input").alpdat("long10").addClass("long10");
+        });
+    </script>
+<?php
+        $al     = $_POST["al"];
+        $alpid   = $_GET["i"];
+        $sub    = $_POST["eintragen"];
+    	$ok		= $_POST["ok"];
+        if (!$al['okn']) $ok=false;
+//        print_r($al);
+        
+        if ($alpid) $text = "editieren"; else $text = "erfassen";
+        echo "<h3>Pr&uuml;fung Anlage $text<h3>";
+        
+        echo "</div>\n";
+        
+        if (!$ok || !$sub)
+        {
+            // form anzeigen
+            if ($alpid && !$sub)
+            {
+                // Inhalte zu Pruefung holen
+                $sql = "SELECT p.al_ID,al_bez,pruef_date,pruef_file,pruef_bem 
+                        FROM fhiiqm.A_Pruefung p INNER JOIN fhiiqm.Anlage a ON p.al_ID=a.al_ID
+                        WHERE alp_ID = $alpid";
+                if ($result = $dbc -> queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        $al["id"]   = $row->al_ID;
+                        $al["bez"]  = $row->al_bez;
+                        $al["pdat"] = $row->pruef_date;
+                        $al["bem"]  = $row->pruef_bem;
+                        $al["pfname"]  = $row->pruef_file;
+                    }
+                }
+            }
+            include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/alpruef_form.inc.php");     
+            if ($sub)
+    		{
+            echo            
+            "<tr>
+        		<td>Upload  Protokoll </td>
+        		<td><input type=\"file\" name=\"pfile\" size=\"50\" maxlength=\"50\" value=\"" .
+            $_FILES["pfile"]["name"] . "\"/></td>
+            </tr>";
+    		  	$frage = "Alle Angaben ok?<br>
+                        erst wenn Haken gesetzt, Upload-File w&auml;hlen!";
+    			echo "<tr>
+    			  <td class=\"red\" valign=\"top\" align=\"left\">$frage</td>
+    			        <td><input type=\"checkbox\" name=\"ok\" value=\"1\"";
+    			        if ($ok)  echo "checked"; 
+    			echo "></td>\n</tr>\n"; 
+    		}
+            if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+            {
+                echo "
+               	<tr><td>&nbsp;</td>\n
+                	<td><input  class=\"button\" type=\"submit\" name=\"eintragen\" value=\"  eintragen  \" /></td>\n
+               	</tr>\n";
+            }
+            echo "</table>\n";
+            echo "</div>\n";
+            if (!is_null($_SESSION["recht"]) && !in_array("ae", $_SESSION["recht"]))
+                echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"alpruef_flist.php\" target=\"_self\" title=\"Anlagen pruefen\">&laquo; zur Liste der Anlagenpr&uuml;fungen</a></p>\n"; 
+            echo "</form>\n";   
+        }
+        else
+        {
+            // Daten speichern
+            echo "<div align='center'>\n";
+            // alte Bezeichnung Protokoll holen
+            $sql = "SELECT pruef_file
+                    FROM fhiiqm.A_Pruefung
+                    WHERE alp_ID = $alpid";
+            if ($result = $dbc -> queryObjectArray($sql))
+                foreach ($result as $row) $al["pfname_old"]  = $row->pruef_file;
+                
+            if ($alpid)
+            {
+                //update
+                // upload File
+                if (is_uploaded_file($_FILES["pfile"]["tmp_name"]) && isset($_FILES["pfile"]["name"]) && $_FILES["pfile"]["name"] )
+                {
+                    include ("inc/file_upload.inc.php");
+                    if ($al['pfname']<"!") $al['pfname']="al_pruefung";
+                    $fname  = gen_filename($al['pfname'],"pfile",$alpid);
+                    $retdf  = mod_file("/var/www/fhiiqm/alprot",$alpid,"","del");  // Loeschen alte Datei
+                    $retf   = upload("pfile", $fname, $alpid, "alprot");           // Datei prüfen und in Dokumentenverzeichnis verschieben
+                    if ($retf) 
+                    {
+                        $sql = "UPDATE A_Pruefung SET pruef_file = '" . $alpid . "_" . $fname ."' WHERE alp_ID=$alpid";
+                        $retp=$dbc->execute($sql);
+                        if (!$retp) 
+                            echo $dbc -> error . "<br>\n";
+                    }
+                }
+                else
+                {   // nur Aenderung Dateiname
+                    include ("inc/file_upload.inc.php");
+                    $fname = gen_filename($al["pfname"],$al["pfname_old"],$alpid,0);
+                    $len = strlen($alpid)+1; 
+                    if (substr($fname,0,$len) != "$alpid" . "_") $fname = $alpid . "_" . $fname;
+                    if ($al["pfname"] != $al["pfname_old"])
+                    {
+                        $retf  = mod_file("/var/www/fhiiqm/alprot",$alpid,$fname,"upd");  // Umbenennen alte Datei
+                        if ($retf) 
+                        {
+                            $sql = "UPDATE A_Pruefung SET pruef_file = '" . $fname ."' WHERE alp_ID=$alpid";
+                            $retp=$dbc->execute($sql);
+                            if (!$retp) 
+                                echo $dbc -> error . "<br>\n";
+                            if (substr($fname,0,$len) == "$alpid" . "_") $fname = substr($fname,$len,50);
+                        }
+                        
+                    }    
+                }    
+                $stmt = $dbc -> stmtinit();
+                if (is_object($stmt))
+                {
+                    $stmt -> prepare ("UPDATE A_Pruefung SET 
+                                al_ID = ?,
+                                pruef_date = ?,
+                                pruef_bem = ?
+                                WHERE alp_ID = $alpid");
+                    $stmt -> bind_param('iss', $al["id"], $al["pdat"],$al["bem"]);
+                    $result = $stmt -> execute();      
+                    if ($stmt->error) echo "UPDATE error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                }
+            }
+            else
+            {
+                //insert
+                $stmt = $dbc -> stmtinit();
+                if (is_object($stmt))
+                {
+                    $stmt -> prepare ("INSERT INTO A_Pruefung (al_ID,pruef_date,pruef_bem) VALUES (?,?,?)");
+                    $stmt -> bind_param('iss', $al["id"], $al["pdat"],$al["bem"]);
+                    $result = $stmt -> execute();      
+                    if ($stmt->error) echo "INSERT error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                }
+//$result=1;
+                if ($result)
+                { // INSERT o.k.
+                  // info_ID ermitteln
+                    $alpid = $dbc -> insertId();
+                    
+                    // upload File
+                    if (is_uploaded_file($_FILES["pfile"]["tmp_name"]) && isset($_FILES["pfile"]["name"]) && $_FILES["pfile"]["name"] )
+                    {
+                        include ("inc/file_upload.inc.php");
+                        if ($al['pfname']<"!") $al['pfname']="al_pruefung";
+                        $fname = gen_filename($al['pfname'],"pfile",$alpid);
+//echo $fname;
+
+                        $retf   = upload("pfile", $fname, $alpid, "alprot");              // Datei prüfen und in Dokumentenverzeichnis verschieben
+
+                        
+                        if ($retf)
+                        {   // upload o.k.
+                            //UPDATE des Filenamens
+                            $sql = "UPDATE A_Pruefung SET pruef_file = '" . $alpid . "_" . $fname ."' WHERE alp_ID=$alpid";
+                            $retp=$dbc->execute($sql);
+                            if (!$retp) 
+                                echo $dbc -> error . "<br>\n";
+                        }
+                       
+                    }
+                    else 
+                    {
+                        $retf=1; //kein Protokoll hochgeladen
+                        $retp=1;
+                    }
+                }
+            }
+            if ($result && $retf && $retp) // INSERT/UPDATE Pruefung
+            {
+                //Eingabe Daten, Upload File erfolgreich 
+                    echo "<p class='green'><b>Pr&uuml;fdaten zu Anlage '".$al["bez"]."' wurden erfolgreich gespeichert.</b></p>\n";
+                    echo "<br /><br />\n";
+
+                // Anzeigen gespeicherte Pruefdaten
+                if ($fname)
+                    $pfile = $alpid . "_" . $fname;
+                else
+                    $pfile = $al['pfname'];
+                echo "<table>\n";
+                echo "<tr><td>Anlagen-ID: </td><td>" . $al["id"] . "<td></td></tr>\n";
+                echo "<tr><td>Anlagenbezeichnung: </td><td>" . $al['bez'] . "<td></td></tr>\n";
+                $pdat = new DateTime($al["pdat"]);
+                if (is_object($pdat)) $pdat = $pdat->format('d.m.Y H:i:s'); else $pdat = "&nbsp;";
+                echo "<tr><td>Prüfdatum: </td><td>" . $pdat. "</td></tr>\n";
+                if ($fname>"!") echo "<tr><td>Dateiname Prüfprotokoll: </td><td>" . $pfile. "</td></tr>\n";
+                echo "<tr><td>Bemerkung: </td><td>" . $al['bem'] . "<td></td></tr>\n";
+                echo "</table>\n";   
+            }            
+            $dbc -> close();
+            echo "</div>\n";
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"alpruef_ed.php\" target=\"_self\" title=\"Pr&uuml;fung erfassen\">Weitere Anlagen-Pr&uuml;fung erfassen</a></p>\n";    
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"alpruef_flist.php\" target=\"_self\" title=\"Anlagen pruefen\">Liste der Anlagenpr&uuml;fungen</a></p>\n"; 
+        }
+ ?>
+ </body>
+ </html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/alpruef_flist.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,192 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ * 
+ * Liste der Anlagenpruefungen (sortieren, filtern)
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+?>
+<!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" media="screen" /> 
+   	<link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print" /> 
+
+	<title>Liste Anlagenpruefungen</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+    
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+
+    // Felder, nach denen gefiltert werden kann
+    $fields = array(2=>"Bezeichnung",3=>"Pr&uuml;fdatum",5=>"Anlagen-ID");
+
+    $zeil = $_GET["z"];
+    if (!$zeil) $zeil = $_POST["z"];
+    if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+    $start = $_GET["st"];
+    if (!$start) $start=0;
+    
+	$sort   = $_GET["s"];   // Sortierung nach Spalte
+    if (!isset($sort) && !$sort) $sort = $_POST["s"];      
+
+    $dir    = $_GET["d"];   // Sortierrichtung
+    if (!isset($dir) && !$dir) $dir = $_POST["d"];
+
+    $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
+    if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+    $filter = $_POST["filter"];
+    if (!isset($filter) && !$filter) $filter = $_GET["b"];   
+
+    $subf   = $_POST["subf"]; // submit
+    
+    if (!isset($fnum) && !$fnum) $fnum = 1;
+    if (!isset($filter) && !$filter) $filter = "";
+    if (!isset($sort) && !$sort) $sort = 2;
+    if (!isset($dir) && !$dir)  $dir = "";
+
+    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+
+    $sql = "CALL alpruef_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);"; 
+    // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Anzahl gefundener Anlagen
+    // liefert: alp_ID,al_bez,pruef_date,pruef_file,pruef_bem,al_id
+//    echo "sql = $sql<br />";  
+    $result = $dbc ->queryObjectArray($sql);
+    if ($dbc ->error) echo "error: " . $dbc ->error . "<br />";
+
+    if ($result)
+    {
+		$bg1 = "#F8F8F8";
+		$bg2 = "#DEDFE1";
+		$bg = "#FFFFFF";
+     
+        echo "<div align='center'>\n";
+ 
+        echo "<p><b>Anlagenpr&uuml;fungen</b></p>\n";
+        
+        echo "<table border='0' cellspacing='0'>\n";
+        echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />' 
+            können Sie nach relevanten Spalten auf- bzw. absteigend sortieren</td></tr>
+            <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' erm&ouml;glicht das Filtern nach ausgew&auml;hlten Spalten der Liste</td></tr>
+            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Anlagenpr&uuml;fung</td></tr>\n";
+        echo "</table>\n";
+
+        $panz = $dbc -> querySingleItem("SELECT @anz");
+        printf ("<p>Anzahl Anlagenpr&uuml;fungen: %s</p>", $panz);
+        
+        if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+        {
+            // Formular anzeigen fuer Filterbegriff
+            $text = $fields[$fnum];
+            echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
+            echo "<table width=\"25%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n";
+            echo "<tr><td>filtern nach $text: ";
+            echo "</td>";
+            echo "<td><input id='filter' name='filter' type=\"text\" size=\"10\" maxlength=\"30\" value=\"$filter\"/></td>";
+            echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr>\n";
+            if ($fnum == 3) echo "<tr><td colspan='3'>Datum im Format 'jjjj-mm-tt' angeben oder Teilbereich davon</td></tr>\n";
+            echo "<input type='hidden' name='s' value='$sort' />";
+            echo "<input type='hidden' name='d' value='$dir' />";
+            echo "<input type='hidden' name='f' value='$fnum' />";
+            echo "</table>\n";
+            echo "</form>\n";
+            echo "<p>&nbsp;&nbsp;&nbsp;";
+            if ($fnum == 3) echo "<br />&nbsp;&nbsp;&nbsp;</p>\n"; else echo "</p>\n";
+        }
+
+        echo "<table>\n";
+        
+        if ($filter>'!') echo "<tr><td class='bigger' colspan=5>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+        // Listenkopf generieren
+        echo "<tr bgcolor='#68ACBF'>";
+        tab_column(2,"Anlage",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+        tab_column(3,"Prüfdatum",$sort,$dir,3,$fnum,$filter,$start,$zeil);
+        tab_column(4,"Protokoll",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        echo "<th>Bemerkung</th>";
+
+        echo "<th>&nbsp;</th></tr>\n";
+        
+        foreach ($result as $row)
+        {
+			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+            echo "<tr bgcolor='" . $bg . "'><td>$row->al_bez</a></td>";
+            echo "<td>$row->pruef_date</td>";
+            if (file_exists("alprot/".$row->pruef_file))
+            {
+                $prot = substr($row->pruef_file,strpos($row->pruef_file,"_")+1); 
+                echo "<td><a href='alprot/$row->pruef_file'>$prot</a></td>";
+            }
+            else    
+                echo "<td>$row->pruef_file</td>";
+            echo "<td>" .nl2br($row->pruef_bem)."</td>";    
+            echo "<td><a href='/fhiiqm/alpruef_ed.php?i=$row->alp_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+        }
+        echo "</table></div>\n";
+
+        echo "<br />&nbsp;&nbsp;&nbsp;";
+        
+        // Sortierung und Filter aus $_GET fuer weitere Seiten
+        foreach ($_GET as $key=>$val)
+        {
+            if ($key != "st") $liste .= "&" . $key ."=".$val;
+        }    
+        // Sortierung und Filter aus $_POST fuer weitere Seiten
+        if ($subf)
+        foreach ($_POST as $key=>$val)
+        {
+            if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+            if ($key == "filter") $liste .= "&b=" . $val;
+        }    
+        
+        // Links auf andere Seiten generieren
+        liste_links($start,$zeil,$panz,$liste);
+
+    }
+    else
+    {
+        if ($dbc -> error)  
+            echo "error: " . $dbc -> error . "<br />\n";
+        else
+        {
+            echo "<p class='red'>&nbsp;&nbsp;&nbsp;Leider nichts gefunden f&uuml;r ". $fields["$fnum"] . " wie '$filter'!</p><br />";
+            echo "&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Anlagen\" class=\"sc\">Anlagenpr&uuml;fungen</a></p>\n";
+        }
+        
+    }
+    $dbc -> close();
+    if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/alpruef_ed.php\" target=\"_self\" title=\"Anlagenpruefung erfassen\" class=\"sc\">Weitere Anlagenpr&uuml;fung erfassen</a></p>\n";    
+
+?>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/alrisk_ed.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,210 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+    include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+    if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+?>
+
+<!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>Risiko Anlage</title>
+ </head>
+ 
+ <body>
+
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+?>
+
+    <div align='center'>
+
+    <script>
+      $(document).ready(function() {
+        $("#arbez").focus();
+        $("#arbez").autocomplete({
+                source: "/fhiiqm/inc/al_list_ac.inc.php",
+    			minLength: 2,
+                select: function(event,ui){$("#arid").val(ui.item.id);}
+    		});
+        $("input").albez("long20").addClass("long20");
+        });
+    </script>
+
+    <?php
+        $ar     = $_POST["ar"];
+        $arid   = $_GET["i"];
+        $sub    = $_POST["eintragen"];
+        $del    = $_POST["del"];
+    	$ok		= $_POST["ok"];
+        if (!$ar['okn']) $ok=false;
+//        print_r($al);
+        
+        if ($arid) $text = "editieren"; else $text = "erfassen";
+        echo "<h3>Risiko Anlage $text<h3>";
+        
+        echo "</div>\n";
+        
+        if (!$ok || (!$sub && !$del))
+        {
+            if ($arid && (!$sub || !$del) && !isset($ar))
+            { // update
+                $sql = "SELECT risk_ID,r.al_ID,al_bez,risk_name,risk_probability,risk_damage,risk_sci_importance 
+                        FROM `fhiiqm`.`A_Risiko` r INNER JOIN 
+                            fhiiqm.Anlage a ON r.al_ID=a.al_ID
+                        WHERE risk_ID = $arid";
+                if ($result = $dbc -> queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        $ar["bez"]  = $row->al_bez;
+                        $ar["risk"] = $row->risk_name;
+                        $ar["rprob"]= str_replace(".",",",$row->risk_probability*100);
+                        $ar["rdam"] = str_replace(".",",",$row->risk_damage);
+                        $ar["rimp"] = str_replace(".",",",$row->risk_sci_importance);
+                        $ar["id"]   = $row->al_ID;
+                    }
+                 } 
+                        
+            }
+            include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/alrisk_form.inc.php");     
+            if ($sub || $del)
+    		{
+    		  	if ($sub)
+                    $frage = "Alle Angaben ok?";
+                elseif ($del)
+                    $frage = "Risiko wirklich l&ouml;schen?";
+    			echo "<tr>
+    			  <td class=\"red\" valign=\"top\" align=\"left\">$frage</td>
+    			        <td><input type=\"checkbox\" name=\"ok\" value=\"1\"";
+    			        if ($ok)  echo "checked"; 
+    			echo "></td>\n</tr>\n"; 
+    		}
+            if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+            {
+                echo "
+               	<tr><td>&nbsp;</td>\n
+                	<td><input  class=\"button\" type=\"submit\" name=\"eintragen\" value=\"  eintragen  \" />";
+                if ($arid)
+                    echo "&nbsp;&nbsp;&nbsp;<input class=\"button\" type=\"submit\" value=\"l&ouml;schen\" name=\"del\" title=\"delete\" />";
+               	echo "</td></tr>\n";
+            }
+            echo "</table>\n";
+            echo "</div>\n";
+            if (!is_null($_SESSION["recht"]) && !in_array("ae", $_SESSION["recht"]))
+                echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"alrisk_flist.php\" target=\"_self\" title=\"Risiko Anlagen\">&laquo; Liste Risiko Anlagen</a></p>\n"; 
+            echo "</form>\n";   
+
+        }
+        else
+        {
+            echo "<div align='center'>\n";
+            
+            $sql = "SELECT al_bez FROM fhiiqm.Anlage WHERE al_ID=".$ar[id];
+            $albez = $dbc->querySingleItem($sql);
+            
+            if ($del)
+            {
+                $sql = "DELETE FROM A_Risiko WHERE risk_ID=$arid";   
+                $res = $dbc -> execute($sql);
+                if ($res)
+                    echo "<p class='green'><b>DELETE: Risiko '".substr($ar["risk"],0,20)." ' zu '$albez' wurde erfolgreich gel&ouml;scht.</b></p>\n";
+                else
+                    echo "<p class='red'><b>DELETE: Risiko '".substr($ar["risk"],0,20)." '   zu '$albez' konnte nicht gel&ouml;scht werden!</b></p>\n";
+            }
+            else //INSERT oder UPDATE
+            {
+                $ar["rprob"]= str_replace(",",".",$ar["rprob"])/100;
+                $ar["rdam"] = str_replace(",",".",$ar["rdam"]);
+                $ar["rimp"] = str_replace(",",".",$ar["rimp"]);
+                $stmt = $dbc -> stmtinit();
+                if (is_object($stmt))
+                {
+                    if ($arid)
+                    {
+                        //edit
+                        $stmt->prepare("UPDATE fhiiqm.A_Risiko SET 
+                                        al_ID = ?,
+                                        risk_name = ?,
+                                        risk_probability = ?,
+                                        risk_damage = ?,
+                                        risk_sci_importance = ?
+                                        WHERE risk_ID = $arid");
+                        $stmt->bind_param("isddd",$ar["id"],$ar["risk"],$ar["rprob"],$ar["rdam"],$ar["rimp"]);                    
+                        $res = $stmt -> execute();
+    //                            print_r($stmt);
+                        if ($stmt->error) echo "UPDATE Anlagenrisiko, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                        if ($res)
+                            echo "<p class='green'><b>UPDATE: Risiko '".substr($ar["risk"],0,20)." ' zu '$albez' wurde erfolgreich gespeichert.</b></p>\n";
+                        else
+                            echo "<p class='red'><b>UPDATE: Risiko '".substr($ar["risk"],0,20)." ' zu '$albez' konnte nicht gespeichert werden!</b></p>\n";
+                    }
+                    else 
+                    {
+                        //insert
+                        $stmt->prepare("INSERT INTO fhiiqm.A_Risiko (al_ID,risk_name,risk_probability,risk_damage,risk_sci_importance) VALUES(?,?,?,?,?)");
+                        $stmt->bind_param("isddd",$ar["id"],$ar["risk"],$ar["rprob"],$ar["rdam"],$ar["rimp"]);                    
+                        $res = $stmt -> execute();
+    //                            print_r($stmt);
+                        if ($stmt->error) echo "INSERT Anlagenrisiko, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                        if ($res)
+                        {
+                            // risk_ID ermitteln
+                            $arid = $dbc -> insertId();
+                            echo "<p class='green'><b>INSERT: Risiko '".substr($ar["risk"],0,20)." ' zu '$albez' wurde erfolgreich gespeichert.</b></p>\n";
+                        }
+                        else
+                            echo "<p class='red'><b>INSERT: Risiko '".substr($ar["risk"],0,20)." ' zu '$albez' konnte nicht gespeichert werden!</b></p>\n";
+                    }
+                }
+            }
+            if ($res)
+            {
+                // Daten zeigen
+                echo "<table>\n";
+                echo "<tr><td>Risiko-ID: </td><td>" . $arid . "<td></td></tr>\n";
+                echo "<tr><td>Risikobezeichnung: </td><td>" . $ar['risk'] . "<td></td></tr>\n";
+                echo "<tr><td>Anlagenbezeichnung: </td><td>$albez<td></td></tr>\n";
+                echo "<tr><td>Risikowahrscheinlichkeit: </td><td>" . str_replace(".",",",$ar['rprob']*100) . " %<td></td></tr>\n";
+                echo "<tr><td>geschätze Schadenshöhe: </td><td>" . number_format($ar['rdam'],2,",",".") . " &euro;<td></td></tr>\n";
+                echo "<tr><td>Wichtung der Bedeutung<br />f&uuml;r Forschungsbetrieb: </td><td class='valignb'>" . str_replace(".",",",$ar['rimp']) . "<td></td></tr>\n";
+                echo "</table>\n";
+            }
+            echo "</div>\n";       
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"alrisk_flist.php\" target=\"_self\" title=\"Anlagenrisiko\">Risiko-Anlagen-Liste</a>\n";    
+
+            
+        }
+ ?>
+ </body>
+ </html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/alrisk_flist.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,186 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ * 
+ * Liste der Anlagenpruefungen (sortieren, filtern)
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+?>
+<!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" media="screen" /> 
+   	<link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print" /> 
+
+	<title>Liste Risiko Anlagen</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+    
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+
+    // Felder, nach denen gefiltert werden kann
+    $fields = array(2=>"Risikobezeichnung",3=>"Anlagebezeichnung",5=>"Anlagen-ID");
+
+    $zeil = $_GET["z"];
+    if (!$zeil) $zeil = $_POST["z"];
+    if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+    $start = $_GET["st"];
+    if (!$start) $start=0;
+    
+	$sort   = $_GET["s"];   // Sortierung nach Spalte
+    if (!isset($sort) && !$sort) $sort = $_POST["s"];      
+
+    $dir    = $_GET["d"];   // Sortierrichtung
+    if (!isset($dir) && !$dir) $dir = $_POST["d"];
+
+    $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
+    if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+    $filter = $_POST["filter"];
+    if (!isset($filter) && !$filter) $filter = $_GET["b"];   
+
+    $subf   = $_POST["subf"]; // submit
+    
+    if (!isset($fnum) && !$fnum) $fnum = 1;
+    if (!isset($filter) && !$filter) $filter = "";
+    if (!isset($sort) && !$sort) $sort = 2;
+    if (!isset($dir) && !$dir)  $dir = "";
+
+    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+
+    $sql = "CALL alrisk_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);"; 
+    // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Anzahl gefundener Anlagen
+    // liefert: risk_ID,risk_name,al_bez,risk_probability,risk_damage,risk_sci_importance,al_id
+//    echo "sql = $sql<br />";  
+    $result = $dbc ->queryObjectArray($sql);
+    if ($dbc ->error) echo "error: " . $dbc ->error . "<br />";
+
+    if ($result)
+    {
+		$bg1 = "#F8F8F8";
+		$bg2 = "#DEDFE1";
+		$bg = "#FFFFFF";
+     
+        echo "<div align='center'>\n";
+ 
+        echo "<p><b>Risiko Anlagen</b></p>\n";
+        
+        echo "<table border='0' cellspacing='0'>\n";
+        echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />' 
+            können Sie nach relevanten Spalten auf- bzw. absteigend sortieren</td></tr>
+            <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' erm&ouml;glicht das Filtern nach ausgew&auml;hlten Spalten der Liste</td></tr>
+            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten Risiko Anlage</td></tr>\n";
+        echo "</table>\n";
+
+        $panz = $dbc -> querySingleItem("SELECT @anz");
+        printf ("<p>Anzahl Risiken Anlage: %s</p>", $panz);
+        
+        if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+        {
+            // Formular anzeigen fuer Filterbegriff
+            $text = $fields[$fnum];
+            echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
+            echo "<table width=\"25%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n";
+            echo "<tr><td>filtern nach $text: ";
+            echo "</td>";
+            echo "<td><input id='filter' name='filter' type=\"text\" size=\"10\" maxlength=\"30\" value=\"$filter\"/></td>";
+            echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr>\n";
+            echo "<input type='hidden' name='s' value='$sort' />";
+            echo "<input type='hidden' name='d' value='$dir' />";
+            echo "<input type='hidden' name='f' value='$fnum' />";
+            echo "</table>\n";
+            echo "</form>\n";
+            echo "<p>&nbsp;&nbsp;&nbsp;";
+        }
+
+        echo "<table>\n";
+        
+        if ($filter>'!') echo "<tr><td class='bigger' colspan=5>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+        // Listenkopf generieren
+        echo "<tr bgcolor='#68ACBF'>";
+        tab_column(2,"Risiko",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+        tab_column(3,"Anlage",$sort,$dir,3,$fnum,$filter,$start,$zeil);
+        tab_column(4,"Wahrscheinlichkeit",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(5,"Schadenshöhe",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(4,"Wichtigkeit",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+
+        echo "<th>&nbsp;</th></tr>\n";
+        
+        foreach ($result as $row)
+        {
+			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+            echo "<tr bgcolor='" . $bg . "'><td>$row->risk_name</a></td>";
+            echo "<td>$row->al_bez</td>";
+            echo "<td>" . str_replace(".",",",$row->risk_probability*100)." %</td>";    
+            echo "<td>" . number_format($row->risk_damage,2,",",".") . " &euro;</td>";    
+            echo "<td>" . str_replace(".",",",$row->risk_sci_importance)."</td>";    
+            echo "<td><a href='/fhiiqm/alrisk_ed.php?i=$row->risk_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+        }
+        echo "</table></div>\n";
+
+        echo "<br />&nbsp;&nbsp;&nbsp;";
+        
+        // Sortierung und Filter aus $_GET fuer weitere Seiten
+        foreach ($_GET as $key=>$val)
+        {
+            if ($key != "st") $liste .= "&" . $key ."=".$val;
+        }    
+        // Sortierung und Filter aus $_POST fuer weitere Seiten
+        if ($subf)
+        foreach ($_POST as $key=>$val)
+        {
+            if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+            if ($key == "filter") $liste .= "&b=" . $val;
+        }    
+        
+        // Links auf andere Seiten generieren
+        liste_links($start,$zeil,$panz,$liste);
+
+    }
+    else
+    {
+        if ($dbc -> error)  
+            echo "error: " . $dbc -> error . "<br />\n";
+        else
+        {
+            echo "<p class='red'>&nbsp;&nbsp;&nbsp;Leider nichts gefunden f&uuml;r ". $fields["$fnum"] . " wie '$filter'!</p><br />";
+            echo "&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Anlagen\" class=\"sc\">Risiko Anlagen</a></p>\n";
+        }
+        
+    }
+    $dbc -> close();
+    if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/alrisk_ed.php\" target=\"_self\" title=\"Risiko Anlage erfassen\" class=\"sc\">Weiteres Risiko Anlage erfassen</a></p>\n";    
+
+?>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/anlage_ed.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,234 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 11/2011
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+    include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+    if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+?>
+
+<!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>Anlage</title>
+ </head>
+ 
+ <body>
+
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+?>
+
+    <div align='center'>
+
+    <script>
+      $(document).ready(function() {
+        $("#albez").focus();
+        $("#persknr").autocomplete({
+                source: "/fhiiqm/inc/ma_list_ac.inc.php",
+    			minLength: 2,
+                select: function(event,ui){$("#pid").val(ui.item.id);}
+    		});
+        $("input").persknr("long20").addClass("long20");
+        });
+    </script>
+
+    <?php
+        $al     = $_POST["al"];
+        $alid   = $_GET["i"];
+        $sub    = $_POST["eintragen"];
+        $del    = $_POST["del"];
+    	$ok		= $_POST["ok"];
+        if (!$al['okn']) $ok=false;
+//        print_r($al);
+        
+        if ($alid) $text = "editieren"; else $text = "erfassen";
+        echo "<h3>Anlage $text<h3>";
+        
+        echo "</div>\n";
+        
+        if (!$ok || (!$sub && !$del))
+        {
+            if ($alid && (!$sub || !$del) && !isset($al))
+            { // update
+                $sql = "SELECT al_ID,al_bez,al_beschreibung,al_kat_ID,al_befgrad_ID,al_pruefart_ID,al_pruefintv_ID,
+                            a.raum_ID,geb_ID,a.persknr, CONCAT(nachname,', ',vorname) AS vname 
+                        FROM `fhiiqm`.`Anlage` a LEFT OUTER JOIN fhiiqm.Mitarbeiter m ON 
+                            a.persknr = m.persknr  LEFT OUTER JOIN fhiiqm.Raum r ON
+                            a.raum_ID=r.raum_ID
+                        WHERE al_ID = $alid";
+                if ($result = $dbc -> queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        $al["bez"]  = $row->al_bez;
+                        $al["beschr"]   = $row->al_beschreibung;
+                        $al["kat"]  = $row->al_kat_ID;
+                        $al["befg"] = $row->al_befgrad_ID;
+                        $al["part"] = $row->al_pruefart_ID;
+                        $al["pintv"] = $row->al_pruefintv_ID;
+                        $al["geb"] = $row->geb_ID;
+                        $al["raum"] = $row->raum_ID;
+                        $al["pid"]  = $row->persknr;
+                        $al["persknr"] = $row->vname;
+                     }
+                 } 
+                        
+            }
+            include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/anlage_form.inc.php");     
+            if ($sub || $del)
+    		{
+    		  	if ($sub)
+                    $frage = "Alle Angaben ok?";
+                elseif ($del)
+                    $frage = "Anlage wirklich l&ouml;schen?";
+    			echo "<tr>
+    			  <td class=\"red\" valign=\"top\" align=\"left\">$frage</td>
+    			        <td><input type=\"checkbox\" name=\"ok\" value=\"1\"";
+    			        if ($ok)  echo "checked"; 
+    			echo "></td>\n</tr>\n"; 
+    		}
+            if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+            {
+                echo "
+               	<tr><td>&nbsp;</td>\n
+                	<td><input  class=\"button\" type=\"submit\" name=\"eintragen\" value=\"  eintragen  \" />";
+                if ($alid)
+                    echo "&nbsp;&nbsp;&nbsp;<input class=\"button\" type=\"submit\" value=\"l&ouml;schen\" name=\"del\" title=\"delete\" />";
+               	echo "</td></tr>\n";
+            }
+            echo "</table>\n";
+            echo "</div>\n";
+            if (!is_null($_SESSION["recht"]) && !in_array("ae", $_SESSION["recht"]))
+                echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"anlage_flist.php\" target=\"_self\" title=\"Anlagen\">&laquo; zur Anlagenliste</a></p>\n"; 
+            echo "</form>\n";   
+
+        }
+        else
+        {            
+            echo "<div align='center'>\n";
+            
+            if ($del)
+            {
+                // sind Pruefprotokolle vorhanden zu alid?
+                $sql = "SELECT alp_ID FROM `fhiiqm`.`A_Pruefung` WHERE al_ID=$alid";
+                $result = $dbc -> queryObjectArray($sql);
+//                print_r ($result);
+                // Anlage loeschen
+                $sql = "DELETE FROM Anlage WHERE al_ID = $alid";
+                $retad = $dbc -> execute($sql);
+                if ($retad)
+                {
+                    echo "<p class='green'><b>DELETE: Daten  zu '".$al["bez"]."' wurden erfolgreich gel&ouml;scht.</b></p>\n";
+                    {
+                        if ($result) // vorhandene Protokolle auf Server physisch loeschen
+                        {
+                            include ("inc/file_upload.inc.php");
+                            foreach ($result as $row)
+                            {
+                                $retdf  = mod_file("/var/www/fhiiqm/alprot",$row->alp_ID,"","del");  // Loeschen Protokoll
+                                if (!$retdf) $strpdel .= ",".$row->alp_ID;
+                            }
+                        }
+                    }
+                    if ($strpdel > "") 
+                        echo "<p class='red><b>Pruefprotokoll(e) zu '".$al["bez"]."' mit ID(s)" . substr($strpdel,1) . "konnte(n) nicht gel&ouml;scht werden!</b></p>\n";
+                    else 
+                        echo "<p class='green'><b>Pruefprotokolle zu '".$al["bez"]."' wurden gel&ouml;scht (Server u. DB).</b></p>\n";
+                    include ("inc/anlage_dat_show.inc.php");
+                }                    
+                else
+                    echo "<p class='red'><b>DELETE: Daten  zu '".$al["bez"]."' konnten nicht gel&ouml;scht werden!</b></p>\n";
+            }
+            else //INSERT oder UPDATE
+            {
+                if ($al["beschr"]) $al["beschr"] = substr($al["beschr"],0,250); else $al["beschr"] = null;
+                if ($al["kat"]== -1) $al["kat"] = null;
+                if ($al["befg"]== -1) $al["befg"] = null;
+                if ($al["part"]== -1) $al["part"] = null;
+                if ($al["pintv"]== -1) $al["pintv"] = null;
+                if ($al["raum"]== -1) $al["raum"] = null;
+                $stmt = $dbc -> stmtinit();
+                if (is_object($stmt))
+                {
+                    if ($alid)
+                    {
+                        //edit
+                        $stmt -> prepare("UPDATE fhiiqm.Anlage SET
+                                    al_bez = ?,
+                                    al_beschreibung = ?,
+                                    al_kat_ID = ?,
+                                    al_befgrad_ID = ?,
+                                    al_pruefart_ID = ?,
+                                    al_pruefintv_ID = ?,
+                                    raum_ID = ?,
+                                    persknr = ? 
+                                    WHERE al_ID = $alid");
+                        $stmt -> bind_param('sssssiii',$al["bez"],$al["beschr"],$al["kat"],$al["befg"],$al["part"],$al["pintv"],$al["raum"],$al["pid"]);
+                        $res = $stmt -> execute();
+    //                            print_r($stmt);
+                        if ($stmt->error) echo "UPDATE Anlage, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                        if ($res)
+                            echo "<p class='green'><b>UPDATE: Daten  zu '".$al["bez"]."' wurden erfolgreich gespeichert.</b></p>\n";
+                        else
+                            echo "<p class='red'><b>UPDATE: Daten  zu '".$al["bez"]."' konnten nicht gespeichert werden!</b></p>\n";
+                    }
+                    else
+                    {
+                        //insert
+                        $stmt -> prepare("INSERT INTO fhiiqm.Anlage (al_bez, al_beschreibung, al_kat_ID, al_befgrad_ID, al_pruefart_ID, al_pruefintv_ID, raum_ID, persknr) 
+                                    VALUES (?,?,?,?,?,?,?,?)");
+                        $stmt -> bind_param('sssssiii',$al["bez"],$al["beschr"],$al["kat"],$al["befg"],$al["part"],$al["pintv"],$al["raum"],$al["pid"]);
+                        $res = $stmt -> execute();
+    //                    $res = 1;
+                        if ($stmt->error) echo "INSERT Anlage, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
+                        if ($res)
+                        {
+                            // anlagen_ID ermitteln
+                            $alid = $dbc -> insertId();
+                            echo "<p class='green'><b>INSERT: Daten  zu '".$al["bez"]."' wurden erfolgreich gespeichert.</b></p>\n";
+                        }    
+                        else
+                            echo "<p class='red'><b>INSERT: Daten  zu '".$al["bez"]."' konnten nicht gespeichert werden!</b></p>\n";
+                    }
+                    if ($res) include ("inc/anlage_dat_show.inc.php");
+                }
+            }
+            echo "</div>\n";       
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"anlage_flist.php\" target=\"_self\" title=\"Anlagen\">Anlagenenliste</a>\n";    
+            echo "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"anlage_ed.php\" target=\"_self\" title=\"Anlage erfassen\">Weitere Anlage erfassen</a></p>";    
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/alpruef_flist.php\" target=\"_self\" title=\"Anlagenpruefung-Liste\" class=\"sc\">Liste Anlagenpr&uuml;fungen</a>";    
+            echo "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/alpruef_ed.php\" target=\"_self\" title=\"Anlagenpruefung erfassen\" class=\"sc\">Anlagenpr&uuml;fung erfassen</a></p>\n";    
+        }      
+
+ ?>
+ </body>
+ </html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/anlage_flist.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,199 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 11/2011
+ * 
+ * Liste der Anlagen (sortieren, filtern)
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ar",$_SESSION["recht"]) && !in_array("ae",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+?>
+<!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" media="screen" /> 
+   	<link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print" /> 
+
+	<title>Liste Anlagen</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+    
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/rotate_01.png\" border=\"0\" alt=\"Anlage\" title=\"Anlage\"/></div>\n";
+
+    // Felder, nach denen gefiltert werden kann
+    $fields = array(2=>"Bezeichnung",4=>"Kategorie",5=>"Bef&auml;higungsgrad",6=>"Pr&uuml;fart",7=>"Pr&uuml;fintervall",8=>"Haus",9=>"Raum-Nr.",10=>"Verantwortlicher");
+
+    $zeil = $_GET["z"];
+    if (!$zeil) $zeil = $_POST["z"];
+    if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+    $start = $_GET["st"];
+    if (!$start) $start=0;
+    
+	$sort   = $_GET["s"];   // Sortierung nach Spalte
+    if (!isset($sort) && !$sort) $sort = $_POST["s"];      
+
+    $dir    = $_GET["d"];   // Sortierrichtung
+    if (!isset($dir) && !$dir) $dir = $_POST["d"];
+
+    $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
+    if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+    $filter = $_POST["filter"];
+    if (!isset($filter) && !$filter) $filter = $_GET["b"];   
+
+    $subf   = $_POST["subf"]; // submit
+    
+    if (!isset($fnum) && !$fnum) $fnum = 1;
+    if (!isset($filter) && !$filter) $filter = "";
+    if (!isset($sort) && !$sort) $sort = 2;
+    if (!isset($dir) && !$dir)  $dir = "";
+
+    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+
+    $sql = "CALL anlage_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);"; 
+    // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Anzahl gefundener Anlagen
+    // liefert: al_ID,al_bez,kat,befgr,pruef,geb_ID,raum_nr,verantw,persknr,raum_ID,raum_name
+//    echo "sql = $sql<br />";  
+    $result = $dbc ->queryObjectArray($sql);
+
+    if ($result)
+    {
+		$bg1 = "#F8F8F8";
+		$bg2 = "#DEDFE1";
+		$bg = "#FFFFFF";
+     
+        echo "<div align='center'>\n";
+        echo "<p><b>Anlagen</b></p>\n";
+        
+        echo "<table border='0' cellspacing='0'>\n";
+        echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />' 
+            können Sie nach relevanten Spalten auf- bzw. absteigend sortieren</td></tr>
+            <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' erm&ouml;glicht das Filtern nach ausgew&auml;hlten Spalten der Liste</td></tr>
+            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Anlage, 
+            '<img src='/fhiiqm/img/details.gif' border='0' hight='11'>' - Pr&uuml;fungen der Anlage, 
+            '<img src='/fhiiqm/img/fire.png' border='0' hight='11'>' - Risiken der Anlage</td>
+            </tr>\n";
+        echo "</table>\n";
+
+        $panz = $dbc -> querySingleItem("SELECT @anz");
+        printf ("<p>Anzahl Anlagen: %s</p>", $panz);
+        
+        if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+        {
+            // Formular anzeigen fuer Filterbegriff
+            $text = $fields[$fnum];
+            echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
+            echo "<input type='hidden' name='s' value='$sort'>";
+            echo "<input type='hidden' name='d' value='$dir'>";
+            echo "<input type='hidden' name='f' value='$fnum'>";
+            echo "<table width=\"25%\" border=\"0\">\n";
+            echo "<tr><td>filtern nach $text: </td>";
+            echo "<td><input id='filter' name='filter' type=\"text\" size=\"10\" maxlength=\"30\" value=\"$filter\"/></td>";
+            
+            echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr></table>\n";
+            echo "</form>\n";
+            echo "<p>&nbsp;&nbsp;&nbsp;</p>\n";
+        }
+        echo "<table width='99%'>\n";
+        
+        if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+        // Listenkopf generieren
+        echo "<tr bgcolor='#68ACBF'>";
+        tab_column(2,"Bezeichnung",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+        echo "<th>Beschreibung</th>";
+        tab_column(4,"Kategorie",$sort,$dir,4,$fnum,$filter,$start,$zeil);
+        tab_column(5,"Bef&auml;higungsgrad",$sort,$dir,5,$fnum,$filter,$start,$zeil);
+        tab_column(6,"Pr&uuml;fart",$sort,$dir,6,$fnum,$filter,$start,$zeil);
+        tab_column(7,"Pr&uuml;fintervall",$sort,$dir,7,$fnum,$filter,$start,$zeil);
+        tab_column(8,"Haus",$sort,$dir,8,$fnum,$filter,$start,$zeil);
+        tab_column(9,"Raum-Nr.",$sort,$dir,9,$fnum,$filter,$start,$zeil);
+        tab_column(10,"Verantwortlicher",$sort,$dir,10,$fnum,$filter,$start,$zeil);
+
+        echo "<th>&nbsp;</th>";
+        echo "<th>&nbsp;</th>";
+        echo "<th>&nbsp;</th></tr>\n";
+        
+        foreach ($result as $row)
+        {
+			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+            echo "<tr bgcolor='" . $bg . "'><td>$row->al_bez</a></td>";
+            echo "<td>" .nl2br($row->al_beschreibung)."</td>";    
+            echo "<td>$row->kat</td>";
+            echo "<td>$row->befgr</td>";
+            echo "<td>$row->pruef</td>";
+            echo "<td>$row->pintv</td>";
+            echo "<td>$row->geb_ID</td>";
+            echo "<td>$row->raum_nr</td>";
+            echo "<td>$row->verantw</td>";
+            echo "<td><a href='/fhiiqm/anlage_ed.php?i=$row->al_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
+            echo "<td><a href='/fhiiqm/alpruef_flist.php?s=3&d=DESC&f=5&b=$row->al_ID&st=0&z=25'>
+                <img src=\"/fhiiqm/img/details.gif\" alt='Pr&uuml;fungen' title='Pr&uuml;fungen' border='0'/></a></td>";
+            echo "<td><a href='/fhiiqm/alrisk_flist.php?s=2&d=&f=5&b=$row->al_ID&st=0&z=25'>
+                <img src=\"/fhiiqm/img/fire.png\" alt='Risiken' title='Risiken' border='0'/></a></td></tr>\n";
+        }
+        echo "</table></div>\n";
+
+        echo "<br />&nbsp;&nbsp;&nbsp;";
+        
+        // Sortierung und Filter aus $_GET fuer weitere Seiten
+        foreach ($_GET as $key=>$val)
+        {
+            if ($key != "st") $liste .= "&" . $key ."=".$val;
+        }    
+        // Sortierung und Filter aus $_POST fuer weitere Seiten
+        if ($subf)
+        foreach ($_POST as $key=>$val)
+        {
+            if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+            if ($key == "filter") $liste .= "&b=" . $val;
+        }    
+        
+        // Links auf andere Seiten generieren
+        liste_links($start,$zeil,$panz,$liste);
+
+    }
+    else
+    {
+        if ($dbc -> error)  
+            echo "error: " . $dbc -> error . "<br />\n";
+        else
+        {
+            echo "<p class='red'>&nbsp;&nbsp;&nbsp;Leider nichts gefunden f&uuml;r ". $fields["$fnum"] . " wie '$filter'!</p><br />";
+            echo "&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Anlagen\" class=\"sc\">Anlagen</a></p>\n";
+        }
+        
+    }
+    $dbc -> close();
+    if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/anlage_ed.php\" target=\"_self\" title=\"Anlage erfassen\" class=\"sc\">Weitere Anlage erfassen</a></p>\n";    
+
+?>
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/css/db.css	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/css/db.css	Fri Dec 09 14:33:22 2011 +0100
@@ -155,6 +155,10 @@
 {
     text-align: center;
 }
+.valignb
+{
+    vertical-align: bottom;
+}
 .long20
 {
     width: 20em;
--- a/fhiiqm/css/db_print.css	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/css/db_print.css	Fri Dec 09 14:33:22 2011 +0100
@@ -108,6 +108,22 @@
 {
     text-align: right;
 }
+.valignb
+{
+    vertical-align: bottom;
+}
+.long20
+{
+    width: 20em;
+}
+.long30
+{
+    width: 30em;
+}
+.long50
+{
+    width: 50em;
+}
 
 .button
 {   font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/alpruef_form.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ * 
+ * Form Anlage Pruefung
+ */
+
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+    $okn = true;
+
+?>
+<div align="center">
+<table>
+<tr><td class="bigger">Die Auswahl der Anlage geschieht durch<br />Eingeben von mindesten 2 Zeichen in das Anlage-Feld.
+</td></tr>
+<tr><td class="bigger"><div class="red">Achtung! </div>Umlaute wie '&auml;', '&uuml;', '&ouml;', '&szlig;' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
+<tr><td class="bigger">&nbsp;</td></tr>
+</table>
+</div>
+<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="falprot"> 
+<div align="center">
+    <table border="0" cellspacing="3" cellpadding="3">
+        <tr><td>Anlage *</td>
+            <td valign="top"><input class="long20" type="text" name="al[bez]" id="albez" value="<?php echo $al['bez']; ?>"/>
+            <?php
+                if (isset($al['bez']) && $al['bez']< "!")
+                { 
+                    echo "<br><span class=\"red\">Anlage ist erforderlich!</span>\n";
+                    $okn = false;
+                }    
+            ?>
+            </td>
+        </tr>
+        <tr><td>Pr&uuml;fdatum *
+            </td>
+            <td valign="top"><input class="long10" type="text" name="al[pdat]" id="alpdat" value="<?php echo $al['pdat']; ?>"/>
+            <?php
+                echo "<br />Uhrzeitangabe im Format 'hh:mm:ss' m&ouml;glich";
+                if (isset($al['pdat']) && $al['pdat']< "!")
+                { 
+                    echo "<br><span class=\"red\">Pr&uuml;fdatum ist erforderlich!</span>\n";
+                    $okn = false;
+                }    
+            ?>
+            </td>
+        </tr> 
+        <tr><td>Bemerkung</td>
+            <td valign="top"><textarea name="al[bem]" id="bem" rows="5" cols="50"><?php echo $al['bem']; ?></textarea>
+            </td>
+        </tr>
+	<tr>
+	   <td>Dateibezeichnung Pr&uuml;fprotokoll (*)</td>
+	   <td><input name="al[pfname]" type="text" size="50" maxlength="50" value="<?php echo $al['pfname']; ?>">
+	   <?php
+            echo "<br />bitte <u>keine</u> Umlaute im Dateinamen angeben!";   
+			if (isset($al['pfname']) && $upd && is_uploaded_file($_FILES["pfile"]["tmp_name"]) && $al['pfname']<'!')
+				{
+					echo "<br><span class=\"red\">Dateiname ist erforderlich!</span>\n";
+					$okn = false;
+				}
+				else
+				{
+                    if ($al['pfname']>='!' && file_exists("alprot/".$al['pfname']))
+                        echo "<br />Protokoll anschauen:&nbsp;<a href='alprot/" . $al['pfname'] ."'>" . $al['pfname'] . "</a>";
+                    if ($okn) $okn = true; else $okn=false;
+                }
+		?>
+		</td>
+    </tr>
+
+    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="al[id]" id="alid" value="<?php echo $al["id"]; ?>"/>
+    <input type="hidden" name="al[okn]" value="<?php echo $okn; ?>"/>
+<!-- </table>
+ </div>   
+</form> -->
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/alrisk_form.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ * 
+ * Form Anlage Risiko
+ */
+
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+    $okn = true;
+
+?>
+<div align="center">
+<table>
+<tr><td class="bigger">Die Auswahl der Anlage geschieht durch<br />Eingeben von mindesten 2 Zeichen in das Anlage-Feld.
+</td></tr>
+<tr><td class="bigger"><div class="red">Achtung! </div>Umlaute wie '&auml;', '&uuml;', '&ouml;', '&szlig;' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
+<tr><td class="bigger">&nbsp;</td></tr>
+</table>
+</div>
+<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="falrisk"> 
+<div align="center">
+    <table border="0" cellspacing="3" cellpadding="3">
+        <tr><td>Anlage *</td>
+            <td valign="top"><input class="long20" type="text" name="ar[bez]" id="arbez" value="<?php echo $ar['bez']; ?>"/>
+            <?php
+                if (isset($ar['bez']) && $ar['bez']< "!")
+                { 
+                    echo "<br><span class=\"red\">Anlage ist erforderlich!</span>\n";
+                    $okn = false;
+                }    
+            ?>
+            </td>
+        </tr>
+        <tr><td>Risikobezeichnung *</td>
+            <td valign="top"><input type="text" name="ar[risk]" size="50" maxlength="50" value="<?php echo $ar['risk']; ?>"/>
+            <?php
+                if (isset($ar['risk']) && $ar['risk']< "!")
+                { 
+                    echo "<br><span class=\"red\">Risikobezeichnung ist erforderlich!</span>\n";
+                    $okn = false;
+                }    
+            ?>
+            </td>
+        </tr>
+        <tr><td>Risikowahrscheinlichkeit</td>
+            <td valign="top"><input type="text" name="ar[rprob]" size="5" maxlength="5" value="<?php echo $ar['rprob']; ?>"/>%
+                <br />Wertebereich: 0 ... 100%, Kommastellen m&ouml;glich
+            </td>
+        </tr>
+        <tr><td>gesch&auml;tzte Schadensh&ouml;he</td>
+            <td valign="top"><input type="text" name="ar[rdam]" size="20" maxlength="20" value="<?php echo $ar['rdam']; ?>"/>&nbsp;&euro;
+                <br />2 Kommastellen m&ouml;glich
+            </td>
+        </tr>
+        <tr><td>Wichtung der Bedeutung<br />f&uuml;r Forschungsbetrieb</td>
+            <td valign="top"><input type="text" name="ar[rimp]" size="5" maxlength="5" value="<?php echo $ar['rimp']; ?>"/>
+                <br />Wertebereich: 0 - keine Bedeutung, 1 - entscheidend, Nachkommastellen m&ouml;glich
+            </td>
+        </tr>
+
+    <input type="hidden" name="ar[id]" id="arid" value="<?php echo $ar["id"]; ?>"/>
+    <input type="hidden" name="ar[okn]" value="<?php echo $okn; ?>"/>
+<!-- </table>
+ </div>   
+</form> -->
\ No newline at end of file
--- a/fhiiqm/form/anlage_form.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/form/anlage_form.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -43,25 +43,29 @@
         </tr>
         <tr><td>Kategorie</td>
             <td valign="top">
-                 <select name="al[kat]">
+                 <select name="al[kat]" onchange="this.form.submit();">
                 <?php 
                     if ($al['kat'] == -1) $select = " selected "; else $select = "";
                     echo "<option $select value=\"-1\"></option>\n";
-                    $sql = "SELECT al_kat_bez, al_kat_ID FROM `fhiiqm`.`A_Kategorie` ORDER BY 1";
+                    $sql = "SELECT al_kat_bez, al_kat_ID FROM `fhiiqm`.`A_Kategorie` ORDER BY 2";
                     if ($result = $dbc->queryObjectArray($sql))
                     {
                         foreach ($result as $row)
-                        {
+                        {   if (strlen($row->al_kat_ID) == 1) $katid =  $row->al_kat_ID . "&nbsp;&nbsp;"; else $katid = $row->al_kat_ID; 
                             if ($row->al_kat_ID == $al['kat'])
-        					   echo "<option selected value=\"$row->al_kat_ID\">$row->al_kat_ID: $row->al_kat_bez</option>\n";
+        					   echo "<option selected value=\"$row->al_kat_ID\">$katid: $row->al_kat_bez</option>\n";
         				    else
-        					   echo "<option value=\"$row->al_kat_ID\">$row->al_kat_ID: $row->al_kat_bez</option>\n";
+        					   echo "<option value=\"$row->al_kat_ID\">$katid: $row->al_kat_bez</option>\n";
                         }
                 }
                 ?>
                 </select>            
             </td>
         </tr>
+     <?php 
+        if ($al["kat"] != 4)
+        {
+     ?>       
         <tr><td>Bef&auml;higungsgrad</td>
             <td valign="top">
                  <select name="al[befg]">
@@ -74,9 +78,9 @@
                         foreach ($result as $row)
                         {
                             if ($row->al_befgrad_ID == $al['befg'])
-        					   echo "<option selected value=\"$row->al_befgrad_ID\">$row->al_befgrad_ID: $row->al_befgrad_bez</option>\n";
+        					   echo "<option selected value=\"$row->al_befgrad_ID\">$row->al_befgrad_bez</option>\n";
         				    else
-        					   echo "<option value=\"$row->al_befgrad_ID\">$row->al_befgrad_ID: $row->al_befgrad_bez</option>\n";
+        					   echo "<option value=\"$row->al_befgrad_ID\">$row->al_befgrad_bez</option>\n";
                         }
                 }
                 ?>
@@ -95,15 +99,39 @@
                         foreach ($result as $row)
                         {
                             if ($row->al_pruefart_ID == $al['part'])
-        					   echo "<option selected value=\"$row->al_pruefart_ID\">$row->al_pruefart_ID: $row->al_pruefart_bez</option>\n";
+        					   echo "<option selected value=\"$row->al_pruefart_ID\">$row->al_pruefart_bez</option>\n";
         				    else
-        					   echo "<option value=\"$row->al_pruefart_ID\">$row->al_pruefart_ID: $row->al_pruefart_bez</option>\n";
+        					   echo "<option value=\"$row->al_pruefart_ID\">$row->al_pruefart_bez</option>\n";
                         }
                 }
                 ?>
                 </select>            
             </td>
         </tr>
+        <tr><td>Pr&uuml;fintervall</td>
+            <td valign="top">
+                 <select name="al[pintv]">
+                <?php 
+                    if ($al['pintv'] == -1) $select = " selected "; else $select = "";
+                    echo "<option $select value=\"-1\"></option>\n";
+                    $sql = "SELECT al_pruefintv_bez, al_pruefintv_ID FROM `fhiiqm`.`A_PruefIntv` ORDER BY 2";
+                    if ($result = $dbc->queryObjectArray($sql))
+                    {
+                        foreach ($result as $row)
+                        {
+                            if ($row->al_pruefintv_ID == $al['pintv'])
+        					   echo "<option selected value=\"$row->al_pruefintv_ID\">$row->al_pruefintv_bez</option>\n";
+        				    else
+        					   echo "<option value=\"$row->al_pruefintv_ID\">$row->al_pruefintv_bez</option>\n";
+                        }
+                }
+                ?>
+                </select>            
+            </td>
+        </tr>
+     <?php
+        }
+     ?>
         <tr><td>Standort</td>
             <td valign="top">Haus&nbsp;
                  <select name="al[geb]" onchange="this.form.submit();">
--- a/fhiiqm/form/login_form.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/form/login_form.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -27,7 +27,7 @@
             </td>
         </tr>
        	<tr bgcolor="#DEDFE1"><td>&nbsp;</td>
-        	<td><input  class="button" type="submit" name="eintragen" value="  login  " />
+        	<td><input  class="button" type="submit" name="login" value="  login  " />
         <!--			<input type="submit" name="abbrechen" value="abbrechen">&nbsp;&nbsp;&nbsp; -->
       		</td>
         	</tr>
--- a/fhiiqm/form/recht_form.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/form/recht_form.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -105,7 +105,7 @@
             &nbsp;&nbsp;&nbsp;gewünschten Listeneinträge
         </td>
         <td>
-            <select name="rt[recht][]" size="14" multiple="multiple"<?php echo $da; ?>>
+            <select name="rt[recht][]" size="16" multiple="multiple"<?php echo $da; ?>>
                 <?php
 //                    $select = null;
 //                    if (is_array($rt['recht'])) $select = in_array( "-1", $rt['recht'] ) ? ' selected' : null;
Binary file fhiiqm/img/details.gif has changed
Binary file fhiiqm/img/fire.png has changed
Binary file fhiiqm/img/rotate_01.png has changed
Binary file fhiiqm/img/weihnachtsmann.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/inc/al_list_ac.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 12/2011
+ *
+ * Autocomplete Anlagen
+ */
+
+    header('Content-type: text/html; charset="iso-8859-1',true); //wg. jquery ui autocomplete
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    $q = strtolower($_GET["term"]); // wird in jquery in 'term' uebergeben
+
+    
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+    // label = angezeigter ListenWert, val = Wert im Eingabefeld nach Klick
+    $sql = "SELECT al_bez as label, al_bez as val, al_ID as id 
+            FROM fhiiqm.Anlage
+            WHERE al_bez LIKE '%".$q."%' COLLATE latin1_general_ci 
+            ORDER BY 1";
+    $result = $dbc ->queryObjectArray($sql);
+    if ($result)
+    {
+        foreach ($result as $row)
+        {
+ 			$clist[] = "{\"label\": \"" . $row->label . "\",\"value\": \"" . $row->val . "\",\"id\": " . $row->id . "}";
+		}
+        echo "[" . implode(", ", $clist) . "]"; // Format, das jquery source erwartet
+    }
+    $dbc -> close();
+?>
\ No newline at end of file
--- a/fhiiqm/inc/anlage_dat_show.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/inc/anlage_dat_show.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -32,6 +32,13 @@
                 foreach ($result as $row)
                     echo "<tr><td>Pr&uuml;fart: </td><td>" . $row->al_pruefart_ID.": " . $row->al_pruefart_bez . "</td></tr>\n";
             }
+            // Pruefintervall
+            $sql = "SELECT al_pruefintv_ID,al_pruefintv_bez FROM fhiiqm.A_PruefIntv WHERE al_pruefintv_ID = '" . $al["pintv"] . "'";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                    echo "<tr><td>Pr&uuml;fintervall: </td><td>" . $row->al_pruefintv_bez . "</td></tr>\n";
+            }
             // Raum
             $sql = "SELECT raum_nr,raum_name,r.geb_ID,geb_name 
                     FROM fhiiqm.Raum r INNER JOIN fhiiqm.Haus h ON r.geb_ID = h.geb_ID 
--- a/fhiiqm/inc/file_upload.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/inc/file_upload.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -65,12 +65,13 @@
 		}	
 }
 
-function gen_filename($nfile, $ufile, $id)
+function gen_filename($nfile, $ufile, $id, $upload=1)
 {
    /** generiert Filenamen aus Eingabefilenamen und Uploadfilenamen
+    *  wenn upload<>1, dann aus neuem Dateinamen+alten (wenn nicht angegeben:Typ)
     * Parameter
-    *   $nfile  -   vorgegebener Name durch Nutzer
-    *    $ufile  -   Name aus Upload-Feld Formular
+    *    $nfile  -   vorgegebener Name durch Nutzer
+    *    $ufile  -   Name aus Upload-Feld Formular, bzw. alter Filename
     *    $id     -   ID
     */
 
@@ -103,7 +104,10 @@
         }
         else // File-Typ aus Uploadfile
         {
-            $filep = explode(".",$_FILES[$ufile]["name"]);
+            if ($upload)
+                $filep = explode(".",$_FILES[$ufile]["name"]);
+            else
+                $filep = explode(".",$ufile);
             $anz    = count($filep);
             if ($anz>1) $typ = $filep[$anz-1]; else $typ = "pdf";
             $fname = $nfile;
@@ -137,14 +141,14 @@
         if (file_exists($path."/".$fname_old))
         {
             chmod($path."/".$fname_old,0644);
-           if ($mod == "del")
-           {
+            if ($mod == "del")
+            {
                 return unlink($path."/".$fname_old);
-           }
-           elseif ($mod == "upd" && $fname_new>"!")
-           {
+            }
+            elseif ($mod == "upd" && $fname_new>"!")
+            {
                 return rename($path."/".$fname_old, $path."/".$fname_new);           
-           }
+            }
         }
     }    
 }
--- a/fhiiqm/inc/func_lib.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/inc/func_lib.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -43,7 +43,7 @@
         if ($fcol>0 && $fanr>0) // Filtern nach Spalte moeglich
         {
             if ($fcol == $fanr) $filt = "filter_activ"; else $filt = "filter"; 
-            $filt = "&nbsp;&nbsp;<a href='".$_SERVER['PHP_SELF']."?f=$fcol&s=$sort&d=$dir&st=$start&z=$anzds'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='$tip' title='$tip'></a>";;
+            $filt = "&nbsp;<a href='".$_SERVER['PHP_SELF']."?f=$fcol&s=$sort&d=$dir&st=$start&z=$anzds'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='$tip' title='$tip'></a>";;
         }
         else
             $filt="";
@@ -112,7 +112,7 @@
         
         
         
-        $login  = $_POST["eintragen"];
+        $login  = $_POST["login"];
         $log    = $_POST["log"];
         
         if ($login)
--- a/fhiiqm/inc/menu.inc.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/inc/menu.inc.php	Fri Dec 09 14:33:22 2011 +0100
@@ -25,8 +25,8 @@
         }
     }
     // maximal moegliche Rechte (29.09.2011):
-    // 'fme','fmr','ie','ir','pe','pr','re','rr','ve','vpe','vpr','vr'
-    // Rechtegruppen: v, i, s
+    // 'ae','ar','fme','fmr','ie','ir','pe','pr','re','rr','ve','vpe','vpr','vr'
+    // Rechtegruppen: a, v, i, s
     if (is_null($_SESSION["recht"]))
         echo "<p>&nbsp;&nbsp;&nbsp;Sie haben keine Rechte, um mit dieser Anwendung zu arbeiten.</p>
               <p>&nbsp;&nbsp;&nbsp;Bitte kontaktieren Sie <a href='mailto:kaendler@fhi-berlin.mpg.de'>Dr. K&auml;ndler</a>.</p>\n";
@@ -51,7 +51,6 @@
             		echo "<li><a href=\"/fhiiqm/partner_ins.php\" target=\"_blank\" title=\"Partner erfassen\">Vertragspartner erfassen</a></li>\n";
           if (in_array("vr",$_SESSION["recht"]) || in_array("ve",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/vertrag_report.php\" target=\"_blank\" title=\"Berichte\">Berichte</a></li>\n";
-    
     	  echo "	</ul>\n
                 </li>\n"; 
         }   
@@ -63,7 +62,25 @@
             		echo "<li><a href=\"/fhiiqm/info_flist.php\" target=\"_blank\" title=\"Infoliste\">Informationen sortieren, filtern, bearbeiten</a></li>\n";
           if (in_array("ie",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/info_ins.php\" target=\"_blank\" title=\"Info erfassen\">Information erfassen</a></li>\n";
-    
+    	  echo "   </ul>\n
+                </li>\n";
+        }	
+        if (is_array($arg) && in_array("a",$arg))
+        {
+          echo "<li>Anlagen\n
+            	   <ul>\n";
+          if (in_array("ar",$_SESSION["recht"]) || in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/anlage_flist.php\" target=\"_blank\" title=\"Anlagenliste\">Anlagen sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/anlage_ed.php\" target=\"_blank\" title=\"Anlage erfassen\">Anlage erfassen</a></li>\n";
+          if (in_array("ar",$_SESSION["recht"]) || in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/alpruef_flist.php\" target=\"_blank\" title=\"Anlagenpr&uuml;fungen\">Anlagenpr&uuml;fungen sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/alpruef_ed.php\" target=\"_blank\" title=\"Anlagenpr&uuml;fung erfassen\">Anlagenpr&uuml;fung erfassen</a></li>\n";
+          if (in_array("ar",$_SESSION["recht"]) || in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/alrisk_flist.php\" target=\"_blank\" title=\"Anlagenrisiken\">Anlagenrisiken sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("ae",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/alrisk_ed.php\" target=\"_blank\" title=\"Anlagenrisiko erfassen\">Anlagenrisiko erfassen</a></li>\n";
     	  echo "   </ul>\n
                 </li>\n";
         }	
@@ -87,12 +104,12 @@
             		echo "<li><a href=\"/fhiiqm/recht_list.php\" target=\"_blank\" title=\"Nutzerliste\"><b>Nutzer - Rechte bearbeiten</b></a></li>\n";
           if (in_array("rte",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/recht_ed.php\" target=\"_blank\" title=\"Rechte\"><b>Rechteverwaltung neuer Nutzer</b></a></li>\n";
-    
     //<!--				<li><a href="#">Anleitungen</a></li> -->
     	  echo "   </ul>\n
                 </li>\n";
+                
         }
         echo "    </ul>
         </div>";
     }
-?>
\ No newline at end of file
+?>
--- a/fhiiqm/recht_ed.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/recht_ed.php	Fri Dec 09 14:33:22 2011 +0100
@@ -120,7 +120,7 @@
         }
         echo "</table>\n";
         echo "</div>\n";
-        if (!is_null($_SESSION["recht"]) && !in_array("rte", $_SESSION["recht"]))
+//        if (!is_null($_SESSION["recht"]) && !in_array("rte", $_SESSION["recht"]))
             echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"recht_list.php\" target=\"_self\" title=\"Nutzerliste\">&laquo; zur Nutzerliste</a></p>\n"; 
         echo "</form>\n";	
 
--- a/fhiiqm/start.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/start.php	Fri Dec 09 14:33:22 2011 +0100
@@ -32,6 +32,16 @@
 //    print_r ($_SESSION['recht']);
     
     include_once($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/menu.inc.php");
+    if (date("Y-m-d") < date("Y-m-d", mktime(0,0,0,12,25,2011)))
+    {
+        echo "<p>&nbsp;</p><p class='red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            <img src='/fhiiqm/img/weihnachtsmann.gif' height='75' />";
+        $heute = new DateTime();
+        $weih = new DateTime('2011-12-24');
+        $tage = $weih -> diff($heute)->days+1;
+        echo "noch $tage Tage bis <em>Weihnachten</em>!</p>";
+    }
+
 ?>
 </div>
 <div id="renavi" align="right"><img src="/fhiiqm/img/fhi.jpg" border="0" alt="FHI" width="100%"/>&nbsp;&nbsp;&nbsp;</div>
--- a/fhiiqm/vertrag_flist1.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/vertrag_flist1.php	Fri Dec 09 14:33:22 2011 +0100
@@ -146,7 +146,7 @@
             echo "</form>\n";
             echo "<p>&nbsp;&nbsp;&nbsp;</p>\n";
         }
-        echo "<table>\n";
+        echo "<table width='99%'>\n";
         
         if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
 //        echo "<tr bgcolor='#CFDEF0'><th>Bezeichnung</th><th>Titel</th><th>Beschreibung</th><th>Typ</th><th>Beginn</th><th>Ende</th><th>K&uuml;nd.frist(mon)</th>
--- a/fhiiqm/vertrag_flist2.php	Mon Nov 21 16:24:43 2011 +0100
+++ b/fhiiqm/vertrag_flist2.php	Fri Dec 09 14:33:22 2011 +0100
@@ -96,7 +96,7 @@
             <tr><td class='bigger'>Klick auf '<img src='img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Vertragsdaten</td></tr>\n";
         echo "</table>\n";
         printf ("<p>Anzahl Vertr&auml;ge: %s </p>", $vanz);
-        echo "<table>\n";
+        echo "<table width='99%'>\n";
 
         if ($filter>'!') echo "<tr><td class='bigger' colspan=7>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";