<?php
if ( isset ( $_GET['t'] ) )
	{
		if ( 'wm' == $_GET['t'] )
			{
				$O_TYP = 'Wohnung';
				$V_TYP = 'Miete';
			}
		if ( 'wk' == $_GET['t'] )
			{
				$O_TYP = 'Wohnung';
				$V_TYP = 'Kauf';
			}
		if ( 'hm' == $_GET['t'] )
			{
				$O_TYP = 'Haus';
				$V_TYP = 'Miete';
			}
		if ( 'hk' == $_GET['t'] )
			{
				$O_TYP = 'Haus';
				$V_TYP = 'Kauf';
			}
		if ( 'gm' == $_GET['t'] )
			{
				$O_TYP = 'Gewerbe';
				$V_TYP = 'Miete';
			}
		if ( 'gk' == $_GET['t'] )
			{
				$O_TYP = 'Gewerbe';
				$V_TYP = 'Kauf';
			}
		if ( 'ro' == $_GET['t'] )
			{
				$O_TYP = 'Anlage';
				$V_TYP = 'Kauf';
			}
		if ( 'fotos' == $_GET['t'] )
			{
				return include "inhalte/8er.php";
			}
		if ( 'FBesch' == $_GET['t'] )
			{
				return include "inhalte/fbesch.php";
			}
	}
	$immo_typ = $O_TYP . ' - ' . $V_TYP;
	if ( 'gm' == $_GET['t'] OR 'gk' == $_GET['t'] OR 'ro' == $_GET['t'] )
		{
			$immo_abfrage = 'WHERE KAT = "' . $O_TYP . '" AND V_TYP = "' . $V_TYP . '"';
		}
	else
		{
			$immo_abfrage = 'WHERE O_TYP = "' . $O_TYP . '" AND V_TYP = "' . $V_TYP . '"';
		}
if ( !$_SESSION['IsAdmin'] )
	{
		$immo_abfrage .= ' AND TID = "' . $_SESSION['TID'] . '"';
	}
$actions = array();
$actions['Anlegen']      = strtolower($O_TYP."/".$V_TYP.'/edit.php');
$actions['Anzeigen']     = 'view.php';
$actions['Bearbeiten']   = strtolower($O_TYP."/".$V_TYP.'/edit.php');
$actions['Speichern']    = strtolower($O_TYP."/".$V_TYP.'/speichern.php');
$actions['Löschen']      = 'delete.php';
$actions['Abbrechen']    = 'delete.php';
$actions['De- / Aktivieren']   = 'aktivieren.php';

if (!isset($_GET['a'])) {
	if (isset($_POST['formaction'])) {
		return include $actions[$_POST['formaction']];
		var_dump($_POST);
	}
}

return include 'overview.php';

?>