<?php 	
include('_dbverbindung.php');
include('_settings.php');

/// Funktionen fur Sicherheitscode
if(!$user_locker){
	$text = rand(1, 15);
	$texttw = rand(1, 15);	
	$_SESSION['text'] = $text;
	$_SESSION['texttw'] = $texttw;
	$_SESSION['check'] = md5($text+$texttw);
}
///////////////////////

/// Für Homepagebereiche!
if(!isset($_SESSION['kat'])) $_SESSION['kat'] = "1";
if($hp_bereiche == 1 && $_GET['kat'] != ''){ 
	  $kat= $_GET['kat'];
	  $_SESSION['kat'] = $kat;
		
}

$bilder_ordner = 'bilder_'.$_SESSION['kat'];

///////////////////////
$lockadmin ='';
if($page_lock == '1' && !user_any($global_user)){
	
	$lock = mysql_query("SELECT message from pagelock");
	$du = mysql_fetch_array($lock);
	
	echo '<center>'.$du['message'];
	
	include('login.php');
	echo '</center>';
	
	die();
}elseif($page_lock == '1') $lockadmin = '<br><br><br> <div class="alert alert-danger">ACHTUNG! Homepage ist derzeit nur für Admins zugänglich!</div> <br><br<br>';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<!--[if !IE]><!-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--<![endif]-->
<?php
if($_GET['modul'] == 'impressum') echo'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
else echo'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; 
?>
<meta name="description" content="Landsitz Immobilien - Verkauf | Beratung | Vermittlung - Hof bei Salzburg">
<meta name="keywords" content="Landsitz Immobilien, Hof bei Salzburg, Vermittlung, Vermietung, Verkauf, Grundstücke, Immo, Immobilienbüro, Salzbrug, Fuschl, See, Wasser, Natur, Wohnung, Grundstück, Haus, Miete, Kauf, Provision, Markler">
<meta name="title" content="Landsitz Immobilien - Verkauf | Beratung | Vermittlung">
<meta name="robots" content="index,follow">
<meta name="language" content="de">
<meta name="city" content="Hof bei Salzburg">
<meta name="state" content="Salzburg">
<meta name="country" content="AT">
<meta name="author" content="TITEL, cms.pum4.at">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title><?php echo $homepagename; ?></title>

<style type="text/css">
		@import 'splitselects.css';
</style>

<!--[if !IE]><!-->
	<link rel="stylesheet" type="text/css" href="_css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="_css/index.css" />
<!--<![endif]-->

<!--[if gte IE 8]>
	<link rel="stylesheet" type="text/css" href="_css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="_css/index.css" />
<![endif]-->

<!--[if lte IE 8]>
	<link rel="stylesheet" type="text/css" href="_css/bootstrap_ie.css" />
	<link rel="stylesheet" type="text/css" href="_css/index_ie.css" />
<![endif]-->

<link rel="stylesheet" type="text/css" href="_css/index_<?php echo $_SESSION['kat']; ?>.css" />
<link rel="stylesheet" type="text/css" href="_css/lightbox.css" media="screen" />

<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>

<?php // Editor! ?>
<!-- TinyMCE -->
<script type="text/javascript" src="editor/tiny_mce.js"></script>
<!-- /TinyMCE -->

<?php // Bildvorschau ?>
<script src="_js/lightbox-2.6.min.js"></script>

<?php // Bootstrap ?>
<script type="text/javascript" src="_js/bootstrap.js"></script>

	<script>
	$(document).ready(function() {
	
	$('.carousel').carousel({
		interval: 5000
	,	wrap: true
	})
	});
	</script>

<?php // Preloader ?>
<script type="text/javascript" src="_js/preLoadingMessage.js"></script>

<?php // Videoplayer ?>
<script type="text/javascript" src="_js/flowplayer-3.2.6.min.js"></script>

<?php // Dropdown ?>
<script type="text/javascript" src="_js/dropdown.js"></script>

</head>
<body>

<center><div class="lock"><?php echo $lockadmin; ?></div></center>

<?php


if($_GET['modul'] == '' || ($_GET['modul'] == 'gallery' && $_GET['page'] == '')) $hintergrund = '';
elseif(!file_exists($_GET['modul'].".php")) $hintergrund = '';
else $hintergrund = 'background-color:#efefef;';
?>


<div class="wrapper">
<div style="background-image:url(bilder/bg_verlauf.png); background-repeat:no-repeat;">
<div class="container main">
    <div class="row">
      <div class="col-xs-12 col-sm-12 col-md-6"><img src="bilder/logo.png" width="326" height="122" /></div>
      <div class="col-xs-12 col-sm-12 col-md-6 visible-md visible-lg"><img src="bilder/logo_tw.png" align="right" width="256" height="122" /></div>
    </div>	
    <div class="row">
    <hr color="#000000" />
	<?php include('navigation.php'); ?>
    </div>	
    <div class="row" style="margin-bottom:15px; margin-top:-15px;">
      <div class="col-xs-12 col-sm-12 col-md-12"><?php include("spezialbox.php"); ?></div>
    </div>
    <div class="row" style="margin-top:10px; min-height:500px; padding-bottom:10px; <?php echo $hintergrund; ?>">
    	<div class="col-xs-12 col-sm-12 col-md-12"> 
        <div style="width:99%">
			<?php
                $erlaubte_dateien = array();
                $verzeichnis = ".";
                $i = 0;
                if(is_dir($verzeichnis))
                {
                    if($handle = opendir($verzeichnis))
                    {
                        while(($file = readdir($handle)) !== false){
                            $datei = explode('.', $file);
                            if($datei[1] == 'php'){
                                $erlaubte_dateien[$i] = $file;
                                $i++;
                            }
                        }
                        closedir($handle);
                    }
                }
            
                $modul= $_GET['modul'];
                if(!isset($modul)) $modul = 'home';
                $modul = trim($modul);
                $invalide = array('\\','/','/\/',':','.');
                $modul = str_replace($invalide,' ',$modul);
                if($modul == 'gb') $modul= 'gastebuch';			
                if($modul == 'benutzerverwaltung') $modul= 'benutzer';
                if($modul == 'gruppenverwaltung') $modul= 'gruppen';
                if($modul == 'matchmodul') $modul= 'matches';	
                if(!file_exists($modul.".php")) $modul = 'home';
                if(file_exists($modul.'.php') && in_array($modul.'.php', $erlaubte_dateien, true)) include($modul.'.php');
            ?> 
        </div>
        </div>
    </div>        
</div>   
</div>
</div>

<div class="row footer">
      <div class="col-xs-12 col-sm-6 col-md-6">
      		ALL RIGHTS RESERVED BY Landsitz Immobilien | <a class="headlinelink" href="index.php?modul=impressum">IMPRESSUM</a> | <a class="headlinelink" href="index.php?modul=kontakt">KONTAKT</a>  <br /><small>Alle Bilder und Texte sind unser Eigentum und d&uuml;rfen ohne unsere Erlaubnis nicht vervielf&auml;ltigt werden!</small>
      		<br /><br /><br />
            <?php include('newsletter.php'); ?><br /><br />
      </div>
  <div class="col-xs-12 col-sm-6 col-md-6" align="right"><br /><br />Design & Umsetzung by<br /><a href="http://pum4.at" target="_blank"><a href="http://pum4.at" target="_blank"><img src="bilder/footer_logo.png" width="144" height="42" /></a><br /><br /><a href="https://www.facebook.com/landsitz.immobilien" target="_blank"><img src="bilder/fb.gif" width="144" height="44" border="0" /></a></div>
</div> 

</body>
</html>