+ csv-Dateien Laser, Vertrag, Raum
+ Erfassen GVP mehrere Verantwortliche autocomplete
+ Arbeitsplatz Gefahr Liste + edit
+ Arbeitsplatz Vorsorge Liste + edit
+ Report Arbeitssicherheit
Binary file Thumbs.db has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/ap_vorsorge_ed.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,192 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2012
+ *
+ * INSERT/UPDATE Arbeitsplatztyp - Vorsorge
+ *
+ */
+
+ 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("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sub = $_POST["eintragen"];
+ $ap = $_POST["ap"];
+ $ok = $_POST["ok"];
+ $apid = $_GET["i"]; // arbeitsplatz_ID
+
+
+
+?>
+<!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>Arbeitsplatztyp - Vorsorge</title>
+
+ <script type="text/javascript">
+ <!--
+ var counter = 0;
+ var limit = 99;
+ var arr = new Array();
+ function addInput(divName){
+ if (counter == limit) {
+ alert("Das Limit von " + counter + " zusätzlichen inputs ist erreicht");
+ }
+ else {
+ var newdiv = document.createElement('div');
+ var count;
+ var opt="<option value='-1'></option>";
+ for (var key in arr)
+ {
+ opt = opt.concat("<option value='",key,"'>",key, " - ",arr[key],"</option>\n" );
+ }
+ opt += "</select>\n";
+ newdiv.innerHTML += "<select name='ap[vs][]'>"+opt;
+ document.getElementById(divName).appendChild(newdiv);
+ counter++;
+ }
+ }
+ function delInput(divId){
+ var kn = document.getElementById(divId);
+ while (kn.childNodes.length>0 && kn.lastChild.nodeName != "SELECT" && kn.lastChild.nodeName != "A")
+ {
+// alert ("vor "+kn.lastChild.nodeName+", nodetyp = "+ kn.lastChild.nodeType);
+ var knc = kn.lastChild;
+ document.getElementById(divId).removeChild(knc);
+ }
+ if (kn.lastChild.nodeName == "SELECT") document.getElementById(divId).removeChild(kn.lastChild);
+ }
+ //-->
+ </script>
+
+</head>
+
+<body>
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"><img src=\"img/role.png\" border=\"0\" alt=\"Arbeitsplatztyp - Vorsorge bearbeiten\" title=\"Arbeitsplatztyp - Vorsorge bearbeiten\"/></div>\n";
+
+ if ($apid) $text = "editieren"; else $text = "erfassen";
+ echo "<div align=\"center\">";
+ echo "<h3>Arbeitsplatztyp - Grundsätze Vorsorge $text</h3>";
+ echo "</div>\n";
+ if (!$sub || !isset($ap) || !$ok)
+ {
+ if ($apid && !$sub && !isset($ap))
+ {
+ $sql = "SELECT vs_ID, arbplatz_typ FROM Vorsorge_Arbplatz WHERE arbplatz_typ = '" . $apid . "'";
+ if ($res = $dbc -> queryObjectArray($sql))
+ {
+ foreach ($res as $row)
+ {
+ $ap["aptyp"] = $row->arbplatz_typ;
+ $ap["vs"][] = $row->vs_ID;
+ }
+ }
+ else $ap["aptyp"] = $apid;
+ }
+ include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/ap_vorsorge_form.inc.php");
+
+ if ($sub)
+ {
+ $frage = "Alle Angaben ok?";
+ 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("ase",$_SESSION["recht"]))
+ {
+ echo "
+ <tr><td> </td>\n
+ <td><input class=\"button\" type=\"submit\" name=\"eintragen\" value=\" eintragen \" />";
+ echo "</td></tr>\n";
+ }
+ echo "</table>\n";
+ echo "</div>\n";
+ echo "<p class='sc'> <a href=\"ap_vorsorge_flist.php\" target=\"_self\" title=\"Arbplatztyp-Liste\">« zur Arbeitsplatztyp-Liste</a></p>\n";
+ echo "</form>\n";
+ }
+ else
+ {
+ echo "<div align='center'>\n";
+
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $stmt = $dbc -> stmtinit();
+ if (is_object($stmt))
+ {
+ $retd = 1;
+ if ($apid && is_array($ap['vs']))
+ { //UPDATE
+ // Loeschen alte Arbeitsplatztypen
+ $retd = $dbc -> execute("DELETE FROM Vorsorge_Arbplatz WHERE arbplatz_typ = '". $ap["aptyp"] ."'");
+ }
+
+ if ($retd && is_array($ap['vs']))
+ {
+ $rett = 1;
+ $stmt -> prepare("INSERT INTO Vorsorge_Arbplatz (vs_ID,arbplatz_typ) VALUES(?,?)");
+ for ($k=0; $k<count($ap["vs"]); $k++)
+ {
+ if ($ap["vs"][$k] && $ap["vs"][$k] != -1)
+ {
+ $stmt -> bind_param('ss',$ap["vs"][$k], $ap["aptyp"]);
+ $rett = $stmt -> execute();
+ if (!$rett) $rett = false;
+ }
+ }
+ if (!$rett) echo "error INSERT Vorsorge: $stmt->error<br />\n";
+
+ }
+ }
+ if ($rett)
+ {
+ echo "<p class='green'><b>Vorsorgegrundsätze für Arbeitsplatztyp '$apid' wurden erfolgreich gespeichert.</b></p>\n";
+ echo "<table>\n";
+ if (is_array($ap["vs"]))
+ {
+ echo "<tr><td>Vorsorgegrundsätze: </td>";
+ foreach ($ap["vs"] as $vsg)
+ {
+ if ($next) $next ="<tr><td> </td>"; else $next =" ";
+ if ($vsg && $vsg != -1) echo "$next<td>$vsg</td></tr>\n";
+ }
+ }
+ echo "</table>\n";
+ }
+ else
+ echo "<p class='red'><b>Vorsorgegrundsätze für Arbeitsplatztyp '$apid'' wurden nicht oder nur teilweise gespeichert</b></p>\n";
+
+ echo "</div>";
+ echo "<p class='sc'> <a href=\"ap_vorsorge_flist.php\" target=\"_self\" title=\"Arbplatztyp-Liste\">« zur Arbeitsplatztyp-Liste</a></p>\n";
+ }
+?>
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/ap_vorsorge_flist.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,141 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2012
+ *
+ * Liste Arbeitsplatztypen - Vorsorge
+ *
+ */
+
+ 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("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen"/>
+ <link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print"/>
+
+ <title>Arbeitsplatztyp-Liste</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+
+<?php
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ $dbc = new dbconnection();
+
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"><img src=\"img/role.png\" border=\"0\" alt=\"Arbeitsplatztypen\" title=\"Arbeitsplatztypen\"/></div>\n";
+
+ // Felder, nach denen gefiltert werden kann
+ $fields = array(3=>"Vorsorge-G-Nr.");
+
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+ $filter = $_POST["filter"];
+ if (!isset($filter) && !$filter) $filter = $_GET["b"];
+
+ $subf = $_POST["subf"]; // submit
+
+ if (!isset($fnum) && !$fnum) $fnum = 1;
+ if (!isset($filter) && !$filter) $filter = "";
+
+ if ($fnum == 3 && $filter>" ") $where = " WHERE a.vs_ID LIKE '%" . $filter ."%'"; else $where = "";
+ $sql = "SELECT t.arbplatz_typ, arbplatz_typ_bez, a.vs_ID, vs_bez
+ FROM Arbplatz_Typ t LEFT OUTER JOIN
+ fhiiqm.Vorsorge_Arbplatz a ON t.arbplatz_typ=a.arbplatz_typ LEFT OUTER JOIN
+ Vorsorge v ON a.vs_ID = v.vs_ID $where";
+
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ echo "<div align='center'>\n";
+ echo "<p><b>Liste Arbeitsplatztypen - Vorsorge</b></p>\n";
+
+ echo "<table border='0' cellspacing='0'>\n";
+ echo "<tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' ermöglicht das Filtern nach Vorsorgegrundsatz</td></tr>\n
+ <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten Arbeitsplatztyp - Vorsorgegrundsatz</td></tr>\n
+ <tr><td class='red'>alle hier gezeigten G-Nummern sind fiktiv(07.05.2012) - bitte durch reale ersetzen</td></tr>
+ <tr><td class='bigger'> </td></tr>";
+ echo "</table>\n";
+
+ if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+ {
+ // Formular anzeigen fuer Filterbegriff
+ $text = $fields[$fnum];
+ echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
+ echo "<input type='hidden' name='f' value='$fnum'>";
+ echo "<table width=\"30%\" 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><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr></table>\n";
+ echo "</form>\n";
+ echo "<p> </p>\n";
+ }
+
+ echo "<table border='0'>\n";
+ echo "<tr bgcolor='#68ACBF'><th>Arbeitsplatz-Typ</th>";
+ if ($fnum == 3) $filt = "filter_activ"; else $filt = "filter";
+ echo "<th>Vorsorge <a href='".$_SERVER['PHP_SELF']."?f=3'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='Filter G(rundsatz)-Nr.' title='Filter G(rundsatz)-Nr.'></a></th>";
+ echo "<th> </th></tr>";
+
+ $vt = "?";
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+
+ foreach ($result as $row)
+ {
+ if ($row->arbplatz_typ != $vt)
+ {
+ if ($vt != "?")
+ {
+ echo "</td><td><a href='/fhiiqm/ap_vorsorge_ed.php?i=$vt'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>
+ </tr>\n";
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ }
+ echo "<tr bgcolor='" . $bg . "'>";
+ echo "<td>$row->arbplatz_typ - $row->arbplatz_typ_bez</td>";
+ echo "<td>$row->vs_ID - $row->vs_bez";
+ }
+ else
+ {
+ echo "<br />$row->vs_ID - $row->vs_bez";
+ }
+ $vt = $row->arbplatz_typ;
+
+ }
+ echo "</td><td><a href='/fhiiqm/ap_vorsorge_ed.php?i=$vt'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n</table></div>\n";
+ }
+
+
+
+?>
+
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/form/alpruef_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/alpruef_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -16,7 +16,6 @@
<table>
<tr><td class="bigger">Die Auswahl der Anlage geschieht durch<br />Eingeben von mindesten 2 Zeichen in das 'Anlage'-Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
--- a/fhiiqm/form/alrisk_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/alrisk_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -16,7 +16,6 @@
<table>
<tr><td class="bigger">Die Auswahl der Anlage geschieht durch<br />Eingeben von mindesten 2 Zeichen in das 'Anlage'-Feld.
</td></tr>
-<tr><td class="bigger"><!--<div class="red">Achtung! </div>-->Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
--- a/fhiiqm/form/alvtr_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/alvtr_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -16,7 +16,6 @@
<table>
<tr><td class="bigger">Die Auswahl einer Anlage und eines Vertrages geschieht durch<br />Eingeben von mindesten 2 Zeichen in das entsprechende Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
--- a/fhiiqm/form/anlage_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/anlage_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -17,7 +17,6 @@
<table>
<tr><td class="bigger">Die Auswahl eines Verantwortlichen geschieht durch Eingeben von<br />mindesten 2 Zeichen in das 'Verantwortlicher'-Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/ap_vorsorge_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,102 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2012
+ *
+ * Form Arbeitsplatztyp - Vorsorge
+ *
+ */
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="form_info" target="_self">
+ <div align="center">
+ <table width="55%" border="0" cellspacing="3" cellpadding="3">
+ <tr>
+ <td width="20%">Arbeitsplatztyp *</td>
+ <td>
+ <select name="ap[aptyp]" size="1">
+ <?php
+ $select = null;
+ $sql = "SELECT arbplatz_typ, arbplatz_typ_bez FROM fhiiqm.Arbplatz_Typ ORDER BY 1";
+ if ($result = $dbc->queryObjectArray($sql))
+ {
+ foreach ($result as $row)
+ {
+ $select = ( $row->arbplatz_typ==$ap['aptyp'] ) ? ' selected' : null;
+ echo "<option $select value=\"$row->arbplatz_typ\">$row->arbplatz_typ - $row->arbplatz_typ_bez</option>\n";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Vorsorge *
+ <br /> leeres Feld = Löschen
+ </td>
+ <td>
+ <div id="add">
+ <select name="ap[vs][]" size="1">
+ <?php
+ $select = null;
+ $select = ( "-1"==$ap['vs'][0] ) ? ' selected' : null;
+ echo "<option $select value=\"-1\"></option>\n";
+ $sql = "SELECT vs_ID, vs_bez FROM fhiiqm.Vorsorge ORDER BY 1";
+ if ($result = $dbc->queryObjectArray($sql))
+ {
+ foreach ($result as $row)
+ {
+ $select = ( $row->vs_ID==$ap['vs'][0] ) ? ' selected' : null;
+ echo "<option $select value=\"$row->vs_ID\">$row->vs_ID - $row->vs_bez</option>\n";
+ $svs .= "'".$row->vs_ID."':'".$row->vs_bez."',";
+ }
+ }
+ $svs = substr($svs,0,strlen($svs)-1);
+ ?>
+ ?>
+ </select>
+ <script type="text/javascript">
+ <!--
+ arr = {<?php echo ($svs); ?>}; // Ergebnis: {'key':'value','key':'value',...}
+ //-->
+ </script>
+
+ <a href="<?php echo "javascript:addInput('add');" ?>" title="weiterer Vorsorgegrundsatz"><img src="/fhiiqm/img/add.png" /></a>
+ <a href="<?php echo "javascript:delInput('add');" ?>" title="löschen letzten Vorsorgegrundsatz"><img src="/fhiiqm/img/delete.png" /></a>
+ <?php
+ if ($apid || ($sub && isset($ap) && !$ok))
+ {
+ if (count($ap['vs'])>1)
+ {
+ $i=0;
+ foreach ($ap['vs'] as $vse)
+ {
+ if ($i>0)
+ {
+ echo "<select name=\"ap[vs][]\" size=\"1\">";
+
+ $select = ( "-1" == $apte ) ? ' selected' : null;
+ echo "<option $select value=\"-1\"></option>\n";
+ foreach ($result as $row)
+ {
+ $select = ( $row->vs_ID == $vse ) ? ' selected' : null;
+ echo "<option $select value=\"$row->vs_ID\">$row->vs_ID - $row->vs_bez</option>\n";
+ }
+ echo "</select><br/>\n";
+ }
+ $i++;
+ }
+ }
+ }
+ ?>
+ </div>
+ </td>
+ </tr>
+<!--
+ </table>
+ </form>
+-->
\ No newline at end of file
--- a/fhiiqm/form/gefahr_ap_search_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/gefahr_ap_search_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -130,10 +130,21 @@
echo "</select> \n";
}
echo "</td></tr>\n";
+
+ $azeil = array(10=>'10',20=>'20',25=>'25',50=>'50',100=>'100',9999=>'alle'); // Anzahl gezeigter rows
+ echo "<tr><td>Zeilen/Seite?</td><td><select name='rag[z]'>\n";
+ if (!$rag['z']) $rag['z'] = 25;
+ foreach ($azeil as $key=>$val)
+ {
+ if ($key == $rag['z']) $select = "selected"; else $select = "";
+ echo "<option $select value='$key'>$val</option>\n";
+ }
+ echo "</select></td></tr>\n";
+
?>
<tr>
<td> </td>
- <td><input class="button" type="submit" name="search" value="suchen"></td>
+ <td><input class="button" type="submit" name="search" value="Bericht erstellen"/></td>
</tr>
</table>
</div>
--- a/fhiiqm/form/info_form2.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/info_form2.inc.php Mon May 07 16:21:00 2012 +0200
@@ -25,6 +25,10 @@
<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">
+<?php
+// if ($inf["ityp"] != 6 && $ityp != 6)
+// {
+?>
<tr>
<td>Titel *<br/><br />
max. 300 Zeichen möglich</td>
@@ -43,9 +47,18 @@
?>
</td>
</tr>
+<?php
+/* }
+ else
+ {
+ echo "<tr><td>Info-ID</td><td><input class='read right' name='inf[infid]' type='text' size='5' value='" .$inf['infid']."' readonly='readonly' /></td></tr>\n";
+ } */
+?>
<tr>
<td>Kurzinformation<br/><br />
- max. 8000 Zeichen möglich
+ max. 8000 Zeichen möglich<br /><br />
+ erforderlich für <br />
+ Geschäftsverteilungsplan
</td>
<td><textarea name="inf[ilong]" cols="80" rows="6"><?php echo $inf['ilong']; ?></textarea>
</td>
@@ -134,7 +147,7 @@
gewünschten Listeneinträge
</td>
<td><table cellspacing="0"><tr><td>
- <select name="inf[vpers][]" size="5" multiple="multiple" onblur="this.form.submit();">
+ <select name="inf[vpers][]" size="20" multiple="multiple" onblur="this.form.submit();">
<?php
$select = null;
if (is_array($inf['vpers'])) $select = in_array( "-1", $inf['vpers'] ) ? ' selected' : null;
@@ -145,7 +158,7 @@
}
else */
$wherm = "";
- $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname) as pname FROM fhiiqm.Mitarbeiter $wherm ORDER BY 2";
+ $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname,' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as pname FROM fhiiqm.Mitarbeiter $wherm ORDER BY 2";
if ($result = $dbc->queryObjectArray($sql))
{
foreach ($result as $row)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/info_form3.inc.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,251 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Form Info Geschaeftsverteilungsplan - 3
+ */
+
+ 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="Ändern / Lö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="70%" border="0" cellspacing="3" cellpadding="3">
+ <tr>
+ <td>Titel *<br/><br />
+ max. 300 Zeichen mö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 " Info-ID";
+ echo " <input class='read right' name='inf[infid]' type='text' size='5' value='" .$inf['infid']."' readonly='readonly' />";
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td>Kurzinformation<br/><br />
+ max. 8000 Zeichen möglich<br /><br />
+ erforderlich für <br />
+ Geschäftsverteilungsplan
+ </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="10" maxlength="10" value="<?php echo $inf['sort']; ?>" /></td>
+ </tr>
+ <tr><td>gehört zu Info</td>
+ <td><select name="inf[infrel]">
+ <?php
+ if ($inf['infid'] == -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ültig ab</td>
+ <td><input class="long10" name="inf[vdat]" id="vdat" value="<?php echo $inf['vdat']; ?>" /></td>
+ </tr>
+ <tr>
+ <td>gü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']; ?>"/>
+ Eingabe von mind. 2 Zeichen -> Namensliste
+ </td>
+ </tr>
+ <tr>
+ <td>Verantwortliche(r) FHI
+ <br /><br /> Eingabe von mind. 2 Zeichen
+ <br /> -> Namensliste,
+ <br /> Wiederholung für weitere Namen
+ </td>
+ <td><table cellspacing="0"><tr><td>
+ <textarea cols="40" rows="5" name="inf[vpers]" id="vpers"><?php echo $inf['vpers']; ?></textarea>
+
+ </td>
+ <?php
+ if (isset($inf["vpn"]) && $inf["vpn"])
+ {
+// $plist = substr($inf["vpn"],0,strlen($inf["vpn"])-1);
+ if (strpos($inf["vpn"],",") === 0) $inf["vpn"] = substr($inf["vpn"],1);
+ echo "<td><table cellspacing='0' cellpadding='0'>";
+ $sql = "SELECT persknr, CONCAT (nachname, ', ',vorname) AS ma FROM Mitarbeiter WHERE persknr IN (".$inf["vpn"].") ORDER BY 2";
+ if ($result = $dbc->queryObjectArray($sql))
+ foreach ($result as $row)
+ {
+ echo "<tr><td class='valignb'> $row->ma: </td>";
+ echo "<td class='valignb' width='40%'> <input name='inf[prio][$row->persknr]' type='text' size='50' maxlength='50' value='". $inf["prio"][$row->persknr] . "' />\n";
+ echo "</td></tr>";
+ }
+ 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 />
+ Mehrfachauswahl möglich:<br />
+ [Strg]-Taste + Anklicken der<br />
+ 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(" "," ",htmlentities(substr($row->bez,0,70))) ."...";
+ else
+ $prod=str_replace(" "," ",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ünen</font> Einträge wählen
+ </td>
+ </tr>
+ <tr><td>Adressat<br /><br />
+ Mehrfachauswahl mö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: <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="inf[vpn]" id="vpid" value="<?php echo $inf['vpn']; // Verantwortliche ?>"/>
+ <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 Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/laser_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -17,7 +17,6 @@
<table>
<tr><td class="bigger">Die Auswahl eines Verantwortlichen geschieht durch Eingeben von<br />mindesten 2 Zeichen in das entsprechende Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
--- a/fhiiqm/form/ma_fkt_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/ma_fkt_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -12,7 +12,6 @@
<table>
<tr><td class="bigger">Die Auswahl eines Mitarbeiters geschieht durch<br />Eingeben von mindesten 2 Zeichen in das Mitarbeiter-Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
@@ -106,7 +105,11 @@
{
?>
<tr><td> </td>
- <td><input class="button" type="submit" name="eintragen" value=" eintragen " /></td>
+ <td><input class="button" type="submit" name="eintragen" value=" eintragen " />
+ <?php
+ if ($mfid) echo " <input class=\"button\" type=\"submit\" value=\"duplizieren\" name=\"dup\" title=\"delete\" />";
+ ?>
+ </td>
</tr>
<?php
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/raum_aptyp_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,121 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 4/2012
+ *
+ * Form Raum - Arbeitsplatztyp
+ *
+ */
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="form_info" target="_self">
+ <div align="center">
+ <table width="45%" border="0" cellspacing="3" cellpadding="3">
+ <tr>
+ <td width="30%">Haus *</td>
+ <td><select name="ap[geb]" onchange="this.form.submit();">
+ <?php
+ $sql = "SELECT geb_ID, geb_name FROM Haus ORDER BY 1";
+ if ($result = $dbc->queryObjectArray($sql))
+ {
+ foreach ($result as $row)
+ {
+ if ($row->geb_ID == $ap['geb'])
+ echo "<option selected value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n";
+ else
+ echo "<option value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Raum *</td>
+ <td><select name="ap[raum]">
+ <?php
+ if (!isset($ap) && !$ap['geb']) $ap['geb'] = "A";
+ $sql = "SELECT raum_ID, raum_nr, raum_name FROM Raum WHERE geb_ID = '". $ap['geb']."' ORDER BY 2";
+ if ($result = $dbc->queryObjectArray($sql))
+ {
+ foreach ($result as $row)
+ {
+ if ($row->raum_ID == $ap['raum'])
+ echo "<option selected value=\"$row->raum_ID\">$row->raum_nr - $row->raum_name</option>\n";
+ else
+ echo "<option value=\"$row->raum_ID\">$row->raum_nr - $row->raum_name</option>\n";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Arbeitsplatztyp *
+ <br /> Hinzufügen weiterer<br /> Typen mit '+'
+ </td>
+ <td>
+ <div id="add">
+ <select name="ap[aptyp][]" size="1">
+ <?php
+ $select = null;
+ $select = ( "-1"==$ap['aptyp'][0] ) ? ' selected' : null;
+ echo "<option $select value=\"-1\"></option>\n";
+ $sql = "SELECT arbplatz_typ, arbplatz_typ_bez FROM fhiiqm.Arbplatz_Typ ORDER BY 1";
+ if ($result = $dbc->queryObjectArray($sql))
+ {
+ foreach ($result as $row)
+ {
+ $select = ( $row->arbplatz_typ==$ap['aptyp'][0] ) ? ' selected' : null;
+ echo "<option $select value=\"$row->arbplatz_typ\">$row->arbplatz_typ - $row->arbplatz_typ_bez</option>\n";
+ $apt .= "'".$row->arbplatz_typ."':'".$row->arbplatz_typ_bez."',";
+ }
+ }
+ $apt = substr($apt,0,strlen($apt)-1);
+ ?>
+ </select>
+ <script type="text/javascript">
+ <!--
+ arr = {<?php echo ($apt); ?>}; // Ergebnis: {'key':'value','key':'value',...}
+ //-->
+ </script>
+
+ <a href="<?php echo "javascript:addInput('add');" ?>" title="weiterer Arbeitsplatztyp"><img src="/fhiiqm/img/add.png" /></a>
+ <a href="<?php echo "javascript:delInput('add');" ?>" title="löschen letzten Arbeitsplatztyp"><img src="/fhiiqm/img/delete.png" /></a>
+ <?php
+ if ($apid || ($sub && isset($ap) && !$ok))
+ {
+ if (count($ap['aptyp'])>1)
+ {
+ $i=0;
+ foreach ($ap['aptyp'] as $apte)
+ {
+ if ($i>0)
+ {
+ echo "<select name=\"ap[aptyp][]\" size=\"1\">";
+
+ $select = ( "-1" == $apte ) ? ' selected' : null;
+ echo "<option $select value=\"-1\"></option>\n";
+ foreach ($result as $row)
+ {
+ $select = ( $row->arbplatz_typ == $apte ) ? ' selected' : null;
+ echo "<option $select value=\"$row->arbplatz_typ\">$row->arbplatz_typ - $row->arbplatz_typ_bez</option>\n";
+ }
+ echo "</select><br/>\n";
+ }
+ $i++;
+ }
+ }
+ }
+ ?>
+ </div>
+ </td>
+ </tr>
+<!--
+ </table>
+ </form>
+-->
\ No newline at end of file
--- a/fhiiqm/form/recht_form.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/form/recht_form.inc.php Mon May 07 16:21:00 2012 +0200
@@ -31,7 +31,6 @@
<table>
<tr><td class="bigger">Die Auswahl eines Mitarbeiters geschieht durch Eingeben von mindesten 2 Zeichen in das Mitarbeiter-Feld.
</td></tr>
-<tr><td class="bigger">Umlaute wie 'ä', 'ü', 'ö', 'ß' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
<tr><td class="bigger"> </td></tr>
</table>
</div>
Binary file fhiiqm/img/alarm_bell.png has changed
Binary file fhiiqm/img/file_extension_xls.png has changed
Binary file fhiiqm/img/role.png has changed
--- a/fhiiqm/inc/al_list_ac.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/al_list_ac.inc.php Mon May 07 16:21:00 2012 +0200
@@ -10,7 +10,7 @@
header('Content-type: text/html; charset="iso-8859-1',true); //wg. jquery ui autocomplete
error_reporting(E_ALL ^ E_NOTICE);
- $q = strtolower($_GET["term"]); // wird in jquery in 'term' uebergeben
+ $q = strtolower(utf8_decode($_GET["term"])); // wird in jquery in 'term' uebergeben, term UTF-8 codiert
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
--- a/fhiiqm/inc/alvertrag_list_ac.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/alvertrag_list_ac.inc.php Mon May 07 16:21:00 2012 +0200
@@ -10,7 +10,7 @@
header('Content-type: text/html; charset="iso-8859-1',true); //wg. jquery ui autocomplete
error_reporting(E_ALL ^ E_NOTICE);
- $q = strtolower($_GET["term"]); // wird in jquery in 'term' uebergeben
+ $q = strtolower(utf8_decode($_GET["term"])); // wird in jquery in 'term' uebergeben, term UTF-8 codiert
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
--- a/fhiiqm/inc/file_upload.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/file_upload.inc.php Mon May 07 16:21:00 2012 +0200
@@ -115,7 +115,7 @@
// ev. vorhandene gaengige Umlaute ersetzen
$fname = str_replace($su,$er,$fname);
- if (strlen($typ) != 3) $typ="pdf";
+ if (strlen($typ) < 3) $typ="pdf";
if (substr($fname,0,1) == ".")
$fname = substr($fname,1,50-(4+$len)) . "." .$typ;
else
--- a/fhiiqm/inc/func_lib.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/func_lib.inc.php Mon May 07 16:21:00 2012 +0200
@@ -44,7 +44,7 @@
if ($fcol>0 && $fanr>0) // Filtern nach Spalte moeglich
{
if ($fcol == $fanr) $filt = "filter_activ"; else $filt = "filter";
- $filt = " <a href='".$_SERVER['PHP_SELF']."?f=$fcol&s=$sort&d=$dir&st=$start&z=$anzds&i=$id'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='$tip' title='$tip'></a>";;
+ $filt = " <a href='".$_SERVER['PHP_SELF']."?f=$fcol&s=$sort&d=$dir&st=$start&z=$anzds&i=$id'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='$tip' title='$tip'></a>";
}
else
$filt="";
--- a/fhiiqm/inc/info_dat_show.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/info_dat_show.inc.php Mon May 07 16:21:00 2012 +0200
@@ -95,7 +95,22 @@
}
}
//Verantwortliche+Prioritaet
- if (isset($inf["vpers"])&& is_array($inf["vpers"]))
+ if (isset($inf["vpn"]) && $inf["vpn"])
+ {
+ $parr = explode(",",$inf["vpn"]);
+ $k = 0;
+ echo "<tr><td>Verantwortliche(r):</td>";
+ foreach ($parr as $pnr)
+ {
+ if ($k == 0) $leer = ""; else $leer = "<td> </td>";
+ $sql = "SELECT CONCAT (nachname, ', ',vorname) as pname FROM fhiiqm.Mitarbeiter WHERE persknr=$pnr";
+ $pname = $dbc -> querySingleItem($sql);
+ echo "$leer<td>".$pname." Bemerkung: ".$inf["prio"][$pnr]."</td></tr>";
+ $k=1;
+ }
+
+ }
+ elseif (isset($inf["vpers"])&& is_array($inf["vpers"]) )
{
echo "<tr><td>Verantwortliche(r):</td>";
for ($k=0; $k<count($inf["vpers"]); $k++)
--- a/fhiiqm/inc/info_tab_ins.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/info_tab_ins.inc.php Mon May 07 16:21:00 2012 +0200
@@ -65,7 +65,19 @@
if ($retv)
{
if (!is_object($stmt)) $stmt = $dbc -> stmtinit();
- if (is_array($inf['vpers']))
+ if (isset($inf["vpn"]) && $inf["vpn"])
+ {
+ $parr = explode(",",$inf["vpn"]);
+ $stmt -> prepare("INSERT INTO Info_Verantwortlich (info_ID,persknr,prioritaet) VALUES(?,?,?)");
+ foreach ($parr as $pnr)
+ {
+ $stmt -> bind_param('iis',$infid, $pnr, $inf["prio"][$pnr]);
+ $retvi = $stmt -> execute();
+ if (!$retvi) $retv = false;
+ }
+ if (!$retv) echo "error INSERT Info_Verantwortlich: $stmt->error<br />\n";
+ }
+ elseif (is_array($inf['vpers']))
{
$stmt -> prepare("INSERT INTO Info_Verantwortlich (info_ID,persknr,prioritaet) VALUES(?,?,?)");
for ($k=0; $k<count($inf['vpers']); $k++)
--- a/fhiiqm/inc/ma_list_ac.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/ma_list_ac.inc.php Mon May 07 16:21:00 2012 +0200
@@ -10,7 +10,7 @@
header('Content-type: text/html; charset="iso-8859-1',true); //wg. jquery ui autocomplete
error_reporting(E_ALL ^ E_NOTICE);
- $q = strtolower($_GET["term"]); // wird in jquery in 'term' uebergeben
+ $q = strtolower(utf8_decode($_GET["term"])); // wird in jquery in 'term' uebergeben, term UTF-8 codiert
$abt = $_GET["s"]; // Sortierung zuerst nach Abteilung (laser)
--- a/fhiiqm/inc/menu.inc.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/inc/menu.inc.php Mon May 07 16:21:00 2012 +0200
@@ -63,9 +63,20 @@
if (in_array("ie",$_SESSION["recht"]))
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äftsverteilungsplan erfassen</a></li>\n";
+ echo "<li><a href=\"/fhiiqm/info_ed3.php?t=6\" target=\"_blank\" title=\"Info GVP erfassen\">Geschä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äftsverteilungsplan</a></li>\n";
+ echo "<li><a href=\"/fhiiqm/info_report.php\" target=\"_blank\" title=\"Report GVP\">Berichte Geschäftsverteilungsplan</a></li>\n";
+ echo " </ul>\n
+ </li>\n";
+ }
+ if (is_array($arg) && in_array("p",$arg))
+ {
+ echo "<li>Prozesse\n
+ <ul>\n";
+ if (in_array("pzr",$_SESSION["recht"]) || in_array("pze",$_SESSION["recht"]))
+ echo "<li><a href=\"/fhiiqm/prozess_flist.php\" target=\"_blank\" title=\"Prozessliste\">Prozesse sortieren, filtern, bearbeiten</a></li>\n";
+ if (in_array("pze",$_SESSION["recht"]))
+ echo "<li><a href=\"/fhiiqm/prozess_ed.php\" target=\"_blank\" title=\"Prozess erfassen\">Prozess erfassen</a></li>\n";
echo " </ul>\n
</li>\n";
}
@@ -109,13 +120,24 @@
if (is_array($arg) && in_array("s",$arg))
{
- echo "<li>Bewegungsdaten\n
- <ul>\n"; // Bearbeitung von ausgewaehlten Stamm-Daten
+ if (in_array("asr",$_SESSION["recht"]) || (in_array("ase",$_SESSION["recht"])))
+ {
+ echo "<li>Arbeitssicherheit\n
+ <ul>\n";
+ echo "<li><a href=\"/fhiiqm/ap_vorsorge_flist.php\" target=\"_blank\" title=\"Arbeitsplatztyp-Vorsorge-Liste\">Arb.platztypen - Vorsorge filtern, bearbeiten</a></li>\n";
+ echo "<li><a href=\"/fhiiqm/raum_report.php\" target=\"_blank\" title=\"Report Arbeitssicherheit\">Berichte Arbeitssicherheit</a></li>\n";
+ echo " </ul>\n
+ </li>\n";
+ }
if (in_array("re",$_SESSION["recht"]))
- echo "<li><a href=\"/fhiiqm/raum_flist_ed.php\" target=\"_blank\" title=\"Raumliste edit\">Räume sortieren, filtern, Reinigungsdaten bearbeiten</a></li>\n";
- echo " </ul>\n
- </li>\n";
-
+ {
+ echo "<li>Bewegungsdaten\n
+ <ul>\n"; // Bearbeitung von ausgewaehlten Stamm-Daten
+ echo "<li><a href=\"/fhiiqm/raum_flist_ed.php\" target=\"_blank\" title=\"Raumliste edit\">Räume - Reinig.-Daten sortieren, filtern, bearbeiten</a></li>\n";
+ echo "<li><a href=\"/fhiiqm/raum_aptyp_flist.php\" target=\"_blank\" title=\"Raum-Arbeitsplatztyp-Liste edit\">Räume - Arb.platztypen sortieren, filtern, bearbeiten</a></li>\n";
+ echo " </ul>\n
+ </li>\n";
+ }
echo "<li>Stammdaten\n
<ul>\n";
if (in_array("pr",$_SESSION["recht"]) || in_array("pe",$_SESSION["recht"]))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/inc/raum_aptyp_dat_show.inc.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Anlisten Raum-Arbeitsplatz-Typ INSERT/UPDATE
+ *
+ */
+
+ echo "<table>\n";
+ $sql = "SELECT geb_ID, raum_nr, raum_name FROM Raum WHERE raum_ID = " . $ap['raum'];
+ $res = $dbc -> queryObjectArray($sql);
+ foreach ($res as $row)
+ {
+ echo "<tr><td>Haus: </td><td>$row->geb_ID</td></tr>\n";
+ echo "<tr><td>Raum: </td><td>$row->raum_nr - $row->raum_name</td></tr>\n";
+ }
+ // Arbeitsplatztyp
+ if (is_array($ap["aptyp"]))
+ {
+ echo "<tr><td>Arbeitsplatztypen: </td>";
+ foreach ($ap["aptyp"] as $atyp)
+ {
+ if ($next) $next ="<tr><td> </td>"; else $next =" ";
+ if ($atyp && $atyp != -1) echo "$next<td>$atyp</td></tr>\n";
+ }
+ }
+ echo "</table>\n";
+?>
\ No newline at end of file
--- a/fhiiqm/info_ed.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/info_ed.php Mon May 07 16:21:00 2012 +0200
@@ -358,7 +358,8 @@
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);
+ $fname = gen_filename($inf['ifname'],"ifile",$infid);
+ $retdf = mod_file("/var/www/fhiiqm/infos",$infid,"","del"); // Loeschen alte Datei
$retf = upload("ifile", $fname, $infid, "infos"); // Datei prüfen und in Dokumentenverzeichnis verschieben
if ($retf)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/info_ed3.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,489 @@
+<?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 && $retp && $reta && $retv)
+ {
+ $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>
+ function split( val ) {
+ return val.split( /;\s*/ );
+ }
+ function extractLast( term ) {
+ return split( term ).pop();
+ }
+// $(document).ready(function() {
+ $(function() {
+ $("#titel").focus();
+ $("#persknr").autocomplete({
+ source: "/fhiiqm/inc/ma_list_ac.inc.php",
+ minLength: 2,
+ select: function(event,ui){$("#pid").val(ui.item.id);}
+ });
+ $("#vpers")
+ .bind( "keydown", function( event ) {
+ if ( event.keyCode === $.ui.keyCode.TAB &&
+ $( this ).data( "autocomplete" ).menu.active ) {
+ event.preventDefault();
+// alert ("bind: "+event.keyCode);
+ }
+ })
+ .autocomplete({
+// source: "/fhiiqm/inc/ma_list_ac.inc.php",
+// minLength: 2,
+// select: function(event,ui){$("#pid").val(ui.item.id);}
+ source: function( request, response ) {
+ $.getJSON( "/fhiiqm/inc/ma_list_ac.inc.php", {
+ term: extractLast( request.term )
+ }, response );
+ },
+ focus: function() {
+ // prevent value inserted on focus
+ return false;
+ },
+ select: function( event, ui ) {
+ var terms = split( this.value );
+// alert ("eingabe: "+terms+ ", ids="+idstr.valueOf());
+ // remove the current input
+ terms.pop();
+ // add the selected item
+ terms.push( ui.item.value );
+ // add placeholder to get the comma-and-space at the end
+ terms.push( "" );
+// alert ("select: "+terms+ "ids = "+$("#vpid").val());
+ this.value = terms.join( "; " );
+
+ var ids = $("#vpid").val().split(",");
+ ids.push(ui.item.id);
+ ids.join(",");
+// alert (ids);
+ $("#vpid").val(ids);
+ return false;
+ },
+ change: function(event, ui){
+// alert ("change: "+ui.item.value+","+ ui.item.id);
+ },
+ search: function() {
+ // custom minLength
+ var term = extractLast( this.value );
+ if ( term.length < 2 ) {
+ return false;
+ }
+ }
+ });
+ $("#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[id='persknr']").addClass("long20");
+ $("input[id='cdat']").addClass("long10");
+ $("input[id='vdat']").addClass("long10");
+ $("input[id='bdat']").addClass("long10");
+ });
+ </script>
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <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 ändern\" title=\"Infodaten ä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) as ma
+ 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->ma . "; ";
+ $inf["vpn"] .= $row->persknr .",";
+// $inf["prio"][] = $row->prioritaet;
+ $inf["prio"][$row->persknr] = $row->prioritaet;
+ }
+ $inf["vpn"] = substr($inf["vpn"],0,strlen($inf["vpn"])-1);
+ }
+// print_r($inf); echo "<br /><br />";
+
+ }
+ include($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/info_form3.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ö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> </td>\n
+ <td><input class=\"button\" type=\"submit\" name=\"eintragen\" value=\" eintragen \" />";
+ if ($infid)
+ {
+ echo " <input class=\"buttonr\" type=\"submit\" value=\"löschen\" name=\"del\" title=\"delete\" />";
+ echo " <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'> <a href=\"info_flist.php\" target=\"_self\" title=\"Infoliste\">« 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öscht.</b></p>\n";
+ echo "<p class='green'><b>Infodaten zu ID '$infid' wurden gelö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ö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ö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,10); // 28.03.2012 5 -> 10 Zeichen
+ 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);
+ $retdf = mod_file("/var/www/fhiiqm/infos",$infid,"","del"); // Loeschen alte Datei
+ $retf = upload("ifile", $fname, $infid, "infos"); // Datei prüfen und in Dokumentenverzeichnis verschieben
+
+ 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'> <a href=\"info_flist.php\" target=\"_self\" title=\"Infoliste\">Infoliste</a></p>\n";
+ echo "<p class='sc'> <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_report.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/info_report.php Mon May 07 16:21:00 2012 +0200
@@ -3,6 +3,9 @@
/**
* @author Bettina Schwarzer, Fritz-Haber-Institut
* @copyright 04/2012
+ *
+ * Reportauswahl Info (GVP)
+ *
*/
@@ -13,7 +16,7 @@
if (! isset($_SESSION["userid"]))
{
include_once ("inc/func_lib.inc.php");
- login("vertrag_report.php");
+ login("info_report.php");
exit;
}
@@ -51,14 +54,14 @@
<td class="bigger">
<a href="/fhiiqm/report/info_report_gvp.php" title="Geschäftsverteilungsplan 1">Geschäftsverteilungsplan nach Produkten</a>
<br /> Auswahl: Produktbereich, Produktgruppe
- <br /> Ansicht: Kennzeichen, Aufgabe(Produkt), Teilgebiet(Info), Verantwortliche(r)
+ <br /> Ansicht: Kennzeichen, Aufgabe(Produkt), Teilgebiet(Kurz-Info), Verantwortliche(r)
</td>
</tr>
<tr>
<td class="bigger">
- <a href="/fhiiqm/report/info_report_gvp.php?r=k" title="Geschäftsverteilungsplan 2">Geschäftsverteilungsplan nach Kennzahlen</a>
- <br /> Auswahl: Kennzahl
- <br /> Ansicht: Kennzeichen, Produktgruppe, Aufgabe(Produkt), Teilgebiet(Info), Verantwortliche(r)
+ <a href="/fhiiqm/report/info_report_gvp.php?r=k" title="Geschäftsverteilungsplan 2">Geschäftsverteilungsplan nach Kennzeichen</a>
+ <br /> Auswahl: Kennzeichen
+ <br /> Ansicht: Kennzeichen, Aufgabe(Produkt), Teilgebiet(Kurz-Info), Verantwortliche(r)
</td>
</tr>
</table>
--- a/fhiiqm/laser_flist.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/laser_flist.php Mon May 07 16:21:00 2012 +0200
@@ -53,7 +53,7 @@
$zeil = $_GET["z"];
if (!$zeil) $zeil = $_POST["z"];
- if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ if (!$zeil) $zeil = 20; // Anzahl der gezeigten Zeilen
$start = $_GET["st"];
if (!$start) $start=0;
@@ -106,7 +106,7 @@
if (!is_null($_SESSION["recht"]) && in_array("le",$_SESSION["recht"]))
echo ", '<img src='/fhiiqm/img/duplicate.gif' border='0' hight='11'>' - Duplizieren";
echo ", '<img src='/fhiiqm/img/script_edit.png' border='0' hight='11'>' - Log-Buch";
- echo " des Lasers</td></tr>\n";
+ echo " des Lasers, '<img src='/fhiiqm/img/file_extension_xls.png' border='0' hight='11'>' - Excel-Export</td></tr>\n";
echo "</table>\n";
$anz = $dbc -> querySingleItem("SELECT @anz");
@@ -205,6 +205,10 @@
// Links auf andere Seiten generieren
liste_links($start,$zeil,$anz,$liste);
+
+ // Export csv-Datei
+ echo " <span class='sc'><a href='/fhiiqm/laser_list_csv.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil'>
+ <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
}
else
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/laser_list_csv.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Export Laserliste als csv-File
+ *
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!$sort) $sort = 2;
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!$dir) $dir = '';
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!$fnum) $fnum = 1;
+ $filter = $_GET["b"]; // Filterbegriff
+ if (!$filter) $filter = '';
+ $start = $_GET["st"]; // Start-DS - 1
+ if (!$start) $start = 0;
+ $zeil = $_GET["z"]; // Anzahl zu zeigender DS
+ if (!$zeil) $zeil = 9999;
+ $sql = "CALL laser_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz,@anzpl);";
+// echo "sql = $sql<br />";
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $crlf = array("\r\n","\n\r","\r","\n"); // Zeilenumbrueche
+ $file ="Laser-ID;zu Laser-ID;Bezeichnung;Welle (nm);Art;Typ;Klasse;Schutzst.;Schutzst.-OD;Leistung;Energie;Apertur;Frequenz;Impulsbreite;in Betrieb;Abt.;Verantwortl.;Haus;Raum;Hersteller;Info\r\n";
+ foreach ($result as $row)
+ {
+ $file .= $row->las_ID . ";";
+ if ($row->las_ref_ID)
+ $file .= $row->las_ref_ID .": " . $row->ref_bez . ";";
+ else
+ $file .= ";";
+ $file .= "" . $row->las_bez . ";";
+ $file .= "" . str_replace(".",",",str_replace(".00","",$row->las_welle_von))." - ".str_replace(".",",",str_replace(".00","",$row->las_welle_bis)).";";
+ $file .= "" . $row->las_art_bez . ";";
+ $file .= "" . $row->las_typ_bez . ";";
+ $file .= "" . $row->las_klasse_bez . ";";
+ $file .= "" . $row->schutzst_bez . ";";
+ $file .= "" . $row->sst_od_bez . ";";
+ $file .= "" . $row->leistung . " " . $row->eleist . ";";
+ $file .= "" . $row->energie . " " . $row->eeng . ";";
+ $file .= "" . $row->apertur . " " . $row->eapt . ";";
+ $file .= "" . $row->frequenz . " " . $row->efrq . ";";
+ $file .= "" . $row->impulsbreite . " " . $row->eipb . ";";
+ $file .= ($row->aktiv) ? "ja;" : "nein;";
+ $file .= "" . $row->abt_name . ";";
+ $file .= "" . $row->vma . ";";
+ $file .= "" . $row->geb_ID . ";";
+ $file .= " ".$row->raum_nr . ";";
+ $file .= "" . $row->las_hersteller_bez . ";";
+ $file .= "" . str_replace($crlf,", ",$row->las_info);
+// $file .= "\n";
+ $file .= "\r\n";
+ }
+ //header ("Content-Type: application/force-download");
+ header( 'Content-Type: text/csv' );
+ header('Content-Disposition: attachment; filename="laser.csv"');
+ header("Content-Length: " . strlen($file));
+ echo $file;
+ }
+ else echo "kein Ergebnis!";
+
+
+?>
\ No newline at end of file
--- a/fhiiqm/ma_fkt_ed.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/ma_fkt_ed.php Mon May 07 16:21:00 2012 +0200
@@ -22,7 +22,36 @@
}
include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $fkt = $_POST["fkt"];
+ $fkt["fid"] = $fkt["func"]; // kein autocomplete bei Funktion
+ if (!$fkt["pid"]) $fkt["pid"] = $_GET["p"];
+ if (!$fkt["fid"]) $fkt["fid"] = $_GET["f"];
+ $mfid = $_GET[i];
+ $sub = $_POST["eintragen"];
+
+ $dup = $_POST["dup"];
+ if (!$dup) $dup = $_GET["d"];
+ $copy = $_GET["c"];
+
+ if ($dup)
+ { // Info duplizieren
+ $tab = "MA_Funktion";
+ $key = "mf_ID";
+ $val = $mfid;
+// $ret=1;
+ $ret = duplicate_record ($tab, $key, $val);
+ if ($ret)
+ {
+ $addr = $_SERVER["PHP_SELF"] . "?i=$ret&c=1";
+ header("Location: $addr");
+ exit;
+ }
+ else $duptext = " - Fehler beim Duplizieren von ". $fkt["persknr"] . " und " .$fkt["fkt_ID"];
+ }
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -95,19 +124,14 @@
</script>
<?php
- $fkt = $_POST["fkt"];
- $fkt["fid"] = $fkt["func"]; // kein autocomplete bei Funktion
- if (!$fkt["pid"]) $fkt["pid"] = $_GET["p"];
- if (!$fkt["fid"]) $fkt["fid"] = $_GET["f"];
- $mfid = $_GET[i];
- $sub = $_POST["eintragen"];
- echo "<h3>Zuordnung von Funktionen zu Mitarbeitern<h3>";
+ if ($copy) $duptext = " (Kopie)"; else $duptext = "";
+ echo "<h3>Zuordnung von Funktionen zu Mitarbeitern$duptext<h3>";
echo "</div>\n";
if ((!isset($fkt) && !$fkt) || !$fkt["pid"] || !$fkt["fid"] || !$sub)
{
- if ($fkt["pid"] && $fkt["fid"] && $mfid)
+ if (($fkt["pid"] && $fkt["fid"] && $mfid) || ($copy && $mfid))
{
$sql = "SELECT fkt_bereich, fkt_von, fkt_bis, fkt_bem, CONCAT(nachname,', ',vorname) AS vname, fkt_bez, ma.fkt_ID
FROM fhiiqm.MA_Funktion ma INNER JOIN
--- a/fhiiqm/ma_fkt_flist.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/ma_fkt_flist.php Mon May 07 16:21:00 2012 +0200
@@ -95,7 +95,8 @@
echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />'
können Sie nach relevanten Spalten auf- bzw. absteigend sortieren</td></tr>
<tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' ermöglicht das Filtern nach ausgewä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 Zuordnung Mitarbeiter - Funktion</td></tr>
+ <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Zuordnung,
+ '<img src='/fhiiqm/img/duplicate.gif' border='0' hight='11'>' - Duplizieren Mitarbeiter - Funktion</td></tr>
<tr><td class='bigger'>Das Klicken auf den Mitarbeiternamen löst das <em>Versenden einer E-Mail</em> an diesen aus.</td></tr>\n";
echo "</table>\n";
@@ -141,6 +142,7 @@
tab_column(6,"Beginn",$sort,$dir,0,$fnum,$filter,$start,$zeil);
tab_column(7,"Ende",$sort,$dir,0,$fnum,$filter,$start,$zeil);
echo "<th>Bemerkung</th>";
+ echo "<th> </th>";
echo "<th> </th></tr>\n";
foreach ($result as $row)
@@ -164,7 +166,8 @@
}
else echo "<td> </td>";
echo "<td>$row->fkt_bem</td>";
- echo "<td><a href='/fhiiqm/ma_fkt_ed.php?i=$row->mf_ID&p=$row->persknr&f=$row->fkt_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+ echo "<td><a href='/fhiiqm/ma_fkt_ed.php?i=$row->mf_ID&p=$row->persknr&f=$row->fkt_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
+ echo "<td><a href='/fhiiqm/ma_fkt_ed.php?i=$row->mf_ID&d=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td></tr>\n";
}
echo "</table></div>\n";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/raum_aptyp_ed.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,188 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * INSERT/UPDATE Raum - Arbeitsplatztyp
+ */
+
+ 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("rr",$_SESSION["recht"]) && !in_array("re",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sub = $_POST["eintragen"];
+ $ap = $_POST["ap"];
+ $ok = $_POST["ok"];
+ $apid = $_GET["i"]; // raum_ID
+
+
+
+?>
+<!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>Raum - Arbeitsplatztyp</title>
+
+ <script type="text/javascript">
+ <!--
+ var counter = 0;
+ var limit = 99;
+ var arr = new Array();
+ function addInput(divName){
+ if (counter == limit) {
+ alert("Das Limit von " + counter + " zusätzlichen inputs ist erreicht");
+ }
+ else {
+ var newdiv = document.createElement('div');
+ var count;
+ var opt="<option value='-1'></option>";
+ for (var key in arr)
+ {
+ opt = opt.concat("<option value='",key,"'>",key, " - ",arr[key],"</option>\n" );
+ }
+ opt += "</select>\n";
+ newdiv.innerHTML += "<select name='ap[aptyp][]'>"+opt;
+ document.getElementById(divName).appendChild(newdiv);
+ counter++;
+ }
+ }
+ function delInput(divId){
+ var kn = document.getElementById(divId);
+ while (kn.childNodes.length>0 && kn.lastChild.nodeName != "SELECT" && kn.lastChild.nodeName != "A")
+ {
+// alert ("vor "+kn.lastChild.nodeName+", nodetyp = "+ kn.lastChild.nodeType);
+ var knc = kn.lastChild;
+ document.getElementById(divId).removeChild(knc);
+ }
+ if (kn.lastChild.nodeName == "SELECT") document.getElementById(divId).removeChild(kn.lastChild);
+ }
+ //-->
+ </script>
+
+</head>
+
+<body>
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"><img src=\"img/house.png\" border=\"0\" alt=\"Raum - Arbeitsplatztyp bearbeiten\" title=\"Raum - Arbeitsplatztyp bearbeiten\"/></div>\n";
+
+ if ($apid) $text = "editieren"; else $text = "erfassen";
+ if ($copy) $duptext = " (Kopie)";
+ echo "<div align=\"center\">";
+ echo "<h3>Raum - Arbeitsplatztypen $text</h3>";
+ echo "</div>\n";
+ if (!$sub || !isset($ap) || !$ok)
+ {
+ if ($apid && !$sub && !isset($ap))
+ {
+ $sql = "SELECT geb_ID, a.raum_ID,a.arbplatz_typ
+ FROM Raum_Arbplatz_Typ a INNER JOIN Raum r ON a.raum_ID = r.raum_ID
+ WHERE a.raum_ID = $apid
+ ORDER BY a.arbplatz_typ";
+ if ($res = $dbc -> queryObjectArray($sql))
+ {
+ foreach ($res as $row)
+ {
+ $ap["geb"] = $row->geb_ID;
+ $ap["raum"] = $row->raum_ID;
+ $ap["aptyp"][] = $row->arbplatz_typ;
+ }
+ }
+ }
+
+ include ($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/form/raum_aptyp_form.inc.php");
+
+ if ($sub)
+ {
+ $frage = "Alle Angaben ok?";
+ 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("re",$_SESSION["recht"]))
+ {
+ echo "
+ <tr><td> </td>\n
+ <td><input class=\"button\" type=\"submit\" name=\"eintragen\" value=\" eintragen \" />";
+ echo "</td></tr>\n";
+ }
+ echo "</table>\n";
+ echo "</div>\n";
+ echo "<p class='sc'> <a href=\"raum_aptyp_flist.php\" target=\"_self\" title=\"Raum-Arbplatztyp-Liste\">« zur Raum-Arbplatztyp-Liste</a></p>\n";
+ echo "</form>\n";
+ }
+ else
+ {
+// print_r($ap); print("<br />");
+ echo "<div align='center'>\n";
+
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $stmt = $dbc -> stmtinit();
+ if (is_object($stmt))
+ {
+ $retd = 1;
+ if ($apid && is_array($ap['aptyp']))
+ { //UPDATE
+ // Loeschen alte Arbeitsplatztypen
+ $retd = $dbc -> execute("DELETE FROM Raum_Arbplatz_Typ WHERE raum_ID = ". $ap["raum"]);
+ }
+
+ if ($retd && is_array($ap['aptyp']))
+ {
+ $rett = 1;
+ $stmt -> prepare("INSERT INTO Raum_Arbplatz_Typ (raum_ID,arbplatz_typ) VALUES(?,?)");
+ for ($k=0; $k<count($ap["aptyp"]); $k++)
+ {
+ if ($ap["aptyp"][$k] && $ap["aptyp"][$k] != -1)
+ {
+ $stmt -> bind_param('is',$ap["raum"], $ap["aptyp"][$k]);
+ $rett = $stmt -> execute();
+ if (!$rett) $rett = false;
+ }
+ }
+ if (!$rett) echo "error INSERT Arbeitsplatz-Typ: $stmt->error<br />\n";
+
+ }
+ }
+ if ($rett)
+ {
+ echo "<p class='green'><b>Arbeitsplatztypen für Raum-ID '$apid' wurden erfolgreich gespeichert.</b></p>\n";
+ include ("inc/raum_aptyp_dat_show.inc.php");
+ }
+ else
+ echo "<p class='red'><b>Arbeitsplatztypen für Raum-ID '$apid'' wurden nicht oder nur teilweise gespeichert</b></p>\n";
+
+ echo "</div>";
+ echo "<p class='sc'> <a href=\"raum_aptyp_flist.php\" target=\"_self\" title=\"Raum-Arbplatztyp-Liste\">« zur Raum-Arbplatztyp-Liste</a></p>\n";
+ }
+?>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/raum_aptyp_flist.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,201 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Liste Raeume Arbeitsplatztyp
+ *
+ */
+
+ 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("rr",$_SESSION["recht"]) && !in_array("re",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen"/>
+ <link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print"/>
+
+ <title>Raum-Arbeitsplatztyp-Liste</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"><img src=\"img/house.png\" border=\"0\" alt=\"Raumdaten\" title=\"Raumdaten\"/></div>\n";
+
+ // Felder, nach denen gefiltert werden kann
+ $fields = array(2=>"Gebäude",3=>"Raum-Nr.",5=>"Arbeitsplatztyp",6=>"Arbeitsplatztyp-Bez.",7=>"Raum-Typ");
+
+ $zeil = $_GET["z"];
+ if (!$zeil) $zeil = $_POST["z"];
+ if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ $start = $_GET["st"];
+ if (!$start) $start=0;
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!isset($sort) && !$sort) $sort = $_POST["s"];
+
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!isset($dir) && !$dir) $dir = $_POST["d"];
+
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+ $filter = $_POST["filter"];
+ if (!isset($filter) && !$filter) $filter = $_GET["b"];
+
+ $subf = $_POST["subf"]; // submit
+
+ if (!isset($fnum) && !$fnum) $fnum = 1;
+ if (!isset($filter) && !$filter) $filter = "";
+ if (!isset($sort) && !$sort) $sort = 2;
+ if (!isset($dir) && !$dir) $dir = "";
+
+ include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ $dbc = new dbconnection();
+
+ $sql = "CALL raum_arbplatztyp_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);";
+ // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, (StartNr DS) -1, Anzahl Zeilen=DS, Anzahl gefundener Raeume
+ // liefert: raum_ID,geb_ID,raum_nr,raum_name,arbplatz_typ,arbplatz_typ_bez,raumtyp_ID,raumtyp_bez
+
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ echo "<div align='center'>\n";
+ echo "<p><b>Liste Räume - Arbeitsplatztypen</b></p>\n";
+
+ echo "<table border='0' cellspacing='0'>\n";
+ echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />'
+ können Sie nach 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öglicht das Filtern nach ausgewä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 Raum-Arbeitsplatztyp</td></tr>\n";
+ echo "</table>\n";
+
+ $ranz = $dbc -> querySingleItem("SELECT @anz");
+ printf ("<p>Es wurden %s Räume gefunden.</p>", $ranz);
+
+ if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+ {
+ // 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=\"40%\" 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> </p>\n";
+ }
+ echo "<table>\n";
+
+ if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+ // Listenkopf generieren
+ echo "<tr bgcolor='#68ACBF'>";
+ tab_column(2,"Haus",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+ tab_column(3,"Raum-Nr.",$sort,$dir,3,$fnum,$filter,$start,$zeil);
+ tab_column(4,"Bezeichnung",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(5,"Arbplatz-Typ",$sort,$dir,5,$fnum,$filter,$start,$zeil);
+ tab_column(6,"Arbplatz-Typ-Bez.",$sort,$dir,6,$fnum,$filter,$start,$zeil);
+ tab_column(7,"Raum-Typ",$sort,$dir,7,$fnum,$filter,$start,$zeil);
+ tab_column(8,"Raum-Typ_bez.",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ echo "<th> </th></tr>\n";
+
+// echo "<tr bgcolor='#68ACBF'><th>Raum-Nr.</th><th>Bezeichnung</th><th>Haus</th><th>Typ</th><th>Fläche (m<sup>2</sup>)</th><th>Raumplan</th><th> </th>
+// </tr>\n";
+ foreach ($result as $row)
+ {
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ echo "<tr bgcolor='" . $bg . "'>";
+ echo "<td>$row->geb_ID</td>";
+ echo "<td class='left'>$row->raum_nr</td>";
+ echo "<td>$row->raum_name</td>";
+ echo "<td>". str_replace("; ","<br />",$row->arbplatz_typ)."</td>";
+ echo "<td>". str_replace("; ","<br />",$row->arbplatz_typ_bez)."</td>";
+ echo "<td>$row->raumtyp_ID</td>";
+ echo "<td>$row->raumtyp_bez</td>";
+ echo "<td><a href='/fhiiqm/raum_aptyp_ed.php?i=$row->raum_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+ }
+ echo "</table></div>\n";
+
+ echo "<br /> ";
+
+ // Sortierung und Filter aus $_GET fuer weitere Seiten
+ foreach ($_GET as $key=>$val)
+ {
+ if ($key != "st") $liste .= "&" . $key ."=".$val;
+ }
+ // Sortierung und Filter aus $_POST fuer weitere Seiten
+ if ($subf)
+ foreach ($_POST as $key=>$val)
+ {
+ if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+ if ($key == "filter") $liste .= "&b=" . $val;
+ }
+
+ // Links auf andere Seiten generieren
+ liste_links($start,$zeil,$ranz,$liste);
+
+ // Export csv-Datei
+// echo " <span class='sc'><a href='/fhiiqm/raum_list_csv.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil'>
+// <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
+
+ }
+ else
+ {
+ if ($dbc -> error)
+ echo "error: " . $dbc -> error . "<br />\n";
+ else
+ {
+ echo "<p class='red'> Leider nichts gefunden für ". $fields["$fnum"] . " wie '$filter'!</p><br />";
+ echo " <a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Raumliste\">Raumliste</a></p>\n";
+ }
+
+ }
+ $dbc -> close();
+/*
+ if (!is_null($_SESSION["recht"]) && in_array("re",$_SESSION["recht"]))
+ echo "<p> <a href=\"raum_ins.php\" target=\"_self\" title=\"Raum erfassen\" class=\"sc\">Weiteren Raum erfassen</a></p>\n";
+*/
+?>
+</body>
+</html>
--- a/fhiiqm/raum_flist.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/raum_flist.php Mon May 07 16:21:00 2012 +0200
@@ -48,6 +48,7 @@
$fields = array(4=>"Gebäude",5=>"Raum-Typ",8=>"Reinigung-Typ");
$zeil = $_GET["z"];
+ if (!$zeil) $zeil = $_POST["z"];
if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
$start = $_GET["st"];
if (!$start) $start=0;
@@ -102,7 +103,8 @@
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 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öglicht das Filtern nach ausgewä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 Raumdaten</td></tr>\n";
+ <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Raumdaten,
+ '<img src='/fhiiqm/img/file_extension_xls.png' border='0' hight='11'>' - Excel-Export</td></tr>\n";
echo "</table>\n";
$ranz = $dbc -> querySingleItem("SELECT @anz");
@@ -112,13 +114,21 @@
{
// 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=\"40%\" 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> </p>\n";
@@ -196,6 +206,10 @@
// Links auf andere Seiten generieren
liste_links($start,$zeil,$ranz,$liste);
+ // Export csv-Datei
+ echo " <span class='sc'><a href='/fhiiqm/raum_list_csv.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil'>
+ <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
+
}
else
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/raum_list_csv.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Export der Raumdaten als csv-Datei
+ *
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!$sort) $sort = 2;
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!$dir) $dir = '';
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!$fnum) $fnum = 1;
+ $filter = $_GET["b"]; // Filterbegriff
+ if (!$filter) $filter = '';
+ $start = $_GET["st"]; // Start-DS - 1
+ if (!$start) $start = 0;
+ $zeil = $_GET["z"]; // Anzahl zu zeigender DS
+ if (!$zeil) $zeil = 9999;
+
+ $sql = "CALL raum_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);";
+
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $crlf = array("\r\n","\n\r","\r","\n"); // Zeilenumbrueche
+ $file ="Raum-ID;Raum-Nr.;Raum-Bez.;Haus;Raum-Typ;Reinig.-Typ;R.-Typ-ID;Reinig.-Kat.;Reinig.-Turn.;R.-Turn.-ID;Boden-Typ;Reinig.-Fl.(m²);Fläche(m²);\r\n";
+
+ foreach ($result as $row)
+ {
+ $file .= $row->raum_ID . ";";
+ $file .= " ".$row->raum_nr . ";";
+ $file .= $row->raum_name . ";";
+ $file .= $row->geb_ID . ";";
+ $file .= $row->raumtyp_bez . ";";
+ $file .= $row->reinigung_typ_bez . ";";
+ $file .= $row->reinigung_typ_ID . ";";
+ $file .= $row->reinigung_kat. ";";
+ $file .= $row->reinigung_turnus_bez. ";";
+ $file .= str_replace(".",",",$row->reinigung_turnus_ID). ";";
+ $file .= $row->boden_typ_bez. ";";
+ $file .= number_format($row->reinigung_flaeche,2,",","."). ";";
+ $file .= number_format($row->raum_flaeche,2,",","."). ";";
+ $file .= "\r\n";
+ }
+ header( 'Content-Type: text/csv' );
+ header('Content-Disposition: attachment; filename="raum.csv"');
+ header("Content-Length: " . strlen($file));
+ echo $file;
+ }
+ else echo "kein Ergebnis!";
+?>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/raum_report.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2012
+ *
+ * Reportauswahl Raeume - Arbeitssicherheit
+ *
+ */
+
+
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ session_start();
+ if (! isset($_SESSION["userid"]))
+ {
+ include_once ("inc/func_lib.inc.php");
+ login("raum_report.php");
+ exit;
+ }
+
+ if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" />
+ <link href="css/navio.css" rel="STYLESHEET" type="TEXT/CSS" />
+ <meta name="author" content="Bettina Schwarzer,FHI" />
+
+ <title>Reports Raeume-Arbeitssicherheit</title>
+</head>
+
+<body>
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r sc\"><img src=\"/fhiiqm/img/role.png\" border=\"0\" alt=\"Berichte Raeume\" title=\"Berichte Raeume\"/></div>\n";
+?>
+ <h3> Berichte Räume - Arbeitssicherheit</h3>
+ <div align="center">
+ <table width="94%" cellspacing="4" cellpadding="4">
+ <tr>
+ <td class="bigger">
+ <a href="/fhiiqm/report/gefahr_ap_report.php" title="Gefahren Arbeitsplatz">Gefahren am Arbeitsplatz</a>
+ <br /> Auswahl: Haus, Raum, Arbeitsplatz-Typ, Gefahr
+ <br /> Ansicht: Haus, Raum-Nr. Raum-Bezeichnung, Arbeitsplatz-Typ, Gefahr
+ </td>
+ </tr>
+ </table>
+ </div>
+
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/recht_ed.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/recht_ed.php Mon May 07 16:21:00 2012 +0200
@@ -146,12 +146,26 @@
}
else
{
- // alte Rechte loeschen
- $sql = "DELETE FROM fhiiqm.user_recht WHERE userid ='" . $rt["userid"] . "'";
- $resr = $dbc -> execute($sql);
- $sql = "DELETE FROM fhiiqm.user_prodgroup WHERE userid ='" . $rt["userid"] . "'";
- $resp = $dbc -> execute($sql);
- if (!$resr || !$resp) $erruid = 1;
+ $sql = "SELECT userid FROM fhiiqm.userweb WHERE persknr = $pget";
+ if ($userid = $dbc->querySingleItem($sql))
+ {
+ $resu=1; $resr=1; $resp=1;
+ if ($userid != $rt["userid"])
+ {
+ // alte userid und Rechte dazu loeschen -> CASCADE DELETE
+ $resu = $dbc -> execute("DELETE FROM fhiiqm.userweb WHERE userid ='" . $userid . "'");
+ }
+ else
+ {
+ // alte Rechte loeschen
+ $sql = "DELETE FROM fhiiqm.user_recht WHERE userid ='" . $userid . "'";
+ $resr = $dbc -> execute($sql);
+ $sql = "DELETE FROM fhiiqm.user_prodgroup WHERE userid ='" . $userid . "'";
+ $resp = $dbc -> execute($sql);
+ }
+ }
+ if (!$resu || !$resr || !$resp) $erruid = 1;
+
}
if ($del)
{
@@ -170,7 +184,7 @@
if (is_object($stmt))
{
$result = 1;
- if ($ins == "eingeben")
+ if ($ins == "eingeben" || $userid != $rt["userid"])
{
$stmt -> prepare("INSERT INTO fhiiqm.userweb (persknr, userid) VALUES (?,?)");
$stmt -> bind_param('is',$rt["pid"],$rt["userid"]);
@@ -189,13 +203,12 @@
$stmt -> bind_param('ss',$rt["userid"],$re);
$resr = $stmt -> execute();
}
+ if ($stmt->error) echo "error user_recht: " . $stmt->errno." -> ".$stmt->error . "<br><br>\n";
$stmt -> reset();
}
- if ($stmt->error) echo "error user_recht: " . $stmt->errno." -> ".$stmt->error . "<br><br>\n";
$resp = 1;
if (is_array($rt["prodg"]) && !is_null($rt["prodg"]))
{
- echo "userid = " . $rt["userid"] . "<br />";
$stmt -> prepare("INSERT INTO fhiiqm.user_prodgroup (userid,prod_group_ID) VALUES (?,?)");
foreach ($rt["prodg"] as $re)
{
@@ -208,10 +221,13 @@
}
// $stmt -> close();
}
- if ($result && $resr && $resp)
+ if ($result && $resu && $resr && $resp)
echo "<p class='green'><b>User-ID '".$rt["userid"]."' und zugeordete Rechte wurden erfolgreich gespeichert.</b></p>\n";
else
+ {
echo "<p class='red'><b>Speichern von User-ID '".$rt["userid"]."' und zugeordeter Rechte war nicht erfolgreich.</b></p>\n";
+ echo "result = $result, resu=$res, resr=$resr, resp=$resp<br />";
+ }
}
$dbc -> close();
echo "</div>\n";
--- a/fhiiqm/recht_list.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/recht_list.php Mon May 07 16:21:00 2012 +0200
@@ -84,6 +84,8 @@
$sql = "SELECT userid,
count(CASE recht_ID WHEN 'ar' THEN 1 END) AS anlage_read,
COUNT(CASE recht_ID WHEN 'ae' THEN 1 END) AS anlage_edit,
+ COUNT(CASE recht_ID WHEN 'asr' THEN 1 END) AS as_read,
+ COUNT(CASE recht_ID WHEN 'ase' THEN 1 END) AS as_edit,
COUNT(CASE recht_ID WHEN 'fmr' THEN 1 END) AS funkt_ma_read,
COUNT(CASE recht_ID WHEN 'fme' THEN 1 END) AS funkt_ma_edit,
COUNT(CASE recht_ID WHEN 'ir' THEN 1 END) AS info_read,
@@ -118,6 +120,7 @@
echo "<tr bgcolor='#68ACBF'>";
echo "<th> </th>
<th colspan='2'>Anlage</th>
+ <th colspan='2'>Arb.Sichh.</th>
<th colspan='2'>Funkt.-MA</th>
<th colspan='2'>Info</th>
<th colspan='2'>Laser</th>
@@ -138,6 +141,7 @@
<th>read</th><th>edit</th>
<th>read</th><th>edit</th>
<th>read</th><th>edit</th>
+ <th>read</th><th>edit</th>
</tr>\n";
foreach ($result as $row)
{
@@ -145,6 +149,8 @@
echo "<tr bgcolor='" . $bg . "'><td><b>$row->userid</b><img src=\"/fhiiqm/img/transp.png\" width=\"2\" height=\"12\" border='0'/></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_read)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->as_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->as_edit)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_read)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_edit)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->info_read)) ."</b></td>";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/report/gefahr_ap_report.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,220 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011, 05/2012
+ *
+ * Arbeitsicherheit
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ session_start();
+ if (! isset($_SESSION["userid"]))
+ {
+ include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+ login($_SERVER["PHP_SELF"]);
+ exit;
+ }
+
+ if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"])))
+ {
+ 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>Arbeitssicherheit</title>
+</head>
+
+<body>
+
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"><img src=\"/fhiiqm/img/role.png\" border=\"0\" alt=\"Raum-Gefahr\" title=\"Raum-Gefahr\"/></div>\n";
+
+ $rag = $_POST["rag"]; // Parameter aus Form
+ $search = $_POST["search"];
+ if (!$search) $search = $_GET["s"];
+
+ $zeil = $rag["z"];
+ if (!$zeil) $zeil = $_GET["z"];
+ if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ $start = $_GET["st"]; // Start bei DS $start+1
+ if (!$start) $start=0;
+
+
+ if (!is_array($rag))
+ {
+ $rag["geb"] = $_GET["g"];
+ $rag["rnum"] = $_GET["r"];
+ $rag["aptyp"] = $_GET["a"];
+ $rag["gef"] = $_GET["f"];
+ $rag["bind"] = $_GET["b"];
+ $rag["sort1"] = $_GET["s1"];
+ $rag["sort2"] = $_GET["s2"];
+ $rag["sort3"] = $_GET["s3"];
+ $rag["sort4"] = $_GET["s4"];
+ }
+ $_GET["g"] = $rag["geb"];
+ $_GET["r"] = $rag["rnum"];
+ $_GET["a"] = $rag["aptyp"];
+ $_GET["f"] = $rag["gef"];
+ $_GET["b"] = $rag["bind"];
+ $_GET["s1"] = $rag["sort1"];
+ $_GET["s2"] = $rag["sort2"];
+ $_GET["s3"] = $rag["sort3"];
+ $_GET["s4"] = $rag["sort4"];
+ $_GET["z"] = $zeil;
+
+ echo "<div align='center'>\n";
+ echo "<p><b>Bericht Gefahren am Arbeitsplatz</b></p>\n";
+ echo "</div>\n";
+
+ if (!$search)
+ {
+ include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/form/gefahr_ap_search_form.inc.php");
+ }
+ else
+ {
+ echo "<div align='center'>\n";
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sql = "SELECT geb_ID, raum_nr, raum_name, r.raumtyp_ID, raumtyp_bez, ra.arbplatz_typ, arbplatz_typ_bez, a.gefahr_ID, gefahr_bez, r.raum_ID
+ FROM Raum r LEFT OUTER JOIN Raum_Typ rt ON r.raumtyp_ID = rt.raumtyp_ID
+ LEFT OUTER JOIN Raum_Arbplatz_Typ ra ON ra.raum_ID = r.raum_ID
+ LEFT OUTER JOIN Arbplatz_Typ at ON ra.arbplatz_typ = at.arbplatz_typ
+ LEFT OUTER JOIN Gefahr_Arbplatz a ON a.arbplatz_typ = at.arbplatz_typ
+ LEFT OUTER JOIN Gefahr g ON a.gefahr_ID = g.gefahr_ID";
+ $lim = " LIMIT $start,$zeil";
+
+ if (!$rag["bind"]) $bind = " AND "; else $bind = $rag["bind"];
+
+ if ($rag["geb"]> -1) $where = " geb_ID = '$rag[geb]' ";
+ if ($rag["rnum"]> -1)
+ if ($where) $where .= "$bind r.raum_ID = '$rag[rnum]' "; else $where = " r.raum_ID = '$rag[rnum]' ";
+ if ($rag["aptyp"]> -1)
+ if ($where) $where .= "$bind ra.arbplatz_typ = '$rag[aptyp]' "; else $where = " ra.arbplatz_typ = '$rag[aptyp]' ";
+ if ($rag["gef"]> -1)
+ if ($where) $where .= "$bind a.gefahr_ID = '$rag[gef]' "; else $where = " a.gefahr_ID = '$rag[gef]' ";
+ if ($where) $where = " WHERE $where";
+
+ if ($rag["sort1"]>0 || $rag["sort2"]>0 || $rag["sort3"]>0 || $rag["sort4"]>0)
+ {
+ if ($rag["sort1"]>0) $ord = " ORDER BY " . $rag["sort1"];
+ if ($rag["sort2"]>0) $ord .= ",".$rag["sort2"];
+ if ($rag["sort3"]>0) $ord .= ",".$rag["sort3"];
+ if ($rag["sort4"]>0) $ord .= ",".$rag["sort4"];
+ }
+
+ $sql .= $where . $ord . $lim;
+// echo "sql = $sql<br />\n";
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($rag["geb"] > -1) $krit = " [Gebäude = '" . $rag["geb"] ."']";
+ if ($rag["rnum"] > -1)
+ {
+ if ($krit) $bd = " ".$bind; else $bd = "";
+ $krit .= $bd." [Raum-Nr. = '" . $rag["rnum"] ."']";
+ }
+ if ($rag["aptyp"] > -1)
+ {
+ if ($krit) $bd = " ".$bind; else $bd = "";
+ $krit .= $bd." [Arb.Platz-Typ = '" . $rag["aptyp"] ."']";
+ }
+ if ($rag["gef"] > -1)
+ {
+ if ($krit) $bd = " ".$bind; else $bd = "";
+ $krit .= $bd." [Gefahr = '" . $rag["gef"] ."']";
+ }
+ if ($krit )echo "Suchergebnis für $krit"; else echo "Suchergebnis";
+
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ $sqlc = "SELECT COUNT(*)
+ FROM Raum r LEFT OUTER JOIN Raum_Typ rt ON r.raumtyp_ID = rt.raumtyp_ID
+ LEFT OUTER JOIN Raum_Arbplatz_Typ ra ON ra.raum_ID = r.raum_ID
+ LEFT OUTER JOIN Arbplatz_Typ at ON ra.arbplatz_typ = at.arbplatz_typ
+ LEFT OUTER JOIN Gefahr_Arbplatz a ON a.arbplatz_typ = at.arbplatz_typ $where";
+ $ianz = $dbc -> querySingleItem($sqlc);
+
+ //$ianz = $dbc -> numrows($sql); //liefert nur $zeil!
+ printf ("<p>Anzahl gefundener Datensätze: %s</p>", $ianz);
+
+ echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
+ // Listenkopf
+ echo "<tr bgcolor='#68ACBF'>";
+ echo "<th>Gebäude</th>";
+ echo "<th>Raum-Nr.</th>";
+ echo "<th>Raum-Bez.</th>";
+ echo "<th>Arb.-Platz-Typ</th>";
+ echo "<th>Gefahr</th></tr>";
+
+
+ foreach ($result as $row)
+ {
+ if ($rid != $row->raum_ID)
+ {
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ echo "<tr bgcolor='" . $bg . "'>";
+ echo "<td>$row->geb_ID</td>";
+ echo "<td>$row->raum_nr</td>";
+ echo "<td>$row->raum_name</td>";
+ echo "<td>$row->arbplatz_typ - $row->arbplatz_typ_bez</td>";
+ }
+ else
+ {
+ echo "<tr bgcolor='" . $bg . "'>";
+ echo "<td> </td><td> </td><td> </td><td> </td>";
+ }
+ echo "<td>$row->gefahr_ID - $row->gefahr_bez</td></tr>\n";
+ $rid = $row->raum_ID;
+ }
+ echo "</table>\n";
+
+ echo "<p></p><table width=60%><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>";
+
+ echo "</div>\n";
+
+ echo "<br /> ";
+ // Parameter aus $_GET fuer weitere Seiten
+ $_GET["s"] = 1; // bewirkt weitere Suche
+ foreach ($_GET as $key=>$val)
+ {
+ if ($key != "st") $liste .= "&" . $key ."=".$val;
+ }
+ // Links auf andere Seiten generieren
+ liste_links($start,$zeil,$ianz,$liste);
+ }
+ else
+ {
+ echo "<p class='red'> Leider gibt es kein Ergebnis für die von Ihnen gewählten Kriterien!</p>";
+ echo "</div>\n";
+ }
+ echo "<br /><br /> <a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Gefahren\" class=\"sc\">neuer Bericht Arbeitsplatz-Gefahr</a></p>\n";
+ }
+
+?>
+
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/report/info_report_gvp.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/report/info_report_gvp.php Mon May 07 16:21:00 2012 +0200
@@ -4,7 +4,7 @@
* @author Bettina Schwarzer, Fritz-Haber-Institut
* @copyright 02/2012
*
- * Report Info
+ * Report Info (GVP)
*
*/
@@ -200,9 +200,9 @@
// Listenkopf
echo "<tr bgcolor='#68ACBF'>";
echo "<th width='5%'>Kennzeichen</th>";
- echo "<th width='10%'>Produktgruppe</th>";
+// echo "<th width='10%'>Produktgruppe</th>";
echo "<th width='25%'>Aufgabe (prod)</th>";
- echo "<th width='25%'>Teilgebiet (info)</th>";
+ echo "<th width='35%'>Teilgebiet (kurzinfo)</th>";
echo "<th>Zuständigkeit</th>";
$bg1 = "#F8F8F8";
$bg2 = "#DEDFE1";
@@ -221,9 +221,10 @@
if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
echo "<tr bgcolor='" . $bg . "'>";
echo "<td>$row->infsort</td>";
- echo "<td>$pgb</td>";
+// echo "<td>$pgb</td>";
echo "<td>$prod</td>";
- echo "<td>$row->iname</td>";
+// echo "<td>$row->iname</td>";
+ echo "<td>".nl2br($row->ilong)."</td>";
echo "<td>".str_replace(";","<br />",$row->verantw)."</td></tr>\n";
$pgv = $pg;
}
@@ -278,7 +279,7 @@
echo "<th width='5%'>Kennzeichen</th>";
// echo "<th>Infotyp</th>";
echo "<th width='30%'>Aufgabe (prod)</th>";
- echo "<th width='30%'>Teilgebiet (info)</th>";
+ echo "<th width='30%'>Teilgebiet (kurzinfo)</th>";
// echo "<th width='40%'>Kurzinfo</th>";
echo "<th>Zuständigkeit</th>";
$bg1 = "#F8F8F8";
@@ -291,8 +292,8 @@
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>$row->iname</td>";
+ echo "<td>".nl2br($row->ilong)."</td>";
echo "<td>".str_replace(";","<br />",$row->verantw)."</td></tr>\n";
$vprodid = $row->prodid;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/autocomplete_multi_select.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,133 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Test multiple select autocomplete
+ * liefert Begriff und ids als ;-separierte Strings
+ *
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ $dbc = new dbconnection();
+
+
+ $sub = $_POST['eintragen'];
+ $pz = $_POST['pz'];
+
+
+?>
+ <!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"/>
+ <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>autocomplete multiple select</title>
+ </head>
+
+ <body>
+ <script>
+ function split( val ) {
+ return val.split( /;\s*/ );
+ }
+ function extractLast( term ) {
+ return split( term ).pop();
+ }
+ var ids = new Array;
+ $(document).ready(function() {
+ $("#pers").focus();
+ $("#pers")
+ .bind( "keydown", function( event ) {
+ if ( event.keyCode === $.ui.keyCode.TAB &&
+ $( this ).data( "autocomplete" ).menu.active ) {
+ event.preventDefault();
+ alert (event.keyCode);
+ }
+ })
+ .autocomplete({
+// source: "/fhiiqm/inc/ma_list_ac.inc.php",
+// minLength: 2,
+// select: function(event,ui){$("#pid").val(ui.item.id);}
+ source: function( request, response ) {
+// $.getJSON( "/fhiiqm/inc/ma_list_ac.inc.php", {
+ $.getJSON( "/fhiiqm/test/ma_list_autocomp.php", {
+ term: extractLast( request.term )
+ }, response );
+ },
+ focus: function() {
+ // prevent value inserted on focus
+ return false;
+ },
+ select: function( event, ui ) {
+ var terms = split( this.value );
+// alert ("eingabe: "+terms+ ", ids="+ids.toString());
+ // remove the current input
+ terms.pop();
+ // add the selected item
+ terms.push( ui.item.value );
+ ids.push(ui.item.id);
+ $("#pid").val(ids.join(";"));
+ // add placeholder to get the comma-and-space at the end
+ terms.push( "" );
+// alert ("select: "+terms+ "ids = "+$("#pid").val());
+ this.value = terms.join( "; " );
+ return false;
+ },
+ search: function() {
+ // custom minLength
+ var term = extractLast( this.value );
+ if ( term.length < 2 ) {
+ return false;
+ }
+ }
+ });
+ });
+ </script>
+<?php
+ if (!$sub)
+ {
+?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form_info" target="_self">
+ <div align="center">
+ <p>Auswahl mehrerer Verantwortlicher in einem Eingabefeld</p>
+ <table width="60%" border="0" cellspacing="3" cellpadding="3">
+ <tr>
+ <td>Verantwortliche(r)</td>
+ <td><textarea cols="60" rows="5" name="pz[pers]" id="pers" ><?php echo $pz['pers']; ?></textarea>
+ <br />Eingabe von mind. 2 Zeichen -> Namensliste, Wiederholung für weitere Namen
+ </td>
+ </tr>
+ <input type="hidden" name="pz[persknr]" id="pid" value="<?php echo $pz['persknr']; // Verantwortlicher?>"/>
+
+<?php
+ echo "
+ <tr><td> </td>\n
+ <td><input class=\"button\" type=\"submit\" name=\"eintragen\" value=\" eintragen \" />";
+ echo "<table\n";
+ echo "</div>\n";
+ echo "<form>\n";
+ }
+ else
+ {
+ echo "<p> ausgewählte Mitarbeiter:</p>";
+ $pers = explode("; ",$pz["pers"]);
+ $pnr = explode (";",$pz["persknr"]);
+ for ($i=0; $i < count($pers)-1;$i++)
+ {
+ echo " " . $pnr[$i]. " - " . $pers[$i] . "<br />\n";
+ }
+// echo "<p> Mitarbeiter:<br /> " . str_replace("; ","<br /> ",$pz["pers"]) .
+// "<br /> persknr:<br /> " . str_replace(";","<br /> ",$pz["persknr"]) . "</p>";
+ }
+
+?>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/download_file.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,66 @@
+<?php
+
+//$file = "6_licht.jpg";
+//chmod($file,0444); // Nutzer www-data nicht gestattet, da von root in 'fhiiqm/test' erstellt!
+$file = $_SERVER["DOCUMENT_ROOT"] ."/fhiiqm/alprot/6_licht.JPG";
+header ("Content-Type: application/force-download");
+//header ("Content-Type: application/jpg");
+//header('Content-Transfer-Encoding: binary');
+header ('Content-Disposition: attachment; filename="licht.jpg"');
+header("Content-Length: " . filesize($file));
+readfile($file);
+//$fp = fopen("$file", "rb"); // geht genau so
+//fpassthru($fp);
+exit;
+
+function downloadFile( $fullPath ){
+
+ // Must be fresh start
+ if( headers_sent() )
+ die('Headers Sent');
+
+ // Required for some browsers
+ if(ini_get('zlib.output_compression'))
+ ini_set('zlib.output_compression', 'Off');
+
+ // File Exists?
+ if( file_exists($fullPath) ){
+
+ // Parse Info / Get Extension
+ $fsize = filesize($fullPath);
+ $path_parts = pathinfo($fullPath);
+ $ext = strtolower($path_parts["extension"]);
+
+ // Determine Content Type
+ switch ($ext) {
+ case "pdf": $ctype="application/pdf"; break;
+ case "exe": $ctype="application/octet-stream"; break;
+ case "zip": $ctype="application/zip"; break;
+ case "doc": $ctype="application/msword"; break;
+ case "xls": $ctype="application/vnd.ms-excel"; break;
+ case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
+ case "gif": $ctype="image/gif"; break;
+ case "png": $ctype="image/png"; break;
+ case "jpeg":
+ case "jpg": $ctype="image/jpg"; break;
+ default: $ctype="application/force-download";
+ }
+
+ header("Pragma: public"); // required
+ header("Expires: 0");
+ header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+ header("Cache-Control: private",false); // required for certain browsers
+ header("Content-Type: $ctype");
+ header("Content-Disposition: attachment; filename=\"".basename($fullPath)."\";" );
+ header("Content-Transfer-Encoding: binary");
+ header("Content-Length: ".$fsize);
+ ob_clean();
+ flush();
+ readfile( $fullPath );
+
+ } else
+ die('File Not Found');
+
+}
+//downloadFile("6_licht.jpg");
+?>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/file_dialog.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Dialogbox File-Auswahl
+ *
+ */
+
+$sub = $_POST["submit"];
+$fn = $_POST["fn"];
+if ($sub) echo "fn = $fn<br />";
+else
+{
+?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" />
+ <link href="/fhiiqm/css/navio.css" rel="STYLESHEET" type="TEXT/CSS" />
+ <meta name="author" content="Bettina Schwarzer,FHI" />
+
+ <title>Test File Dialog</title>
+ </head>
+
+ <body>
+ <p> Bitte Datei wählen:</p>
+ <form action="<?php $_SERVER["PHP_SELF"] ?>" method="post">
+ <p>
+ <input type="file" name="fn" />
+ <input type="submit" name="submit" value=" submit " class="button"/></p>
+ </form>
+
+<?php
+}
+?>
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/ma_list_autocomp.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Autocomplete Mitarbeitersuche
+ */
+
+ header('Content-type: text/html; charset="iso-8859-1',true); //wg. jquery ui autocomplete
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ $q = strtolower(utf8_decode($_GET["term"])); // wird in jquery in 'term' uebergeben
+// echo "q = $q<br />";
+
+ $abt = $_GET["s"]; // Sortierung zuerst nach Abteilung (laser)
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ $dbc = new dbconnection();
+ // label = angezeigter ListenWert, val = Wert im Eingabefeld nach Klick
+/* $sql = "SELECT CONCAT (nachname, ', ',vorname, ' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as label,
+ CONCAT (nachname, ', ',vorname, ' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as val,persknr as id
+ FROM fhiiqm.Mitarbeiter
+ WHERE nachname LIKE '%".$q."%' COLLATE latin1_general_ci
+ ORDER BY 1";
+*/
+ if (isset($abt) && $abt == "a") $ord = "abt_ID, "; else $ord = "";
+ $sql = "SELECT CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''),' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as label,
+ CONCAT (nachname, ', ',vorname, ', ' , IFNULL(abt_name,''), ' (',CASE aktiv WHEN 1 THEN 'aktiv' ELSE 'inaktiv' END, ')') as val,persknr as id
+ FROM fhiiqm.Mitarbeiter m LEFT OUTER JOIN fhiiqm.Abteilung a ON m.abt_tel=a.abt_ID
+ WHERE nachname LIKE '%".$q."%' COLLATE latin1_general_ci
+ ORDER BY ". $ord ."1";
+// echo "sql = $sql<br />";
+ $result = $dbc ->queryObjectArray($sql);
+ if ($result)
+ {
+ foreach ($result as $row)
+ {
+ $clist[] = "{\"label\": \"" . $row->label . "\",\"value\": \"" . $row->val . "\",\"id\": " . $row->id . "}";
+ }
+ echo "[" . implode(", ", $clist) . "]"; // Format, das jquery source erwartet
+ }
+ $dbc -> close();
+?>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/test/vertrag_list_csv.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Export Vertragsliste als csv-File
+ *
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!$sort) $sort = 2;
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!$dir) $dir = '';
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!$fnum) $fnum = 1;
+ $filter = $_GET["b"]; // Filterbegriff
+ if (!$filter) $filter = '';
+ $start = $_GET["st"]; // Start-DS - 1
+ if (!$start) $start = 0;
+ $zeil = $_GET["z"]; // Anzahl zu zeigender DS
+ if (!$zeil) $zeil = 9999;
+ $listg = $_GET["l"]; // Recht fuer ausgewaehlte Produktgruppen
+ if (!$listg) $listg = '';
+
+ $sql = "CALL fhiiqm.vertrag_flist2(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "',$start,$zeil, @anz, @ganz)";
+
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $crlf = array("\r\n","\n\r","\r","\n"); // Zeilenumbrueche
+ $file ="Vertrag-ID;Bezeichnung;Beschreibung;Typ;zu Produkt;Partner;Bearbeiter;Beginn;Ende;Verlängerung;Künd.Frist(mon);Bemerkung;E-Mail?;Jahr;Kosten\r\n";
+ $cid=0;
+
+ foreach ($result as $row)
+ {
+ $file .= $row->contract_ID . ";";
+ if ($row->contract_ID != $cid)
+ { // Anzeigen der nur einmal relevanten Daten
+ $file .= $row->cname . ";";
+ $file .= str_replace($crlf,", ",$row->clong) . ";";
+ $file .= $row->typ . ";";
+ $file .= str_replace(";",":",$row->prod) . ";";
+ $file .= $row->partfirma . ";";
+ $file .= str_replace(";",":",$row->bearb) . ";";
+ if ($row->cbegin)
+ {
+ $cb = new DateTime($row->cbegin);
+ $file .= $cb->format('d.m.Y').";";
+ }
+ else $file .= ";";
+ if ($row->cend)
+ {
+ $cb = new DateTime($row->cend);
+ $file .= $cb->format('d.m.Y').";";
+ }
+ else $file .= ";";
+ if ($row->cautoend) $file .= "automatisch;"; else $file .= ";";
+ $file .= $row->kmon . ";";
+ $file .= str_replace(";",":",str_replace($crlf,", ",$row->bem)) . ";";
+ if ($row->email) $file .= "ja;"; else $file .= ";";
+ }
+ if ($row->kosten)
+ {
+ if ($cid == $row->contract_ID) $file .= ";;;;;;;;;;;;";
+ $file .= $row->kyear .";";
+ $file .= number_format($row->kosten,2,",",".") . ";";
+ }
+ $file .= "\r\n";
+ $cid = $row->contract_ID;
+ }
+ header( 'Content-Type: text/csv' );
+ header('Content-Disposition: attachment; filename="vertrag.csv"');
+ header("Content-Length: " . strlen($file));
+ echo $file;
+ }
+ else echo "kein Ergebnis!";
+?>
\ No newline at end of file
--- a/fhiiqm/user_recht_list.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/user_recht_list.php Mon May 07 16:21:00 2012 +0200
@@ -50,8 +50,10 @@
if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
$sql = "SELECT userid,
- count(CASE recht_ID WHEN 'ar' THEN 1 END) AS anlage_read,
+ COUNT(CASE recht_ID WHEN 'ar' THEN 1 END) AS anlage_read,
COUNT(CASE recht_ID WHEN 'ae' THEN 1 END) AS anlage_edit,
+ COUNT(CASE recht_ID WHEN 'asr' THEN 1 END) AS as_read,
+ COUNT(CASE recht_ID WHEN 'ase' THEN 1 END) AS as_edit,
COUNT(CASE recht_ID WHEN 'fmr' THEN 1 END) AS funkt_ma_read,
COUNT(CASE recht_ID WHEN 'fme' THEN 1 END) AS funkt_ma_edit,
COUNT(CASE recht_ID WHEN 'ir' THEN 1 END) AS info_read,
@@ -84,6 +86,7 @@
// Listenkopf
echo "<tr bgcolor='#68ACBF'>";
echo "<th>userid</th><th>Anlage read</th><th>Anlage edit</th>
+ <th>Arb.Sichh. read</th><th>Arb.Sichh. edit</th>
<th>FktMa read</th><th>FktMa edit</th>
<th>Info read</th><th>Info edit</th>
<th>Laser read</th><th>Laser edit</th>
@@ -99,6 +102,8 @@
echo "<tr bgcolor='" . $bg . "'><td><b>$row->userid</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_read)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->as_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->as_edit)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_read)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_edit)) ."</b></td>";
echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->info_read)) ."</b></td>";
--- a/fhiiqm/vertrag_flist1.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/vertrag_flist1.php Mon May 07 16:21:00 2012 +0200
@@ -53,7 +53,8 @@
echo "<div class=\"float-r\"> <img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Verträge\" title=\"Verträge\"/></div>\n";
$zeil = $_GET["z"];
- if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ if (!$zeil) $zeil = $_POST["z"];
+ if (!$zeil) $zeil = 20; // Anzahl der gezeigten Zeilen
$start = $_GET["st"]; // Start bei DS $start+1
if (!$start) $start=0;
@@ -114,11 +115,12 @@
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 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öglicht das Filtern nach ausgewä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 Vertragsdaten</td></tr>\n";
+ <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' hight='11'>' - Bearbeiten der Vertragsdaten,
+ '<img src='/fhiiqm/img/file_extension_xls.png' border='0' hight='11'>' - Excel-Export</td></tr>\n";
echo "</table>\n";
printf ("<p>Anzahl Verträge: %s </p>", $vanz);
echo "</div>\n";
- echo "<p> <a href=\"/fhiiqm/vertrag_flist2.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
+ echo "<p> <a href=\"/fhiiqm/vertrag_flist12.php?s=$sort&d=$dir&f=$fnum&b=$filter&l=$listg&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
echo "<div align='center'>\n";
@@ -126,11 +128,12 @@
{
// 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=\"40%\" 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\"";
if ($fnum == 6)
@@ -144,6 +147,13 @@
}
}
echo "/></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> </p>\n";
@@ -207,6 +217,10 @@
// Links auf andere Seiten generieren
liste_links($start,$zeil,$vanz,$liste);
+
+ // Export csv-Datei
+ echo " <span class='sc'><a href='/fhiiqm/vertrag_list12_csv.php?s=$sort&d=$dir&f=$fnum&b=$filter&l=$listg&st=$start&z=$zeil'>
+ <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
}
else
{
@@ -217,7 +231,7 @@
$dbc -> close();
- echo "<p> <a href=\"/fhiiqm/vertrag_flist2.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
+ echo "<p> <a href=\"/fhiiqm/vertrag_flist12.php?s=$sort&d=$dir&f=$fnum&b=$filter&l=$listg&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
echo "<p> <a href=\"/fhiiqm/vertrag_ins.php\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/vertrag_flist12.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,196 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Liste Vertragsdaten mit Sortierung
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ session_start();
+ if (! isset($_SESSION["userid"]))
+ {
+ include_once ("inc/func_lib.inc.php");
+ login("vertrag_flist2.php");
+ exit;
+ }
+
+ if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen "/>
+ <link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print" />
+
+ <title>Liste Vertragsdaten, Teil 2</title>
+</head>
+
+<body>
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"> <img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Verträge\" title=\"Verträge\"/></div>\n";
+
+ $zeil = $_GET["z"];
+ if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ $start = $_GET["st"]; // Start bei DS $start+1
+ if (!$start) $start=0;
+
+ // Felder, nach denen gefiltert werden kann
+ $fields = array(2=>"Bezeichnung",4=>"Bearbeiter",6=>"Vertragstyp",7=>"Produkt",8=>"Partner");
+
+ $sort = $_GET["s"];
+ $dir = $_GET["d"];
+ if (!isset($sort) && !$sort) $sort = 2;
+ if (!isset($dir) && !$dir) $dir = "";
+
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ $filter = $_GET["b"];
+ if (!isset($fnum) && !$fnum) $fnum = 0;
+
+ $listg = $_GET["l"];
+ if (!isset($listg) && !$listg)
+ {
+ // Recht Produktgruppe beruecksichtigen
+ if (is_array($_SESSION["prodg"]))
+ {
+ foreach ($_SESSION["prodg"] as $val)
+ $listg .= "," .$val;
+ $listg = substr($listg,1);
+ }
+ else $listg = "";
+ }
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+ $dbc = new dbconnection();
+
+ $sql = "CALL fhiiqm.vertrag_flist12(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "',$start,$zeil, @anz, @ganz)";
+ // Parameter: Nr. Sortfelf, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Start bei DS $start+1, Anzahl DS/Seite, Anzahl gefundener Vertraege, Anzahl DS gesamt
+ // liefert Felder: contract_ID,cname,clong,bearb,doc,typ,prod,cbegin,cend,kmon,partfirmar,kyear,kosten,bem
+ $result = $dbc -> queryObjectArray($sql);
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ $heute = new DateTime();
+
+ $vanz = $dbc -> querySingleItem("SELECT @anz");
+ $ganz = $dbc -> querySingleItem("SELECT @ganz");
+
+ echo "<div align='center'>\n";
+ echo "<p><b>Verträge Teil 2</b></p>\n";
+ echo "<table border='0' cellspacing='0'>\n";
+ echo "<tr><td class='bigger'>Mittels '<img src='img/auf.gif' border='0' width='9' hight='9'>' / '<img src='img/ab.gif' border='0' width='9' hight='9'>'
+ können Sie Spalten auf- bzw. absteigend sortieren</td></tr>
+ <tr><td class='bigger'>Klick auf '<img src='img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Vertragsdaten</td></tr>\n";
+ echo "</table>\n";
+ printf ("<p>Anzahl Verträge: %s </p>", $vanz);
+ echo "<table width='99%'>\n";
+
+ if ($filter>'!') echo "<tr><td class='bigger' colspan=7>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+ echo "<tr bgcolor='#68ACBF'>";
+ tab_column(2,"Bezeichnung",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(8,"Beginn",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(9,"Ende",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(10,"Verläng.",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(11,"Künd.frist (mon)",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+// tab_column(12,"Partner",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ echo "<th>Kosten/Jahr(€)</th>";
+ echo "<th>Bemerkung</th>";
+ echo "<th>E-Mail</th>";
+
+ echo "<th> </th></tr>\n";
+ $cid=0;
+ foreach ($result as $row)
+ {
+ // Anzeigen der nur einmal relevanten Daten
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ if ($row->cend)
+ {
+ $ce = new DateTime($row->cend);
+ if ((!$row->cautoend || is_null($row->cautoend)) && $heute > $ce) $class="class='red'"; else $class="";
+ }
+ else $class="";
+ echo "<tr bgcolor='" . $bg . "'><td $class><b>$row->cname</b></td>";
+// echo "<td>$row->contract_s</td>";
+ if ($row->cbegin)
+ {
+ $cb = new DateTime($row->cbegin);
+ echo "<td>" . $cb->format('d.m.Y')."</td>";
+ }
+ else echo "<td> </td>";
+ if ($row->cend)
+ echo "<td>" . $ce->format('d.m.Y')."</td>";
+ else echo "<td> </td>";
+ if ($row->cautoend) echo "<td>automatisch</td>"; else echo "<td> </td>";
+ echo "<td class='center'>$row->kmon</td>";
+// echo "<td>$row->partfirma</td>";
+
+ // Anzeigen Kosten pro Jahr -> 1 Zeile des Resultsets (Kosten fast rechtsbuendig!))
+ if ($row->yearkosten) // Form: yyyy:nnn.nn|yyyy:nnnnn|yyyy:nn.n usw.
+ {
+ $yka = explode('|',$row->yearkosten);
+ $first = true;
+ foreach ($yka as $yk)
+ {
+ if (!$first) echo "<br />"; else echo "<td>";
+ list($year,$kost) = explode(':',$yk);
+ echo "$year: " . str_replace(" "," ",sprintf("%' 10s",number_format($kost,2,",","."))) . "";
+ $first = false;
+ }
+ echo "</td>";
+ }
+ else echo "<td> </td>";
+ $mail = ($row->email)? "ja": " ";
+ echo "<td width='27%'>".nl2br($row->bem)."</td>";
+ echo "<td>$mail</td>";
+ echo "<td><a href='vertrag_upd.php?uid=$cid'><img src=\"img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+ }
+ echo "</table></div>\n";
+ echo "<br /> ";
+
+ // Sortierung und Filter aus $_GET fuer weitere Seiten
+ foreach ($_GET as $key=>$val)
+ {
+ if ($key != "st") $liste .= "&" . $key ."=".$val;
+ }
+ // Sortierung und Filter aus $_POST fuer weitere Seiten
+ if ($subf)
+ foreach ($_POST as $key=>$val)
+ {
+ if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+ if ($key == "filter") $liste .= "&b=" . $val;
+ }
+
+ // Links auf andere Seiten generieren
+ liste_links($start,$zeil,$ganz,$liste);
+ }
+ else
+ {
+ print_r ($dbc -> error);
+ }
+ $dbc -> close();
+ if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
+ echo "<p> <a href=\"vertrag_ins.php\" class=\"sc\" target=\"_self\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
+
+?>
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/vertrag_flist2.php Thu Apr 05 15:35:43 2012 +0200
+++ b/fhiiqm/vertrag_flist2.php Mon May 07 16:21:00 2012 +0200
@@ -154,7 +154,8 @@
// Anzeigen Kosten pro Jahr -> 1 Zeile des Resultsets (Kosten fast rechtsbuendig!))
if ($row->kosten)
{
- echo "<br />$row->kyear: " . str_replace(" "," ",sprintf("%' 10s",number_format($row->kosten,2,",","."))) . "";
+ if ($row->contract_ID == $cid) echo "<br />";
+ echo "$row->kyear: " . str_replace(" "," ",sprintf("%' 10s",number_format($row->kosten,2,",","."))) . "";
}
$cid = $row->contract_ID;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/vertrag_list12_csv.php Mon May 07 16:21:00 2012 +0200
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 04/2012
+ *
+ * Export Vertragsliste als csv-File
+ *
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ include_once($_SERVER["DOCUMENT_ROOT"]."/fhiiqm/inc/dbconnect.inc.php");
+ if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!$sort) $sort = 2;
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!$dir) $dir = '';
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!$fnum) $fnum = 1;
+ $filter = $_GET["b"]; // Filterbegriff
+ if (!$filter) $filter = '';
+ $start = $_GET["st"]; // Start-DS - 1
+ if (!$start) $start = 0;
+ $zeil = $_GET["z"]; // Anzahl zu zeigender DS
+ if (!$zeil) $zeil = 9999;
+ $listg = $_GET["l"]; // Recht fuer ausgewaehlte Produktgruppen
+ if (!$listg) $listg = '';
+
+ $sql = "CALL fhiiqm.vertrag_flist12(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "',$start,$zeil, @anz, @ganz)";
+
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $crlf = array("\r\n","\n\r","\r","\n"); // Zeilenumbrueche
+ $file ="Vertrag-ID;Bezeichnung;Beschreibung;Typ;zu Produkt;Partner;Bearbeiter;Beginn;Ende;Verlängerung;Künd.Frist(mon);Bemerkung;E-Mail?;Jahr;Kosten\r\n";
+
+ foreach ($result as $row)
+ {
+ $file .= $row->contract_ID . ";";
+ $file .= $row->cname . ";";
+ $file .= str_replace($crlf,", ",$row->clong) . ";";
+ $file .= $row->typ . ";";
+ $file .= str_replace(";",":",$row->prod) . ";";
+ $file .= $row->partfirma . ";";
+ $file .= str_replace(";",":",$row->bearb) . ";";
+ if ($row->cbegin)
+ {
+ $cb = new DateTime($row->cbegin);
+ $file .= $cb->format('d.m.Y').";";
+ }
+ else $file .= ";";
+ if ($row->cend)
+ {
+ $cb = new DateTime($row->cend);
+ $file .= $cb->format('d.m.Y').";";
+ }
+ else $file .= ";";
+ if ($row->cautoend) $file .= "automatisch;"; else $file .= ";";
+ $file .= $row->kmon . ";";
+ $file .= str_replace(";",":",str_replace($crlf,", ",$row->bem)) . ";";
+ if ($row->email) $file .= "ja;"; else $file .= ";";
+
+ if ($row->yearkosten)
+ { // Form: yyyy:nnn.nn|yyyy:nnnnn|yyyy:nn.n usw.
+ $yka = explode('|',$row->yearkosten);
+ $first = true;
+ foreach ($yka as $yk)
+ {
+ if (!$first) $file .= "\r\n$row->contract_ID;;;;;;;;;;;;;";
+ list($year,$kost) = explode(':',$yk);
+ $file .= $year .";" .number_format($kost,2,",",".") . ";";
+ $first = false;
+ }
+ }
+ else $file .= ";;";
+ $file .= "\r\n";
+ }
+
+ header( 'Content-Type: text/csv' );
+ header('Content-Disposition: attachment; filename="vertrag.csv"');
+ header("Content-Length: " . strlen($file));
+
+ echo $file;
+ }
+ else echo "kein Ergebnis!";
+?>
\ No newline at end of file