+ Info GVP, Raum-Reinigung, Vertrag: Email vor Ende, Test Hierarchie
authorBettina Schwarzer <schwarzer@fhi-berlin.mpg.de>
Fri, 02 Mar 2012 13:54:32 +0100
changeset 24 15f33315f045
parent 23 a382de56a8e4
child 25 482252ff12fd
+ Info GVP, Raum-Reinigung, Vertrag: Email vor Ende, Test Hierarchie
fhiiqm/anlage_flist.php
fhiiqm/css/db.css
fhiiqm/css/db_print.css
fhiiqm/form/info_form2.inc.php
fhiiqm/form/laser_form.inc.php
fhiiqm/form/produkt_form.inc.php
fhiiqm/form/raum_form.inc.php
fhiiqm/form/vertrag_form.inc.php
fhiiqm/img/minus.gif
fhiiqm/img/plus.gif
fhiiqm/inc/dbconnect.inc.php
fhiiqm/inc/info_dat_show.inc.php
fhiiqm/inc/info_tab_ins.inc.php
fhiiqm/inc/menu.inc.php
fhiiqm/inc/raum_dat_show.inc.php
fhiiqm/inc/vertrag_dat_show.inc.php
fhiiqm/info_ed.php
fhiiqm/info_flist.php
fhiiqm/laser_flist.php
fhiiqm/prod_hier.php
fhiiqm/raum_flist.php
fhiiqm/raum_flist_ed.php
fhiiqm/raum_ins.php
fhiiqm/raum_upd.php
fhiiqm/report/info_report.php
fhiiqm/report/vertrag_kuend_email.php
fhiiqm/test/hierarchie.php
fhiiqm/test/raum_list.php
fhiiqm/vertrag_flist2.php
fhiiqm/vertrag_ins.php
fhiiqm/vertrag_upd.php
--- a/fhiiqm/anlage_flist.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/anlage_flist.php	Fri Mar 02 13:54:32 2012 +0100
@@ -159,7 +159,7 @@
             echo "<td>$row->verantw</td>";
             echo "<td><a href='/fhiiqm/anlage_ed.php?i=$row->al_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
             if (!is_null($_SESSION["recht"]) && in_array("ae",$_SESSION["recht"]))
-                echo "<td><a href='/fhiiqm/anlage_ed.php?i=$row->al_ID&d=1&c=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td>";
+                echo "<td><a href='/fhiiqm/anlage_ed.php?i=$row->al_ID&d=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td>";
             echo "<td><a href='/fhiiqm/alpruef_flist.php?s=3&d=DESC&f=5&b=$row->al_ID&st=0&z=25'>
                 <img src=\"/fhiiqm/img/details.gif\" alt='Pr&uuml;fungen' title='Pr&uuml;fungen' border='0'/></a></td>";
             echo "<td><a href='/fhiiqm/alrisk_flist.php?s=2&d=&f=5&b=$row->al_ID&st=0&z=25'>
--- a/fhiiqm/css/db.css	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/css/db.css	Fri Mar 02 13:54:32 2012 +0100
@@ -1,3 +1,5 @@
+.pr {display: none;}
+
 #navi {
     margin-top: 0.3em;
     float: left; 
@@ -159,6 +161,10 @@
 {
     vertical-align: bottom;
 }
+.valignt
+{
+    vertical-align: top;
+}
 .long20
 {
     width: 20em;
--- a/fhiiqm/css/db_print.css	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/css/db_print.css	Fri Mar 02 13:54:32 2012 +0100
@@ -112,6 +112,10 @@
 {
     vertical-align: bottom;
 }
+.valignt
+{
+    vertical-align: top;
+}
 .long20
 {
     width: 20em;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/info_form2.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -0,0 +1,277 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 02/2012
+ *
+ * Form Info Geschaeftsverteilungsplan
+ */
+
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+    $okn = true;
+
+?>
+<div align="center">
+<?php
+    if (!is_null($_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"]))
+        $text = "";
+    else
+        if  (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="&Auml;ndern / L&ouml;schen";
+?>
+<h5>* - Felder sind erforderlich!</h5>
+</div>
+<!-- <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="form_svc"> -->	
+<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form_info" target="_self"> 	
+<div align="center">
+<table width="60%" border="0" cellspacing="3" cellpadding="3">
+    <tr>
+        <td>Titel *<br/><br />
+            &nbsp;&nbsp;&nbsp;max. 300 Zeichen m&ouml;glich</td>
+        <td><textarea name="inf[iname]" id="titel" cols="50" rows="2"><?php echo $inf['iname']; ?></textarea>
+            <?php 
+			     if (isset($inf['iname']) && $inf['iname']<'!')
+				{
+					echo "<br><span class=\"red\">Titel ist erforderlich!</span>\n";
+					$okn = false;
+				}
+                if ($infid)
+                { 
+                    echo "&nbsp;&nbsp;&nbsp;Info-ID";
+                    echo "&nbsp;&nbsp;&nbsp;<input class='read right' name='inf[infid]' type='text' size='5' value='" .$inf['infid']."' readonly='readonly' />"; 
+                }
+             ?>
+        </td>
+    </tr>
+    <tr>
+        <td>Kurzinformation<br/><br />
+            &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>
+	<tr>
+	   <td>Kennzeichen(Sort.)</td>
+	   <td><input name="inf[sort]" type="text" size="5" maxlength="5" value="<?php echo $inf['sort']; ?>" /></td>
+    </tr>
+    <tr><td>geh&ouml;rt zu Info</td>
+        <td><select name="inf[infrel]">
+            <?php
+                if ($inf['adr'] == -1) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                if (isset($inf["infid"]) && $inf["infid"]>0) $where = " WHERE info_ID != " . $inf["infid"]; else $where=""; 
+                $sql = "SELECT info_ID, LEFT(info_name_s,50) AS iname FROM Info $where ORDER BY 2";
+                if ($result = $dbc -> queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if ($row->info_ID == $inf['infrel'])
+    					   echo "<option selected value=\"$row->info_ID\">$row->info_ID - $row->iname</option>\n";
+    				    else
+    					   echo "<option value=\"$row->info_ID\">$row->info_ID - $row->iname</option>\n";
+                    }
+                }
+            ?>
+        </select>
+        </td>
+    </tr>
+    <tr>
+        <td>Info-Typ</td>
+        <td><select name="inf[ityp]">
+            <?php 
+                if (!$ityp)
+                { 
+                    $wher = "";
+                    if ($inf['ityp'] == -1) $select = " selected "; else $select = "";
+                    echo "<option $select value=\"-1\"></option>\n";
+                }
+                else $wher = " WHERE infotyp_ID = $ityp";
+                $sql = "SELECT infotyp_ID, infotyp_bez FROM Info_Typ $wher ORDER BY 2";
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if ($row->infotyp_ID == $inf['ityp'])
+    					   echo "<option selected value=\"$row->infotyp_ID\">$row->infotyp_bez</option>\n";
+    				    else
+    					   echo "<option value=\"$row->infotyp_ID\">$row->infotyp_bez</option>\n";
+                    }
+            }
+            ?>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>Erstellungsdatum *</td>
+        <td><input class="long10" name="inf[cdat]" id="cdat"  value="<?php echo $inf['cdat']; ?>">
+            <?php
+                if (isset($inf['cdat']) && $inf['cdat']< "!")
+                { 
+                    echo "<br><span class=\"red\">Erstellungsdatum ist erforderlich!</span>\n";
+                    $okn = false;
+                }    
+            ?>
+        </td>
+    </tr>
+    <tr>
+        <td>g&uuml;ltig ab</td>
+        <td><input class="long10" name="inf[vdat]" id="vdat"  value="<?php echo $inf['vdat']; ?>"></td>
+    </tr>
+     <tr>
+        <td>g&uuml;ltig bis</td>
+        <td><input class="long10" name="inf[bdat]" id="bdat"  value="<?php echo $inf['bdat']; ?>"></td>
+    </tr>
+    <tr>
+        <td>Autor</td>
+        <td><input class="long20" type="text" name="inf[persknr]" id="persknr" value="<?php echo $inf['persknr']; ?>"/>
+        &nbsp;&nbsp;&nbsp;Eingabe von mind. 2 Zeichen -&gt; Namensliste
+        </td>
+    </tr>
+    <tr>
+        <td>Verantwortliche(r) FHI <br /><br />
+            &nbsp;&nbsp;&nbsp;Mehrfachauswahl m&ouml;glich:<br />
+            &nbsp;&nbsp;&nbsp;[Strg]-Taste + Anklicken der<br /> 
+            &nbsp;&nbsp;&nbsp;gewünschten Listeneinträge
+        </td>
+        <td><table cellspacing="0"><tr><td>
+            <select name="inf[vpers][]" size="5" multiple="multiple" onblur="this.form.submit();">
+                <?php
+                    $select = null;
+                    if (is_array($inf['vpers'])) $select = in_array( "-1", $inf['vpers'] ) ? ' selected' : null;
+                    echo "<option $select value=\"-1\"></option>\n";
+/*                    if ((isset($ityp) && $ityp==6) || (isset($inf["ityp"]) && $inf["ityp"]==6)) 
+                    {    // nur fuer Infotyp 'Geschaeftsverteilungsplan'
+                        $wherm = " WHERE abt_tel=6 OR persknr IN (122,390,414,418,1339,2450,2452) ";
+                    }    
+                    else */
+                        $wherm = "";
+                    $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname) as pname FROM fhiiqm.Mitarbeiter $wherm ORDER BY 2";
+                    if ($result = $dbc->queryObjectArray($sql))
+                    {
+                        foreach ($result as $row)
+                        {
+                            if (is_array($inf['vpers']))
+                            { 
+                                $select = in_array( $row->persknr, $inf['vpers'] ) ? ' selected' : null;
+                                if ($select) $inf["vma"][] = $row->pname;
+                            }                                    
+        					echo "<option $select value=\"$row->persknr\">$row->pname</option>\n";
+                        }
+                    }
+                ?>
+            </select></td>
+            <?php
+            if (isset($inf["vma"]) && is_array($inf["vma"]))
+            {
+                $i=0;
+               echo "<td><table cellspacing='0' cellpadding='0'>";
+                foreach ($inf["vma"] as $vma)
+                {
+                    echo "<tr><td class='valignb'>&nbsp;&nbsp;&nbsp;$vma:&nbsp;&nbsp;&nbsp;</td>";
+//                        <td class='valignb'>Priorit&auml;t <select name=' inf[prio][$i]'>";
+                    echo "<td class='valignb'> <input name='inf[prio][$i]' type='text' size='50' maxlength='50' value='". $inf["prio"][$i] . "' />";
+/*                    for ($j=1; $j<4; $j++)
+                    {
+                        $select =  ($j == $inf["prio"][$i] ) ? ' selected' : null;
+                        echo "<option$select value='$j'>$j</option>";                    
+                    }
+                    echo "</select></td></tr>";
+*/
+                    echo "</td></tr>";
+                    $i++; 
+                }
+                echo "</table></td>\n";    
+            }
+            ?>
+        </tr></table></td>
+    </tr>
+    <tr><td>Sprache</td>
+        <td><select name="inf[lang]">
+        <?php
+                if ($inf['lang'] == -1) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $alang = array("de"=>"deutsch","en"=>"englisch");
+                foreach ($alang as $key=>$value)
+                {
+                    if ($inf['lang'] == $key) $select = " selected "; else $select = "";
+                    echo "<option $select value=\"$key\">$value</option>\n";
+                }
+        ?>
+        </select></td>
+    </tr>
+    <tr>
+        <td>zugeordnet zu Produkt<br /><br />
+            &nbsp;&nbsp;&nbsp;Mehrfachauswahl m&ouml;glich:<br />
+            &nbsp;&nbsp;&nbsp;[Strg]-Taste + Anklicken der<br /> 
+            &nbsp;&nbsp;&nbsp;gewünschten Listeneinträge</td>
+        <td>
+            <select name="inf[prid][]" size="6" multiple="multiple">
+            <?php 
+                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";
+                $sql = "CALL prod_hiera_all(0,0)";  
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if (strlen($row->bez) > 70) 
+                            $prod=str_replace(" ","&nbsp;",htmlentities(substr($row->bez,0,70))) ."..."; 
+                        else 
+                            $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";
+                    }
+                }
+                unset($result);
+            ?>
+            </select>
+            <br />bitte nur die <font color="green">gr&uuml;nen</font> Eintr&auml;ge w&auml;hlen
+        </td>
+    </tr>
+    <tr><td>Adressat<br /><br />
+            &nbsp;&nbsp;&nbsp;Mehrfachauswahl m&ouml;glich</td>
+        <td><select name="inf[adr][]" size="4" multiple="multiple">
+            <?php
+                if (is_array($inf['adr'])) $select = in_array( "-1", $inf['adr'] ) ? ' selected' : null;
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT info_adr_ID, info_adr_name FROM Adressat ORDER BY 2";
+                if ($result = $dbc -> queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if (is_array($inf['adr'])) $select = in_array( $row->info_adr_ID, $inf['adr'] ) ? ' selected' : null;
+       					echo "<option $select value=\"$row->info_adr_ID\">$row->info_adr_name</option>\n";
+                    }
+                }
+            ?>
+        </select>
+        </td>
+    </tr>
+	<tr>
+	   <td>Dateibezeichnung Dokument (*)</td>
+	   <td><input name="inf[ifname]" type="text" size="50" maxlength="50" value="<?php echo $inf['ifname']; ?>">
+	   <?php
+            echo "<br />bitte <u>keine</u> Umlaute im Dateinamen angeben!";   
+			if (isset($inf['ifname']) && $upd && is_uploaded_file($_FILES["ifile"]["tmp_name"]) && $inf['ifname']<'!')
+				{
+					echo "<br><span class=\"red\">Dateiname ist erforderlich!</span>\n";
+					$okn = false;
+				}
+				else
+				{
+                    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;
+                }
+		?>
+		</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="inf[okn]" value="<?php echo $okn; ?>"/>
+<!--  </table>
+ </div>   
+</form> -->
\ No newline at end of file
--- a/fhiiqm/form/laser_form.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/form/laser_form.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -73,9 +73,9 @@
             <td><input type="checkbox" name="la[akt]" value="1" <?php echo ($la["akt"] )?  "checked=\"checked\"" : "";?> />
             </td>
         </tr>
-        <tr><td>Laserwelle von</td>
+        <tr><td>Wellenl&auml;nge(nm) von</td>
             <td valign="top"><input type="text" name="la[wvon]" size="10" maxlength="7" value="<?php echo $la['wvon']; ?>"/>
-            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Laserwelle bis&nbsp;&nbsp;&nbsp;
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wellenl&auml;nge(nm) bis&nbsp;&nbsp;&nbsp;
             <input type="text" name="la[wbis]" size="10" maxlength="7" value="<?php echo $la['wbis']; ?>"/></td>
         </tr>
         <tr><td>Laserart</td>
--- a/fhiiqm/form/produkt_form.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/form/produkt_form.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -36,7 +36,8 @@
 				}
 				else
 					if ($okn) $okn = true; else $okn=false;
-            ?> 
+            ?>
+            <div>Stelle 1 u. 2 = Produktgruppe, 3 u. 4 lfd. Nr.</div> 
         </td>
     </tr>
     <tr>
@@ -59,7 +60,7 @@
         <td><select name="prod[grp]">
             <?php 
                 $sql = "SELECT prod_group_ID, prod_group_name, prod_ber_name FROM Produkt_Gruppe g 
-                        INNER JOIN Produkt_Bereich b ON g.prod_ber_ID=b.prod_ber_ID ORDER BY prod_ber_name,2";
+                        INNER JOIN Produkt_Bereich b ON g.prod_ber_ID=b.prod_ber_ID ORDER BY 1";
                 if ($result = $dbc->queryObjectArray($sql))
                 {
                     foreach ($result as $row)
@@ -68,10 +69,10 @@
                         if (strlen($row->prod_ber_name)>35 ) $row->prod_ber_name = substr($row->prod_ber_name,0,35) . "...";
                         if ($row->prod_group_ID == $prod['grp'])
                         {
-    					   echo "<option selected value=\"$row->prod_group_ID\" title=\"$row->prod_group_ID\">$row->prod_ber_name: $row->prod_group_name</option>\n";
+    					   echo "<option selected value=\"$row->prod_group_ID\" title=\"$row->prod_group_ID\">$row->prod_group_ID - $row->prod_ber_name: $row->prod_group_name</option>\n";
                         }  
     				    else
-    					   echo "<option value=\"$row->prod_group_ID\" title=\"$row->prod_group_ID\">$row->prod_ber_name: $row->prod_group_name</option>\n";
+    					   echo "<option value=\"$row->prod_group_ID\" title=\"$row->prod_group_ID\">$row->prod_group_ID - $row->prod_ber_name: $row->prod_group_name</option>\n";
                     }
             }
             ?>
--- a/fhiiqm/form/raum_form.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/form/raum_form.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -84,8 +84,9 @@
             ?>
             </select>
         </td>
-    <tr>
-        <td>Reinigungs-Typ</td>
+    </tr>
+    <tr>    
+        <td>&nbsp;&nbsp;&nbsp;Reinigungs-Typ</td>
         <td><select name="raum[reityp]">
             <?php 
                 if ($raum['reityp'] == -1) $select = " selected "; else $select = "";
@@ -100,7 +101,74 @@
     				    else
     					   echo "<option value=\"$row->reinigung_typ_ID\">$row->reinigung_typ_ID: $row->reinigung_typ_bez</option>\n";
                     }
-            }
+                }
+            ?>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;&nbsp;&nbsp;Bodentyp</td>
+        <td><select name="raum[boden]">
+            <?php 
+                if ($raum['boden'] == -1) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT boden_typ_ID, boden_typ_bez FROM fhiiqm.Boden_Typ ORDER BY 2";
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if ($row->boden_typ_ID == $raum['boden'])
+    					   echo "<option selected value=\"$row->boden_typ_ID\">$row->boden_typ_bez</option>\n";
+    				    else
+    					   echo "<option value=\"$row->boden_typ_ID\">$row->boden_typ_bez</option>\n";
+                    }
+                }
+            ?>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;&nbsp;&nbsp;Reinigungs-Kategorie</td>
+        <td><select name="raum[reikat]">
+            <?php
+                if ($raum['reikat'] == -1) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SHOW COLUMNS FROM Raum WHERE Field = 'reinigung_kat'";
+                if ($result = $dbc->queryRow($sql))
+                { 
+                    //print_r($result);
+                    foreach ($result as $row)
+                        $arr=explode("','",preg_replace("/(enum|set)\('(.+?)'\)/","\\2",$row[1]));
+                    //print "werte =";print_r($werte);
+                    foreach ($arr as $kat)
+                    {
+                        if ($kat == $raum["reikat"])
+                            echo "<option selected value=\"$kat\">$kat</option>\n";
+                        else
+                            echo "<option value=\"$kat\">$kat</option>\n";
+                    }
+                }
+            ?>
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td>&nbsp;&nbsp;&nbsp;Reinigungs-Turnus</td>
+        <td><select name="raum[reitur]">
+            <?php 
+                if ($raum['reitur'] == -1) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT reinigung_turnus_ID, reinigung_turnus_bez FROM fhiiqm.Reinigung_Turnus ORDER BY 1";
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        if ($row->reinigung_turnus_ID == $raum['reitur'])
+    					   echo "<option selected value=\"$row->reinigung_turnus_ID\">$row->reinigung_turnus_bez</option>\n";
+    				    else
+    					   echo "<option value=\"$row->reinigung_turnus_ID\">$row->reinigung_turnus_bez</option>\n";
+                    }
+                }
             ?>
             </select>
         </td>
--- a/fhiiqm/form/vertrag_form.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/form/vertrag_form.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -247,6 +247,10 @@
         <td><input name="vertrag[cnot]" type="text" size="10" maxlength="3" value="<?php echo $vtr['cnot']; ?>"/></td>
     </tr>
     <tr>
+        <td>autom. E-Mail vor Vertr.-Ende</td>
+        <td><input name="vertrag[email]" type="checkbox" value="1" <?php if ($vtr["email"]) echo "checked";?>/></td>
+    </tr>
+    <tr>
         <td>Partner (Firma)</td>
         <td>
             <select name="vertrag[partid]">
Binary file fhiiqm/img/minus.gif has changed
Binary file fhiiqm/img/plus.gif has changed
--- a/fhiiqm/inc/dbconnect.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/dbconnect.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -107,6 +107,41 @@
 		}
 	
 	}
+    
+    function queryRow($sql)
+    {// in $result steht einfaches Array, Zugriff auf Element ueber Index
+ 		if ( is_string($sql) )
+		{
+			if ($this->result = $this->_connid->query($sql))
+			{
+				if ($this->result->num_rows)
+				{
+					while ($row = $this->result->fetch_row())
+						$result_arr[] = $row;
+					$this->result->free();
+                    $this->_connid->next_result(); // wegen OUT-Parameter in stored procedures
+                    return $result_arr;
+				}
+				else
+				{   //kein Ergebnis
+					$this->error = "";
+					$this->result->free();
+                    $this->_connid->next_result(); // wegen OUT-Parameter in stored procedures
+					return false;
+				}
+			}
+			else
+			{
+				$this->error = $this->_connid->error;
+				return false;
+			}
+		}
+		else
+		{
+			$this->error = "'$sql'<br> ist kein SQL-Statement!";
+			return false;
+		}
+    }
 
 	function querySingleItem($sql)
 	{// gibt nur 1 Zeile mit einer Spalte zurueck, z.B. Count()
--- a/fhiiqm/inc/info_dat_show.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/info_dat_show.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -10,6 +10,7 @@
             echo "<table>\n";
             echo "<tr><td>Infotitel: </td><td>" . $inf["iname"] . "<td></td></tr>\n";
             echo "<tr><td>Kurzinfo: </td><td>" . nl2br($inf["ilong"]) . "<td></td></tr>\n";
+            echo "<tr><td>Kennzeichen: </td><td>" . $inf["sort"] . "<td></td></tr>\n";
             // Infoyp
             $sql = "SELECT infotyp_ID, infotyp_bez FROM Info_Typ
                         WHERE infotyp_ID = '" . $inf['ityp'] . "'";
@@ -18,11 +19,24 @@
                 foreach ($result as $row)
                 echo "<tr><td>Infoyp: </td><td>" . $row->infotyp_bez . "</td></tr>\n";
             }
-            if (is_object($idat)) $sdat = $idat->format('d.m.Y'); else $sdat = "&nbsp;";
+            // Datums
+            if (is_object($idat)) 
+                $sdat = $idat->format('d.m.Y');  
+            elseif ($inf["cdat"])
+                {$sdat = new DateTime($inf["cdat"]); $sdat = $sdat->format("d.m.Y");}
+            else $sdat = "&nbsp;";
             echo "<tr><td>Erstellungsdatum: </td><td>$sdat</td></tr>\n";
-            if (is_object($bdat)) $sdat = $bdat->format('d.m.Y'); else $sdat = "&nbsp;";
+            if (is_object($bdat)) 
+                $sdat = $bdat->format('d.m.Y');
+            elseif ($inf["vdat"])
+                {$sdat = new DateTime($inf["vdat"]); $sdat = $sdat->format("d.m.Y");}
+            else $sdat = "&nbsp;";
             echo "<tr><td>g&uuml;ltig ab: </td><td>$sdat</td></tr>\n";
-            if (is_object($edat)) $sdat = $edat->format('d.m.Y'); else $sdat = "&nbsp;";
+            if (is_object($edat)) 
+                $sdat = $edat->format('d.m.Y'); 
+            elseif ($inf["bdat"])
+                {$sdat = new DateTime($inf["bdat"]); $sdat = $sdat->format("d.m.Y");}
+            else $sdat = "&nbsp;";
             echo "<tr><td>g&uuml;ltig bis: </td><td>$sdat</td></tr>\n";
             // Autor
             if ($inf["pers"])
@@ -80,6 +94,18 @@
                     }
                 }
             }
+            //Verantwortliche+Prioritaet
+            if (isset($inf["vpers"])&& is_array($inf["vpers"]))
+            {
+                echo "<tr><td>Verantwortliche(r):</td>";
+                for ($k=0; $k<count($inf["vpers"]); $k++)
+                {
+                    if ($k == 0) $leer = ""; else $leer = "<td>&nbsp;</td>";
+                    $sql = "SELECT CONCAT (nachname, ', ',vorname) as pname FROM fhiiqm.Mitarbeiter WHERE persknr=" . $inf["vpers"][$k];
+                    $pname = $dbc -> querySingleItem($sql);                    
+                    echo "$leer<td>".$pname."&nbsp;&nbsp;&nbsp;Bemerkung: ".$inf["prio"][$k]."</td></tr>";    
+                }
+            }
             // Bezug zu anderer Info
             if ($inf["infrel"])
             {
--- a/fhiiqm/inc/info_tab_ins.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/info_tab_ins.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -24,7 +24,7 @@
                         $retpi = $dbc -> execute($sql); 
                         if (!$retpi) $retp=false;
                     }
-                    if (!$retp) echo "error INSERT Info_Produkt<br />\n";
+                    if (!$retp) echo "error INSERT Info_Produkt: $dbc->error<br />\n";
                 }
                 else
                 { 
@@ -49,7 +49,7 @@
                             if (!$retai) $reta = false;
                         }
                     }
-                    if (!$reta) echo "error INSERT Info_Adressat<br />\n";
+                    if (!$reta) echo "error INSERT Info_Adressat: $dbc->error<br />\n";
                 }
 
             }
@@ -58,6 +58,35 @@
                 echo "error INSERT Info_Adressat: " . $dbc -> error . " <br />\n";
                 $reta = false;
             }
+            // Verantwortliche + Bemerkung (ehemals Prioritaet)
+            $retv = true;
+            $sql = "DELETE FROM Info_Verantwortlich WHERE info_ID = $infid";
+            $retv = $dbc -> execute($sql);
+            if ($retv)
+            {
+                if (!is_object($stmt)) $stmt = $dbc -> stmtinit();
+                if (is_array($inf['vpers']))
+                {
+                    $stmt -> prepare("INSERT INTO Info_Verantwortlich (info_ID,persknr,prioritaet) VALUES(?,?,?)");
+                    for ($k=0; $k<count($inf['vpers']); $k++)
+                    {
+                        if ($inf['vpers'] != -1)
+                        { 
+//                            $sql = "INSERT INTO Info_Verantwortlich (info_ID,persknr,prioritaet) VALUES($infid, " .$inf['vpers'][$k].", '" .$inf["prio"][$k]."')";
+//                            $retvi = $dbc -> execute($sql);
+                            $stmt -> bind_param('iis',$infid, $inf["vpers"][$k], $inf["prio"][$k]);
+                            $retvi = $stmt -> execute();
+                            if (!$retvi) $retv = false;
+                        }
+                    }
+                    if (!$retv) echo "error INSERT Info_Verantwortlich: $stmt->error<br />\n";
+                }
+            }
+            else
+            { 
+                echo "error INSERT Info_Verantwortlich: " . $dbc -> error . " <br />\n";
+                $retv = false;
+            }
 
 
 ?>
\ No newline at end of file
--- a/fhiiqm/inc/menu.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/menu.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -61,7 +61,11 @@
           if (in_array("ir",$_SESSION["recht"]) || in_array("ie",$_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_ins.php\" target=\"_blank\" title=\"Info erfassen\">Information erfassen</a></li>\n";
+            		echo "<li><a href=\"/fhiiqm/info_ed.php\" target=\"_blank\" title=\"Info erfassen\">Information erfassen</a></li>\n";
+          if (in_array("ie",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/info_ed.php?t=6\" target=\"_blank\" title=\"Info GVP erfassen\">Gesch&auml;ftsverteilungsplan erfassen</a></li>\n";
+          if (in_array("ir",$_SESSION["recht"]) || in_array("ie",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/report/info_report.php\" target=\"_blank\" title=\"Report GVP\">Gesch&auml;ftsverteilungsplan</a></li>\n";
     	  echo "   </ul>\n
                 </li>\n";
         }	
@@ -108,7 +112,7 @@
           echo "<li>Bewegungsdaten\n    
             	   <ul>\n";    // Bearbeitung von ausgewaehlten Stamm-Daten
           if (in_array("re",$_SESSION["recht"]))
-            		echo "<li><a href=\"/fhiiqm/raum_flist_ed.php\" target=\"_blank\" title=\"Raumliste edit\">R&auml;ume sortieren, filtern, Reinigungs-Typ bearbeiten</a></li>\n";
+            		echo "<li><a href=\"/fhiiqm/raum_flist_ed.php\" target=\"_blank\" title=\"Raumliste edit\">R&auml;ume sortieren, filtern, Reinigungsdaten bearbeiten</a></li>\n";
     	  echo "   </ul>\n
                 </li>\n";
                 
--- a/fhiiqm/inc/raum_dat_show.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/raum_dat_show.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -32,8 +32,28 @@
             if ($result = $dbc->queryObjectArray($sql))
             {
                 foreach ($result as $row)
-                echo "<tr><td>Reinigungstyp: </td><td>" . $row->reinigung_typ_ID." - ".$row->reinigung_typ_bez . "</td></tr>\n";
+                echo "<tr><td>&nbsp;&nbsp;&nbsp;Reinigungstyp: </td><td>" . $row->reinigung_typ_ID." - ".$row->reinigung_typ_bez . "</td></tr>\n";
+            }
+            // Bodentyp
+            $sql = "SELECT boden_typ_ID, boden_typ_bez FROM fhiiqm.Boden_Typ
+                        WHERE boden_typ_ID = '" . $raum['boden'] . "'";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                echo "<tr><td>&nbsp;&nbsp;&nbsp;Bodentyp: </td><td>" . $row->boden_typ_bez . "</td></tr>\n";
             }
+            // ReinigungKategorie
+            if ($raum['reikat']>"!")
+                echo "<tr><td>&nbsp;&nbsp;&nbsp;Reinigungskategorie: </td><td>" . $raum['reikat'] . "<td></td></tr>\n";
+            // Reinigungsturnus
+            $sql = "SELECT reinigung_turnus_ID, reinigung_turnus_bez FROM fhiiqm.Reinigung_Turnus
+                        WHERE reinigung_turnus_ID = '" . $raum['reitur'] . "'";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                echo "<tr><td>&nbsp;&nbsp;&nbsp;Reinigungsturnus: </td><td>" . $row->reinigung_turnus_bez . "</td></tr>\n";
+            }
+            //Flaeche
             if ($raum["rflae"] == "NULL") $raum["rflae"] = "&nbsp;";
             echo "<tr><td>Raum-Fl&auml;che (m<sup>2</sup>): </td><td>" . str_replace(".",",",$raum['rflae']) . "<td></td></tr>\n";
             if (file_exists("raeume/$rfile"))
--- a/fhiiqm/inc/vertrag_dat_show.inc.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/inc/vertrag_dat_show.inc.php	Fri Mar 02 13:54:32 2012 +0100
@@ -30,6 +30,10 @@
                 echo "<tr><td>automatische Verl&auml;ngerung:</td><td>ja</td><tr>";
                 
             echo "<tr><td>Kündigungsfrist (mon vor V-Ende): </td><td>" . $vtr['cnot'] . "</td></tr>\n";
+
+            if ($vtr["email"])
+                echo "<tr><td>automat. E-Mail vor Vertr.-Ende:</td><td>ja</td><tr>";
+                
             // Partner
             $sql = "SELECT part_firma FROM Partner WHERE part_ID = $pid";
             if ($result = $dbc -> queryObjectArray($sql))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/info_ed.php	Fri Mar 02 13:54:32 2012 +0100
@@ -0,0 +1,427 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 02/2012
+ *
+ * INSERT,UPDATE Informationen Geschaeftverteilungsplan   
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("ir",$_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+
+    $ityp   = $_GET["t"];
+    
+    $infid  = $_GET["i"];
+    $del    = $_POST["del"];
+    $sub    = $_POST["eintragen"];
+    $dup    = $_POST["dup"];
+    if (!$dup) $dup = $_GET["d"];
+    $copy   = $_GET["c"];
+	$inf    = $_POST["inf"];
+    $ok		= $_POST["ok"];
+    if (!$inf["okn"]) $ok = false;
+    $duptext="";
+    
+//    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 ($dup)
+    {   // Info duplizieren
+        $tab = "Info";
+        $key = "info_ID";
+        $val =  $infid;
+//        $ret=1;
+        $ret = duplicate_record ($tab, $key, $val);
+        if ($ret)
+        { 
+            $infid_new=$ret;
+            // Infofilename loeschen
+            $sql = "UPDATE fhiiqm.Info SET info_file = NULL WHERE info_ID = $infid_new";
+            $retf = $dbc -> execute($sql);
+            if ($dbc->error) echo "<p  class='red'>error loeschen Info-File: " . $dbc->error . "</p>";
+            
+            // duplizieren Produkte
+            $sql = "INSERT INTO Info_Produkt SELECT $infid_new,produkt_ID FROM Info_Produkt WHERE info_ID = $infid";
+            $retp = $dbc -> execute($sql);
+            if ($dbc->error) echo "<p  class='red'>error copy Info_Produkt: " . $dbc->error . "</p>";
+            
+            // duplizieren Adressat
+            $sql = "INSERT INTO Info_Adressat SELECT $infid_new,info_adr_ID FROM Info_Adressat WHERE info_ID = $infid";
+            $reta = $dbc -> execute($sql);
+            if ($dbc->error) echo "<p  class='red'>error copy Info_Adressat: " . $dbc->error . "</p>";
+            
+            // duplizieren Verantwortliche
+            $sql = "INSERT INTO Info_Verantwortlich SELECT $infid_new,persknr,prioritaet FROM Info_Verantwortlich WHERE info_ID = $infid";
+            $retv = $dbc -> execute($sql);
+            if ($dbc->error) echo "<p  class='red'>error copy Info_Verantwortlich: " . $dbc->error . "</p>";
+            
+            if ($ret && $retf)
+            {
+                $addr = $_SERVER["PHP_SELF"] . "?i=$infid_new&c=1";
+                header("Location: $addr");
+                exit;
+            }
+            else $duptext = " - Fehler beim Duplizieren von ". $inf["iname"];    
+        }
+        else $duptext = " - Fehler beim Duplizieren von ". $inf["iname"];    
+    }
+    
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen"/> 
+   	<link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print"/> 
+    <link type="text/css" href="/fhiiqm/css/jquery/ui-lightness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />	
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-1.6.2.min.js"></script>
+    <script type="text/javascript" src="/fhiiqm/js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
+
+	<title>Edit Informationen</title>
+</head>
+
+<body>
+
+    <script>
+      $(document).ready(function() {
+        $("#titel").focus();
+        $("#persknr").autocomplete({
+                source: "/fhiiqm/inc/ma_list_ac.inc.php",
+    			minLength: 2,
+                select: function(event,ui){$("#pid").val(ui.item.id);}
+    		});
+        $("#cdat").datepicker({
+            dateFormat: 'yy-mm-dd', //nur Datum
+            yearRange: '2000:2025',
+            changeMonth: true,
+			changeYear: true,
+            firstDay: 1,
+            dayNamesMin: ['So','Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa' ],
+            monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'] 
+        });
+        $("#vdat").datepicker({
+            dateFormat: 'yy-mm-dd', //nur Datum
+            yearRange: '2000:2025',
+            changeMonth: true,
+			changeYear: true,
+            firstDay: 1,
+            dayNamesMin: ['So','Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa' ],
+            monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'] 
+        });
+        $("#bdat").datepicker({
+            dateFormat: 'yy-mm-dd', //nur Datum
+            yearRange: '2000:2025',
+            changeMonth: true,
+			changeYear: true,
+            firstDay: 1,
+            dayNamesMin: ['So','Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa' ],
+            monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'] 
+        });
+        $("input").persknr("long20").addClass("long20");
+        $("input").cdat("long10").addClass("long10");
+        $("input").vdat("long10").addClass("long10");
+        $("input").bdat("long10").addClass("long10");
+        });
+    </script>
+
+<?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/document_image_ver.png\" border=\"0\" alt=\"Infodaten &auml;ndern\" title=\"Infodaten &auml;ndern\"/></div>\n";
+
+
+    echo "<div align='center'>";
+    if ($infid) $text = "editieren"; else $text = "erfassen";
+    if ($copy) $duptext = " (Kopie)";
+    echo "<h3>Information $text$duptext<h3>";
+    
+    echo "</div>\n";
+    
+    if (!$ok || (!$sub && !$del && !$dup))
+    {
+        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,info_sort, 
+                                CONCAT(nachname,', ',vorname) AS aname 
+                                FROM fhiiqm.Info i LEFT OUTER JOIN fhiiqm.Mitarbeiter m 
+                                ON i.persknr=m.persknr 
+                                WHERE info_ID = $infid";
+            if ($result = $dbc -> queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                {
+                    $inf["infid"]   = $infid;
+                    $inf["iname"]   = $row->info_name_s;
+                    $inf["ilong"]   = $row->info_name_l;
+                    $inf["cdat"]    = $row->info_date;
+                    $inf["vdat"]    = $row->info_valid_from;
+                    $inf["bdat"]    = $row->info_valid_to;
+                    $inf["ityp"]    = $row->infotyp_ID;
+                    $inf["persknr"] = $row->aname;
+                    $inf["pers"]    = $row->persknr;
+                    $inf["infrel"]  = $row->info_rel_ID;
+                    $inf["ifname"]  = $row->info_file;
+                    $inf["lang"]    = $row->lang;     
+                    $inf["sort"]    = $row->info_sort;     
+                }            
+            }
+            // Produkt
+            $sql = "SELECT produkt_ID FROM Info_Produkt WHERE info_ID = $infid";
+            if ($result = $dbc -> queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                {
+                    $inf['prid'][] = $row->produkt_ID;
+                }
+            }
+            // Adressat
+            $sql = "SELECT info_adr_ID FROM Info_Adressat WHERE info_id = $infid";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                $inf["adr"][] = $row->info_adr_ID;
+            }
+            // Verantwortlicher
+            $sql = "SELECT iv.persknr,prioritaet, CONCAT (nachname, ', ',vorname) 
+                    FROM Info_Verantwortlich iv INNER JOIN Mitarbeiter m ON iv.persknr=m.persknr
+                    WHERE info_id = $infid
+                    ORDER BY 3";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                foreach ($result as $row)
+                {
+                    $inf["vpers"][] = $row->persknr;
+                    $inf["prio"][]  = $row->prioritaet;
+                }
+            }
+//    print_r($inf); echo "<br /><br />";
+            
+        }
+        include($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/info_form2.inc.php");     
+        if ($sub)
+		{
+            echo            
+            "<tr>
+        		<td>Upload Infodokument </td>
+        		<td><input type=\"file\" name=\"ifile\" size=\"50\" maxlength=\"50\" value=\"" .
+            $_FILES["ifile"]["name"] . "\"/></td>
+            </tr>";
+    
+		}
+        if ($sub || $del)
+		{
+		  	if ($sub)
+                $frage = "Alle Angaben ok?";
+            elseif ($del)
+                $frage = "Information wirklich l&ouml;schen?";
+			echo "<tr>
+			  <td class=\"red\" valign=\"top\" align=\"left\">$frage</td>
+			        <td><input type=\"checkbox\" name=\"ok\" value=\"1\"";
+			        if ($ok)  echo "checked=\"checked\""; 
+			echo " /></td>\n</tr>\n"; 
+		}
+        if (!is_null($_SESSION["recht"]) && in_array("ie",$_SESSION["recht"]))
+        {
+            echo "
+           	<tr><td>&nbsp;</td>\n
+            	<td><input  class=\"button\" type=\"submit\" name=\"eintragen\" value=\"  eintragen  \" />";
+            if ($infid)
+            {
+                echo "&nbsp;&nbsp;&nbsp;<input class=\"buttonr\" type=\"submit\" value=\"l&ouml;schen\" name=\"del\" title=\"delete\" />";
+                echo "&nbsp;&nbsp;&nbsp;<input class=\"button\" type=\"submit\" value=\"duplizieren\" name=\"dup\" title=\"delete\" />";
+            }    
+           	echo "</td></tr>\n";
+        }
+        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=\"info_flist.php\" target=\"_self\" title=\"Infoliste\">&laquo; zur Infoliste</a></p>\n"; 
+        echo "</form>\n";   
+    }
+    else
+    {
+        echo "<div align='center'>\n";
+        
+        if ($del)
+        {   // loescht auch m:n - Tabellen wegen Loeschweitergabe
+            $sql = "DELETE FROM Info WHERE info_ID = '$infid'";
+            $retdi = $dbc -> execute($sql);
+            if ($retdi)
+            {
+                include ("inc/file_upload.inc.php");
+                $retdf  = mod_file("/var/www/fhiiqm/infos",$infid,"","del");  // Loeschen Dokument
+                if ($retdf) echo "<p class='green'><b>Infodokument zu ID '$infid' wurde gel&ouml;scht.</b></p>\n";
+                echo "<p class='green'><b>Infodaten zu ID '$infid' wurden gel&ouml;scht.</b></p>\n";
+                echo "<br /><br />\n";
+    
+                // Anzeigen geloeschter Infodaten
+                if ($fname)
+                    $ifile = $infid . "_" . $fname;
+                else
+                    $ifile = $inf['ifname'];
+                echo "<p class='green'><b>DELETE: Daten  zu '".$inf["iname"]."' wurden erfolgreich gel&ouml;scht.</b></p>\n";
+                include ("inc/info_dat_show.inc.php");
+            }                
+            else
+            {
+                echo "<p class='red'><b>DELETE: Daten  zu '".$inf["iname"]."' konnten nicht gel&ouml;scht werden!</b></p>\n";
+                echo "sql = $sql<br />";
+                echo "error DELETE: " . $dbc->error . "<br />";
+            }
+        }
+        else //INSERT oder UPDATE
+        {
+            //daten speichern
+            $inf["iname"] = substr($inf["iname"],0,300);
+            $inf["ilong"] = substr($inf["ilong"],0,8000);
+            $inf["sort"] = substr($inf["sort"],0,5);
+            if ($inf["ityp"] == -1) $inf["ityp"] = null;
+            
+            if ($inf["persknr"] < "!") $inf["pers"] = null;
+            if ($inf["infrel"] == -1) $inf["infrel"] = null;
+            if ($inf["lang"] == -1) $inf["lang"] = null;
+            if ($inf["ifname"] < "!") $inf["ifname"] = null;
+            
+            if ($inf["cdat"] == "") $inf["cdat"] = null; 
+            if ($inf["vdat"] == "") $inf["vdat"] = null; 
+            if ($inf["bdat"] == "") $inf["bdat"] = null; 
+    
+            if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+            
+            $stmt = $dbc -> stmtinit();
+            if (is_object($stmt))
+            {
+                if ($infid)
+                {   //UPDATE
+                    // alter Name Infofile
+                    $sql = "SELECT info_file FROM Info WHERE info_ID = $infid";
+                    $ifile_old = $dbc -> querySingleItem($sql);
+                    
+                    $stmt -> prepare("UPDATE fhiiqm.Info SET
+                                info_name_s = ?, 
+                                info_name_l = ?, 
+                                info_date = ?, 
+                                info_valid_from = ?, 
+                                info_valid_to = ?, 
+                                infotyp_ID = ?, 
+                                persknr = ?, 
+                                lang = ?,
+                                info_sort = ?, 
+                                info_rel_ID = ? WHERE info_ID = $infid");
+                    $stmt -> bind_param('sssssiissi',$inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["sort"],$inf["infrel"]);
+                    $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_sort,info_rel_ID) VALUES (?,?,?,?,?,?,?,?,?,?)");
+                    $stmt -> bind_param('sssssiissi', $inf["iname"],$inf["ilong"],$inf["cdat"],$inf["vdat"],$inf["bdat"],$inf["ityp"],$inf["pers"],$inf["lang"],$inf["sort"],$inf["infrel"]);
+                    $result = $stmt -> execute();      
+                
+                    if ($stmt->error) echo "error INSERT Info: " . $stmt->error . "<br><br>\n";
+                    if ($result)
+                    { // INSERT o.k.
+                      // info_ID ermitteln
+                        $infid = $dbc -> insertId();
+                    }    
+                } 
+            }   // stmt-Objekt
+            if ($result)
+            {
+                 // 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"] )
+                {
+                    include ("inc/file_upload.inc.php");
+                    $fname = gen_filename($inf['ifname'],"ifile",$infid);
+                    $retf   = upload("ifile", $fname, $infid, "infos");              // Datei prüfen und in Dokumentenverzeichnis verschieben
+                    
+                    if ($retf)
+                    {   // upload o.k.
+                        //UPDATE des Filenamens
+                        $sql = "UPDATE Info SET info_file = '" . $infid . "_" . $fname ."' WHERE info_ID=$infid";
+                        $reti=$dbc->execute($sql);
+                        if (!$reti) 
+                            echo $dbc -> error . "<br>\n";
+                    }
+                   
+                }
+                else
+                {// nur Aenderung Dateiname
+                    if ($inf["ifname"]) // Dateiname vergeben
+                    {
+                        include ("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;
+                        if ($inf["ifname"] != $ifile_old)
+                        {
+                            $retf  = mod_file("/var/www/fhiiqm/infos",$infid,$fname,"upd");  // Umbenennen alte Datei
+                            if ($retf) 
+                            {
+                                $sql = "UPDATE Info SET info_file = '" . $fname . "' WHERE info_ID=$infid";
+                                $reti=$dbc->execute($sql);
+                                if (!$reti) 
+                                    echo $dbc -> error . "<br>\n";
+                                if (substr($fname,0,$len) == "$infid" . "_") $fname = substr($fname,$len,50);
+                            }
+                            
+                        }
+                        else
+                        {
+                            //kein Upload, keine Dateinamenaenderung
+                            if (substr($fname,0,$len) == "$infid" . "_") $fname = substr($fname,$len,50);
+                            $retf=1; $reti=1;
+                        }
+                    }
+                    else // kein Dateiname angegeben
+                    {$retf=1; $reti=1;}
+                }
+            }            
+            if ($result && $retf && $reti && $reta && $retp && $retv) // INSERT/UPDATE Info
+            {
+                //Eingabe Daten, Upload File erfolgreich 
+                    echo "<p class='green'><b>Infodaten zu ID '$infid' wurden erfolgreich gespeichert.</b></p>\n";
+                    echo "<br /><br />\n";
+
+                // Anzeigen gespeicherte Infodaten
+                if ($fname)
+                    $ifile = $infid . "_" . $fname;
+                else
+                    $ifile = $inf['ifname'];
+                include ("inc/info_dat_show.inc.php");
+            }            
+        }   // INSERT / UPDATE
+        echo "</div>";
+        echo "<p class='sc'>&nbsp;&nbsp;&nbsp;<a href=\"info_flist.php\" 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
+?>
+    
+</body>
+</html>
--- a/fhiiqm/info_flist.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/info_flist.php	Fri Mar 02 13:54:32 2012 +0100
@@ -45,10 +45,11 @@
     echo "<div class=\"float-r\"><img src=\"img/document_image_ver.png\" border=\"0\" alt=\"Infodaten\" title=\"Infodaten\"/></div>\n";
 
     // Felder, nach denen gefiltert werden kann
-    $fields = array(2=>"Titel",4=>"Info-Typ",5=>"Produkt",6=>"Adressat");
+    $fields = array(2=>"Titel",4=>"Info-Typ",5=>"Produkt",6=>"Adressat", 7=>"Verantwortlicher");
 
     $zeil = $_GET["z"];
-    if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+    if (!$zeil) $zeil = $_POST["z"];
+    if (!$zeil) $zeil = 10; // Anzahl der gezeigten Zeilen
     $start = $_GET["st"];   // Start bei DS $start+1
     if (!$start) $start=0;
     
@@ -68,7 +69,7 @@
     
     if (!isset($fnum) && !$fnum) $fnum = 1;
     if (!isset($filter) && !$filter) $filter = "";
-    if (!isset($sort) && !$sort) $sort = 1;
+    if (!isset($sort) && !$sort) $sort = 15; // Kennzeichen
     if (!isset($dir) && !$dir)  $dir = "";
 
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
@@ -95,7 +96,9 @@
         echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />' 
             können Sie nach bestimmten Spalten auf- bzw. absteigend sortieren</td></tr>
             <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' erm&ouml;glicht das Filtern nach ausgew&auml;hlten Spalten der Liste</td></tr>
-            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Infodaten</td></tr>\n";
+            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten , 
+            '<img src='/fhiiqm/img/duplicate.gif' border='0' hight='11'>' - Duplizieren der Infodaten
+            </td></tr>\n";
         echo "</table>\n";
 
         $ianz = $dbc -> querySingleItem("SELECT @anz");
@@ -105,36 +108,47 @@
         {
             // Formular anzeigen fuer Filterbegriff
             $text = $fields[$fnum];
+            $azeil = array(10=>'10',20=>'20',25=>'25',50=>'50',100=>'100',9999=>'alle'); // Anzahl gezeigter rows
             echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
             echo "<input type='hidden' name='s' value='$sort'>";
             echo "<input type='hidden' name='d' value='$dir'>";
             echo "<input type='hidden' name='f' value='$fnum'>";
-            echo "<table width=\"30%\" border=\"0\">\n";
+            echo "<table width=\"45%\" border=\"0\">\n";
             echo "<tr><td>filtern nach $text: </td>";
             echo "<td><input id='filter' name='filter' type=\"text\" size=\"30\" maxlength=\"30\" value=\"$filter\"/></td>";
+            echo "<td>Zeilen/Seite?   <select name='z'>\n";
+            foreach ($azeil as $key=>$val)
+            {
+                if ($key == $zeil) $select = "selected"; else $select = "";
+                echo "<option $select value='$key'>$val</option>\n";
+            }
+            echo "</select></td>\n";
             echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr></table>\n";
             echo "</form>\n";
             echo "<p>&nbsp;&nbsp;&nbsp;</p>\n";
         }
-        echo "<table>\n";
+        echo "<table width='99%'>\n";
         
         if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
 
         // Listenkopf generieren
         echo "<tr bgcolor='#68ACBF'>";
         echo "<th>ID</th>";
+        tab_column(15,"Kz",$sort,$dir,15,$fnum,$filter,$start,$zeil);
         tab_column(2,"Titel",$sort,$dir,2,$fnum,$filter,$start,$zeil);
         tab_column(3,"Kurzinfo",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         tab_column(4,"Info-Typ",$sort,$dir,4,$fnum,$filter,$start,$zeil);
         tab_column(5,"Produkt",$sort,$dir,5,$fnum,$filter,$start,$zeil);
         tab_column(6,"Adressat",$sort,$dir,6,$fnum,$filter,$start,$zeil);
-        tab_column(7,"Autor",$sort,$dir,0,$fnum,$filter,$start,$zeil);
-        tab_column(8,"Erst-Datum",$sort,$dir,0,$fnum,$filter,$start,$zeil);
-        tab_column(9,"gilt ab",$sort,$dir,0,$fnum,$filter,$start,$zeil);
-        tab_column(10,"gilt bis",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(7,"Verantw.",$sort,$dir,7,$fnum,$filter,$start,$zeil);
+        tab_column(8,"Autor",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(9,"erst. am",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(10,"gilt ab",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(11,"gilt bis",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         echo "<th>Sprache</th>";
         echo "<th>Dokument</th>";
-        echo "<th>Bezug</th>";
+        echo "<th>zu ID</th>";
+        echo "<th>&nbsp;</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>
@@ -143,11 +157,14 @@
         {
 			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
             echo "<tr bgcolor='" . $bg . "'><td class=\"left\">$row->info_ID</td>";    
+            echo "<td class=\"left\">$row->infsort</td>";
             echo "<td class=\"left\">$row->iname</td>";
+//            if (strlen($row->ilong)>60) $row->ilong = substr($row->ilong,0,60)."...";
             echo "<td class=\"left\">" . nl2br($row->ilong) . "</td>";
             echo "<td class=\"left\">$row->ityp</td>";
             echo "<td class=\"left\">" . str_replace(";","<br />",$row->prod) . "</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\">$row->author</td>";
             if ($row->idate)
             {
@@ -176,7 +193,8 @@
             else    
                 echo "<td class=\"left\">$row->doc</td>";
             echo "<td class=\"left\">$row->infrel</td>";
-            echo "<td><a href='/fhiiqm/info_upd.php?uid=$row->info_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+            echo "<td><a href='/fhiiqm/info_ed.php?i=$row->info_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
+            echo "<td><a href='/fhiiqm/info_ed.php?i=$row->info_ID&d=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td></tr>\n";
         }
         echo "</table></div>\n";
 
@@ -212,7 +230,7 @@
     $dbc -> close();
 
     if (!is_null($_SESSION["recht"]) && in_array("ie",$_SESSION["recht"]))
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"info_ins.php\" target=\"_self\" title=\"Info erfassen\" class=\"sc\">Weitere Info erfassen</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"info_ed.php\" target=\"_self\" title=\"Info erfassen\" class=\"sc\">Weitere Info erfassen</a></p>\n";    
 
 ?>
 </body>
--- a/fhiiqm/laser_flist.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/laser_flist.php	Fri Mar 02 13:54:32 2012 +0100
@@ -139,7 +139,7 @@
         tab_column(2,"ID",$sort,$dir,2,$fnum,$filter,$start,$zeil);
         tab_column(13,"zu ID",$sort,$dir,13,$fnum,$filter,$start,$zeil);
         tab_column(3,"Bezeichnung",$sort,$dir,3,$fnum,$filter,$start,$zeil);
-        echo "<th>Welle</th>";
+        echo "<th>Wellenl&auml;nge(nm)</th>";
         tab_column(4,"Art",$sort,$dir,4,$fnum,$filter,$start,$zeil);
         tab_column(6,"Typ",$sort,$dir,6,$fnum,$filter,$start,$zeil);
         tab_column(5,"Klasse",$sort,$dir,5,$fnum,$filter,$start,$zeil);
--- a/fhiiqm/prod_hier.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/prod_hier.php	Fri Mar 02 13:54:32 2012 +0100
@@ -114,7 +114,7 @@
                         $where = "WHERE prod_group_ID IN ($listg) ";
                     else 
                         $where = "";
-                    $sql = "SELECT prod_group_ID, prod_group_name, prod_group_hier FROM Produkt_Gruppe $where ORDER BY 2";
+                    $sql = "SELECT prod_group_ID, prod_group_name, prod_group_hier FROM Produkt_Gruppe $where ORDER BY 3";
                     if ($result = $dbc->queryObjectArray($sql))
                     {
                         foreach ($result as $row)
@@ -173,7 +173,7 @@
 			$bg = "#FFFFFF";
 			echo "<p><b>Produkthierarchie</b></p>\n";
             echo "<p>Die Produkte (unterste Hierarchieebene) können Sie mittels Klick auf '<img src=\"img/edit.gif\" alt='edit' title='edit' border='0'/>' editiern</p>\n";
-			echo "<table cellpadding='2'>";
+			echo "<table cellpadding='2' width='99%'>";
 			echo "<tr bgcolor='#68ACBF'><th align='left'>Hierar.</th><th>&nbsp;</th>
 				<th align='left'>Produkt-Kategorie</th><th align='left'>AG (Abteilung)</th><th align='left'>Wichtigkeit</th><th align='left'>Bindungsst&auml;rke</th><th align='left'>Bemerkung</th></tr>\n";
 			foreach($result as $row)
--- a/fhiiqm/raum_flist.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/raum_flist.php	Fri Mar 02 13:54:32 2012 +0100
@@ -133,8 +133,12 @@
         tab_column(3,"Bezeichnung",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         tab_column(4,"Haus",$sort,$dir,4,$fnum,$filter,$start,$zeil);
         tab_column(5,"Raum-Typ",$sort,$dir,5,$fnum,$filter,$start,$zeil);
-        tab_column(8,"Reinigungs-Typ",$sort,$dir,8,$fnum,$filter,$start,$zeil);
-        tab_column(6,"Fl&auml;che (m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(8,"Reinig.-Typ",$sort,$dir,8,$fnum,$filter,$start,$zeil);
+        tab_column(9,"Reinig.-Kat.",$sort,$dir,9,$fnum,$filter,$start,$zeil);
+        tab_column(10,"Reinig.-Turn.",$sort,$dir,10,$fnum,$filter,$start,$zeil);
+        tab_column(11,"Boden-Typ",$sort,$dir,11,$fnum,$filter,$start,$zeil);
+        tab_column(12,"Reinig.Fl.(m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(6,"Fl&auml;che(m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         tab_column(7,"Raumplan",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         echo "<th>&nbsp;</th></tr>\n";
         
@@ -150,6 +154,18 @@
             if ($row->reinigung_typ_ID)
                 echo "<td>$row->reinigung_typ_ID: $row->reinigung_typ_bez</td>";
             else echo "<td>&nbsp;</td>";
+            if ($row->reinigung_kat)
+                echo "<td>$row->reinigung_kat</td>";
+            else echo "<td>&nbsp;</td>";
+            if ($row->reinigung_turnus_bez)
+                echo "<td>$row->reinigung_turnus_bez</td>";
+            else echo "<td>&nbsp;</td>";
+            if ($row->boden_typ_bez)
+                echo "<td>$row->boden_typ_bez</td>";
+            else echo "<td>&nbsp;</td>";
+            if ($row->reinigung_flaeche)
+                echo "<td class='right'>" . number_format($row->reinigung_flaeche,2,',','') . "</td>";
+            else echo "<td>&nbsp;</td>";
             echo "<td class='right'>" . str_replace(".",",",$row->raum_flaeche) . "</td>";
             if (file_exists("raeume/".$row->raum_file))
             {
--- a/fhiiqm/raum_flist_ed.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/raum_flist_ed.php	Fri Mar 02 13:54:32 2012 +0100
@@ -94,15 +94,23 @@
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	$dbc = new dbconnection();
 
-    if ($ok && $sub) // Daten Raum - Reinigungstyp speichern
+    if ($ok && $sub) // Daten Raum - Reinigung speichern
     {
             $stmt = $dbc -> stmtinit();
             if (is_object($stmt))
             {
                 if ($raum['reityp']== -1) $raum['reityp'] = null;
-                // reinigung_typ_ID aendern
-                $stmt -> prepare("UPDATE fhiiqm.Raum SET reinigung_typ_ID = ? WHERE raum_ID=?");
-                $stmt -> bind_param('si',$raum['reityp'],$rid);        
+                if ($raum['reikat']== -1) $raum['reikat'] = null;
+                if ($raum['reitur']== -1) $raum['reitur'] = null;
+                if ($raum['boden']== -1) $raum['boden'] = null;
+                // reinigung aendern
+                $stmt -> prepare("UPDATE fhiiqm.Raum SET 
+                                        reinigung_typ_ID = ?,
+                                        reinigung_kat = ?,
+                                        reinigung_turnus_ID = ?,
+                                        boden_typ_ID = ? 
+                                    WHERE raum_ID=?");
+                $stmt -> bind_param('ssdii',$raum['reityp'],$raum["reikat"],$raum["reitur"],$raum["boden"],$rid);        
                 $res = $stmt -> execute();
                 if ($stmt->error) echo "UPDATE Raum, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
                 $stmt -> free_result(); // wegen weiterer query
@@ -143,7 +151,7 @@
             können Sie nach jeder Spalte auf- bzw. absteigend sortieren</td></tr>
             <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' erm&ouml;glicht das Filtern nach ausgew&auml;hlten Spalten der Liste</td></tr>
             <tr><td>&nbsp;</td></tr>
-            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten des Reinigungs-Typs</td></tr>\n";
+            <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Reinigungs-Daten</td></tr>\n";
         echo "</table>\n";
 
         $ranz = $dbc -> querySingleItem("SELECT @anz");
@@ -175,7 +183,11 @@
         tab_column(4,"Haus",$sort,$dir,4,$fnum,$filter,$start,$zeil);
         tab_column(5,"Raum-Typ",$sort,$dir,5,$fnum,$filter,$start,$zeil);
         tab_column(8,"Reinigungs-Typ",$sort,$dir,8,$fnum,$filter,$start,$zeil);
-        tab_column(6,"Fl&auml;che (m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(9,"Reinig.-Kat.",$sort,$dir,9,$fnum,$filter,$start,$zeil);
+        tab_column(10,"Reinig.-Turn.",$sort,$dir,10,$fnum,$filter,$start,$zeil);
+        tab_column(11,"Boden-Typ",$sort,$dir,11,$fnum,$filter,$start,$zeil);
+        tab_column(12,"Reinig.Fl.(m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+        tab_column(6,"Fl&auml;che(m<sup>2</sup>)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         tab_column(7,"Raumplan",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         echo "<th>&nbsp;</th></tr>\n";
         
@@ -190,12 +202,15 @@
             echo "<td>$row->geb_ID</td>";
             echo "<td>$row->raumtyp_bez</td>";
             if ($rid == $row->raum_ID)
-            {   //Aenderungsform, nur Reinigungstyp-Eintrag
+            {   //Aenderungsform
                 $okn = true;
                 if (!$raum['reityp']) $raum['reityp'] = $row->reinigung_typ_ID; 
+                if (!$raum['reikat']) $raum['reikat'] = $row->reinigung_kat; 
+                if (!$raum['reitur']) $raum['reitur'] = $row->reinigung_turnus_ID; 
+                if (!$raum['boden']) $raum['boden'] = $row->boden_typ_ID; 
                 echo "<form action='". $_SERVER['PHP_SELF'] ."' method='post' enctype='application/x-www-form-urlencoded' name='frr'>\n"; 
                 echo "<td class='red'><select name='raum[reityp]'>";
-                if ($raum['reityp'] == -1) $select = " selected "; else $select = "";
+                if (is_null($raum['reityp'])) $select = " selected "; else $select = "";
                 echo "<option $select value=\"-1\"></option>\n";
                 $sql = "SELECT reinigung_typ_ID, reinigung_typ_bez FROM fhiiqm.Reinigung_Typ ORDER BY 1";
                 if ($result = $dbc->queryObjectArray($sql))
@@ -211,12 +226,12 @@
                 echo "</select><br />";
                 echo "<input type=\"hidden\" name=\"raum[okn]\" value=\"$okn\"/>\n";
                 echo "<input type=\"hidden\" name=\"i\" value=\"$rid\"/>\n"; // nur gewaehlte Raum-ID
-                echo "<input type='hidden' name='s' value='$sort'>";
-                echo "<input type='hidden' name='d' value='$dir'>";
-                echo "<input type='hidden' name='f' value='$fnum'>";
-                echo "<input type='hidden' name='filter' value='$filter'>";
-                echo "<input type='hidden' name='st' value='$start'>";
-                echo "<input type='hidden' name='subf' value='finden'>";
+                echo "<input type='hidden' name='s' value='$sort'>\n";
+                echo "<input type='hidden' name='d' value='$dir'>\n";
+                echo "<input type='hidden' name='f' value='$fnum'>\n";
+                echo "<input type='hidden' name='filter' value='$filter'>\n";
+                echo "<input type='hidden' name='st' value='$start'>\n";
+                echo "<input type='hidden' name='subf' value='finden'>\n";
               	if ($sub)
                 {
                     $frage = "Alle Angaben ok?";
@@ -225,7 +240,6 @@
                     echo "/>&nbsp;&nbsp;&nbsp;"; 
                 }
                 echo "<input  class=\"button\" type=\"submit\" name=\"eintragen\" value=\"eintragen\" /></td>";    
-                echo "</form>\n";
             }
             else
             {
@@ -233,6 +247,85 @@
                     echo "<td>$row->reinigung_typ_ID: $row->reinigung_typ_bez</td>";
                 else echo "<td>&nbsp;</td>";
             }
+            if ($rid == $row->raum_ID)
+            {   //Aenderungsform
+                echo "<td><select name='raum[reikat]'>";
+                if (is_null($raum['reikat'])) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SHOW COLUMNS FROM Raum WHERE Field = 'reinigung_kat'";
+                if ($result = $dbc->queryRow($sql))
+                { 
+                    foreach ($result as $ro)
+                        $arr=explode("','",preg_replace("/(enum|set)\('(.+?)'\)/","\\2",$ro[1]));
+                    foreach ($arr as $kat)
+                    {
+                        if ($kat == $raum["reikat"])
+                            echo "<option selected value=\"$kat\">$kat</option>\n";
+                        else
+                            echo "<option value=\"$kat\">$kat</option>\n";
+                    }
+                }
+                echo "</select></td>";
+            }
+            else
+            {            
+                if ($row->reinigung_kat)
+                    echo "<td>$row->reinigung_kat</td>";
+                else echo "<td>&nbsp;</td>";
+            }
+            if ($rid == $row->raum_ID)
+            {             
+                echo "<td><select name='raum[reitur]'>";
+                if (is_null($raum['reitur'] == -1)) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT reinigung_turnus_ID, reinigung_turnus_bez FROM fhiiqm.Reinigung_Turnus ORDER BY 1";
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $ro)
+                    {
+                        if ($ro->reinigung_turnus_ID == $raum['reitur'])
+    					   echo "<option selected value=\"$ro->reinigung_turnus_ID\">$ro->reinigung_turnus_bez</option>\n";
+    				    else
+    					   echo "<option value=\"$ro->reinigung_turnus_ID\">$ro->reinigung_turnus_bez</option>\n";
+                    }
+                }
+                echo "</select></td>";
+            }
+            else
+            {
+                if ($row->reinigung_turnus_bez)
+                    echo "<td>$row->reinigung_turnus_bez</td>";
+                else echo "<td>&nbsp;</td>";
+            }
+            if ($rid == $row->raum_ID)
+            {             
+                echo "<td><select name='raum[boden]'>";
+                if (is_null($raum['boden'])) $select = " selected "; else $select = "";
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT boden_typ_ID, boden_typ_bez FROM fhiiqm.Boden_Typ ORDER BY 2";
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $ro)
+                    {
+                        if ($ro->boden_typ_ID == $raum['boden'])
+    					   echo "<option selected value=\"$ro->boden_typ_ID\">$ro->boden_typ_bez</option>\n";
+    				    else
+    					   echo "<option value=\"$ro->boden_typ_ID\">$ro->boden_typ_bez</option>\n";
+                    }
+                }
+                echo "</select></td>";
+            
+                echo "</form>\n";
+            }
+            else
+            {
+                if ($row->boden_typ_bez)
+                    echo "<td>$row->boden_typ_bez</td>";
+                else echo "<td>&nbsp;</td>";
+            }
+            if ($row->reinigung_flaeche)
+                echo "<td class='right'>" . number_format($row->reinigung_flaeche,2,',','') . "</td>";
+            else echo "<td>&nbsp;</td>";
             echo "<td class='right'>" . str_replace(".",",",$row->raum_flaeche) . "</td>";
             if (file_exists("raeume/".$row->raum_file))
             {
@@ -280,6 +373,8 @@
         
     }
     $dbc -> close();
+    
+//    echo "<br />rid = $rid, row[raum_ID] = $row->raum_ID<br />";
 
     if (!is_null($_SESSION["recht"]) && in_array("re",$_SESSION["recht"]))
         echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"raum_ins.php\" target=\"_self\" title=\"Raum erfassen\" class=\"sc\">Weiteren Raum erfassen</a></p>\n";    
--- a/fhiiqm/raum_ins.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/raum_ins.php	Fri Mar 02 13:54:32 2012 +0100
@@ -98,6 +98,9 @@
         $raum['rnum'] = substr($raum['rnum'],0,10);
         if ($raum['rtyp']== -1) $rtyp = "NULL"; else $rtyp = "'" . $raum['rtyp'] . "'"; 
         if ($raum['reityp']== -1) $raum['reityp'] = null;
+        if ($raum['reikat']== -1) $raum['reikat'] = null;
+        if ($raum['reitur']== -1) $raum['reitur'] = null;
+        if ($raum['boden']== -1) $raum['boden'] = null;
         // Filename Vertrag
         $raum['rfname'] = substr($raum['rfname'],0,50);
         if (isset($raum['rflae']) && $raum['rflae']>"0")
@@ -125,8 +128,10 @@
         if (is_object($stmt))
         {
             if ($raum['rtyp']== -1) $raum['rtyp']=null;
-            $stmt -> prepare ("INSERT INTO Raum (raum_nr,raum_name,geb_ID,raumtyp_ID,reinigung_typ_ID,raum_flaeche) VALUES (?,?,?,?,?,?)");
-            $stmt -> bind_param('sssssd', $raum['rnum'], $raum['rbez'], $raum['geb'], $raum['rtyp'], $raum["reityp"], $raum['rflae']);
+            $stmt -> prepare ("INSERT INTO Raum (raum_nr,raum_name,geb_ID,raumtyp_ID,reinigung_typ_ID,raum_flaeche,reinigung_kat,reinigung_turnus_ID,boden_typ_ID) 
+                                VALUES (?,?,?,?,?,?,?,?,?)");
+            $stmt -> bind_param('sssssdsdi', $raum['rnum'], $raum['rbez'], $raum['geb'], $raum['rtyp'], $raum["reityp"], $raum['rflae'], 
+                                $raum["reikat"], $raum["reitur"], $raum["boden"]);
             $result = $stmt -> execute();      
         }
         if ($stmt->error) echo "error: " . $stmt->error . "<br><br>\n";
--- a/fhiiqm/raum_upd.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/raum_upd.php	Fri Mar 02 13:54:32 2012 +0100
@@ -63,7 +63,8 @@
     {
         if (!$upd && !$del)
         {
-            $sql = "SELECT raum_ID,raum_nr,raum_name,geb_ID,raumtyp_ID,reinigung_typ_ID,raum_flaeche,raum_file 
+            $sql = "SELECT raum_ID,raum_nr,raum_name,geb_ID,raumtyp_ID,reinigung_typ_ID,raum_flaeche,raum_file,
+                    reinigung_kat,reinigung_turnus_ID,boden_typ_ID 
                     FROM fhiiqm.Raum WHERE raum_ID = $rid";
             if ($result = $dbc ->queryObjectArray($sql))
             {
@@ -76,6 +77,9 @@
                     $raum['reityp']       = $row->reinigung_typ_ID;
                     $raum['rflae']      = str_replace(".",",",$row->raum_flaeche);
                     $raum['rfname']     = $row->raum_file;
+                    $raum['reikat']     = $row->reinigung_kat;
+                    $raum['reitur']     = $row->reinigung_turnus_ID;
+                    $raum['boden']     = $row->boden_typ_ID;
                 }  
             }
         }
@@ -132,6 +136,9 @@
         $raum['rnum'] = substr($raum['rnum'],0,10);
         if ($raum['rtyp']== -1) $raum['rtyp'] = null;
         if ($raum['reityp']== -1) $raum['reityp'] = null;
+        if ($raum['reikat']== -1) $raum['reikat'] = null;
+        if ($raum['reitur']== -1) $raum['reitur'] = null;
+        if ($raum['boden']== -1) $raum['boden'] = null;
         // Filename Vertrag
         $raum['rfname'] = substr($raum['rfname'],0,50);
         if (isset($raum['rflae']) && $raum['rflae']>"0")
@@ -177,11 +184,16 @@
                                 raum_name = ?, 
                                 geb_ID = ?, 
                                 raumtyp_ID = ?, 
-                                reinigung_typ_ID = ?, 
+                                reinigung_typ_ID = ?,
                                 raum_flaeche = ?, 
-                                raum_file = ? WHERE raum_ID = $rid");
+                                raum_file = ?, 
+                                reinigung_kat = ?,
+                                reinigung_turnus_ID = ?,
+                                boden_typ_ID = ? 
+                                WHERE raum_ID = $rid");
                                 
-            $stmt -> bind_param('sssssds',$raum["rnum"],$aum["rbez"],$raum["geb"],$raum["rtyp"],$raum["reityp"],$raum["rflae"],$rfile);        
+            $stmt -> bind_param('sssssdssdi',$raum["rnum"],$raum["rbez"],$raum["geb"],$raum["rtyp"],$raum["reityp"],$raum["rflae"],$rfile,
+                                $raum["reikat"],$raum["reitur"],$raum["boden"]);        
             $retr = $stmt -> execute();
          }       
 //        echo "UPDATE-sql = $sql<br />\n";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/report/info_report.php	Fri Mar 02 13:54:32 2012 +0100
@@ -0,0 +1,239 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 02/2012
+ * 
+ * Report Info
+ * 
+ */
+
+    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("ir",$_SESSION["recht"]) && !in_array("ie",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="/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"/> 
+
+	<title>Gesch&auml;ftsverteilungsplan</title>
+</head>
+
+<body >
+
+<?php
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+    include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+
+	$dbc = new dbconnection();
+
+    $create = $_POST["create"];
+    $inf    = $_POST["inf"];
+    $sort = array("-1"=>"","15"=>"Kennzeichen","2"=>"Teilgebiet");
+
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller sc\" 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 sc\"><img src=\"/fhiiqm/img/document_image_ver.png\" border=\"0\" alt=\"Infodaten\" title=\"Infodaten\"/></div>\n";
+
+    if (!isset($create) || !$create)
+    {   // Form Kriterien
+        echo "<div align='center'><h3>Gesch&auml;ftsverteilungsplan</h3></div>\n";
+
+        echo "<div align=\"center\">";
+        echo "<p>Bitte die Kriterien für den Bericht wählen</p>\n";
+        
+        echo "<form action=\"". $_SERVER['PHP_SELF'] ."\" method=\"post\" enctype=\"application/x-www-form-urlencoded\" name=\"form_inf\">\n";
+        echo "<table width=\"50%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">";
+//        echo "<tr><td>Infotyp wie</td><td><input name='inf[ityp]' type='text' size='10' maxlength='50' value='". $inf['ityp'] ."' /></td>";
+        
+        echo "<td>Produktbereich</td>";
+        echo "<td><select name='inf[prodb]'>";
+                if (is_array($inf['prodb'])) $select = in_array( "-1", $inf['prodb'] ) ? ' selected' : null;
+                echo "<option $select value=\"-1\"></option>\n";
+                $sql = "SELECT prod_ber_ID,prod_ber_name FROM Produkt_Bereich";  
+                if ($result = $dbc->queryObjectArray($sql))
+                {
+                    foreach ($result as $row)
+                    {
+                        $prod=str_replace(" ","&nbsp;",htmlentities($row->prod_ber_name));
+                        if (is_array($inf['prodb'])) $select = in_array($row->prod_ber_ID, $inf['prodb']) ? ' selected' : null;
+                        echo "<option  $select value=\"|$row->prod_ber_ID|\">$prod ($row->prod_ber_ID)</option>\n";
+                    }
+                }
+        echo "</select></td></tr>";
+        echo "<tr><td>Produktgruppe</td>";
+        echo "<td><select name='inf[prodg]'>";
+            if ($inf["prodg"] == -1) $select = " selected "; else $select = "";
+            echo "<option $select value=\"-1\"></option>\n";
+            $sql = "SELECT prod_group_ID, prod_group_name, prod_group_hier FROM Produkt_Gruppe ORDER BY 1";
+            if ($result = $dbc->queryObjectArray($sql))
+            {
+                $select = "";
+                foreach ($result as $row)
+                {
+                    if (isset($inf["prodg"])) $select = ($row->prod_group_ID == $inf["prodg"] ) ? ' selected' : null;
+        			   echo "<option $select value=\"|$row->prod_group_ID|\">$row->prod_group_name ($row->prod_group_hier)</option>\n";
+                }
+            }
+        echo "</select></td>";
+        echo 
+        "</tr>\n";
+/*        echo "<tr><td>Sortierung nach</td>";
+        echo "<td><select name='inf[sort]'>";
+        foreach ($sort as $key=>$val)
+        { 
+            if ($inf["sort"] == $key) $select= " selected"; else $select = "";
+            echo "<option$select value='$key'>$val</option>\n";
+        }
+        echo "</select></td></tr>";
+*/    
+        echo "    <tr> 
+                <td>&nbsp;</td>
+                <td colspan='3'><input class=\"button\" type=\"submit\" name=\"create\" value=\"Bericht erstellen\"></td>
+            </tr>
+            </table>\n
+            </form>\n
+            </div>\n";
+        
+//        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
+    }    
+    else
+    {
+        // Auswertung Kriterien
+//        if ($inf["ityp"]) $ityp = "'" . $inf["ityp"] . "'"; else $ityp = "''";
+        if ($inf["prodb"] && $inf["prodb"] != '-1')
+        {  
+            $prodb = $inf["prodb"];
+            $sql = "SELECT prod_ber_name FROM Produkt_Bereich WHERE prod_ber_ID = REPLACE('" .$inf["prodb"] ."','|','')";
+            $prodbb = $dbc -> querySingleItem($sql);
+        }    
+        else $prodb = "''";
+        if ($inf["prodg"] && $inf["prodg"] != '-1')
+        {  
+            $prodg = $inf["prodg"];
+        }    
+        else $prodg = "''";
+        if ($prodb > "''" && $prodg > "''") $prod = "'" . $prodg . substr($prodb,1) . "'";
+        elseif ($prodb > "''" && $prodg == "''") $prod = "'" . $prodb . "'";
+        elseif ($prodb == "''" && $prodg > "''") $prod = "'" . $prodg . "'";
+        else $prod = "''";
+
+        if ($inf["sort"] && $inf["sort"] != '-1') $sor = $inf["sort"]; else $sor=15;
+
+        $sql = "CALL info_report($sor,'',4,6,5,$prod,0,100,@anz)";
+
+        $result = $dbc ->queryObjectArray($sql);
+        if ($dbc -> error) echo "$sql<br />".$dbc -> error."<br />";
+
+        echo "<br />&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" 
+                title=\"Report Info\" class=\"sc\">neuer Bericht GVP</a></p>\n";
+
+        echo "<div class='sc' align='center'><h3>Gesch&auml;ftsverteilungsplan</h3></div>\n"; // Anzeige nur Screen
+        
+        echo "<div align='center'>\n";
+        
+//        echo "<p>Kriterien: Infotyp wie $ityp, Produktbereich = '" .$prodbb. "', Produktgruppe = '" .$prodgb. "'; Sortierung nach ".$sort[$sor] . " </p>";
+        
+        if ($result)
+        {
+            $ianz = $dbc -> querySingleItem("SELECT @anz");
+            echo "<p class='sc'>Anzahl Aufgaben:&nbsp;&nbsp;&nbsp;$ianz</p>";
+         
+            if ($prodgb) echo "<p><b>Sachgebiet $prodgb<b></p>";
+            $i=0;
+            foreach ($result as $row)
+            {
+                    if ($i==0)
+                    { 
+                         $vprodid = $row->prodid;
+                    }
+                    $aprod = explode('; ',$row->prod);
+                    $prod=null; 
+                    $pg=null; 
+                    $pb=null;  
+                    foreach ($aprod as $eprod)
+                    { 
+                        list($pro,$prg,$prb) = explode ('|',$eprod); // prodgroup, prodbereich stehen innerhalb von |-Zeichen in prod
+                        $prod .= $pro . "; ";
+                        $pg .=  $prg . ";";
+                        $pb .= $prb . ";";
+                    }
+                    $prod = substr($prod,0,strlen($prod)-2);
+//echo "prod = $prod, pg = $pg, pb = $pb <br />";    
+                    if ($pg != $vpg)
+                    {
+                        if ($i!=0) echo "</table>\n<p style=\"page-break-after:always\">&nbsp;</p>";
+                        echo "<div class='pr' align='center'><h3>Gesch&auml;ftsverteilungsplan</h3></div>\n"; // Anzeige nur im Ausdruck
+                        // Produktgruppe fuer Teiliste
+                        $sql = "SELECT prod_group_name,IFNULL(prod_group_bem,'&nbsp;') AS bem FROM Produkt_Gruppe WHERE prod_group_ID = $pg";
+                        $res = $dbc -> queryObjectArray($sql);
+                        if ($res)
+                        foreach ($res as $ro)
+                            echo "<p><b>Sachgebiet ".$ro->prod_group_name."</b></p><p>".$ro->bem."</p>";
+
+                        echo "<table border='1' cellspacing='0' cellpadding='2' width=99%>\n";
+                        // Listenkopf
+                        echo "<tr bgcolor='#68ACBF'>";
+                        echo "<th width='5%'>Kennzeichen</th>";
+//                        echo "<th>Infotyp</th>";
+                        echo "<th width='35%'>Aufgabe</th>";
+                        echo "<th width='40%'>Teilgebiet</th>";
+//                        echo "<th width='40%'>Kurzinfo</th>";
+                        echo "<th width='20%'>Zust&auml;ndigkeit</th>";
+                		$bg1 = "#F8F8F8";
+                		$bg2 = "#DEDFE1";
+                		$bg = "#FFFFFF";
+                    }
+                    if ($row->prodid != $vprodid && $pg == $vpg) echo "<tr><td colspan='5'>&nbsp;</td></tr>\n";  // Leerzeile  
+        			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+                    echo "<tr bgcolor='" . $bg . "'>";
+                    echo "<td>$row->infsort</td>";
+//                    echo "<td>$row->ityp</td>";
+                    echo "<td>".$prod."</td>";
+                    echo "<td>$row->iname</td>";
+//                        echo "<td>".nl2br($row->ilong)."</td>";
+                    echo "<td>".str_replace(";","<br />",$row->verantw)."</td></tr>\n";
+
+                    $vprodid = $row->prodid;
+                    $vpg = $pg;
+                    $i++;
+            }
+            
+
+            echo "</table>\n";
+
+            echo "<p></p><table width=99%><tr><td class='right'><a href=\"javascript:window.print()\" class='sc'>
+                <img src=\"/fhiiqm/img/printer.png\" alt=\"Bericht drucken\" border=\"0\" align=\"right\" title=\"Bericht drucken\"></a></td></tr></table>";
+            
+        }
+        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 "<br />&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" 
+                title=\"Report Info\" class=\"sc\">neuer Bericht GVP</a></p>\n";
+
+    }
+
+?>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/report/vertrag_kuend_email.php	Fri Mar 02 13:54:32 2012 +0100
@@ -0,0 +1,87 @@
+#!/usr/bin/php
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 02/2012
+ * 
+ * sendet email an Bearbeiter 'kuendigugsfrist'Monate + 1 Monat vor Vertragsende
+ * auch als cron-Job einsetzbar
+ * 
+ */
+
+	include_once("/var/www/fhiiqm/inc/dbconnect.inc.php");
+	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+    $heute = new DateTime();
+    
+    $infoh = "  
+        <html>
+        <head>
+          <title>Vertragsinfo (IQM-DB)</title>
+        </head>
+        <body>
+          <p>Liebe(r) Frau/Herr ";
+    $infoh2 = ",</p>
+          <p>der folgende Vertrag l&auml;uft demn&auml;chst aus:</p>
+          <table border='1' cellspacing='0' cellpadding='5'>\n
+          <tr><td>Vertragsbezeichnung</td><td>VTyp</td><td>VBeginn</td><td>VEnde</td>
+                    <td>Verl&auml;ngerung</td><td>K&uuml;nd.-frist(mon)</td><td>Bemerkung</td></tr>\n";
+
+    
+    $sql = "CALL vertrag_ablauf()";
+    
+    $result = $dbc -> queryObjectArray($sql);
+    if ($result)
+    {
+        $sql = "SELECT nachname,email 
+                FROM fhiiqm.Vertrag v LEFT OUTER JOIN Vertrag_Bearbeiter b
+                ON v.contract_ID=b.contract_ID LEFT OUTER JOIN Mitarbeiter m
+                ON b.persknr=m.persknr WHERE v.contract_ID=";
+        foreach ($result as $row)
+        {
+//            if (!is_null($row -> ckdate) && $row->ckdate <= $heute->format("Y-m-d") && $row->email) // nur fuer Test
+            if (!is_null($row -> ckdate) && $heute->format("Y-m-d") == $row->ckdate && $row->email) // 28.02.2012
+            {
+                $av = $row->cauto? "automatisch" : "&nbsp;";
+                if ($begin = new DateTime($row->cbegin)) $begin=$begin->format("d.m.Y"); else $begin="&nbsp;";
+                if ($end = new DateTime($row->cend)) $end=$end->format("d.m.Y"); else $end="&nbsp;";
+                if ($ckd = new DateTime($row->ckdate)) $ckd=$ckd->format("d.m.Y"); else $ckd="&nbsp;";
+                $info = "<tr><td><b>$row->cname</b></td><td>$row->vtypk</td><td>$begin</td><td><b>$end</b></td>
+                    <td>&nbsp;$av</td><td>&nbsp;&nbsp;&nbsp;$row->cmon</td><td>$row->bem</td></tr>\n";
+
+                // Adressat(en)) ermitteln
+                $strsql = $sql .$row->cid;
+                $addr = "";
+                if ($res = $dbc -> queryObjectArray($strsql))
+                {
+                    foreach ($res as $ro)
+                        $addr .= $ro->email.",";
+                    $addr = substr($addr,0,strlen($addr)-1);
+                }
+
+            	// email senden
+//                $eaddr = "wieczorek@fhi-berlin.mpg.de";
+//                $eaddr = "kaendler@fhi-berlin.mpg.de";
+//                $eaddr = "schwarzer@fhi-berlin.mpg.de";
+                $eaddr = $addr;
+        		$eheader = 'MIME-Version: 1.0' . "\r\n" .
+                            'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 
+                            'From: achilleus@fhi-berlin.mpg.de' . "\r\n" .
+                            'Bcc: schwarzer@fhi-berlin.mpg.de' . "\r\n" .
+        					'Reply-To: ' . "\r\n" .
+        				    'X-Mailer: PHP';
+        				    
+        		$esubj = "Vertragsinformation (IQM-DB)";
+//        		$emess = $infoh.$ro->nachname.$infoh2.$addr."\n".$info ."\n";
+        		$emess = $infoh.$ro->nachname.$infoh2."\n".$info ."\n";
+        		$emess .= "</table>\n";
+                $emess .= "<p>Bitte pr&uuml;fen Sie, ob er verl&auml;ngert oder gek&uuml;ndigt werden soll.</p><br />\n";  
+                $emess .= "<p>Dies ist eine automatisch generierte E-Mail, bitte nicht darauf antworten.</p>\n";  
+        		$emess .= "<p>Beste Grü&szlig;e, Ihre IQM-Datenbank</p>\n</body></html>";
+                mail($eaddr,$esubj,$emess,$eheader);
+            }
+        }
+    }
+
+?>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/hierarchie.php	Fri Mar 02 13:54:32 2012 +0100
@@ -0,0 +1,107 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 02/2012
+ * 
+ * hierarchie
+ */
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="/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"/> 
+
+	<title>Hierarchie</title>
+</head>
+
+<body>
+<?php
+	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+	$dbc = new dbconnection();
+    
+    $id     = $_GET["i"];
+    if (!$id) $id=0;
+    $stat   = $_GET["s"];  
+    if (!isset($stat)) $stat=1;
+    
+    echo "<div align='center'>\n";
+    
+    echo "<h3>Test: Hierarchie</h3>\n"; 
+    
+    // lineage der gesuchten ID
+    if ($id > 0)
+    {
+        $sql = "SELECT h_lineage FROM hierarchie WHERE h_ID=$id";
+        $lin = $dbc->querySingleItem($sql);
+    }
+    echo "<table cellspacing='10'><tr><td>";
+    // Hierarchie   
+    echo "<p> hierarchische Sicht</p>\n";
+    $sql = "CALL hier4id($id,$stat)";
+
+    if ($result = $dbc -> queryObjectArray($sql))
+    {
+		$bg1 = "#F8F8F8";
+		$bg2 = "#DEDFE1";
+		$bg = "#FFFFFF";
+        echo "<table><tr bgcolor='#68ACBF'><th>ID</th><th>Bezeichnung</th></tr>\n";
+        foreach ($result as $row)
+        {
+			if (strpos($lin,$row->h_lineage) !== false) //liegt ueber betrachteter ID
+            { 
+//echo "oberhalb: ". $row->h_lineage . " in $lin<br />";
+                $status = 0;
+                $sign = "<img src='/fhiiqm/img/minus.gif' />";
+                $title = "reduzieren";
+                if ($row->h_lineage == $lin && $stat == 0)
+                {
+                    $status = 1;
+                    $sign = "<img src='/fhiiqm/img/plus.gif' />";
+                    $title = "erweitern";
+                }
+            }     
+            else 
+            { 
+//echo "andere: $lin (aktuell) ". $row->h_lineage . "<br />";
+                $status = 1;
+                $sign = "<img src='/fhiiqm/img/plus.gif' />";
+                $title = "erweitern";
+            }     
+            //$sign = ($id == $row->h_ID)? '-':'+'; 
+            if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+            echo "<tr bgcolor='" . $bg . "'>";
+            echo "<td><a href='".$_SERVER["PHP_SELF"]."?i=".trim($row->h_ID)."&s=$status' title='$title'>". str_repeat("&nbsp;",($row->h_deep*2));
+            echo  " $sign </a>";
+            echo "$row->h_ID</td><td>$row->h_bez</td></tr>\n";
+        }    
+        echo "</table>\n";
+    }
+    echo "</td><td>";     
+    // gesamte Tabelle
+    echo "<p> gesamte Tabelle</p>\n";
+    $sql = "SELECT CONCAT(REPEAT('&nbsp;',h_deep*2),h_ID) AS ID,h_bez,h_par_ID,h_deep,h_lineage FROM fhiiqm.hierarchie ORDER BY h_lineage";
+    if ($result = $dbc -> queryObjectArray($sql))
+    {
+		$bg1 = "#F8F8F8";
+		$bg2 = "#DEDFE1";
+		$bg = "#FFFFFF";
+        echo "<table><tr bgcolor='#68ACBF'><th>ID</th><th>Bezeichnung</th></tr>\n";
+        foreach ($result as $row)
+        { 
+            if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+            echo "<tr bgcolor='" . $bg . "'>";
+            echo "<td>$row->ID</td><td>$row->h_bez</td></tr>\n";
+        }
+         echo "</table>\n";
+    }
+    echo "</td></tr></table>";
+    echo "</div>\n";
+?>
+
+</body></html>
\ No newline at end of file
--- a/fhiiqm/test/raum_list.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/test/raum_list.php	Fri Mar 02 13:54:32 2012 +0100
@@ -3,7 +3,7 @@
 
 <head>
 	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
-   	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+   	<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
 
 	<title>Raumliste</title>
 </head>
@@ -20,8 +20,10 @@
  */
 
     error_reporting(E_ALL ^ E_NOTICE);
-    
+
+print_r($_SERVER); echo "<br /><br />";    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+//	include_once("http://achilleus/fhiiqm/inc/dbconnect.inc.php"); //nur wenn 'allow_url_include=1' in php.ini, nicht notwendig
 	$dbc = new dbconnection();
 
     if (!$start) $start=0;
--- a/fhiiqm/vertrag_flist2.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/vertrag_flist2.php	Fri Mar 02 13:54:32 2012 +0100
@@ -111,6 +111,7 @@
 //        tab_column(12,"Partner",$sort,$dir,0,$fnum,$filter,$start,$zeil);
         echo "<th>Kosten/Jahr(&euro;)</th>";
         echo "<th>Bemerkung</th>";
+        echo "<th>E-Mail</th>";
 
         echo "<th>&nbsp;</th></tr>\n";
         $cid=0;
@@ -119,7 +120,8 @@
             if ($row->contract_ID != $cid && $cid != 0)
             {   // nicht beim 1. Datensatz
                 echo "</td>";
-                echo "<td width='30%'>$bem</td>";    
+                echo "<td width='27%'>$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";
             }
             if ($row->contract_ID != $cid)
@@ -146,7 +148,8 @@
                 echo "<td class='center'>$row->kmon</td>";    
 //                echo "<td>$row->partfirma</td>";
                 echo "<td>"; 
-                $bem = nl2br($row->bem);   
+                $bem = nl2br($row->bem);
+                if ($row->email) $mail= "ja"; else $mail= "&nbsp;";   
             }
             // Anzeigen Kosten pro Jahr -> 1 Zeile des Resultsets (Kosten fast rechtsbuendig!))
             if ($row->kosten)
@@ -157,6 +160,7 @@
        }
         echo "</td>";
         echo "<td>$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 "</table></div>\n";
         echo "<br />&nbsp;&nbsp;&nbsp;";
--- a/fhiiqm/vertrag_ins.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/vertrag_ins.php	Fri Mar 02 13:54:32 2012 +0100
@@ -154,9 +154,9 @@
         if (is_object($stmt))
         {
             $stmt -> prepare("INSERT INTO Vertrag (contract_name, contract_l,vtyp_ID,contract_begin, contract_end, contract_autoend, 
-                    contract_mon_notice, bemerkung) 
-                    VALUES(?,?,?,?,?,?,?,?)");
-            $stmt -> bind_param('ssissiis',$vtr["cname"],$vtr["clong"],$vtr['vtyp'],$vbegin,$vend,$vtr['cautoend'],$vtr['cnot'],$vtr['cbem']);
+                    contract_mon_notice, bemerkung,email_send) 
+                    VALUES(?,?,?,?,?,?,?,?,?)");
+            $stmt -> bind_param('ssissiisi',$vtr["cname"],$vtr["clong"],$vtr['vtyp'],$vbegin,$vend,$vtr['cautoend'],$vtr['cnot'],$vtr['cbem'],$vtr["email"]);
             $result = $stmt -> execute();
         }       
         if ($stmt->error) echo "INSERT Vertrag, error: " . $stmt->errno . " - ". $stmt->error . "<br><br>\n";
--- a/fhiiqm/vertrag_upd.php	Mon Feb 06 13:44:00 2012 +0100
+++ b/fhiiqm/vertrag_upd.php	Fri Mar 02 13:54:32 2012 +0100
@@ -64,7 +64,7 @@
         if (!$upd && !$del)
         {
             $sql = "SELECT contract_ID,contract_name,contract_s,contract_l,vtyp_ID,contract_begin,contract_end,
-                    contract_autoend,contract_mon_notice,contract_file,Bemerkung 
+                    contract_autoend,contract_mon_notice,contract_file,Bemerkung,email_send 
                     FROM fhiiqm.Vertrag WHERE contract_ID = $cid";
             if ($result = $dbc ->queryObjectArray($sql))
             {
@@ -84,6 +84,7 @@
                     $vtr['cnot']    = $row->contract_mon_notice;
                     $vtr['cfname']  = $row->contract_file;
                     $vtr['cbem']    = $row->Bemerkung;
+                    $vtr['email']   = $row->email_send;
                 }  
             }
             // Bearbeiter
@@ -255,9 +256,10 @@
                     contract_autoend = ?, 
                     contract_mon_notice = ?,
                     contract_file = ?,  
-                    Bemerkung = ? 
+                    Bemerkung = ?,
+                    email_send = ? 
                     WHERE contract_ID = $cid") ;
-            $stmt -> bind_param('ssissiiss',$vtr["cname"],$vtr["clong"],$vtr['vtyp'],$vbegin,$vend,$vtr['cautoend'],$vtr['cnot'],$cfile,$vtr['cbem']);
+            $stmt -> bind_param('ssissiissi',$vtr["cname"],$vtr["clong"],$vtr['vtyp'],$vbegin,$vend,$vtr['cautoend'],$vtr['cnot'],$cfile,$vtr['cbem'],$vtr["email"]);
             $retv = $stmt -> execute();
         }       
 //        echo "UPDATE-sql = \n";print_r($stmt); echo "<br />";