<?php require_once 'includes/protect.php'; ?>
<div class="menudcontainer parallax divmodel2 color3 text-center hidden-print"><?php echo $slogan2 ?><div class="container menudstyle hidden-print"><div class="content menudin text-center"><?php include 'includes/itemmenu.php';?><?php include 'includes/share.php';?><?php echo $banner2 ?></div></div></div>
<?php echo $menudbefore ?>
<div class="menudcontainer"><div class="container menudbgr"><div class="content menudcontent">
<?php echo $map ?>
<?php echo $sitetextd ?>
<div class="boxdown boxcontact"><div class="boxdownin">
<div class="titlesdown"><a href="contact"><?php echo $titlecontact ?></a></div>
<hr class="hrdown">
<div class="titlesdown1"><?php echo $sitecompany1 ?></div> 
<?php if ($titleactivity) { ?><a href="."><?php echo $titleactivity ?></a><?php } ?>
<div class="padtop5">
<?php echo $siteaddress ?><br>
<a href="mailto:<?php echo $sitemail?>?subject=<?php echo $domain ?>" class="linkmail"><?php echo $iconmail?><?php echo $sitemail?></a> 
</div>
</div></div>
<?php echo $sitetextd0 ?>
<?php
$result70 = $mysqli->query("SELECT id FROM links WHERE publish='yes'");
$lrows = mysqli_num_rows($result70);
?>
<?php if ($lrows>0 OR $socialplugin) {?>
<div class="boxdown boxsocial hidden-print"><div class="boxdownin">
<div class="titlesdown"><?php echo $socialmedia ?></div>
<hr class="hrdown">
<?php
$result71 = $mysqli->query("SELECT id, name, url FROM links WHERE publish='yes' ORDER BY priority");
while($row = $result71->fetch_array()) {
$socialid=$row['id'];
$social=$row['name'];
$surl=$row['url'];
?>
<div class="divsocial">
<a href="<?php echo $surl ?>" target="_blank"><img src="<?php echo $filepath ?>links/<?php echo $socialid ?>.png" class="img-social bgrcolor3 bordercolor2 <?php echo $social ?>" alt="<?php echo $social ?>"></a>
</div>
<?php } ?>
<div class="cleared"></div>
<?php echo $socialplugin ?>
</div></div>
<?php } ?>
<?php if ($formdown) { ?>
<div class="boxdown boxform"><div class="boxdownin">
<div class="titlesdown"><?php echo $titleformd ?></div>
<hr class="hrdown">
<?php include 'includes/'.$formdown.'.php';?>
</div></div>
<?php } ?>
<?php if ($newsletter==1) { ?><div class="boxdown boxnewsletter hidden-print"><div class="boxdownin">
<div class="titlesdown"><?php echo $pagenewsletter ?></div>
<hr class="hrdown">
<?php
if (isset($_POST['submitnl']) && $_REQUEST['notes']=='' && $_REQUEST['emailnl']!='' && $_REQUEST['namem']!='') {

$result = $mysqli->query("SELECT insert_id FROM categories WHERE type=4 AND priority=2 GROUP BY lang_id LIMIT 1");
$row = $result->fetch_array(); 
$nlid=$row['insert_id'];

$namem = $mysqli->real_escape_string(strip_tags($_REQUEST['namem']));
$namem = mb_convert_case($namem, MB_CASE_TITLE, "UTF-8");
$namem = preg_replace('/\s+/', ' ',$namem);
$emailm = $mysqli->real_escape_string(strip_tags($_REQUEST['emailnl']));
$emailm = strtolower($emailm);
$emailm = preg_replace('/\s+/', '',$emailm);
$date = date ("j.m.Y");
$emailparts = explode("@", $emailm);
$passwordm1 = $emailparts[0];
$passwordm = $passwordm1.$date;
$passwordm = preg_replace('/[.,]/', '', $passwordm);

$resultnl = $mysqli->query("SELECT id FROM members WHERE email='$emailm'");
$nrmember = mysqli_num_rows($resultnl);

if ($nrmember==0 AND $_REQUEST['notes']=='' AND $namem!=' ' AND $namem!='' AND (filter_var($emailm, FILTER_VALIDATE_EMAIL)) ) {
$mysqli->query("INSERT INTO members (category_id, name, email, password, publish, active, date) VALUES ('$nlid', '$namem', '$emailm', '$passwordm', 'yes', '1', '$date')");
}
?>
<?php echo $textnewsletter2 ?>
<?php } else { ?>
<div class="margbottom10"><?php echo $textnewsletter1 ?></div>
<form name="formanl" method="post">
<label for="namem" class="hlabel"><?php echo $fieldname ?></label>
<input type="text" name="namem" id="namem" placeholder="<?php echo $fieldname ?>*" size="18" maxlength="60" class="formsd forms1" required>
<label for="emailnl" class="hlabel"><?php echo $pagenewsletter ?></label>
<input type="email" name="emailnl" id="emailnl" placeholder="<?php echo $textnl ?>*" size="18" maxlength="60" class="formsd forms1" required>
<input type="submit" name="submitnl" value="<?php echo $signup ?>" class="button buttond">
<label class="hide">note<input type="text" name="notes" id="notes" size="1" maxlength="20" class="formsn"></label>
</form>
<?php } ?>
</div></div><?php } ?>
<?php echo $sitetextd1 ?>
<?php
$result72 = $mysqli->query("SELECT insert_id, page, name, text, type FROM categories WHERE promote LIKE '%2%' AND type<3 AND lang_id=$lang ORDER BY priority, level");
while($row = $result72->fetch_array()) {
$menucatid=$row['insert_id'];
$menupage=$row['page'];
$menucategory=$row['name'];
$menutextc1=$row['text'];
$menutextc = mb_substr(strip_tags($menutextc1), 0, 200, 'UTF-8');
if (strlen($menutextc1)>200) {
$menutextc = substr($menutextc, 0, strrpos($menutextc, ' '));
}
$mtypec=$row['type'];

$result73 = $mysqli->query("SELECT id FROM categories WHERE parent=$menucatid AND lang_id=$lang AND publish='yes'");
$nrowscat = mysqli_num_rows($result73);

$result74 = $mysqli->query("SELECT id FROM items WHERE category_id=$menucatid AND lang_id=$lang AND publish='yes'");
$nrows = mysqli_num_rows($result74);
?>
<?php if ($nrowscat>0) {?><div class="boxdown boxdownw hidden-print"><div class="boxdownin">
<div class="titlesdown"><?php echo $menucategory ?></div>
<hr class="hrdown">
<div class="margbottom10"><?php echo $menutextc ?><?php if (strlen($menutextc1)>200) { ?>...<?php } ?></div>
<?php
$result75 = $mysqli->query("SELECT page, name FROM categories WHERE parent=$menucatid AND lang_id=$lang AND publish='yes' ORDER BY priority");
while($row = $result75->fetch_array()) {	
$menupage2=$row['page'];
$menucategory2=$row['name'];
?>
<div class="mspace"><a href="<?php echo $menupage2 ?>" class="linksdown"><?php echo $menucategory2 ?></a></div>
<?php } ?>
</div></div><?php } ?>
<?php if ($nrows>0) {?><div class="boxdown boxdownw hidden-print"><div class="boxdownin">
<a href="<?php echo $menupage ?>" class="titlesdown"><?php echo $menucategory ?></a>
<hr class="hrdown">
<div class="margbottom10"><?php echo $menutextc ?><?php if (strlen($menutextc1)>200) { ?>...<?php } ?></div>
<?php
$result76 = $mysqli->query("SELECT * FROM items WHERE category_id=$menucatid AND promote LIKE '%2%' AND lang_id=$lang AND publish='yes' ORDER BY priority");
$nrows2 = mysqli_num_rows($result76);
while($row = $result76->fetch_array()) {	
$nid=$row['insert_id'];
$pageid=$row['page_id'];
$pageitem=$row['page'];
if ($itempage==1) { $siteitem=$pageitem; }
$pagesiteitem=$siteitem.".".$pageid;
if ($mtypec==1) { $pagesiteitem=$menupage; }

$nname=$row['name'];
$ndetails=$row['details'];
$ntext=$row['text'];
if ($ndetails=='') { 
$ntext1="$ntext";
} else {
$ntext1="$ndetails";	
}
$ntext = mb_substr(strip_tags($ntext1), 0, 130, 'UTF-8');
if (strlen($ntext1)>130) {
$ntext = substr($ntext, 0, strrpos($ntext, ' '));
}
$nurl=$row['url'];
$nimage=$row['image'];
$nshowpage=$row['showpage'];
?>
<div class="divfloat3">
<?php if ($nimage==1) { ?>
<a <?php if ($nurl AND $nshowpage==0) { ?>href="<?php echo $nurl ?>" target="_blank"<?php }else{ ?>href="<?php echo $pagesiteitem ?>"<?php } ?>><img src="<?php echo $codepath ?>includes/image.php?image=<?php echo $imagepath ?>items/<?php echo $nid ?>.jpg&amp;nwidth=100" class="img-md" alt="<?php echo $nname ?>" title="<?php echo $nname ?>"></a>
<?php } ?>
<div class="mspace"><a <?php if ($nurl AND $nshowpage==0) { ?>href="<?php echo $nurl ?>" target="_blank"<?php }else{ ?>href="<?php echo $pagesiteitem ?>"<?php } ?> class="linksdown"><?php echo $nname ?> &raquo;</a><br>
<?php echo $ntext ?> <?php if (strlen($ntext1)>130) { ?>...<?php } ?>
</div>
</div>
<?php } ?>
</div></div><?php } ?><?php } ?>
<?php echo $sitetextd2 ?>
<?php echo $banner3 ?>
<?php if ($type==2 OR $cookies==1) { ?><?php echo $textcookies ?><?php } ?>
<div class="cleared"></div>
<div class="floatright margright10 hidden-print linkf"><?php echo $promocode ?></div>
<div class="divarrow hidden-print"><a href="#" class="icon fa-angle-up arrowtop"><span class="hide">top</span></a></div> 
</div></div></div>
<?php echo $menudafter ?>
<?php echo $sitescript3 ?>