|
1 <?php |
|
2 |
|
3 /** |
|
4 * @author Bettina Schwarzer, Fritz-Haber-Institut |
|
5 * @copyright 06/2012 |
|
6 * |
|
7 * Liste Arbeitssicherheit - Massnahmen |
|
8 * |
|
9 */ |
|
10 |
|
11 error_reporting(E_ALL ^ E_NOTICE); |
|
12 |
|
13 session_start(); |
|
14 if (! isset($_SESSION["userid"])) |
|
15 { |
|
16 include_once ("inc/func_lib.inc.php"); |
|
17 login($_SERVER["PHP_SELF"]); |
|
18 exit; |
|
19 } |
|
20 |
|
21 if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("asr",$_SESSION["recht"]) && !in_array("ase",$_SESSION["recht"]))) |
|
22 { |
|
23 header("Location: start.php"); |
|
24 exit; |
|
25 } |
|
26 |
|
27 include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php"); |
|
28 include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php"); |
|
29 if (!isset($dbc) || !$dbc) $dbc = new dbconnection(); |
|
30 |
|
31 ?> |
|
32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
33 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
34 |
|
35 <head> |
|
36 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> |
|
37 <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen"/> |
|
38 <link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print"/> |
|
39 |
|
40 <title>Arbeitssicherheit-Maßnahmen-Liste</title> |
|
41 </head> |
|
42 |
|
43 <body onload="document.ffilter.filter.focus();"> |
|
44 |
|
45 <?php |
|
46 |
|
47 echo " "; |
|
48 echo "<div class=\"float-br smaller\" valign='top'>"; |
|
49 echo " user: " . $_SESSION["userid"]; |
|
50 echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n"; |
|
51 echo "<div class=\"float-r\"><img src=\"img/role.png\" border=\"0\" alt=\"AS Massnahmen\" title=\"AS Massnahmen\"/></div>\n"; |
|
52 |
|
53 // Felder, nach denen gefiltert werden kann |
|
54 $fields = array(2=>"Maßnahme-Bezeichnung"); |
|
55 |
|
56 $sort = $_GET["s"]; // Sortierung nach Spalte |
|
57 if (!isset($sort) && !$sort) $sort = $_POST["s"]; |
|
58 |
|
59 $dir = $_GET["d"]; // Sortierrichtung |
|
60 if (!isset($dir) && !$dir) $dir = $_POST["d"]; |
|
61 |
|
62 $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird |
|
63 if (!isset($fnum) && !$fnum) $fnum = $_POST["f"]; |
|
64 |
|
65 $filter = $_POST["filter"]; |
|
66 if (!isset($filter) && !$filter) $filter = $_GET["b"]; |
|
67 |
|
68 $subf = $_POST["subf"]; // submit |
|
69 |
|
70 if (!isset($fnum) && !$fnum) $fnum = 1; |
|
71 if (!isset($filter) && !$filter) $filter = ""; |
|
72 if (!isset($sort) && !$sort) $sort = 1; |
|
73 if (!isset($dir) && !$dir) $dir = ""; |
|
74 |
|
75 if ($fnum == 2 && $filter>" ") $where = " WHERE asm_bez LIKE '%" . $filter ."%'"; else $where = ""; |
|
76 $sql = "SELECT asm_ID,asm_bez,asm_bem FROM fhiiqm.AS_Massnahme $where "; |
|
77 $sql .= " ORDER BY $sort $dir"; |
|
78 |
|
79 $result = $dbc ->queryObjectArray($sql); |
|
80 |
|
81 echo "<div align='center'>\n"; |
|
82 echo "<p><b>Liste Arbeitssicherheit - Maßnahmen</b></p>\n"; |
|
83 |
|
84 if ($result) |
|
85 { |
|
86 $bg1 = "#F8F8F8"; |
|
87 $bg2 = "#DEDFE1"; |
|
88 $bg = "#FFFFFF"; |
|
89 |
|
90 echo "<table border='0' cellspacing='0'>\n"; |
|
91 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' />' |
|
92 können Sie nach Maßnahmen auf- bzw. absteigend sortieren</td></tr> |
|
93 <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' ermöglicht das Filtern nach Maßnahmen</td></tr>\n |
|
94 <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten Maßnahme</td></tr>\n |
|
95 <tr><td class='bigger'> </td></tr>"; |
|
96 echo "</table>\n"; |
|
97 |
|
98 if (isset($fnum) && $fnum>1 && !$filter && !$subf) |
|
99 { |
|
100 // Formular anzeigen fuer Filterbegriff |
|
101 $text = $fields[$fnum]; |
|
102 echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n"; |
|
103 echo "<input type='hidden' name='f' value='$fnum'>"; |
|
104 echo "<table width=\"30%\" border=\"0\">\n"; |
|
105 echo "<tr><td>filtern nach $text: </td>"; |
|
106 echo "<td><input id='filter' name='filter' type=\"text\" size=\"30\" maxlength=\"30\" value=\"$filter\"/></td>"; |
|
107 echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr></table>\n"; |
|
108 echo "</form>\n"; |
|
109 echo "<p> </p>\n"; |
|
110 } |
|
111 |
|
112 echo "<table border='0'>\n"; |
|
113 if ($fnum == 2) $filt = "filter_activ"; else $filt = "filter"; |
|
114 echo "<tr bgcolor='#68ACBF'>"; |
|
115 // <th>Massnahme <a href='".$_SERVER['PHP_SELF']."?f=2'><img src='/fhiiqm/img/$filt.gif' border='0' width='14' hight='11' alt='Filter Massnahme' title='Filter Massnahme'></a></th>"; |
|
116 tab_column(2,"Maßnahme",$sort,$dir,2,$fnum,$filter,0,9999); |
|
117 echo "<th>Bemerkung</th>"; |
|
118 echo "<th> </th></tr>"; |
|
119 |
|
120 if ($bg == $bg1) $bg = $bg2; else $bg = $bg1; |
|
121 foreach ($result as $row) |
|
122 { |
|
123 echo "<tr bgcolor='" . $bg . "'>"; |
|
124 echo "<td>$row->asm_bez</td>"; |
|
125 echo "<td>".nl2br($row->asm_bem) ."</td>"; |
|
126 echo "</td><td><a href='/fhiiqm/as_massn_ed.php?i=$row->asm_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td> |
|
127 </tr>\n"; |
|
128 } |
|
129 echo "</table>\n"; |
|
130 echo "</div>\n"; |
|
131 } |
|
132 else |
|
133 { |
|
134 echo "<p class='red'> Leider nichts gefunden für ". $fields["$fnum"] . " wie '$filter'!</p><br /></div>"; |
|
135 echo " <a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"AS Massnahme\" class=\"sc\">Liste AS Maßnahmen</a></p>\n"; |
|
136 } |
|
137 echo " <a href=\"/fhiiqm/as_massn_ed.php\" target=\"_self\" title=\"AS Maßnahme erfassen\" class=\"sc\">weitere AS Maßnahme erfassen</a></p>\n"; |
|
138 ?> |
|
139 |
|
140 </body> |
|
141 </html> |