<?php
include "php/myfunci.inc";
include "php/IP_hackcheck.inc";
include "index_vars.inc";
header('Content-Type: text/html; charset=windows-1252');

if (isset($_POST["P"])){$P=$_POST['P'];} elseif (isset($_GET["P"])){$P=$_GET['P'];} else {$P="";} 

if(!empty($P))
{
	if($P=="Abbruch-Leistungen"){$thema_id=1;}
	elseif($P=="Abbruch-Projekte"){$thema_id=2;}
	elseif($P=="BS-Abbruch-GmbH"){$thema_id=3;}
	elseif($P=="BS-Abbruch-Kontakt"){$thema_id=4;}
	else
	{
	$query_R="select page_id,thema_id,sub_thema_id,headline,text from BS_pages where clearname='$P' ";
	$result_R=safe_query($query_R);
	list($page_id,$thema_id,$sub_thema_id,$headline_AZ,$text_AZ)=mysqli_fetch_row($result_R);
#	print " <div style=\"position:absolute;top:100px;left100px;z-index:200;background-color:#FFFFCC;width:300px;height:50px;\">page_id $page_id , thema_id:$thema_id , sub_thema_id:$sub_thema_id<br>P: $P</div>'";
	}
}







if(empty($bgimg_default)){$bgimg_default="";}
if(empty($header_trans)){$header_trans="";}

if(empty($sub_thema_AZ)){$sub_thema_AZ="";}
if(empty($thema_AZ)){$thema_AZ="";}

?>

<!DOCTYPE html>

<html lang="de">

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0 /">
<?php 
  include "meta.inc";
?>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="style2021_05.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style_effects.css" type="text/css" media="screen" />


<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" href="venobox/venobox.css" type="text/css" media="screen" />



<script> 
function show(id) { 
    if(document.getElementById) { 
        var mydiv = document.getElementById(id); 
        mydiv.style.display = (mydiv.style.display=='block'?'none':'block'); 
    } 
} 
</script> 

<script>
<!--
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
// -->
</script>


<script src="css/venobox/venobox.min.js"></script>

<script>
$(document).ready(function(){

    /* default settings */
    $('.venobox').venobox(); 


    /* custom settings */
    $('.venobox_custom').venobox({
        framewidth: '800px',        // default: ''
        frameheight: '600px',       // default: ''
        border: '10px',             // default: '0'
        bgcolor: '#FFFFFF',         // default: '#fff'
        titleattr: 'data-title',    // default: 'title'
        numeratio: true,            // default: false
        infinigall: true            // default: false
    });

    /* auto-open #firstlink on page load */
    $("#firstlink").venobox().trigger('click');
});
</script>


</head>
<body>
<?php 

##### HEADERBILD

	#### Grosses Headerbild zuordnen


	if(!empty($thema_id))
		{
		$query_R="select thema,bild_name,liste from BS_thema where thema_id=$thema_id";
		$result_R=safe_query($query_R);
		list($thema_AZ,$bgimg,$liste_AZ)=mysqli_fetch_row($result_R);
		$bgimg_default="$bgimg";
		if(!empty($thema_AZ)){$header_trans="$thema_AZ";}
		if($liste_AZ==1){$GET="LIST";}
		}
	if(!empty($sub_thema_id))
		{
		$query_R="select sub_thema,bild_name from BS_sub_thema where sub_thema_id=$sub_thema_id";
		$result_R=safe_query($query_R);
		list($sub_thema_AZ,$bgimg)=mysqli_fetch_row($result_R);
		if(empty($bgimg) && !empty($bgimg_default)){$bgimg="$bgimg_default";}	
		if(!empty($sub_thema_AZ)){$header_trans="$sub_thema_AZ";}
		}

	if(!empty($page_id))
		{
		$query_R="select headline from BS_pages where page_id=$page_id";
		$result_R=safe_query($query_R);
		list($headline_AZ)=mysqli_fetch_row($result_R);
		}

	if(!empty($bgimg)){$bgimg="$UPhead/$bgimg";}
	else{$bgimg="grafics/header.jpg";}
##print "bgimg: $bgimg";
?>



<header id="headcontainer">

	<img src="<?php print "$bgimg";?>" class="header_pic" alt="BS Abbruch & Recycling">

	<div class="header_blend">
		<a href="index.php" title="BS Abbruch & Recycling"><img src="grafics/BSabbruch_logo.png" class="header_logo" alt="BS Abbruch & Recycling Logo"></a>
	</div>
<?php
	print "<div id=\"header_searchbox\">";
		print "	<form method=\"GET\" action=\"index.php\">\n";
		print "	<input type=\"hidden\" name=\"GET\" value=\"SUCHE\">\n";
		print "            <input type=\"text\" name=\"suchwort\" class=\"searchInput\" value=\"Suche\" onFocus=\"clearDefault(this)\" style=\"float:left;\">\n";
		print "          <input type=\"image\" name=\"imageField\" src=\"grafics/but_lupe.png\" class=\"searchBut\" alt=\"Suche\">\n";
		print "	</form>\n";
	print "</div>";
?>

	<nav class="header_navbox">
		<?php include "navi_top.inc";?>
	</nav>



</header>

<main id="maincontainer">

<?php
	print "<article id=\"articleR\">\n";

			if($GET=="LIST"){include "info/news_main.inc";}
			elseif(empty($GET)){include "info/info_main.inc";}
			elseif(empty($GET) && empty($thema_id)){include "info_start.inc";}

			if($GET=="SUCHE"){include "suche_main.inc";}

	print "</article>\n";

	print "<nav id=\"naviL\">\n";

			include "naviL_info.inc";

	print "</nav>\n";
?>

</main>

	<nav class="nav_top_mobile">
		<a href="" onclick="javascript:show('divText'); return false"><img src="grafics/menue_open.png" class="nav_top_mobile_button" alt="Navigation öffnen"></a>
	</nav>
	<!-- Navimenue Mobil -->
	<div style="display:none" id="divText" class="nav_top_mobile">
		<a href="" onclick="javascript:show('divText'); return false"><img src="grafics/menue_close.png" class="nav_top_mobile_button" alt="Schliessen"></a>
		<?php include "naviR_mob.inc";?>
	</div>

<div class="clear50"></div>


<footer id="footer">
<?php

		  print "<div class=\"footer_box\">\n";	
			  print "<div class=\"footer_txt\">\n";	
			  print "<b>BS Abbruch & Recycling<br />GmbH & Co. KG</b><br />\n";
			  print "Feldbergweg 11<br />\n";
			  print "D-71139 Ehningen<br />\n";
			  print "Mobil: 0171 8173817<br />\n";
			  print "Tel: 07034 9479001<br />\n";
			  print "</div>\n";
		  print "</div>\n";

		  print "<div class=\"footer_box\">\n";

			$query_sub_thema="select thema_id,thema from BS_thema where thema_id!=4 order by thema_order asc";
			$result_sub_thema=safe_query($query_sub_thema);
			if($row=mysqli_fetch_array($result_sub_thema))
			{
	  			do{
				$thema_idX=$row["thema_id"];
				$thema=$row["thema"];


				if($thema=="Aktuell/Projekte"){$thema="BS Abbruch Projekte";}
				if($thema_idZ==1){$PX="BS Abbruch Leistungen";}
				elseif($thema_idZ==2){$PX="BS Abbruch Projekte";}
				elseif($thema_idZ==3){$PX="BS-Abbruch-GmbH";}
				elseif($thema_idZ==4){$PX="BS-Abbruch-Kontakt";}

					print "<a href=\"index.php?P=$PX\" class=\"footer_txt\" title=\"$thema\">&rArr; $thema</a><br />";
		
				 }while($row=mysqli_fetch_array($result_sub_thema)) ;
			}
		  print "</div>\n";

		  print "<div class=\"footer_box\">\n";
	
			$query_sub_thema="select sub_thema_id,sub_thema from BS_sub_thema where thema_id=4 order by sub_thema_order asc";
			$result_sub_thema=safe_query($query_sub_thema);
			if($row=mysqli_fetch_array($result_sub_thema))
			{
	  			do{
				$sub_thema_idX=$row["sub_thema_id"];
				$sub_thema=$row["sub_thema"];
				
				$query_R="select page_id,clearname from BS_pages where sub_thema_id=$sub_thema_idX ";
				$result_R=safe_query($query_R);
				list($page_idX,$clearname)=mysqli_fetch_row($result_R);

					print "<a href=\"index.php?P=$clearname\" class=\"footer_txt\" title=\"Bs Abbruch $sub_thema\">&rArr; $sub_thema</a><br />";
		
				 }while($row=mysqli_fetch_array($result_sub_thema)) ;
			}
		  print "</div>\n";

		  print "<div class=\"footer_box\" style=\"text-align:center\">\n";

				print "<span class=\"smalltext\">© 2021 by jamjam</span><br/><a href=\"https://jamjam.de\" title=\"Small Business CMS by jamjam Informationssysteme\" target=\"_blank\"><img src=\"grafics/jamjam_logo.png\" style=\"width:200px;height:auto\" alt=\"jamjam Informationssysteme CMS\"></a>\n";
		  print "</div>\n";

?>
</footer>

<div class="clear50"></div>

</body>
</html>
