72 echo "<td class='center'>$row->pw</td>"; |
75 echo "<td class='center'>$row->pw</td>"; |
73 echo "<td><a href='/fhiiqm/recht_ed.php?pid=$row->persknr'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n"; |
76 echo "<td><a href='/fhiiqm/recht_ed.php?pid=$row->persknr'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n"; |
74 } |
77 } |
75 echo "</table></div>\n"; |
78 echo "</table></div>\n"; |
76 } |
79 } |
|
80 echo "</td><td class='valignb'>"; |
|
81 // Liste der Rechte je userid |
|
82 $sql = "SELECT userid, |
|
83 count(CASE recht_ID WHEN 'ar' THEN 1 END) AS anlage_read, |
|
84 COUNT(CASE recht_ID WHEN 'ae' THEN 1 END) AS anlage_edit, |
|
85 COUNT(CASE recht_ID WHEN 'fmr' THEN 1 END) AS funkt_ma_read, |
|
86 COUNT(CASE recht_ID WHEN 'fme' THEN 1 END) AS funkt_ma_edit, |
|
87 COUNT(CASE recht_ID WHEN 'ir' THEN 1 END) AS info_read, |
|
88 COUNT(CASE recht_ID WHEN 'ie' THEN 1 END) AS info_edit, |
|
89 COUNT(CASE recht_ID WHEN 'lr' THEN 1 END) AS laser_read, |
|
90 COUNT(CASE recht_ID WHEN 'le' THEN 1 END) AS laser_edit, |
|
91 COUNT(CASE recht_ID WHEN 'pr' THEN 1 END) AS prod_read, |
|
92 COUNT(CASE recht_ID WHEN 'pe' THEN 1 END) AS prod_edit, |
|
93 COUNT(CASE recht_ID WHEN 'rr' THEN 1 END) AS raum_read, |
|
94 COUNT(CASE recht_ID WHEN 're' THEN 1 END) AS raum_edit, |
|
95 COUNT(CASE recht_ID WHEN 'rtr' THEN 1 END) AS recht_read, |
|
96 COUNT(CASE recht_ID WHEN 'rte' THEN 1 END) AS recht_edit, |
|
97 COUNT(CASE recht_ID WHEN 'vr' THEN 1 END) AS vertrag_read, |
|
98 COUNT(CASE recht_ID WHEN 've' THEN 1 END) AS vertrag_edit, |
|
99 COUNT(CASE recht_ID WHEN 'vpr' THEN 1 END) AS vertr_part_read, |
|
100 COUNT(CASE recht_ID WHEN 'vpe' THEN 1 END) AS vertr_part_edit |
|
101 FROM `fhiiqm`.`user_recht` |
|
102 GROUP BY userid"; |
|
103 if ($result = $dbc -> queryObjectArray($sql)) |
|
104 { |
|
105 $bg1 = "#F8F8F8"; |
|
106 $bg2 = "#DEDFE1"; |
|
107 $bg = "#FFFFFF"; |
|
108 |
|
109 echo "<div align='center'>\n"; |
|
110 echo "<p><br /><b>fhiiqm-Nutzer und zugeordnete Rechte</b> ('edit' impliziert 'read')</p>\n"; |
|
111 |
|
112 echo "<table cellpadding='2' cellspacing='2'>\n"; |
|
113 // Listenkopf |
|
114 echo "<tr bgcolor='#68ACBF'>"; |
|
115 echo "<th> </th> |
|
116 <th colspan='2'>Anlage</th> |
|
117 <th colspan='2'>Funkt.-MA</th> |
|
118 <th colspan='2'>Info</th> |
|
119 <th colspan='2'>Laser</th> |
|
120 <th colspan='2'>Produkt</th> |
|
121 <th colspan='2'>Raum</th> |
|
122 <th colspan='2'>Recht</th> |
|
123 <th colspan='2'>Vertrag</th> |
|
124 <th colspan='2'>Vertr.Partner</th></tr>\n"; |
|
125 echo "<tr bgcolor='#68ACBF'>"; |
|
126 echo "<th>userid</th><th>read</th><th>edit</th> |
|
127 <th>read</th><th>edit</th> |
|
128 <th>read</th><th>edit</th> |
|
129 <th>read</th><th>edit</th> |
|
130 <th>read</th><th>edit</th> |
|
131 <th>read</th><th>edit</th> |
|
132 <th>read</th><th>edit</th> |
|
133 <th>read</th><th>edit</th> |
|
134 <th>read</th><th>edit</th> |
|
135 </tr>\n"; |
|
136 foreach ($result as $row) |
|
137 { |
|
138 if ($bg == $bg1) $bg = $bg2; else $bg = $bg1; |
|
139 echo "<tr bgcolor='" . $bg . "'><td><b>$row->userid</b><img src=\"/fhiiqm/img/transp.png\" width=\"2\" height=\"12\" border='0'/></td>"; |
|
140 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_read)) ."</b></td>"; |
|
141 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->anlage_edit)) ."</b></td>"; |
|
142 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_read)) ."</b></td>"; |
|
143 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->funkt_ma_edit)) ."</b></td>"; |
|
144 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->info_read)) ."</b></td>"; |
|
145 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->info_edit)) ."</b></td>"; |
|
146 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->laser_read)) ."</b></td>"; |
|
147 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->laser_edit)) ."</b></td>"; |
|
148 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->prod_read)) ."</b></td>"; |
|
149 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->prod_edit)) ."</b></td>"; |
|
150 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->raum_read)) ."</b></td>"; |
|
151 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->raum_edit)) ."</b></td>"; |
|
152 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->recht_read)) ."</b></td>"; |
|
153 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->recht_edit)) ."</b></td>"; |
|
154 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertrag_read)) ."</b></td>"; |
|
155 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertrag_edit)) ."</b></td>"; |
|
156 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertr_part_read)) ."</b></td>"; |
|
157 echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertr_part_edit)) ."</b></td>"; |
|
158 echo "</tr>\n"; |
|
159 } |
|
160 echo "</table></div>\n"; |
|
161 } |
|
162 |
|
163 echo "</td></tr></table></div>\n"; |
|
164 |
77 if (!is_null($_SESSION["recht"]) && in_array("re",$_SESSION["recht"])) |
165 if (!is_null($_SESSION["recht"]) && in_array("re",$_SESSION["recht"])) |
78 echo "<p class=\"sc\"> <a href=\"/fhiiqm/recht_ed.php\" target=\"_self\" title=\"Nutzer erfassen\">Weiteren Nutzer & Rechte erfassen</a></p>\n"; |
166 echo "<p class=\"sc\"> <a href=\"/fhiiqm/recht_ed.php\" target=\"_self\" title=\"Nutzer erfassen\">Weiteren Nutzer & Rechte erfassen</a></p>\n"; |
79 |
167 |
80 ?> |
168 ?> |
81 </body> |
169 </body> |