--- a/fhiiqm/recht_list.php Fri Dec 23 15:03:37 2011 +0100
+++ b/fhiiqm/recht_list.php Thu Jan 12 11:41:22 2012 +0100
@@ -4,7 +4,7 @@
* @author Bettina Schwarzer, Fritz-Haber-Institut
* @copyright 10/2011
*
- * INSERT Rechte
+ * Liste User fhiiqm
*/
error_reporting(E_ALL ^ E_NOTICE);
@@ -46,10 +46,13 @@
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+ echo "<div align='center'>\n";
+ echo "<table><tr><td class='valignb'>";
+
$sql = "SELECT u.persknr, CONCAT (nachname, ', ',vorname) AS ma, userid,
CASE WHEN ISNULL(pwd) THEN '-' ELSE 'ja' END AS pw
FROM fhiiqm.userweb u INNER JOIN fhiiqm.Mitarbeiter m ON u.persknr = m.persknr
- ORDER BY ma";
+ ORDER BY userid";
if ($result = $dbc -> queryObjectArray($sql))
{
$bg1 = "#F8F8F8";
@@ -74,6 +77,91 @@
}
echo "</table></div>\n";
}
+ echo "</td><td class='valignb'>";
+ // Liste der Rechte je userid
+ $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 '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,
+ COUNT(CASE recht_ID WHEN 'ie' THEN 1 END) AS info_edit,
+ COUNT(CASE recht_ID WHEN 'lr' THEN 1 END) AS laser_read,
+ COUNT(CASE recht_ID WHEN 'le' THEN 1 END) AS laser_edit,
+ COUNT(CASE recht_ID WHEN 'pr' THEN 1 END) AS prod_read,
+ COUNT(CASE recht_ID WHEN 'pe' THEN 1 END) AS prod_edit,
+ COUNT(CASE recht_ID WHEN 'rr' THEN 1 END) AS raum_read,
+ COUNT(CASE recht_ID WHEN 're' THEN 1 END) AS raum_edit,
+ COUNT(CASE recht_ID WHEN 'rtr' THEN 1 END) AS recht_read,
+ COUNT(CASE recht_ID WHEN 'rte' THEN 1 END) AS recht_edit,
+ COUNT(CASE recht_ID WHEN 'vr' THEN 1 END) AS vertrag_read,
+ COUNT(CASE recht_ID WHEN 've' THEN 1 END) AS vertrag_edit,
+ COUNT(CASE recht_ID WHEN 'vpr' THEN 1 END) AS vertr_part_read,
+ COUNT(CASE recht_ID WHEN 'vpe' THEN 1 END) AS vertr_part_edit
+ FROM `fhiiqm`.`user_recht`
+ GROUP BY userid";
+ if ($result = $dbc -> queryObjectArray($sql))
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ echo "<div align='center'>\n";
+ echo "<p><br /><b>fhiiqm-Nutzer und zugeordnete Rechte</b> ('edit' impliziert 'read')</p>\n";
+
+ echo "<table cellpadding='2' cellspacing='2'>\n";
+ // Listenkopf
+ echo "<tr bgcolor='#68ACBF'>";
+ echo "<th> </th>
+ <th colspan='2'>Anlage</th>
+ <th colspan='2'>Funkt.-MA</th>
+ <th colspan='2'>Info</th>
+ <th colspan='2'>Laser</th>
+ <th colspan='2'>Produkt</th>
+ <th colspan='2'>Raum</th>
+ <th colspan='2'>Recht</th>
+ <th colspan='2'>Vertrag</th>
+ <th colspan='2'>Vertr.Partner</th></tr>\n";
+ echo "<tr bgcolor='#68ACBF'>";
+ echo "<th>userid</th><th>read</th><th>edit</th>
+ <th>read</th><th>edit</th>
+ <th>read</th><th>edit</th>
+ <th>read</th><th>edit</th>
+ <th>read</th><th>edit</th>
+ <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)
+ {
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ 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->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>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->info_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->laser_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->laser_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->prod_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->prod_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->raum_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->raum_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->recht_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->recht_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertrag_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertrag_edit)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertr_part_read)) ."</b></td>";
+ echo "<td class='center'><b>" . str_replace("0"," ",str_replace("1","x",$row->vertr_part_edit)) ."</b></td>";
+ echo "</tr>\n";
+ }
+ echo "</table></div>\n";
+ }
+
+ echo "</td></tr></table></div>\n";
+
if (!is_null($_SESSION["recht"]) && in_array("re",$_SESSION["recht"]))
echo "<p class=\"sc\"> <a href=\"/fhiiqm/recht_ed.php\" target=\"_self\" title=\"Nutzer erfassen\">Weiteren Nutzer & Rechte erfassen</a></p>\n";