+ Raumverantwortliche
authorBettina Schwarzer <schwarzer@fhi-berlin.mpg.de>
Fri, 16 Nov 2012 10:39:25 +0100
changeset 31 0a1eb975fbd9
parent 30 d02d02efc55a
child 32 c2d325791e24
+ Raumverantwortliche + Mitarbeiter - Telefon
Thumbs.db
fhiiqm/alpruef_ed.php
fhiiqm/anlage_ed.php
fhiiqm/as_report.php
fhiiqm/css/db.css
fhiiqm/form/alpruef_form.inc.php
fhiiqm/form/info_allg_search_form.inc.php
fhiiqm/form/info_betrst_form.inc.php
fhiiqm/form/info_form2.inc.php
fhiiqm/form/info_form3.inc.php
fhiiqm/form/rag_gv_search_form.inc.php
fhiiqm/form/raum_form.inc.php
fhiiqm/form/vertrag_form.inc.php
fhiiqm/inc/file_upload.inc.php
fhiiqm/inc/func_lib.inc.php
fhiiqm/inc/info_dat_show.inc.php
fhiiqm/inc/info_tab_ins.inc.php
fhiiqm/inc/ma_list_ac.inc.php
fhiiqm/inc/menu.inc.php
fhiiqm/inc/vertrag_list_ac.inc.php
fhiiqm/info_betrst_ed.php
fhiiqm/info_ed.php
fhiiqm/info_ed3.php
fhiiqm/info_flist.php
fhiiqm/raum_flist.php
fhiiqm/raum_ins.php
fhiiqm/raum_upd.php
fhiiqm/recht_list.php
fhiiqm/report/abt_ag_aptyp_report.php
fhiiqm/report/abt_raum_rt_report.php
fhiiqm/report/aptyp_gefahr_massn_report.php
fhiiqm/report/info_allg_report.php
fhiiqm/report/ma_abt_raumgr_report.php
fhiiqm/report/rag_gefahr_massn_report.php
fhiiqm/report/raum_rt_report.php
fhiiqm/report/vertrag_report_kuend.php
fhiiqm/test/tab_info_ed.php
fhiiqm/test/tab_info_flist.php
fhiiqm/test/tabs_dyn_content.php
fhiiqm/vertrag_flist1.php
fhiiqm/vertrag_flist12.php
fhiiqm/vertrag_ins.php
fhiiqm/vertrag_search.php
fhiiqm/vertrag_upd.php
Binary file Thumbs.db has changed
--- a/fhiiqm/alpruef_ed.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/alpruef_ed.php	Fri Nov 16 10:39:25 2012 +0100
@@ -89,6 +89,13 @@
         if ($alpid) $text = "editieren"; else $text = "erfassen";
         echo "<h3>Pr&uuml;fung Anlage $text<h3>";
         
+        if ($_FILES["pfile"]["error"] == 1 || $_FILES["pfile"]["error"] == 2)
+        {
+            if ($_FILES["pfile"]["error"] == 2)
+                echo "<p class='red'><b>Uploadfile zu ID '$alpid' > 10 MByte!</b></p>\n";
+            $ok = 0;
+        }
+        
         echo "</div>\n";
         
         if (!$ok || !$sub)
@@ -146,16 +153,15 @@
         {
             // 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
+                // alte Bezeichnung Protokoll holen
+                $sql = "SELECT pruef_file
+                        FROM fhiiqm.A_Pruefung
+                        WHERE alp_ID = $alpid";
+                $al["pfname_old"]  = $dbc -> querySingleItem($sql);
                 // upload File
                 if (is_uploaded_file($_FILES["pfile"]["tmp_name"]) && isset($_FILES["pfile"]["name"]) && $_FILES["pfile"]["name"] )
                 {
@@ -180,14 +186,33 @@
                     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) 
+                        if ($al["pfname"]>"!")
+                        {
+                            $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);
+                            }
+                        }
+                        else
                         {
-                            $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);
+                            $retf=1; $retp=1;
+                            if ($al["pfname_old"])
+                            {    // Loeschen alte Datei
+                                $retf  = mod_file("/var/www/fhiiqm/alprot",$alpid,"","del");
+                                if ($retf) 
+                                {
+                                    $sql = "UPDATE A_Pruefung SET pruef_file = null WHERE alp_ID=$alpid";
+                                    $retp=$dbc->execute($sql);
+                                    if (!$retp) 
+                                        echo $dbc -> error . "<br>\n";
+                                }
+                            }    
+                            
                         }
                         
                     }
--- a/fhiiqm/anlage_ed.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/anlage_ed.php	Fri Nov 16 10:39:25 2012 +0100
@@ -64,9 +64,14 @@
 	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
     <link type="text/css" href="/fhiiqm/css/db.css" rel="Stylesheet" media="screen"/>	
     <link type="text/css" href="/fhiiqm/css/db_print.css" rel="Stylesheet" media="print"/>	
+<!--
     <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>
+-->
+    <link type="text/css" href="/fhiiqm/css/jquery/ui-lightness-1.8.21/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-1.7.2.min.js"></script>
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-ui-1.8.21.custom.min.js"></script>
     <title>Anlage</title>
  </head>
  
--- a/fhiiqm/as_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/as_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -36,7 +36,7 @@
    	<link href="css/navio.css" rel="STYLESHEET" type="TEXT/CSS" /> 
 	<meta name="author" content="Bettina Schwarzer,FHI" />
 
-	<title>Reports Raeume-Arbeitssicherheit</title>
+	<title>Reports Arbeitssicherheit</title>
 </head>
 
 <body>
@@ -54,12 +54,19 @@
             <td class="bigger">
                 <a href="/fhiiqm/report/raum_rt_report.php" title="Raum Raumtyp APTyp">(1) Raum - Raumtyp - Arbeitsplatz-Typ</a>
                 <br />&nbsp;&nbsp;&nbsp;Auswahl: Haus, Raum, Raum-Typ
-                <br />&nbsp;&nbsp;&nbsp;Ansicht: Haus, Raum-Nr., Betriebsanweisung, Raum-Bezeichnung, Raum-Typ, Arbeitsplatz-Typ
+                <br />&nbsp;&nbsp;&nbsp;Ansicht: Haus, Raum-Nr., Raum-Bezeichnung, Betriebsanweisung, Raum-Typ, Arbeitsplatz-Typen
             </td>
         </tr>
         <tr>
             <td class="bigger">
-                <a href="/fhiiqm/report/raum_ohne_rag_report.php" title="Report Raum ohne AG">(1a) R&auml;ume ohne Arbeitsgruppen-Zuordnung</a>
+                <a href="/fhiiqm/report/raum_apt_info_report.php" title="Raum APTyp Info">(1a) Raum - Arbeitsplatz-Typ - Info</a>
+                <br />&nbsp;&nbsp;&nbsp;Auswahl: Haus, Raum, Arbeitsplatz-Typ
+                <br />&nbsp;&nbsp;&nbsp;Ansicht: Haus, Raum-Nr., Raum-Bezeichnung, Raum-Typ, Arbeitsplatz-Typen, Info zu Raum
+            </td>
+        </tr>
+        <tr>
+            <td class="bigger">
+                <a href="/fhiiqm/report/raum_ohne_rag_report.php" title="Report Raum ohne AG">(1b) R&auml;ume ohne Arbeitsgruppen-Zuordnung</a>
                 <br />&nbsp;&nbsp;&nbsp;Auswahl: Haus, Raum-Typ
                 <br />&nbsp;&nbsp;&nbsp;Ansicht: Haus, Raum-Nr. Raum-Bezeichnung, Raum-Typ, Arbeitsplatz-Typ
             </td>
--- a/fhiiqm/css/db.css	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/css/db.css	Fri Nov 16 10:39:25 2012 +0100
@@ -69,7 +69,9 @@
     font-size: 11px;
     text-decoration: underline;
     color: #07079E;}
-
+/*
+tr:hover {background-color:#68ACBF ;}
+*/
 td,span {
     font-family:  Verdana, Arial, Helvetica, Geneva, sans-serif;
     font-size: 11px;
--- a/fhiiqm/form/alpruef_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/alpruef_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -70,7 +70,7 @@
 		</td>
     </tr>
 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>    
     <input type="hidden" name="al[id]" id="alid" value="<?php echo $al["id"]; ?>"/>
     <input type="hidden" name="al[okn]" value="<?php echo $okn; ?>"/>
 <!-- </table>
--- a/fhiiqm/form/info_allg_search_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/info_allg_search_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -44,7 +44,7 @@
             echo "<td><select name='inf[ityp]'>";
                 if ($inf["ityp"] == -1) $select = " selected "; else $select = "";
                 echo "<option $select value=\"-1\"></option>\n";
-                $sql = "SELECT infotyp_ID, infotyp_bez FROM Info_Typ ORDER BY 1";
+                $sql = "SELECT infotyp_ID, infotyp_bez FROM Info_Typ ORDER BY CONVERT(infotyp_ID,CHAR)";
                 if ($result = $dbc->queryObjectArray($sql))
                 {
                     $select = "";
--- a/fhiiqm/form/info_betrst_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/info_betrst_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -39,18 +39,19 @@
     </tr>
     <tr>
         <td>Kurzinformation<br/><br />
-            &nbsp;&nbsp;&nbsp;max. 8000 Zeichen m&ouml;glich<br /><br />
-            &nbsp;&nbsp;&nbsp;erforderlich f&uuml;r <br />
-            &nbsp;&nbsp;&nbsp;Gesch&auml;ftsverteilungsplan
+            &nbsp;&nbsp;&nbsp;max. 8000 Zeichen m&ouml;glich
         </td>
         <td><textarea name="inf[ilong]" cols="80" rows="6"><?php echo $inf['ilong']; ?></textarea>
         </td>
     </tr>
-	<?php if ($ityp != 8)
-    {                       ?>
+	<?php if (substr($ityp,0,1) != 8)
+    {                       
+        if ($ityp == 71) $inf['sort'] = "BSI_7_" . substr($inf['sort'],6);
+    ?>
     <tr>
 	   <td>Kennzeichen(Sort.)</td>
-	   <td><input name="inf[sort]" type="text" size="10" maxlength="10" value="<?php echo $inf['sort']; ?>" /></td>
+	   <td><input name="inf[sort]" type="text" size="10" maxlength="10" value="<?php echo $inf['sort']; ?>" />
+       <?php if ($ityp==7) echo "&nbsp;&nbsp;&nbsp;BSI_... "; ?></td>
     </tr>
     <?php 
     }                       ?>      
@@ -166,10 +167,14 @@
     <tr><td>Status Freigabe</td>
         <td><select name="inf[fg]" size="1">
             <?php
-                if (!isset($inf["fg"])) $inf["fg"] = 1;
+                if (!isset($inf["fg"]))
+                {
+                    if ($ityp == 71) $inf["fg"] = 3; else  $inf["fg"] = 1;
+                } 
                 if ($inf['fg']) $select = ( "-1" == $inf['fg'] ) ? ' selected' : null;
                 echo "<option $select value=\"-1\"></option>\n";
-                $sql = "SELECT info_freigabe_ID, info_freigabe_bez FROM Info_Freigabe ORDER BY 2";
+                if ($ityp == 71) $wher = " WHERE info_freigabe_ID=3 "; else $wher="";
+                $sql = "SELECT info_freigabe_ID, info_freigabe_bez FROM Info_Freigabe $wher ORDER BY 2";
                 if ($result = $dbc -> queryObjectArray($sql))
                 {
                     foreach ($result as $row)
@@ -205,16 +210,27 @@
     </tr>
     <tr>
         <td>zugeordnet zu Produkt<br /><br />
-            &nbsp;&nbsp;&nbsp;Mehrfachauswahl m&ouml;glich:<br />
+            <?php
+                if ($ityp != 71)
+                echo 
+            "&nbsp;&nbsp;&nbsp;Mehrfachauswahl m&ouml;glich:<br />
             &nbsp;&nbsp;&nbsp;[Strg]-Taste + Anklicken der<br /> 
-            &nbsp;&nbsp;&nbsp;gewünschten Listeneinträge</td>
+            &nbsp;&nbsp;&nbsp;gewünschten Listeneinträge";
+            ?>
+        </td>
         <td>
-            <select name="inf[prid][]" size="9" multiple="multiple">
-            <?php 
+            <?php
+                if ($ityp != 71)
+                    echo "<select name=\"inf[prid][]\" size=\"9\" multiple=\"multiple\">\n";
+                else
+                {   // Betriebsstörung dezentrale Technik
+                    echo "<select name=\"inf[prid][]\" size=\"3\">\n";
+                    $inf['prid'][0] = "4108"; // Branschutz- und Steuerungstechnik
+                }   
                 if (is_array($inf['prid'])) $select = in_array( "-1", $inf['prid'] ) ? ' selected' : null;
                 echo "<option $select value=\"-1\"></option>\n";
 //                $sql = "SELECT produkt_ID, LEFT(prod_name,70) AS prod, LENGTH(prod_name) AS lenp FROM Produkt ORDER BY 2";
-                if ($ityp == 7) $sql = "CALL prod_hiera_all(4,41)"; 
+                if (substr($ityp,0,1) == 7) $sql = "CALL prod_hiera_all(4,41)"; 
                 elseif (substr($ityp,0,1) == 8) $sql = "CALL prod_hiera_all(1,15)";  
                 if ($result = $dbc->queryObjectArray($sql))
                 {
@@ -226,7 +242,15 @@
                             $prod=str_replace(" ","&nbsp;",htmlentities($row->bez));
                         if ($row->prid >0) $color=" class='green'"; else $color="";
                         if (is_array($inf['prid'])) $select = in_array($row->prid, $inf['prid']) ? ' selected' : null;
-                        echo "<option $color $select value=\"$row->prid\">$prod</option>\n";
+                        if ($ityp != 71)
+                        {
+                            echo "<option $color $select value=\"$row->prid\">$prod</option>\n";
+                        }
+                        else
+                        {
+                            if ($row->prid == $inf['prid'][0] || $row->prid == 0)
+                                echo "<option $color $select value=\"$row->prid\">$prod</option>\n";
+                        }
                     }
                 }
                 unset($result);
@@ -238,6 +262,10 @@
 	<?php if (substr($ityp,0,1) != 8)  // 8 - Betriebsanweisung
     {                       ?>
     <tr><td>Adressat (Beauftragte)<br />
+    <?php
+        if ($ityp != 71)
+        {
+    ?>
             &nbsp;&nbsp;&nbsp;leeres Feld = L&ouml;schen</td>
         <td>
             <div id="add">
@@ -294,6 +322,15 @@
             ?>
             </div>
         </td>
+    <?php
+    }
+    else
+    {
+        echo "</td>";
+        echo "<td><select name='inf[adr][]' size='1'>";
+        echo "<option selected value='LV'>LV - Laborverantwortlicher</option></select></td>";
+    }
+    ?>
     </tr>
     <?php 
     }                       
@@ -335,14 +372,14 @@
 				{
                     if ($inf['ifname']>='!' && file_exists("infos/".$inf['ifname']))
                         echo "<br />Dokument anschauen:&nbsp;<a href='infos/" . $inf['ifname'] ."'>" . $inf['ifname'] . "</a>";
-                    if ($okn) $okn = true; else $okn=false;
+//                    if ($okn) $okn = true; else $okn=false;
                 }
 		?>
 		</td>
     </tr>
 
     <input type="hidden" name="inf[pers]" id="pid" value="<?php echo $inf['pers']; // Author ?>"/> 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="32000000"/>    
     <input type="hidden" name="inf[okn]" value="<?php echo $okn; ?>"/>
 <!--  </table>
  </div>   
--- a/fhiiqm/form/info_form2.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/info_form2.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -170,7 +170,7 @@
                         $wherm = " WHERE abt_tel=6 OR persknr IN (122,390,414,418,1339,2450,2452) ";
                     }    
                     else */
-                        $wherm = "";
+                        $wherm = " WHERE aktiv < 2 "; // nur MA, keine Objekte, 02.11.2012, bs
                     $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname,' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as pname FROM fhiiqm.Mitarbeiter $wherm ORDER BY 2";
                     if ($result = $dbc->queryObjectArray($sql))
                     {
@@ -213,6 +213,13 @@
             ?>
         </tr></table></td>
     </tr>
+    <?php 
+        if ($inf['ityp'] == 6 && strtolower(substr($inf['sort'],0,2)) == 'bk')
+        {
+            echo "<tr><td>KST: <i>Obergrenze Bestellwert</i> (&euro;)</td>";
+            echo "<td><input name=\"inf[betr]\" type=\"text\" value=\"" . $inf['betr'] . "\" size='15' /></td></tr>\n";    
+        }
+    ?>
     <tr><td>Sprache</td>
         <td><select name="inf[lang]">
         <?php
@@ -298,7 +305,7 @@
     </tr>
 
     <input type="hidden" name="inf[pers]" id="pid" value="<?php echo $inf['pers']; // Author?>"/> 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>    
     <input type="hidden" name="inf[okn]" value="<?php echo $okn; ?>"/>
 <!--  </table>
  </div>   
--- a/fhiiqm/form/info_form3.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/info_form3.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -54,7 +54,8 @@
     </tr>
 	<tr>
 	   <td>Kennzeichen(Sort.)</td>
-	   <td><input name="inf[sort]" type="text" size="15" maxlength="10" value="<?php echo $inf['sort']; ?>" /></td>
+	   <td><input name="inf[sort]" type="text" size="15" maxlength="10" value="<?php echo $inf['sort']; ?>" />
+       &nbsp;&nbsp;&nbsp;BK... bei KST</td>
     </tr>
     <tr><td>geh&ouml;rt zu Info</td>
         <td><select name="inf[infrel]">
@@ -178,6 +179,13 @@
             ?>
         </tr></table></td>
     </tr>
+    <?php 
+        if ($inf['ityp'] == 6 && strtolower(substr($inf['sort'],0,2)) == 'bk')
+        {
+            echo "<tr><td>KST: <i>Obergrenze Bestellwert</i> (&euro;)</td>";
+            echo "<td><input name=\"inf[betr]\" type=\"text\" value=\"" . $inf['betr'] . "\" size='15' /></td></tr>\n";    
+        }
+    ?>
     <tr><td>Sprache</td>
         <td><select name="inf[lang]">
         <?php
@@ -264,7 +272,7 @@
 
     <input type="hidden" name="inf[pers]" id="pid" value="<?php echo $inf['pers']; // Author ?>"/> 
     <input type="hidden" name="inf[vpn]" id="vpid" value="<?php echo $inf['vpn']; // Verantwortliche ?>"/> 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>    
     <input type="hidden" name="inf[okn]" value="<?php echo $okn; ?>"/>
 <!--  </table>
  </div>   
--- a/fhiiqm/form/rag_gv_search_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/rag_gv_search_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -27,7 +27,7 @@
             <?php 
                 if ($rag["abt"] == -1) $select = " selected "; else $select = "";
                 echo "<option $select value=\"-1\"></option>\n";
-                $sql = "SELECT abt_name, abt_long FROM Abteilung ORDER BY 1";
+                $sql = "SELECT abt_name, abt_long FROM Abteilung WHERE abt_ID < 8 ORDER BY abt_ID";
                 if ($result = $dbc->queryObjectArray($sql))
                 {
                     foreach ($result as $row)
--- a/fhiiqm/form/raum_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/raum_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -198,7 +198,7 @@
 		</td>
     </tr>
 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>    
     <input type="hidden" name="raum[okn]" value="<?php echo $okn; ?>"/>
        
 <!--  </table>
--- a/fhiiqm/form/vertrag_form.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/form/vertrag_form.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -286,7 +286,7 @@
                     $select = null;
                     if (is_array($vtr['cpers'])) $select = in_array( "-1", $vtr['cpers'] ) ? ' selected' : null;
                     echo "<option $select value=\"-1\"></option>\n";
-                    $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname) as pname FROM fhiiqm.Mitarbeiter ORDER BY 2";
+                    $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname,' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as pname FROM fhiiqm.Mitarbeiter WHERE aktiv < 2 ORDER BY 2";
                     if ($result = $dbc->queryObjectArray($sql))
                     {
                         foreach ($result as $row)
@@ -409,7 +409,7 @@
 		<div>max. 500 Zeichen sind m&ouml;glich</div></td>
     </tr>
 
-    <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>    
+    <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>    
     <input type="hidden" name="vertrag[okn]" value="<?php echo $okn; ?>"/>
        
 <!--  </table>
--- a/fhiiqm/inc/file_upload.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/file_upload.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -21,7 +21,7 @@
         $errupl3 = null;
 		// Test filesize, filetyp	
 		if ($_FILES[$ufile]["size"] < 1) $errupl1 .= "$ufile: File ist leer! ";
-		if ($_FILES[$ufile]["size"] > 6000000) $errupl1 .= "$ufile: File > 6MByte! ";
+		if ($_FILES[$ufile]["size"] > 32000000) $errupl1 .= "$ufile: File > 32MByte! ";
 //		list($first,$rest) = explode(".",$_FILES[$ufile]["name"]);
 		$filep = explode(".",$_FILES[$ufile]["name"]);
 		$anz    = count($filep);
@@ -29,7 +29,7 @@
 		if (substr($typ,0,2)=="ph" || substr($typ,0,2)=="pl" || substr($typ,0,2)=="cg" || substr($typ,0,2)=="ex") $errupl2 .="$ufile: falscher Filetyp! ";
 //echo "filesize=" . $_FILES[$ufile]["size"] . "<br>\n";
 		if ($_FILES[$ufile]["error"] > 0) $errupl3 = "Fehler upload: ".$_FILES[$ufile]["error"];
-		if (!$errupl1 && ! $errupl2 && !$errupl3)
+		if (!$errupl1 && !$errupl2 && !$errupl3)
 		{
 			// File laden
 			$filetyp = $_FILES[$ufile]['type'];
--- a/fhiiqm/inc/func_lib.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/func_lib.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -22,6 +22,8 @@
         * $anzds    Anzahl angezeigter Datensaetze
         * $id       fuer spezielle ID als zusaetzl. Filter (Laser-Log)
         * $g        Gesamtansicht (rag-gefahr-massnahmen-vorsorge)
+        * [$tab     fuer tab-basierte Seite
+        * $adr      wohin gehen (Teilseite)]
         */
         
         if ($colnum == $sort)
--- a/fhiiqm/inc/info_dat_show.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/info_dat_show.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -142,6 +142,10 @@
                         echo "$leer<td>".$pname."&nbsp;&nbsp;&nbsp;Bemerkung: ".$inf["prio"][$inf["vpers"][$k]]."</td></tr>";    
                     }
                 }
+                if ($inf['ityp'] == 6 && strtolower(substr($inf['sort'],0,2)) == 'bk' && $inf['betr'])
+                {
+                    echo "<tr><td>KST: Obergrenze Bestellwert (&euro;):</td><td>".$inf['betr']."</td></tr>\n";   
+                }            
             }
             else
             {
--- a/fhiiqm/inc/info_tab_ins.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/info_tab_ins.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -32,8 +32,8 @@
                     $retp = false;
                 }
             }
-            if ($inf['ityp'] != 7 && substr($inf['ityp'],0,1) != 8)
-            {
+            if (substr($inf['ityp'],0,1) != 7 && substr($inf['ityp'],0,1) != 8)
+            {   // != Betriebsstörung & != Betriebsanweisung(Anlage)
                 // Adressat
                 $reta = true;
                 $sql = "DELETE FROM Info_Adressat WHERE info_ID = $infid";
@@ -100,9 +100,9 @@
                     $retv = false;
                 }
             }
-            elseif ($inf['ityp'] == 7)
-            {
-                // Adressat
+            elseif (substr($inf['ityp'],0,1) == 7)
+            {   // Betriebsstörung
+                // Adressat = Funktion
                 $reta = true; $retv = true; // Verantwortliche werden nicht benannt
                 $sql = "DELETE FROM Info_Funktion WHERE info_ID = $infid";
                 $retd = $dbc -> execute($sql);
@@ -131,7 +131,7 @@
                 
             }
             elseif (substr($inf['ityp'],0,1) == 8)
-            {
+            {   // Betriebsanweisung(Anlage))
                 $reta = true; $retv = true; // keine Adressaten, Verantwortliche
             }
             $retl = true;
--- a/fhiiqm/inc/ma_list_ac.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/ma_list_ac.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -24,10 +24,10 @@
             ORDER BY 1";
 */
     if (isset($abt) && $abt == "a") $ord = "abt_ID, "; else $ord = "";
-    $sql = "SELECT CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''),' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as label, 
-            CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''), ' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as val,persknr as id 
+    $sql = "SELECT CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''),' (',CASE aktiv WHEN 0 THEN 'inaktiv' ELSE 'aktiv' END, ')') as label, 
+            CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''), ' (',CASE aktiv WHEN 0 THEN 'inaktiv' ELSE 'aktiv' END, ')') as val,persknr as id 
             FROM fhiiqm.Mitarbeiter m LEFT OUTER JOIN fhiiqm.Abteilung a ON m.abt_tel=a.abt_ID
-            WHERE nachname LIKE '%".$q."%' COLLATE latin1_general_ci 
+            WHERE aktiv < 2 AND nachname LIKE '%".$q."%' COLLATE latin1_general_ci 
             ORDER BY ". $ord ."1";
     $result = $dbc ->queryObjectArray($sql);
     if ($result)
--- a/fhiiqm/inc/menu.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/menu.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -24,15 +24,14 @@
     
         }
     }
-    // maximal moegliche Rechte (29.09.2011):
-    // 'ae','ar','fme','fmr','ie','ir','pe','pr','re','rr','ve','vpe','vpr','vr'
+    // maximal moegliche Rechte (29.10.2012):
+    // 'ae','ar','ase','asr','dde','ddr','fme','fmr','ie','ir','le','lr','pe','pr','pze','pzr','re','rr','rtr','rte','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";
     else
     {
-
         echo "
         <div id=\"navio\">
             <ul>";
@@ -54,11 +53,11 @@
     	  echo "	</ul>\n
                 </li>\n"; 
         }   
-        if (is_array($arg) && in_array("i",$arg))
+        if ((is_array($arg) && in_array("i",$arg)) || in_array("ddr",$_SESSION["recht"]) || in_array("dde",$_SESSION["recht"]))
         {
           echo "<li>Informationen zu FHI-Leistungen und Produkten\n
             	   <ul>\n";
-          if (in_array("ir",$_SESSION["recht"]) || in_array("ie",$_SESSION["recht"]))
+          if (in_array("ir",$_SESSION["recht"]) || in_array("ie",$_SESSION["recht"]) || in_array("ddr",$_SESSION["recht"]) || in_array("dde",$_SESSION["recht"]))
             		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_ed.php\" target=\"_blank\" title=\"Info erfassen\">Information erfassen</a></li>\n";
@@ -66,6 +65,8 @@
             		echo "<li><a href=\"/fhiiqm/info_ed3.php?t=6\" target=\"_blank\" title=\"Info GVP erfassen\">Gesch&auml;ftsverteilungsplan erfassen</a></li>\n";
           if (in_array("ie",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/info_betrst_ed.php?t=7\" target=\"_blank\" title=\"Betriebsst&ouml;rung erfassen\">Betriebsst&ouml;rung erfassen</a></li>\n";
+          if (in_array("dde",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/info_betrst_ed.php?t=71\" target=\"_blank\" title=\"Betriebsst&ouml;rung dezentrale Technikerfassen\">Betriebsst&ouml;rung dezentrale Technik erfassen</a></li>\n";
           if (in_array("ie",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/info_betrst_ed.php?t=8\" target=\"_blank\" title=\"Betriebsanweisung erfassen\">Betriebsanweisung erfassen</a></li>\n";
           if (in_array("ie",$_SESSION["recht"]))
@@ -175,6 +176,8 @@
             		echo "<li><a href=\"/fhiiqm/raum_ins.php\" target=\"_blank\" title=\"Raum erfassen\">Raum erfassen</a></li>\n";
                 	echo "<li><a href=\"/fhiiqm/raum_flist_ed.php\" target=\"_blank\" title=\"Raumliste edit\">R&auml;ume - Reinig.-Daten sortieren, filtern, bearbeiten</a></li>\n";
                 }
+          if (in_array("ddr",$_SESSION["recht"]) || in_array("dde",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/raum_vma_flist.php\" target=\"_blank\" title=\"Raumliste\">Raumverantwortliche sortieren, filtern, bearbeiten</a></li>\n";
           if (in_array("rtr",$_SESSION["recht"]) || in_array("rte",$_SESSION["recht"]))
             		echo "<li><a href=\"/fhiiqm/recht_list.php\" target=\"_blank\" title=\"Nutzerliste\">Nutzer - Rechte bearbeiten</a></li>\n";
           if (in_array("rte",$_SESSION["recht"]))
--- a/fhiiqm/inc/vertrag_list_ac.inc.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/inc/vertrag_list_ac.inc.php	Fri Nov 16 10:39:25 2012 +0100
@@ -19,8 +19,8 @@
             $listg = substr($listg,1);
     }
     else $listg = "";
-    
-    $q = strtolower($_GET["term"]); // wird in jquery in 'term' uebergeben
+    $p = $_GET['part'];
+    $q = strtolower(utf8_decode($_GET["term"])); // wird in jquery in 'term' uebergeben, term UTF-8 codiert
 
     $su = array("ä","ö","ü","ß","Ä","Ö","Ü");
     $er = array("&auml;","&ouml;","&uuml;","&szlig;","&Auml;","&Ouml;","&Uuml;");
@@ -35,12 +35,16 @@
             LEFT OUTER JOIN Partner p ON vp.part_ID=p.part_ID ";
     if ($listg > "")
         $sql .= " LEFT OUTER JOIN fhiiqm.Produkt_Vertrag pv ON v.contract_ID=pv.contract_ID
-            LEFT JOIN fhiiqm.Produkt p ON pv.produkt_ID=p.produkt_ID 
+            LEFT JOIN fhiiqm.Produkt pr ON pv.produkt_ID=pr.produkt_ID 
             WHERE prod_group_ID IN ($listg) ";
     else
         $sql .= " WHERE 1=1 ";
     
-    $sql .= " AND contract_name LIKE '%".$q."%' COLLATE latin1_general_ci 
+    if ($p)
+        $sql .= " AND part_firma LIKE '%".$q."%' COLLATE latin1_general_ci 
+            ORDER BY part_firma, contract_name";
+    else
+        $sql .= " AND contract_name LIKE '%".$q."%' COLLATE latin1_general_ci 
             ORDER BY contract_name";
 
     $result = $dbc ->queryObjectArray($sql);
@@ -49,6 +53,7 @@
         foreach ($result as $row)
         {
             $cb = new DateTime($row->contract_begin);
+            if ($p) $row->part_firma = strtoupper($row->part_firma);
 // 			$clist[] = "\"" . $row->contract_ID . " - " . str_replace($su,$er,$row->contract_name) . " | " . 
 //               str_replace($su,$er,$row->vtyp_bezeichnung) . " | VBeginn: " . $cb->format('d.m.Y') . "\"";
  			$clist[] = "\"" . $row->contract_ID . " - " . $row->contract_name . " | " . $row->part_firma. " | " . 
--- a/fhiiqm/info_betrst_ed.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/info_betrst_ed.php	Fri Nov 16 10:39:25 2012 +0100
@@ -4,7 +4,7 @@
  * @author Bettina Schwarzer, Fritz-Haber-Institut
  * @copyright 07/2012, 08/2012
  *
- * INSERT,UPDATE Informationen Betriebsstoerung, Betriebssicherheit  
+ * INSERT,UPDATE Informationen Betriebsstoerung, Betriebsanweisung  
  */
 
     error_reporting(E_ALL ^ E_NOTICE);
@@ -17,13 +17,14 @@
         exit;
     }
     
-    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ir",$_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"])))
+    $ityp   = $_GET["t"]; // t=7 - Betriebsstoerung, t=8 - Betriebsanweisung
+    if ($ityp == 71) $repr = "dd"; else $repr = "i";
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array($repr."r",$_SESSION["recht"]) && !in_array($repr."e",$_SESSION["recht"])))
     {
         header("Location: start.php");
         exit;
     }    
 
-    $ityp   = $_GET["t"]; // t=7 - Betriebsstoerung, t=8 - Betriebssicherheit
     
     $infid  = $_GET["i"];
 
@@ -48,11 +49,23 @@
     if (!$inf["okn"]) $ok = false;
     $duptext="";
 
-    if ($ityp == 7) $titel = "Betriebsst&ouml;rung";
-    elseif ($ityp == 8) $titel = "Betriebsanweisung";
-    elseif ($ityp == 81) $titel = "Betriebsanweisung Anlage";
-    
-//    print_r($inf); echo "<br /><br />";
+    switch ($ityp)
+    {
+        case 7: $titel = "Betriebsst&ouml;rung";
+            break;
+        case 71: $titel = "Betriebsst&ouml;rung dezentrale Technik";
+            break;
+        case 8: $titel = "Betriebsanweisung";
+            break;
+        case 81: $titel = "Betriebsanweisung Anlage";
+            break;
+    }
+
+    if ($_FILES["ifile"]["error"] == 1 || $_FILES["ifile"]["error"] == 2)
+    {
+        echo "<p class='red'><b>Uploadfile zu ID '$infid'  > 32MByte!.</b></p>\n";
+        $retf=0; $reti=0;
+    }    
 
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
@@ -207,7 +220,8 @@
     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/document_image_ver.png\" border=\"0\" alt=\"Infodaten &auml;ndern\" title=\"Infodaten &auml;ndern\"/></div>\n";
 
-
+//print_r($inf); echo "<br />ok = $ok, okn = " .$inf['okn'].", upload: " . $_FILES["ifile"]["error"] .", sub = $sub<br /><br />";
+//print_r($_FILES["ifile"]); echo "<br /><br />";
     echo "<div align='center'>";
     if ($infid) $text = "editieren"; else $text = "erfassen";
     if ($copy) $duptext = " (Kopie)";
@@ -299,7 +313,7 @@
 			        if ($ok)  echo "checked=\"checked\""; 
 			echo " /></td>\n</tr>\n"; 
 		}
-        if (!is_null($_SESSION["recht"]) && in_array("ie",$_SESSION["recht"]))
+        if (!is_null($_SESSION["recht"]) && in_array($repr."e",$_SESSION["recht"]))
         {
             echo "
            	<tr><td>&nbsp;</td>\n
@@ -416,11 +430,17 @@
             }   // stmt-Objekt
             if ($result)
             {
+//                echo "upload error: ". $_FILES["ifile"]["error"] . "<br /><br />";    
                  // n:m Tabellen INSERT
                 include ("inc/info_tab_ins.inc.php");
 
                 // upload File
-                if (is_uploaded_file($_FILES["ifile"]["tmp_name"]) && isset($_FILES["ifile"]["name"]) && $_FILES["ifile"]["name"] )
+                if ($_FILES["ifile"]["error"] == 1 || $_FILES["ifile"]["error"] == 2)
+                {
+                    echo "<p class='red'><b>Uploadfile zu ID '$infid'  > 32MByte!.</b></p>\n";
+                    $retf=0; $reti=0;
+                }    
+                elseif (is_uploaded_file($_FILES["ifile"]["tmp_name"]) && isset($_FILES["ifile"]["name"]) && $_FILES["ifile"]["name"] )
                 {
                     include ("inc/file_upload.inc.php");
                     $fname  = gen_filename($inf['ifname'],"ifile",$infid);
@@ -466,7 +486,21 @@
                         }
                     }
                     else // kein Dateiname angegeben
-                    {$retf=1; $reti=1;}
+                    {
+                        include ("inc/file_upload.inc.php");
+                        $retf=1; $reti=1;
+                        if ($ifile_old)
+                        {    // Loeschen alte Datei
+                            $retf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");
+                            if ($retf) 
+                            {
+                                $sql = "UPDATE Info SET info_file = null WHERE info_ID=$infid";
+                                $reti=$dbc->execute($sql);
+                                if (!$reti) 
+                                    echo $dbc -> error . "<br>\n";
+                            }
+                        }    
+                    }
                 }
             }            
             if ($result && $retf && $reti && $reta && $retp && $retv && $retl) // INSERT/UPDATE Info
--- a/fhiiqm/info_ed.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/info_ed.php	Fri Nov 16 10:39:25 2012 +0100
@@ -4,7 +4,7 @@
  * @author Bettina Schwarzer, Fritz-Haber-Institut
  * @copyright 02/2012
  *
- * INSERT,UPDATE Informationen Geschaeftverteilungsplan   
+ * INSERT,UPDATE Informationen ausser Betriebsanweisung, Betriebsstoerung
  */
 
     error_reporting(E_ALL ^ E_NOTICE);
@@ -172,6 +172,13 @@
     if ($copy) $duptext = " (Kopie)";
     echo "<h3>Information $text$duptext<h3>";
     
+    if ($_FILES["ifile"]["error"] == 1 || $_FILES["ifile"]["error"] == 2)
+    {
+        if ($_FILES["ifile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile zu ID '$infid' > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
+        
     echo "</div>\n";
     
     if (!$ok || (!$sub && !$del && !$dup))
@@ -179,7 +186,7 @@
         if ($infid && (!$sub || !$del) && !isset($inf))
         { // update
             $sql = "SELECT info_ID,info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,infotyp_ID,
-                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort, 
+                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort,betrag, 
                                 CONCAT(nachname,', ',vorname) AS aname 
                                 FROM fhiiqm.Info i LEFT OUTER JOIN fhiiqm.Mitarbeiter m 
                                 ON i.persknr=m.persknr 
@@ -201,7 +208,8 @@
                     $inf["ifname"]  = $row->info_file;
                     $inf["lang"]    = $row->lang;     
                     $inf["fg"]      = $row->info_freigabe_ID;
-                    $inf["sort"]    = $row->info_sort;     
+                    $inf["sort"]    = $row->info_sort;
+                    $inf["betr"]    = str_replace('.',',',$row->betrag);     
                 }            
             }
             // Produkt
@@ -326,6 +334,7 @@
             if ($inf["vdat"] == "") $inf["vdat"] = null; 
             if ($inf["bdat"] == "") $inf["bdat"] = null; 
             if ($inf["fg"] == -1) $inf["fg"] = null;
+            if (isset($inf['betr']) && $inf['betr']) $betrag = dbformat_wert($inf['betr']); else $betrag = null;   
     
             if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
             
@@ -349,16 +358,17 @@
                                 lang = ?,
                                 info_freigabe_ID = ?, 
                                 info_sort = ?, 
-                                info_rel_ID = ? WHERE info_ID = $infid");
-                    $stmt -> bind_param('sssssiisisi',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                info_rel_ID = ?,
+                                betrag = ?  WHERE info_ID = $infid");
+                    $stmt -> bind_param('sssssiisisid',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();
                     if ($stmt->error) echo "error UPDATE Info: " . $stmt->error . "<br><br>\n";
                 }
                 else
                 {   //INSERT
                     $stmt -> prepare ("INSERT INTO Info (info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,
-                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID) VALUES (?,?,?,?,?,?,?,?,?,?,?)");
-                    $stmt -> bind_param('sssssiisisi', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID,betrag) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
+                    $stmt -> bind_param('sssssiisisid', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();      
                 
                     if ($stmt->error) echo "error INSERT Info: " . $stmt->error . "<br><br>\n";
@@ -396,7 +406,7 @@
                 {// nur Aenderung Dateiname
                     if ($inf["ifname"]) // Dateiname vergeben
                     {
-                        include ("inc/file_upload.inc.php");
+                        include_once ("inc/file_upload.inc.php");
                         $fname = gen_filename($inf["ifname"],$ifile_old,$infid,0);
                         $len = strlen($infid)+1;
                         if (substr($fname,0,$len) != "$infid" . "_") $fname = $infid . "_" . $fname;
@@ -421,7 +431,21 @@
                         }
                     }
                     else // kein Dateiname angegeben
-                    {$retf=1; $reti=1;}
+                    {
+                        $retf=1; $reti=1;
+                        if ($ifile_old)
+                        {    // Loeschen alte Datei
+                            include_once ("inc/file_upload.inc.php");
+                            $retf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");
+                            if ($retf) 
+                            {
+                                $sql = "UPDATE Info SET info_file = null WHERE info_ID=$infid";
+                                $reti=$dbc->execute($sql);
+                                if (!$reti) 
+                                    echo $dbc -> error . "<br>\n";
+                            }
+                        }    
+                    }
                 }
             }            
             if ($result && $retf && $reti && $reta && $retp && $retv) // INSERT/UPDATE Info
--- a/fhiiqm/info_ed3.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/info_ed3.php	Fri Nov 16 10:39:25 2012 +0100
@@ -4,7 +4,7 @@
  * @author Bettina Schwarzer, Fritz-Haber-Institut
  * @copyright 02/2012
  *
- * INSERT,UPDATE Informationen Geschaeftverteilungsplan   
+ * INSERT(,UPDATE) Informationen Geschaeftverteilungsplan   
  */
 
     error_reporting(E_ALL ^ E_NOTICE);
@@ -214,6 +214,13 @@
     if ($infid) $text = "editieren"; else $text = "erfassen";
     if ($copy) $duptext = " (Kopie)";
     echo "<h3>Gesch&auml;ftsverteilungsplan $text$duptext<h3>";
+
+    if ($_FILES["ifile"]["error"] == 1 || $_FILES["ifile"]["error"] == 2)
+    {
+        if ($_FILES["ifile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
     
     echo "</div>\n";
     
@@ -222,7 +229,7 @@
         if ($infid && (!$sub || !$del) && !isset($inf))
         { // update
             $sql = "SELECT info_ID,info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,infotyp_ID,
-                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort, 
+                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort,betrag, 
                                 CONCAT(nachname,', ',vorname) AS aname 
                                 FROM fhiiqm.Info i LEFT OUTER JOIN fhiiqm.Mitarbeiter m 
                                 ON i.persknr=m.persknr 
@@ -244,7 +251,8 @@
                     $inf["ifname"]  = $row->info_file;
                     $inf["lang"]    = $row->lang;     
                     $inf["fg"]      = $row->info_freigabe_ID;
-                    $inf["sort"]    = $row->info_sort;     
+                    $inf["sort"]    = $row->info_sort;
+                    $inf["betr"]    = str_replace('.',',',$row->betrag);     
                 }            
             }
             // Produkt
@@ -371,7 +379,8 @@
             if ($inf["vdat"] == "") $inf["vdat"] = null; 
             if ($inf["bdat"] == "") $inf["bdat"] = null; 
             if ($inf["fg"] == -1) $inf["fg"] = null;
-    
+            if (isset($inf['betr']) && $inf['betr']) $betrag = dbformat_wert($inf['betr']); else $betrag = null;   
+
             if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
             
             $stmt = $dbc -> stmtinit();
@@ -394,16 +403,17 @@
                                 lang = ?,
                                 info_freigabe_ID = ?, 
                                 info_sort = ?, 
-                                info_rel_ID = ? WHERE info_ID = $infid");
-                    $stmt -> bind_param('sssssiisisi',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                info_rel_ID = ?,
+                                betrag = ? WHERE info_ID = $infid");
+                    $stmt -> bind_param('sssssiisisid',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();
                     if ($stmt->error) echo "error UPDATE Info: " . $stmt->error . "<br><br>\n";
                 }
                 else
                 {   //INSERT
                     $stmt -> prepare ("INSERT INTO Info (info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,
-                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID) VALUES (?,?,?,?,?,?,?,?,?,?,?)");
-                    $stmt -> bind_param('sssssiisisi', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID,betrag) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
+                    $stmt -> bind_param('sssssiisisid', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();      
                 
                     if ($stmt->error) echo "error INSERT Info: " . $stmt->error . "<br><br>\n";
@@ -422,7 +432,7 @@
                 // upload File
                 if (is_uploaded_file($_FILES["ifile"]["tmp_name"]) && isset($_FILES["ifile"]["name"]) && $_FILES["ifile"]["name"] )
                 {
-                    include ("inc/file_upload.inc.php");
+                    include_once ("inc/file_upload.inc.php");
                     $fname  = gen_filename($inf['ifname'],"ifile",$infid);
                     $retdf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");     // Loeschen alte Datei
                     $retf   = upload("ifile", $fname, $infid, "infos");              // Datei prüfen und in Dokumentenverzeichnis verschieben
@@ -441,7 +451,7 @@
                 {// nur Aenderung Dateiname
                     if ($inf["ifname"]) // Dateiname vergeben
                     {
-                        include ("inc/file_upload.inc.php");
+                        include_once ("inc/file_upload.inc.php");
                         $fname = gen_filename($inf["ifname"],$ifile_old,$infid,0);
                         $len = strlen($infid)+1;
                         if (substr($fname,0,$len) != "$infid" . "_") $fname = $infid . "_" . $fname;
@@ -466,7 +476,21 @@
                         }
                     }
                     else // kein Dateiname angegeben
-                    {$retf=1; $reti=1;}
+                    {
+                        $retf=1; $reti=1;
+                        if ($ifile_old)
+                        {    // Loeschen alte Datei
+                            include_once ("inc/file_upload.inc.php");
+                            $retf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");
+                            if ($retf) 
+                            {
+                                $sql = "UPDATE Info SET info_file = null WHERE info_ID=$infid";
+                                $reti=$dbc->execute($sql);
+                                if (!$reti) 
+                                    echo $dbc -> error . "<br>\n";
+                            }
+                        }    
+                    }
                 }
             }            
             if ($result && $retf && $reti && $reta && $retp && $retv) // INSERT/UPDATE Info
--- a/fhiiqm/info_flist.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/info_flist.php	Fri Nov 16 10:39:25 2012 +0100
@@ -17,7 +17,8 @@
         exit;
     }
     
-    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ir",$_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"])))
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ir",$_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"])
+         && !in_array("ddr",$_SESSION["recht"]) && !in_array("dde",$_SESSION["recht"])))
     {
         header("Location: start.php");
         exit;
@@ -129,7 +130,7 @@
         }
         echo "<table width='99%'>\n";
         
-        if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+        if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td></tr>\n";
 
         // Listenkopf generieren
         echo "<tr bgcolor='#68ACBF'>";
@@ -174,8 +175,11 @@
 //            echo "<td class=\"left\">" . str_replace(";",";<br />",$row->prod) . "</td>";
             echo "<td class=\"left\">" . str_replace(";",";<br />",$prods) . "</td>";
             echo "<td class=\"left\">" . str_replace(";","<br />",$row->adressat) . "</td>";
-            echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw) . "</td>";
-            if ($row->ityp_ID == 7 || substr($row->ityp_ID,0,1) == 8)   // 7 = Betriebsstörung, 8 = Betriebsanweisung
+            echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw);
+            if (isset($row->betrag) && $row->betrag)
+                echo "<br><i> max. Bestellwert: ".number_format($row->betrag,2,",",".")." &euro;</i>";
+            echo "</td>";
+            if (substr($row->ityp_ID,0,1) == 7 || substr($row->ityp_ID,0,1) == 8)   // 7 = Betriebsstörung, 8 = Betriebsanweisung
             {    if ($row->raum_ID)
                 {
                     $sql = "SELECT geb_ID, raum_nr FROM Raum WHERE raum_ID = $row->raum_ID";
@@ -218,7 +222,7 @@
                 echo "<td class=\"left\">$row->doc</td>";
             echo "<td class=\"left\">$row->infrel</td>";
             $getp = "&s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil";
-            if ($row->ityp_ID == 7 || substr($row->ityp_ID,0,1) == 8) $ref = "/fhiiqm/info_betrst_ed.php?i=$row->info_ID&t=$row->ityp_ID$getp"; else $ref="/fhiiqm/info_ed.php?i=$row->info_ID$getp";
+            if (substr($row->ityp_ID,0,1) == 7 || substr($row->ityp_ID,0,1) == 8) $ref = "/fhiiqm/info_betrst_ed.php?i=$row->info_ID&t=$row->ityp_ID$getp"; else $ref="/fhiiqm/info_ed.php?i=$row->info_ID$getp";
             echo "<td><a href='$ref'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
             echo "<td><a href='$ref&dp=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td></tr>\n";
         }
--- a/fhiiqm/raum_flist.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/raum_flist.php	Fri Nov 16 10:39:25 2012 +0100
@@ -45,7 +45,7 @@
     echo "<div class=\"float-r\"><img src=\"img/house.png\" border=\"0\" alt=\"Raumdaten\" title=\"Raumdaten\"/></div>\n";
     
     // Felder, nach denen gefiltert werden kann
-    $fields = array(4=>"Gebäude",5=>"Raum-Typ",8=>"Reinigung-Typ");
+    $fields = array(4=>"Gebäude",5=>"Raum-Typ",8=>"Reinigung-Typ",9=>"Reinigung-Ketegorie",10=>"Reinigung-Turnus",11=>'Bodentyp');
 
     $zeil = $_GET["z"];
     if (!$zeil) $zeil = $_POST["z"];
--- a/fhiiqm/raum_ins.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/raum_ins.php	Fri Nov 16 10:39:25 2012 +0100
@@ -55,6 +55,13 @@
 //    echo "<br><br>\n";
 //    echo "Vertragsbezeichnung: " . $vtr['cname'] ."<br><br>\n";
     
+    if ($_FILES["rfile"]["error"] == 1 || $_FILES["rfile"]["error"] == 2)
+    {
+        if ($_FILES["rfile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
+
     if (!$ok || !$ins || ($ins && is_uploaded_file($_FILES["rfile"]["tmp_name"]) && $raum['rfname']<'!'))
     {
         $upd = $ins; // wegen filename-Pruefung bei Upload
--- a/fhiiqm/raum_upd.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/raum_upd.php	Fri Nov 16 10:39:25 2012 +0100
@@ -59,6 +59,12 @@
 //    echo "<br><br>\n";
 //    echo "Vertragsbezeichnung: " . $raum['cname'] ."<br><br>\n";
     
+    if ($_FILES["rfile"]["error"] == 1 || $_FILES["rfile"]["error"] == 2)
+    {
+        if ($_FILES["rfile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile zu ID '$rid' > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
     if ((!$ok && ((!$upd && !$del) || $upd || $del)) || ($upd && is_uploaded_file($_FILES["rfile"]["tmp_name"]) && $raum['rfname']<'!'))
     {
         if (!$upd && !$del)
@@ -148,17 +154,48 @@
 
         if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
         
+        // alter Name Raumfile
+        $sql = "SELECT raum_file FROM Raum WHERE raum_ID = $rid";
+        $rfile_old = $dbc -> querySingleItem($sql);
+
         
         // upload File, wenn vorhanden
         if (is_uploaded_file($_FILES["rfile"]["tmp_name"]) && isset($_FILES["rfile"]["name"]) && $_FILES["rfile"]["name"] )
         {
-            include ("inc/file_upload.inc.php");
+            include_once ("inc/file_upload.inc.php");
             $fname  = gen_filename($raum['rfname'],"rfile",$rid);           // Dateinamen generieren
             $retdf  = mod_file("/var/www/fhiiqm/raeume",$rid,"","del");     // Loeschen alte Datei
             $retf   = upload("rfile", $fname, $rid, "raeume");              // Datei prüfen und in Dokumentenverzeichnis verschieben
         }
-        
-        if (isset($fname) && $retf) $rfile = $rid . "_" . $fname; else $rfile = $raum['rfname'];
+        else
+        {   // nur Aenderung Dateiname
+            include_once ("inc/file_upload.inc.php");
+            $fname = gen_filename($raum['rfname'],$rfile_old,$rid,0);
+            $len = strlen($rid)+1;
+            if (substr($fname,0,$len) != "$rid" . "_") $fname = $rid . "_" . $fname;
+            if ($raum['rfname'] != $rfile_old)
+            {
+                if ($raum['rfname']>"!")
+                {
+                    $retf  = mod_file("/var/www/fhiiqm/raeume",$rid,$fname,"upd");  // Umbenennen alte Datei
+                }
+                else
+                {   // Dateiname nicht angegeben
+                    $retf=1; 
+                    if ($vfile_old)
+                    {    // Loeschen alte Datei
+                        $retf  = mod_file("/var/www/fhiiqm/raeume",$rid,"","del");
+                    }    
+                }
+            }
+            else
+            {
+                //kein Upload, keine Dateinamenaenderung
+                $retf=1;
+            }    
+        }    
+        $len = strlen($rid)+1;
+        if (isset($fname) && $retf && (substr($fname,0,$len) != "$rid" . "_")) $rfile = $rid . "_" . $fname; else $rfile = $fname;
 /*        
         if ($raum['rtyp']== -1) $rtyp = "NULL"; else $rtyp = "'" . $raum['rtyp'] . "'"; 
         if (isset($raum['rflae']) && $raum['rflae']>"0")
@@ -204,10 +241,6 @@
             echo "<br /><br />\n";
 
             // Anzeigen gespeicherte Vertragsdaten
-            if ($fname)
-                $rfile = $rid . "_" . $fname;
-            else
-                $rfile = $raum['rfname'];
             include ("inc/raum_dat_show.inc.php");
         }
     }
--- a/fhiiqm/recht_list.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/recht_list.php	Fri Nov 16 10:39:25 2012 +0100
@@ -98,6 +98,8 @@
             COUNT(CASE recht_ID WHEN 'pze' THEN 1 END) AS proz_edit,
             COUNT(CASE recht_ID WHEN 'rr' THEN 1 END) AS raum_read,
             COUNT(CASE recht_ID WHEN 're' THEN 1 END) AS raum_edit,
+            COUNT(CASE recht_ID WHEN 'ddr' THEN 1 END) AS dez_dat_read,
+            COUNT(CASE recht_ID WHEN 'dde' THEN 1 END) AS dez_dat_edit,
             COUNT(CASE recht_ID WHEN 'rtr' THEN 1 END) AS recht_read,
             COUNT(CASE recht_ID WHEN 'rte' THEN 1 END) AS recht_edit,
             COUNT(CASE recht_ID WHEN 'vr' THEN 1 END) AS vertrag_read,
@@ -127,9 +129,10 @@
                 <th colspan='2'>Produkt</th>
                 <th colspan='2'>Prozess</th>
                 <th colspan='2'>Raum</th>
-                <th colspan='2'>Recht</th>
                 <th colspan='2'>Vertrag</th>
-                <th colspan='2'>Vertr.Partner</th></tr>\n";
+                <th colspan='2'>Vertr.Partner</th>
+                <th colspan='2'>dez. Daten</th>
+                <th colspan='2'>Recht</th></tr>\n";
         echo "<tr bgcolor='#68ACBF'>";
         echo "<th>userid</th><th>read</th><th>edit</th>
                 <th>read</th><th>edit</th>
@@ -142,6 +145,7 @@
                 <th>read</th><th>edit</th>
                 <th>read</th><th>edit</th>
                 <th>read</th><th>edit</th>
+                <th>read</th><th>edit</th>
         </tr>\n";
         foreach ($result as $row)
         {
@@ -163,12 +167,14 @@
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->proz_edit)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->raum_read)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->raum_edit)) ."</b></td>";
-            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->recht_read)) ."</b></td>";
-            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->recht_edit)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->vertrag_read)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->vertrag_edit)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->vertr_part_read)) ."</b></td>";
             echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->vertr_part_edit)) ."</b></td>";
+            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->dez_dat_read)) ."</b></td>";
+            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->dez_dat_edit)) ."</b></td>";
+            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->recht_read)) ."</b></td>";
+            echo "<td class='center'><b>" . str_replace("0","&nbsp;",str_replace("1","x",$row->recht_edit)) ."</b></td>";
             echo "</tr>\n";
         }
         echo "</table></div>\n";
--- a/fhiiqm/report/abt_ag_aptyp_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/abt_ag_aptyp_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -100,7 +100,7 @@
                     <?php 
                         if ($rag["abt"] == -1) $select = " selected "; else $select = "";
                         echo "<option $select value=\"-1\"></option>\n";
-                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung ORDER BY 1";
+                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung WHERE abt_ID < 8 ORDER BY 1";
                         if ($result = $dbc->queryObjectArray($sql))
                         {
                             foreach ($result as $row)
--- a/fhiiqm/report/abt_raum_rt_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/abt_raum_rt_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -110,7 +110,7 @@
                     <?php 
                         if ($rag["abt"] == -1) $select = " selected "; else $select = "";
                         echo "<option $select value=\"-1\"></option>\n";
-                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung ORDER BY 1";
+                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung WHERE abt_ID < 8 ORDER BY 1";
                         if ($result = $dbc->queryObjectArray($sql))
                         {
                             foreach ($result as $row)
--- a/fhiiqm/report/aptyp_gefahr_massn_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/aptyp_gefahr_massn_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -9,18 +9,21 @@
 
     error_reporting(E_ALL ^ E_NOTICE);
     
-    session_start();
-    if (! isset($_SESSION["userid"]))
-    { 
-        include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");	
-        login($_SERVER["PHP_SELF"]);
-        exit;
-    }
-    
-    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+    if (!isset($_GET['s']) || $_GET['s'] != 2 )
     {
-        header("Location: start.php");
-        exit;
+        session_start();
+        if (! isset($_SESSION["userid"]))
+        { 
+            include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");	
+            login($_SERVER["PHP_SELF"]);
+            exit;
+        }
+        
+        if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+        {
+            header("Location: start.php");
+            exit;
+        }
     }    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
@@ -41,9 +44,12 @@
 
 <?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";
+    if (!isset($_GET['s']) || $_GET['s'] != 2 )
+    {
+        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=\"/fhiiqm/img/role.png\" border=\"0\" alt=\"Arbeitssicherheit\" title=\"Arbeitssicherheit\"/></div>\n";
 
     $rag    = $_POST["rag"];    // Parameter aus Form
@@ -73,7 +79,7 @@
     $_GET["s3"] = $rag["sort3"];
     $_GET["z"]  = $zeil;
    
-    if ($search)
+    if ($search && $_GET['s'] != 2)
     {    
         echo "<span class='sc'>";
         echo "<br />&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/as_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a>";
@@ -278,24 +284,32 @@
             echo "</div>\n";
         
             echo "<br />&nbsp;&nbsp;&nbsp;";
-            // Parameter aus $_GET fuer weitere Seiten
-            $_GET["s"] = 1; // bewirkt weitere Suche
-            foreach ($_GET as $key=>$val)
-            {
-                if ($key != "st") $liste .= "&" . $key ."=".$val;
-            }    
-            // Links auf andere Seiten generieren
-            liste_links($start,$zeil,$ianz,$liste);
+            if ($search != 2) // Aufruf aus fhiiqm
+            {    
+                // Parameter aus $_GET fuer weitere Seiten
+                $_GET["s"] = 1; // bewirkt weitere Suche
+                foreach ($_GET as $key=>$val)
+                {
+                    if ($key != "st") $liste .= "&" . $key ."=".$val;
+                }    
+                // Links auf andere Seiten generieren
+                liste_links($start,$zeil,$ianz,$liste);
+            }
         }
         else
         {
             echo "<p class='red'>&nbsp;&nbsp;&nbsp;Leider gibt es kein Ergebnis für die von Ihnen gewählten Kriterien!</p>";
             echo "</div>\n";
         }
-        echo "<span class='sc'>";
-        echo "<br /><br />&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/as_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a>";
-        echo "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Arbplatz-Gef.-Massn\" class=\"sc\">neuer Bericht Arbeitsplatztyp - Gef&auml;hrdung - Ma&szlig;nahme</a>\n";    
-        echo "</span>";
+        if ($search != 2)
+        {    
+            echo "<span class='sc'>";
+            echo "<br /><br />&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/as_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a>";
+            echo "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Arbplatz-Gef.-Massn\" class=\"sc\">neuer Bericht Arbeitsplatztyp - Gef&auml;hrdung - Ma&szlig;nahme</a>\n";    
+            echo "</span>";
+        }
+        else
+            echo "<a href='javascript:history.back();' onMouseOver=\"{window.status='Zur&uuml;ck'; return true;}\">&laquo; Zur&uuml;ck</a>";
 
     }
 
--- a/fhiiqm/report/info_allg_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/info_allg_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -217,7 +217,7 @@
             // Listenkopf
             echo "<tr bgcolor='#68ACBF'>";
             echo "<th>Kennzeichen</th>";
-            echo "<th>Infotitel</th>";
+            echo "<th>ID: Infotitel</th>";
             echo "<th>zu Info</th>";
             echo "<th>Kurzinfo</th>";
             if ($ityp == "''") echo "<th>Infotyp</th>";
@@ -251,7 +251,7 @@
                     foreach ($adr as $val)
                         $adrs .= "; " . substr($val,0,strpos($val,"|")-1);
                     $adrs = substr($adrs,2);
-                    echo "<td>" . str_replace(";",";<br />",$adrs) . "</td>";
+                    echo "<td>" . str_replace(";","<br />",$adrs) . "</td>";
                 }
                 if ($ityp == 7 || substr($ityp,0,1) == 8)   // 7 = Betriebsstörung, 8 = Betriebsanweisung
                 {    if ($row->raum_ID)
--- a/fhiiqm/report/ma_abt_raumgr_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/ma_abt_raumgr_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -122,7 +122,7 @@
                     <?php 
                         if ($rag["abt"] == -1) $select = " selected "; else $select = "";
                         echo "<option $select value=\"-1\"></option>\n";
-                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung ORDER BY 1";
+                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung WHERE abt_ID < 8 ORDER BY 1";
                         if ($result = $dbc->queryObjectArray($sql))
                         {
                             foreach ($result as $row)
--- a/fhiiqm/report/rag_gefahr_massn_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/rag_gefahr_massn_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -111,7 +111,7 @@
                     <?php 
                         if ($rag["abt"] == -1) $select = " selected "; else $select = "";
                         echo "<option $select value=\"-1\"></option>\n";
-                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung ORDER BY 1";
+                        $sql = "SELECT abt_ID, abt_name, abt_long FROM Abteilung WHERE abt_ID < 8 ORDER BY 1";
                         if ($result = $dbc->queryObjectArray($sql))
                         {
                             foreach ($result as $row)
--- a/fhiiqm/report/raum_rt_report.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/raum_rt_report.php	Fri Nov 16 10:39:25 2012 +0100
@@ -92,7 +92,7 @@
         echo "</span>";
     }
     echo "<div align='center'>\n";
-    echo "<p><b>(1) Bericht Raum - Raumtyp</b></p>\n";
+    echo "<p><b>(1) Bericht Raum - Raumtyp - Arbeitsplatztypen</b></p>\n";
     echo "</div>\n";
     
 
@@ -279,7 +279,7 @@
             echo "<th>Raum-Bezeichnung</th>";
             echo "<th>Betriebsanweisung</th>";
             if ($rag['rtyp'] == -1) echo "<th>Raum-Typ</th>";
-            echo "<th>Arbeitsplatz-Typ</th>";
+            echo "<th>Arbeitsplatz-Typen</th>";
             echo "</tr>\n";
 
             foreach ($result as $row)
--- a/fhiiqm/report/vertrag_report_kuend.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/report/vertrag_report_kuend.php	Fri Nov 16 10:39:25 2012 +0100
@@ -32,9 +32,14 @@
 	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    	<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS"  media="screen"/> 
    	<link href="/fhiiqm/css/db_print.css" rel="STYLESHEET" type="TEXT/CSS"  media="print"/> 
+<!--
     <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>
+-->
+    <link type="text/css" href="/fhiiqm/css/jquery/ui-lightness-1.8.21/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-1.7.2.min.js"></script>
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-ui-1.8.21.custom.min.js"></script>
 	<title>Bericht Vertrag-K&uuml;ndigungstermin</title>
 </head>
 
@@ -77,7 +82,7 @@
     echo "<table border='0' cellspacing='0'>\n";
     echo "<tr><td class='bigger'>Annahmen:</td></tr>\n
         <tr><td>&nbsp;&ndash;&nbsp;wenn keine K&uuml;ndigungsfrist angegeben ist, wird eine Frist von 3 Monaten angenommen</td></tr>\n
-        <tr><td>&nbsp;&ndash;&nbsp;wenn keine K&uuml;ndigungsdatum gesetzt wird, wird das aktuelle Datum angenommen</td></tr>\n
+        <tr><td>&nbsp;&ndash;&nbsp;wenn kein K&uuml;ndigungsdatum gesetzt ist, wird das aktuelle Datum angenommen</td></tr>\n
         <tr><td>&nbsp;&ndash;&nbsp;wenn kein Vertragsende und keine automatische Verl&auml;ngerung angegeben sind, erfolgt keine Berechnung</td></tr>\n
         <tr><td>&nbsp;&ndash;&nbsp;wenn das Vertragsende vor dem gew&auml;hlten K&uuml;ndigungsdatum liegt, erfolgt keine Berechnung</td></tr>\n
         <tr><td>&nbsp;&ndash;&nbsp;fr&uumlhestm&ouml;glicher K&uuml;ndigungstermin ist der letzter Tag des Monats, zu dem die K&uuml;ndigung erfolgt</td></tr>\n";
@@ -110,16 +115,16 @@
         $sqlr = "CALL fhiiqm.vertrag_kuendtermin($vr[prodg],$vr[vtyp],'$vr[kd]','$vr[bind]',$sort)";
 //        echo $sqlr;
     	$dbc = new dbconnection();
-        if ($vr["prodg"]>0 || $vr["vtyp"]>0 || $vr["kd"]>0) 
+        if ($vr["prodg"]>0 || $vr["vtyp"]>0 || $vr["kd"]) 
         {
-            if ($vr["kd"]>0)
+            if ($vr["kd"])
             {
                 $kd = new DateTime($vr["kd"]);    
-                $krit1 .=  $bd. " [gew&auml;hltes K&uuml;ndigungsdatum = '<b>" . $kd->format('d.m.Y') ."</b>']";
+                $krit .= " [gew&auml;hltes K&uuml;ndigungsdatum = '<b>" . $kd->format('d.m.Y') ."</b>']";
             }
-            else $krit1 .= $bd. " [gesetztes K&uuml;ndigungsdatum = '<b>" . date('d.m.Y') . "</b>']";
+            else $krit .= " [gesetztes K&uuml;ndigungsdatum = '<b>" . date('d.m.Y') . "</b>']";
 
-            if ($vr["prodg"]>0 || $vr["vtyp"]>0) $krit1 .= " AND (";
+            if ($vr["prodg"]>0 || $vr["vtyp"]>0) $krit1 .= " (";
             if ($vr["prodg"]>0)
             {
                 if ($krit) $bd = " ".$bind; else $bd = "";
--- a/fhiiqm/test/tab_info_ed.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/test/tab_info_ed.php	Fri Nov 16 10:39:25 2012 +0100
@@ -49,12 +49,13 @@
     $ok		= $_POST["ok"];
     if (!$inf["okn"]) $ok = false;
     $duptext="";
+    if (!$infid) $infid = $inf['infid'];
     
 //    print_r($inf); echo "<br /><br />";
 
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
-	$dbc = new dbconnection();
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
     
     if ($dup)
     {   // Info duplizieren
@@ -221,7 +222,7 @@
         if ($infid && (!$sub || !$del) && !isset($inf))
         { // update
             $sql = "SELECT info_ID,info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,infotyp_ID,
-                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort, 
+                                i.persknr,lang,info_file,info_rel_ID,info_freigabe_ID,info_sort,info_sort,betrag, 
                                 CONCAT(nachname,', ',vorname) AS aname 
                                 FROM fhiiqm.Info i LEFT OUTER JOIN fhiiqm.Mitarbeiter m 
                                 ON i.persknr=m.persknr 
@@ -244,6 +245,7 @@
                     $inf["lang"]    = $row->lang;     
                     $inf["fg"]      = $row->info_freigabe_ID;
                     $inf["sort"]    = $row->info_sort;     
+                    $inf["betr"]    = str_replace('.',',',$row->betrag);     
                 }            
             }
             // Produkt
@@ -335,7 +337,7 @@
         echo "</table>\n";
         echo "</div>\n";
 //            if (!is_null($_SESSION["recht"]) && !in_array("le", $_SESSION["recht"]))
-            echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/info_flist.php?$getp\" target=\"_self\" title=\"Infoliste\">&laquo; zur Infoliste</a></p>\n"; 
+        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"".$_SERVER["PHP_SELF"]."\" target=\"_self\" title=\"Info erfassen\">Weitere Info erfassen</a></p>\n";    
         echo "</form>\n";
         echo "</div>\n";
     }
@@ -387,6 +389,7 @@
             if ($inf["vdat"] == "") $inf["vdat"] = null; 
             if ($inf["bdat"] == "") $inf["bdat"] = null; 
             if ($inf["fg"] == -1) $inf["fg"] = null;
+            if (isset($inf['betr']) && $inf['betr']) $betrag = dbformat_wert($inf['betr']); else $betrag = null;   
     
             if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
             
@@ -410,16 +413,17 @@
                                 lang = ?,
                                 info_freigabe_ID = ?, 
                                 info_sort = ?, 
-                                info_rel_ID = ? WHERE info_ID = $infid");
-                    $stmt -> bind_param('sssssiisisi',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                info_rel_ID = ?, 
+                                betrag = ?  WHERE info_ID = $infid");
+                    $stmt -> bind_param('sssssiisisid',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();
                     if ($stmt->error) echo "error UPDATE Info: " . $stmt->error . "<br><br>\n";
                 }
                 else
                 {   //INSERT
                     $stmt -> prepare ("INSERT INTO Info (info_name_s,info_name_l,info_date,info_valid_from,info_valid_to,
-                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID) VALUES (?,?,?,?,?,?,?,?,?,?,?)");
-                    $stmt -> bind_param('sssssiisisi', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"]);
+                                infotyp_ID,persknr,lang,info_freigabe_ID,info_sort,info_rel_ID,betrag) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
+                    $stmt -> bind_param('sssssiisisid', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["fg"],$inf["sort"],$inf["infrel"],$betrag);
                     $result = $stmt -> execute();      
                 
                     if ($stmt->error) echo "error INSERT Info: " . $stmt->error . "<br><br>\n";
@@ -440,8 +444,8 @@
                 {
                     include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/file_upload.inc.php");
                     $fname  = gen_filename($inf['ifname'],"ifile",$infid);
-                    $retdf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");     // Loeschen alte Datei
-                    $retf   = upload("ifile", $fname, $infid, "infos");              // Datei prüfen und in Dokumentenverzeichnis verschieben
+                    $retdf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");        // Loeschen alte Datei
+                    $retf   = upload("ifile", $fname, $infid, "/var/www/fhiiqm/infos"); // Datei prüfen und in Dokumentenverzeichnis (vollstaendiger Pfad)) verschieben
                     
                     if ($retf)
                     {   // upload o.k.
@@ -500,7 +504,7 @@
             }            
         }   // INSERT / UPDATE
         echo "</div>";
-        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/info_flist.php?$getp\" target=\"_self\" title=\"Infoliste\">Infoliste</a></p>\n"; 
+//        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/info_flist.php?$getp\" target=\"_self\" title=\"Infoliste\">Infoliste</a></p>\n"; 
         echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"".$_SERVER["PHP_SELF"]."\" target=\"_self\" title=\"Info erfassen\">Weitere Info erfassen</a></p>\n";    
         
     }   // Form o.k. und submit
--- a/fhiiqm/test/tab_info_flist.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/test/tab_info_flist.php	Fri Nov 16 10:39:25 2012 +0100
@@ -149,7 +149,8 @@
 //        echo "<th>Sprache</th>";
 //        tab_column(12,"Status",$sort,$dir,0,$fnum,$filter,$start,$zeil,"",0,"#ui-tabs-1","tabs_dyn_content.php");
         echo "<th>Dokument</th>";
-        echo "<th>zu ID</th></tr>\n";
+        echo "<th>zu ID</th>";
+        echo "<th>&nbsp;</th></tr>\n";
         
 //        echo "<tr bgcolor='#68ACBF'><th>Raum-Nr.</th><th>Bezeichnung</th><th>Haus</th><th>Typ</th><th>Fl&auml;che (m<sup>2</sup>)</th><th>Raumplan</th><th>&nbsp;</th>
 //                </tr>\n";
@@ -172,7 +173,10 @@
 //            echo "<td class=\"left\">" . str_replace(";",";<br />",$row->prod) . "</td>";
             echo "<td class=\"left\">" . str_replace(";",";<br />",$prods) . "</td>";
             echo "<td class=\"left\">" . str_replace(";","<br />",$row->adressat) . "</td>";
-            echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw) . "</td>";
+            echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw);
+            if (isset($row->betrag) && $row->betrag)
+                echo "<br><i> max. Bestellwert: ".number_format($row->betrag,2,",",".")." &euro;</i>";
+            echo "</td>";
             if ($row->ityp_ID == 7 || substr($row->ityp_ID,0,1) == 8)   // 7 = Betriebsstörung, 8 = Betriebsanweisung
             {    if ($row->raum_ID)
                 {
@@ -207,14 +211,16 @@
             else  echo "<td>&nbsp;</td>";       
 //            echo "<td class=\"left\">$row->lang</td>";
             echo "<td class=\"left\">$row->freigabe</td>";
-            if (file_exists("infos/".$row->doc))
+            if (file_exists($_SERVER['DOCUMENT_ROOT']."/fhiiqm/infos/".$row->doc))
             {
                 $doc = substr($row->doc,strpos($row->doc,"_")+1); 
-                echo "<td class=\"left\"><a href=\"infos/$row->doc\">$doc</td>";
+                echo "<td class=\"left\"><a href=\"/fhiiqm/infos/$row->doc\">$doc</td>";
             }
             else    
                 echo "<td class=\"left\">$row->doc</td>";
             echo "<td class=\"left\">$row->infrel</td>";
+            $ref = "?i=$row->info_ID";
+            echo "<td><a href='$ref' class='info_edit'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
             echo "</tr>\n";
         }
         echo "</table></div>\n";
--- a/fhiiqm/test/tabs_dyn_content.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/test/tabs_dyn_content.php	Fri Nov 16 10:39:25 2012 +0100
@@ -9,6 +9,8 @@
 
     error_reporting(E_ALL ^ E_NOTICE);
     header('Content-type: text/html; charset="iso-8859-1',true);    
+
+
     session_start();
     if (! isset($_SESSION["userid"]))
     { 
@@ -23,6 +25,8 @@
         exit;
     }    
 
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
     $titel = "Test tabs"
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -44,40 +48,7 @@
     <?php     
         echo "<h3>&nbsp;&nbsp;&nbsp;$titel </h3>";
         echo "<table width='80%'><tr>
-        <td class='bigger'>&nbsp;&nbsp;&nbsp;hier k&ouml;nnen Informationen erfasst und daneben die Produkte eingesehen werden<br /><br /><br /></td><td>";
-        
-    ?>
-    <form id="infol" method="POST" action="<?php $_SERVER['PHP_SELF'] ?>" enctype="application/x-www-form-urlencoded">
-    <table>
-        <tr><td>Infoliste sort nach</td>
-            <td><select name="s">
-                <option value="15">Kennzeichen</option>
-                <option value="2">Titel</option>
-                <option value="3">Kurzinfo</option>
-                <option value="4">Infotyp</option>
-                <option value="5">Produkt</option>
-                <option value="6">Adressat</option>
-                <option value="7">Verantwortlichen</option>
-                <option value="8">Autor</option>
-                <option value="9">erstellt am</option>
-                <option value="10">gültig ab</option>
-                <option value="11">gültig bis</option>
-                <option value="12">Status</option>
-            </select>
-            </td>
-        </tr>
-        <tr><td>Sortierrichtung</td>
-            <td><select name="d">
-                <option value="ASC">aufsteigend</option>
-                <option value="DESC">absteigend</option>
-            </select>
-            &nbsp;&nbsp;&nbsp;<input type="submit" class="button" name="subil" value="sortieren" /></td>
-        </tr>
-    
-    </table>
-    </form>
-    <?php
-        echo "</td></tr></table>";
+        <td class='bigger'>&nbsp;&nbsp;&nbsp;hier k&ouml;nnen Informationen erfasst, editiert, angelistet und daneben die Produkte eingesehen werden<br /><br /><br /></td><td>";
         
         $zeil = $_GET["z"];
         if (!$zeil) $zeil = $_POST["z"];
@@ -94,9 +65,70 @@
     
         $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
         if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+/*
+        $infoid = $_POST['id']; // aus Feld 'id'
+        if ($infoid == -1) $infoid=null;
+        else*/if (!$infoid) $infoid=$_GET['i'] ; // aus tab_info_flist.php
 //        print_r ($_GET); echo "<br /><br />";
+//        print_r ($_POST); echo "<br /><br />";
+
+//        $_GET['i'] = $infoid;   // fuer tab_info_ed.php, wenn klick aus info-liste
     ?>
-
+    <form id="infol" method="POST" action="<?php $_SERVER['PHP_SELF'] ?>" enctype="application/x-www-form-urlencoded">
+    <table>
+        <tr><td>Infoliste sort nach</td>
+            <td><select name="s">
+                <?php
+                $asort = array(15=>"Kennzeichen",2=>"Titel",3=>"Kurzinfo",4=>"Infotyp",5=>"Produkt",6=>"Adressat",
+                        7=>"Verantwortlichen",8=>"Autor",9=>"erstellt am",10=>"gültig ab",11=>"gültig bis",12=>"Status"); 
+                foreach ($asort as $key => $val)
+                {
+                    $select = ($sort == $key)? "selected" : "";
+                    echo "<option $select value='$key'>$val</option>\n";
+                }        
+                ?>
+            </select>
+            </td>
+        </tr>
+        <tr><td>Sortierrichtung</td>
+            <td><select name="d">
+                <?php $select = ($dir == "ASC")? "selected" : "";
+                echo "<option $select value='ASC'>aufsteigend</option>";
+                $select = ($dir == "DESC")? "selected" : "";
+                echo "<option $select value='DESC'>absteigend</option>"; ?>
+            </select>
+            &nbsp;&nbsp;&nbsp;<input type="submit" class="button" name="subil" id="subil" value="sortieren" /></td>
+        </tr>
+    
+    </table>
+    </form>
+    <?php
+        echo "</td></tr></table>";
+        
+    ?>
+<!--
+    <form id="infoi" method="POST" action="<?php $_SERVER['PHP_SELF'] ?>" enctype="application/x-www-form-urlencoded">
+    <table>
+        <tr><td>&nbsp;&nbsp;&nbsp;zu editierende Info wählen</td>
+            <td><select name="id" onchange="this.form.submit();">
+            <option value="-1">&nbsp;</option>
+            <?php
+            /*
+                $sql = " SELECT info_ID,info_name_s FROM Info ORDER BY 2";
+                if ($res = $dbc -> queryObjectArray($sql));
+                    foreach ($res as $row)
+                    {
+                        $select = ($row->info_ID == $infoid) ? "selected" : "";
+                        echo "<option $select value='$row->info_ID'>$row->info_ID - $row->info_name_s</option>\n";
+                    }
+             */                                
+            ?>            
+                </select>
+            </td>
+        <td>&nbsp;&nbsp;&nbsp;<a href="#tab_1" id="link_edit" class="link_edit">Edit Info</a></td></tr>
+    </table>
+    </form>
+-->
     <script>
     <!--
         $(function() {
@@ -135,31 +167,41 @@
                         }
             });
              $('.link_edit').click(function() { 
-                $('#tabs').tabs("url", 0, '/fhiiqm/test/tab_info_ed.php?i=123');
+                $('#tabs').tabs('select',0);
+                $('#tabs').tabs("url", 0, '/fhiiqm/test/tab_info_ed.php?i=<?php echo $infoid; ?>');
                 $('#tabs').tabs("load",0);
 //                window.location = $('#tabs').tabs( "option", "selected",0);
 //                alert ("url:" + $('#tabs').( "option", "selected" ));
 //                $('#tabs').bind('tabsshow', function(event, ui){document.location = $(document).attr('location').pathname + '#' + ui.panel.id +"?i=123";});                 alert ("url = "+ui.tab.href);
                 return false;
                 })
+/*
+             $('.info_edit').click(function() { 
+                $('#tabs').tabs('select',0);
+                $('#tabs').tabs("url", 0, '/fhiiqm/test/tab_info_ed.php?i=<?php echo $_GET["i"]; ?>');
+                $('#tabs').tabs("load",0);
+                return false;
+                })
+*/
+             $('#subil').click(function() { 
+                $('#tabs').tabs('select',1);
+                return true;
+                })
         });
     -->
 	</script>
 
-    <p>&nbsp;&nbsp;&nbsp;<a href="#tab_1" id="link_edit" class="link_edit">Edit Info</a></p>
+    <p>&nbsp;</p>
     <div id="tabs">
     	<ul>
-            <li><a href="#tab_1">Info editieren</a></li>
+            <li><a href="#tab_1">Info neu/editieren</a></li>
 <!--            <li><a href="#tab_2">Infoliste</a></li>   -->
     		<li><a href="/fhiiqm/test/tab_info_flist.php<?php echo "?f=$fnum&s=$sort&d=$dir&st=$start&z=$zeil";?>" class="thisPane">Infoliste</a></li>
     		<li><a href="/fhiiqm/test/tab_prod_hier.php?b=0&g=0&s=1">Produkte</a></li>
     	</ul>
         <div id="tab_1">
             <?php include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/test/tab_info_ed.php"); ?>
-        </div> <!-- tab_1 -->
-<!--        <div id="tab_2">
-            <?php // include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/test/tab_info_flist.php"); ?>
-        </div> <!-- tab_2 -->
+        </div>            
     </div> <!-- tabs -->
  </body>
  </html>
\ No newline at end of file
--- a/fhiiqm/vertrag_flist1.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/vertrag_flist1.php	Fri Nov 16 10:39:25 2012 +0100
@@ -78,6 +78,8 @@
     if (!isset($fnum) && !$fnum) $fnum = 1;
     if (!isset($sort) && !$sort) $sort = 2;
     if (!isset($dir) && !$dir)  $dir = "";
+    // $_GET-Parameter zurueck zur Vertragliste mit den selben Einstellungen wie zuvor fuer Update
+    $getp = "&s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil";
     
     // Recht Produktgruppe beruecksichtigen
     if (is_array($_SESSION["prodg"]))
@@ -197,7 +199,7 @@
             }    
             else    
                 echo "<td>$row->doc</td>";
-            echo "<td><a href='/fhiiqm/vertrag_upd.php?uid=$row->contract_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+            echo "<td><a href='/fhiiqm/vertrag_upd.php?uid=$row->contract_ID$getp'><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;";
--- a/fhiiqm/vertrag_flist12.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/vertrag_flist12.php	Fri Nov 16 10:39:25 2012 +0100
@@ -61,6 +61,8 @@
     $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
     $filter = $_GET["b"];
     if (!isset($fnum) && !$fnum) $fnum = 0;
+    // $_GET-Parameter zurueck zur Vertragliste mit den selben Einstellungen wie zuvor fuer Update
+    $getp = "&s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil&t=2"; 
     
     $listg  = $_GET["l"];
     if (!isset($listg) && !$listg)
@@ -118,7 +120,6 @@
         echo "<th>E-Mail</th>";
 
         echo "<th>&nbsp;</th></tr>\n";
-        $cid=0;
         foreach ($result as $row)
         {
             // Anzeigen der nur einmal relevanten Daten
@@ -163,7 +164,7 @@
             $mail = ($row->email)? "ja": "&nbsp;";   
             echo "<td width='27%'>".nl2br($row->bem)."</td>";    
             echo "<td>$mail</td>";
-            echo "<td><a href='vertrag_upd.php?uid=$cid'><img src=\"img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+            echo "<td><a href='vertrag_upd.php?uid=$row->contract_ID$getp'><img src=\"img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
        }
         echo "</table></div>\n";
         echo "<br />&nbsp;&nbsp;&nbsp;";
--- a/fhiiqm/vertrag_ins.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/vertrag_ins.php	Fri Nov 16 10:39:25 2012 +0100
@@ -57,6 +57,13 @@
 //    print_r($vtr);
 //    echo "<br><br>\n";
 //    echo "Vertragsbezeichnung: " . $vtr['cname'] ."<br><br>\n";
+
+    if ($_FILES["vfile"]["error"] == 1 || $_FILES["vfile"]["error"] == 2)
+    {
+        if ($_FILES["vfile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
     
     if (!$ok || !$submit)
     {
--- a/fhiiqm/vertrag_search.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/vertrag_search.php	Fri Nov 16 10:39:25 2012 +0100
@@ -27,7 +27,10 @@
 	$dbc = new dbconnection();
 
 //    $cid = $_POST["con_id"];
-    $cname = $_POST["conbez"];
+    if (isset($_POST["conbez"]) && $_POST["conbez"])
+        $cname = $_POST["conbez"];
+    if (!$cname) $cname = $_POST["conprod"];
+    if (!$cname) $cname = $_POST["conpart"];
     $cid = trim(substr($cname,0,strpos($cname,"-")));
 //    echo "cname = $cname, cid = $cid<br />\n";
     if (isset($cid) && $cid) 
@@ -79,6 +82,18 @@
 */
                     close: (function(event,ui){
                                 $("#fcontract").submit();})
+            });
+            $("#conprod").autocomplete({
+        			minLength: 2,
+                    source: "/fhiiqm/inc/vertrag_prod_list_ac.inc.php",
+                    close: (function(event,ui){
+                                $("#fcontractpr").submit();})
+        		});
+            $("#conpart").autocomplete({
+        			minLength: 2,
+                    source: "/fhiiqm/inc/vertrag_list_ac.inc.php?part=1",
+                    close: (function(event,ui){
+                                $("#fcontractpa").submit();})
         		});
             $("input[id='conbez']").addClass("long50");
             });
@@ -86,15 +101,31 @@
         <div align="center">
         <h3>Vertragssuche</h3>
     	       <table>   
-        		<tr><td class="bigger">Bitte <i>Vertragsbezeichnung</i> oder Teil davon eingeben und dann Vertrag</td></tr> 
-                <tr><td class="bigger">aus angebotener Liste durch Anklicken w&auml;hlen:</td></tr>   
+        		<tr><td class="bigger">Bitte <i>Vertragsbezeichnung</i> bzw. Teil davon eingeben</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; ?>"/>
+                        <input class="long50" id="conbez" name="conbez" type="text" value=""/>
             		</div></td></tr>
                 
             	</form> 
+        		<tr><td class="bigger">oder <i>Vertragspartner</i> bzw. Teil davon eingeben</td></tr>   
+            	<form name="fcontractpa" id="fcontractpa" action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
+                
+                    <tr><td><div class="ui-widget">
+                        <input class="long50" id="conpart" name="conpart" type="text" value=""/>
+            		</div></td></tr>
+                
+            	</form> 
+        		<tr><td class="bigger">oder <i>Produkt</i> bzw. Teil davon eingeben</td></tr> 
+            	<form name="fcontractpr" id="fcontractpr" action="<?php $_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
+                
+                    <tr><td><div class="ui-widget">
+                        <input class="long50" id="conprod" name="conprod" type="text" value=""/>
+            		</div></td></tr>
+                
+            	</form> 
+                <tr><td class="bigger">dann Vertrag aus angebotener Liste durch Anklicken w&auml;hlen</td></tr>   
                 <tr><td>Falls keine Liste angezeigt wird, existiert kein Vertrag mit den eingegebenen Zeichen!</td></tr>
         	   </table>
         </div>
--- a/fhiiqm/vertrag_upd.php	Fri Aug 31 14:22:20 2012 +0200
+++ b/fhiiqm/vertrag_upd.php	Fri Nov 16 10:39:25 2012 +0100
@@ -49,6 +49,19 @@
 	$dbc = new dbconnection();
     $cid    = $_GET["uid"];
     if (!$cid) $cid=3;
+    $zeil = $_GET["z"];
+    if (!$zeil) $zeil = 20; // Anzahl der gezeigten Zeilen
+    $start = $_GET["st"];   // Start bei DS $start+1
+    if (!$start) $start=0;
+	$sort   = $_GET["s"];   // Sortierung nach Spalte
+    $dir    = $_GET["d"];   // Sortierrichtung
+    $fnum   = $_GET["f"];   // Spaltennummer, nach der aktuell gefiltert wird
+    $filter = $_GET["b"];   // Filterbegriff
+    $teil   = $_GET["t"];   // t = 2 zu Vertragsliste Teil 2 zurueck
+    if ($teil == 2) $tlist = "vertrag_flist12.php"; else $tlist = "vertrag_flist1.php";
+    // $_GET-Parameter zurück zur Vertragliste mit den selben Einstellungen wie zuvor
+    $getp = "s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil";
+
 	$ok		= $_POST["ok"];
 	$upd	= $_POST["upd"];
     $del    = $_POST["del"];
@@ -59,6 +72,12 @@
 //    echo "<br><br>\n";
 //    echo "Vertragsbezeichnung: " . $vtr['cname'] ."<br><br>\n";
     
+    if ($_FILES["vfile"]["error"] == 1 || $_FILES["vfile"]["error"] == 2)
+    {
+        if ($_FILES["vfile"]["error"] == 2)
+            echo "<p class='red'><b>Uploadfile zu ID '$cid' > 10 MByte!</b></p>\n";
+        $ok = 0;
+    }
     if (!$ok && ((!$upd && !$del) || $upd || $del))
     {
         if (!$upd && !$del)
@@ -173,8 +192,8 @@
         }
         echo "</table>\n";
         echo "</div>\n";
-        if (!is_null($_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"]))
-            echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_flist1.php\" target=\"_self\" title=\"Vertragsliste\">&laquo; zur Vertragsliste</a></p>\n";    
+//        if (!is_null($_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"]))
+            echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"$tlist?$getp\" target=\"_self\" title=\"Vertragsliste\">&laquo; zur Vertragsliste</a></p>\n";    
         echo "</form>\n";
         	
     }
@@ -218,6 +237,10 @@
 
         if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
         
+        // alter Name Vertragsdocument
+        $sql = "SELECT contract_file FROM Vertrag WHERE contract_ID = $cid";
+        $vfile_old = $dbc -> querySingleItem($sql);
+
         
         // upload File, wenn vorhanden
         if (is_uploaded_file($_FILES["vfile"]["tmp_name"]) && isset($_FILES["vfile"]["name"]) && $_FILES["vfile"]["name"] )
@@ -227,8 +250,36 @@
             $retdf  = mod_file("/var/www/fhiiqm/documents",$cid,"","del");  // Loeschen alte Datei
             $retf   = upload("vfile", $fname, $cid);                        // Datei prüfen und in Dokumentenverzeichnis verschieben
         }
+        else
+        {   // nur Aenderung Dateiname
+            include ("inc/file_upload.inc.php");
+            $fname = gen_filename($vtr['cfname'],$vfile_old,$cid,0);
+            $len = strlen($cid)+1;
+            if (substr($fname,0,$len) != "$cid" . "_") $fname = $cid . "_" . $fname;
+            if ($vtr['cfname'] != $vfile_old)
+            {
+                if ($vtr['cfname']>"!")
+                {
+                    $retf  = mod_file("/var/www/fhiiqm/documents",$cid,$fname,"upd");  // Umbenennen alte Datei
+                }
+                else
+                {   // Dateiname nicht angegeben, darf nicht vorkommen
+                    $retf=1; 
+                    if ($vfile_old)
+                    {    // Loeschen alte Datei
+                        $retf  = mod_file("/var/www/fhiiqm/documents",$cid,"","del");
+                    }    
+                }
+            }
+            else
+            {
+                //kein Upload, keine Dateinamenaenderung
+                $retf=1;
+            }    
+        }    
+        $len = strlen($cid)+1;
+        if (isset($fname) && $retf && (substr($fname,0,$len) != "$cid" . "_")) $cfile = $cid . "_" . $fname; else $cfile = $fname;
         
-        if (isset($fname) && $retf) $cfile = $cid . "_" . $fname; else $cfile = $vtr['cfname'];
 /*        
         if (isset($fname) && $retf) $cfile = "contract_file = '" . $cid . "_" . $fname . "', ";
         $sql = "UPDATE fhiiqm.Vertrag SET
@@ -276,11 +327,13 @@
             echo "<br /><br />\n";
 
             // Anzeigen gespeicherte Vertragsdaten
-            if ($fname)
+/*           if ($fname)
                 $cfile = $cid . "_" . $fname;
             else
                 $cfile = $vtr['cfname'];
+*/            
             include ("inc/vertrag_dat_show.inc.php");
+
         }
     }
     elseif ($ok && $del)
@@ -309,7 +362,7 @@
     if ($ok && ($upd || $del))
     {
         echo "</div><br /><br />\n";
-        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_flist1.php\" target=\"_self\" title=\"Vertragsliste\">Zur&uuml;ck zur Vertragsliste</a></p>\n";    
+        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"$tlist?$getp\" target=\"_self\" title=\"Vertragsliste\">Zur&uuml;ck zur Vertragsliste</a></p>\n";    
         echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_ins.php\" target=\"_self\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";    
     }