<?php
	@session_start();
	
	$admin_rechte = welche_systemrechte_besitzt_benutzer( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ] );
	
	
	
	$html = '<div style="position:absolute;margin-left:25px; top:115px; left:0px; width:165px;  border:0px solid yellow;"><table border="0">';
	$i = 0;
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button1" style=" " value="Mandantverwaltung" type="button" onclick="document.location.href=\'ad_mandant.php\';" /></td></tr>';
			$i = 1;
			break;
		}
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMIN_BENUTZER" )
		{
			$html = $html.'<tr><td><input id="button2" style=" " value="Benutzerverwaltung" type="button" onclick="document.location.href=\'ad_benutzer.php\';" /></td></tr>';
			$i = 1;
			break;
		}
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMIN_GRUPPE" )
		{
			$html = $html.'<tr><td><input id="button3" style=" " value="Gruppenverwaltung" type="button" onclick="document.location.href=\'ad_gruppe.php\';" /></td></tr>';
			$i = 1;
			break;
		}
	}
	
	if ( $i == 1 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMIN_BENUTZER_GRUPPE" )
		{
			$html = $html.'<tr><td><input id="button4" style=" " value="Benutzer in Gruppen" type="button" onclick="document.location.href=\'ad_benutzer_in_gruppen.php\';" /></td></tr>';
			$i = 2;
			break;
		}
	}
	
	/*
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button5" style=" " value="Gruppen in Gruppen" type="button" onclick="document.location.href=\'ad_gruppen_in_gruppen.php\';" /></td></tr>';
			$i = 2;
			break;
		}
	}
	*/
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button6" style=" " value="Gruppen/Systemrechte" type="button" onclick="document.location.href=\'ad_gruppe_systemrechte.php\';" /></td></tr>';
			$i = 2;
			break;
		}
	}
	
	if ( $i == 2 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button7" style=" " value="Attribute" type="button" onclick="document.location.href=\'ad_attribut.php\';" /></td></tr>';
			$i = 3;
			break;
		}
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button8" style=" " value="Dokumentkatalog" type="button" onclick="document.location.href=\'ad_dokumentart.php\';" /></td></tr>';
			$i = 3;
			break;
		}
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button9" style=" " value="Depot" type="button" onclick="document.location.href=\'ad_depot.php\';" /></td></tr>';
			$i = 3;
			break;
		}
	}
	
	if ( $i == 3 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMIN_WERTEMENGE" )
		{
			$html = $html.'<tr><td><input id="button10" style=" " value="Wertemengen" type="button" onclick="document.location.href=\'ad_wertemenge.php\';" /></td></tr>';
			$i = 4;
			break;
		}
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button11" style=" " value="Konfiguration" type="button" onclick="document.location.href=\'ad_konfig.php\';" /></td></tr>';
			$i = 4;
			break;
		}
	}
	
	if ( $i == 4 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMIN_GRUPPE" )
		{
			$html = $html.'<tr><td><input id="button3" style=" " value="Reports" type="button" onclick="document.location.href=\'ad_reports.php\';" /></td></tr>';
			$i = 1;
			break;
		}
	}
	
	
	
	/*
	if ( $i == 4 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	*/
	
	/*
	foreach( $admin_rechte[ 2 ] as $sysrecht )
	{
		if ( $sysrecht == "ADMINISTRATOR" )
		{
			$html = $html.'<tr><td><input id="button11" style=" " value="Jobs" type="button" onclick="document.location.href=\'ad_jobs.php\';" /></td></tr>';
			$i = 5;
			break;
		}
	}
	
	if ( $i == 5 )
	{
		$html = $html.'<tr ><td style="height:2px;" ><hr style="border:1px solid silver;" ></hr></td></tr>';
		$i = 0;
	}
	*/
	//$html = $html.'<tr><td><input id="button1" style="" value="Support" type="button" onclick="document.location.href=\'ad_support.php\';" /></td></tr>';
	
	$html = $html."</table></div>";
	/*
		<tr><td><input id="button1" style="" value="Konfiguration" type="button" onclick="document.location.href=\'su_konfig.php\';" /></td></tr>
		<tr><td><input id="button1" style=" " value="Wertemengen" type="button" onclick="document.location.href=\'su_wertemenge.php\';" /></td></tr>
		<tr style="height:5px;"><td style="height:5px;"><hr style="border:1px solid silver;" /></td></tr>
		<tr><td><input id="button1" style="" value="Support" type="button" onclick="document.location.href=\'su_mandant.php\';" /></td></tr>
		</table></div>
		';*/
	
	
	echo $html;
	
?>