<?php
@session_start();

if ( ( $_SESSION[ "benutzer_anmeldename" ] == "superuser" ) and ( $_SESSION[ "mandant_name" ] == "Standard" ) )
{
	header( "Location: su_uebersicht.php" );
	exit;
}



//$benutzer_anmeldename = $_SESSION[ "benutzer_anmeldename" ];

if ( strlen( $_SESSION[ "benutzer_anmeldename" ] ) > 0 )
{
	////////////////////////////////////////
	// Javascript-Dateien
	$_SESSION[ "javascript_dateien" ] = "";
	////////////////////////////////////////
	
	////////////////////////////////////////
	// Javascript-Startup
	$_SESSION[ "javascript_startup" ] = '';
	////////////////////////////////////////
	
	////////////////////////////////////////
	// CSS-Dateien
	$_SESSION[ "css_dateien" ] = "";
	////////////////////////////////////////
	

	$_SESSION[ "title" ] = "infobase - Forum";
	include( 'ssi_header.php' );
	$_SESSION[ "title" ] = "";
	
	////////////////////////////////////////
	// Javascript-Dateien
	$_SESSION[ "javascript_dateien" ] = "";
	////////////////////////////////////////
	
	////////////////////////////////////////
	// Javascript-Startup
	$_SESSION[ "javascript_startup" ] = "";
	////////////////////////////////////////
	
	////////////////////////////////////////
	// CSS-Dateien
	$_SESSION[ "css_dateien" ] = "";
	////////////////////////////////////////
	
	//onclick=\"$( '#ergebnis_3' ).load('su_web.php?cmd=benutzer_anlegen', function() { $( '.date-pick' ).datepicker({ showAnim: 'clip', buttonImageOnly: true,  showOn: 'both', buttonImage: 'img/kalender.png', showWeek: true } ); } );
	
	
	
	
	$_SESSION[ "infobase_root" ] = '1';

	$rechte_ibkat = welche_rechte_hat_benutzer_auf_dokuaktenart( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ], "IBKAT" );
	$rechte_ibthr = welche_rechte_hat_benutzer_auf_dokuaktenart( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ], "IBTHR" );
	$rechte_ibart = welche_rechte_hat_benutzer_auf_dokuaktenart( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ], "IBART" );
	
	
	
	$us_rech_imp_button = liefere_benutzerspezifische_einstellung( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ], "us_rech_imp_button" );
	
	if ( $us_rech_imp_button == "ja" )
	{
		echo "<div style='margin-left:200px; padding-bottom:30px;  min-height:550px;'  >";
		include( "us_menu.php" );
	}
	else
	{
		echo "<div style='margin-left:20px; padding-bottom:30px;  min-height:550px;'  >";
	}
	/*
	$ergebnis = welche_dokumentarten_darf_benutzer_importieren( $_SESSION[ "mandant_name" ], $_SESSION[ "benutzer_anmeldename" ] );
	
	if ( $ergebnis[ 0 ] > 0 )
	{
		echo '<select name="alpha_03" style="height:100%; width:255px;" onchange="$( \'#importmaske\' ).load( \'su_web.php?cmd=liefere_importmaske&mandant_name='.urlencode( $mandant_name ).'&element_typ=\'+this.value, function() { $( \'.date-pick\' ).datepicker({ showAnim: \'clip\', buttonImageOnly: true,  showOn: \'both\', buttonImage: \'img/kalender.png\', showWeek: true } ); }, function() { $ (\'.fileupload\' ).fileupload({ url: \'us_upload.php\' }) } ) " ><option />';
		
		//echo '<select name="alpha_03" style="height:100%; width:255px;" onchange="ajaxFunction( \'su_web.php?cmd=liefere_importmaske&mandant_name='.urlencode( $mandant_name ).'&element_typ=\'+this.value, \'importmaske\' );" ><option />';
		
		foreach ( $ergebnis[ 1 ] as $dokart_kuerzel )
		{
			$erg = liefere_dokartinformationen( $mandant_name, $dokart_kuerzel );
			echo "<option value='".$erg[ 2 ][ "dokart_kuerzel" ]."'>".$erg[ 2 ][ "dokart_name" ]."</option>";
		}
		
		echo "</select><div id='importmaske'></div>
		
		
		
		
		
		
		
		
		";
	}
	
	
	
	*/
	
	$schriftfarbe = liefere_konfig( $_SESSION[ "mandant_name" ], "standardfarbe" );
	
	echo "<h2>infobase - Forum</h2>";
	
	$infobase_content = "";
	
	$infobase_admin = "<button id='infobase_kat_anlegen' onclick='$( \"#infobase_admin_maske\" ).html(\"hallo\");'>Kategorie anlegen</button>";
	
	$e = variable_recherche( $_SESSION[ "mandant_name" ], "IBKAT", $_SESSION[ "benutzer_anmeldename" ], array(array( "feld"=>"num_01", "operator"=>"EQUAL", "wert"=>$_SESSION[ "infobase_root" ] )) );
	
	
	
	foreach ( $e[ 2 ] as $treffer )
	{
		//$infobase_content = $infobase_content."".json_encode( $treffer )."<br/>";
		
		$infobase_content = $infobase_content."<div style='width:100%; color: #".$schriftfarbe.";  background-color:lightblue; border:2px solid black; margin-bottom: 10px;' ><table style='width:100%;'><tr><td><span style='font-size: 140%; text-decoration:underline;' onclick='alert(\"hallo\");' >".$treffer[ "alpha_02"]."</span><br/>erstellt von ".$treffer[ "alpha_01"]." am ".$treffer[ "archivierungsdatum"]." Uhr</td><td style='text-align:right;'>hallo</td></tr></table></div>";
		
	}
	
	if ( $_SESSION[ "infobase_root" ] != '1' )
	{
		$infobase_admin = $infobase_admin."<button id='infobase_thr_anlegen'  >Thread anlegen</button>";
	}
	
	echo "<div id='infobase_admin'>".$infobase_admin."</div>";
	echo "<div id='infobase_admin_maske'></div>";
	echo "<div id='infobase_content'>".$infobase_content."</div>";
	
	echo '<div name="ergebnis_3" id="ergebnis_3" style=" margin-top:10px;" >'.$_SESSION[ "meldung_ad" ].'</div>';
	$_SESSION[ "meldung_ad" ] = "";
	
	?>
	
	
	
	
	
	
	
	
	
	<?php
	
	echo '</div>';
	
	
	echo "<p style='clear:both;' />";
	include( 'ssi_footer.php' );

}
else
{
	header("Location: index.php");
}
?>