Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        $self=basename($PHP_SELF);
        require_once "connect.php";
        if (!$modul) {$modul=1;}
?>
<html>
<head>
<title>Content-Management-System</title>
<link rel=stylesheet type="text/css" href="buttons.css">
<style type="text/css"><? require_once "buttons.css"; ?></style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
</head>

<?
        $images_Pfad='images/navigation/';
        $query="
                select
                        button_name
                from
                        Access,
                        user_modules,
                        user_modules_tools,
                        modules,
                        tools
                where   
                        Access.user = '$PHP_AUTH_USER'
                and
                        Access.ID = user_modules.Access
                and
                        user_modules.ID = user_modules_tools.user_modules
                and
                        user_modules_tools.tools = tools.ID
                and
                        (tools.server = '%' or tools.server = '".$_SERVER["SERVER_ADDR"]."') 
                and
                        user_modules.modules = modules.ID

        ";
        $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
        $buttons=array();
        while($zeile=mysql_fetch_array($result))
        {
                array_push($buttons,"'".$images_Pfad."bt_".$zeile[button_name]."_f2.gif'");
        }
        $buttons=implode(", ", $buttons);

?>
<body leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages(<? echo $buttons ?>,'../images/redaktion/bt_kontakt_f2.gif','../images/redaktion/bt_exit_f2.gif')" bgcolor="#FFFFFF" text="#000000">
<table border="0" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#666666">
  <tr valign="top"> 
<?
        $query_modules="select distinct modules.ID,modules.name from Access, user_modules, user_modules_tools, tools,  modules where user_modules.modules = modules.ID and user_modules_tools.user_modules = user_modules.ID and user_modules_tools.tools = tools.ID and user_modules.Access = Access.ID and Access.user = '$PHP_AUTH_USER' order by modules.rang";
        $result_modules = mysql_query ($query_modules) or die (mysql_errno().": ".mysql_error()."<hr>$query_modules<hr>");
        while($zeile_modules=mysql_fetch_array($result_modules))
        {
                $query_buttons="select tools.* from Access, user_modules, user_modules_tools, modules, tools where tools.modules = $modul and  user_modules.modules = modules.ID and user_modules_tools.user_modules = user_modules.ID and user_modules_tools.tools = tools.ID and user_modules.Access = Access.ID and Access.user = '$PHP_AUTH_USER' order by tools.rang";
                $result_buttons = mysql_query ($query_buttons) or die (mysql_errno().": ".mysql_error()."<hr>$query_buttons<hr>");
?>
    <td valign="top"> 
      <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#666666">
        <tr>
                  <td colspan="<? echo mysql_num_rows($result_buttons) ?>" align="center" class="button"><a href="<? echo $self ?>?modul=<? echo $zeile_modules[ID]; ?>">
            <? echo $zeile_modules[name]; ?>
            </a></td>
        </tr>
<? 
        if ($zeile_modules[ID] == $modul)
        {
?>      
        <tr>
<?
        while($zeile_buttons=mysql_fetch_array($result_buttons))
        {
                $imgsrc=$images_Pfad.'bt_'.$zeile_buttons[button_name].'.gif';
                $imgsrc_f2=$images_Pfad.'bt_'.$zeile_buttons[button_name].'_f2.gif';
?>
                  <td align="center" bgcolor="#CCCCCC"><a href="<? echo $zeile_buttons[filename] ?>" target="tool" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ID','','<? echo $imgsrc_f2 ?>',0)"><img name="Image<? echo $zeile_buttons[ID] ?>" border="0" src="<? echo $imgsrc ?>"></a></td>
<?
        }
?>
        </tr>
<?
        }
?>
        </table>
</td>
<?
        }
?>
</tr>
</table>
</body>
</html>