HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/verrassendveel.komma.pro/wwwroot/php/getVestigen.php
<?php

function getVestigen(){
	global $mysqli;
	
	//// Get Info Introtext \\\\
	$query = 'SELECT v.title, v.description 
			  FROM vestigen AS v, content_status AS s
			  WHERE s.active = 1
			  AND s.itemId = v.id
			  AND s.linkname = "vestigen"
			  ORDER BY v.itemOrder DESC';
	$result = $mysqli->query($query);
	
	//// create variable \\\\
	$output = '';
	$output .= '<div class="pagetop"></div>';
	$output .= '<div class="mid-content-container page-top-margin">';
		$output .= '<h1>Winkelpand, showroom, bedrijfsruimte huren</h1>';
		$output .= '<hr class="mid-content" />';
		//social media
		// FACEBOOK \\
//		$output .= '<a class="hover-button socialtop top-facebook-btn" href="https://www.facebook.com/langstraat.biz/" target="_blank">
//						<span class="btn-facebook"></span>
//						<span class="btn-facebookhover hover"></span>
//					</a>';
	$output .= '</div>';
	$output .= '<div class="clear"></div>';
	
	// photos //
	$photoquery = 'SELECT DISTINCT vp.shortcode, v.itemOrder
			  FROM vestigen_photos AS vp, vestigen AS v, content_status AS s
			  WHERE s.active = 1
			  AND s.itemId = v.id
			  AND v.id = vp.itemId
			  AND s.linkname = "vestigen"
			  ORDER BY v.itemOrder DESC';
	if( ! $photoresult = $mysqli->query($photoquery)) dd($mysqli->error);
	$numphotos = $photoresult->num_rows;
	$photos = array();
	$other = $other2 = '';
	$i = 0;
	$photoRel = 'vestigen';
	while($photorecord = $photoresult->fetch_assoc()){
		if(!empty($photorecord['shortcode'])){
				$shortcode =$photorecord['shortcode'];				
				$mediaResult = $mysqli->query('SELECT title, path FROM media_files WHERE shortcode = "'.$shortcode.'" LIMIT 1');
				$mediaRecord = $mediaResult->fetch_assoc();
				$photoPath = $mediaRecord['path'];
				if(!empty($photoPath)){
					if($i == 0){ $first = $first2 = './images/uploads/'.$photoPath; }
						else{
							$other .= '<a href="./images/uploads/'.$photoPath.'" rel="lightbox['.$photoRel.']" class="hidden">&nbsp;</a>';
							$other2 .= '<a href="./images/uploads/'.$photoPath.'" rel="lightbox['.$photoRel.'2]" class="hidden">&nbsp;</a>';
						}
					$i++;
				}
		}
	}
	$output .= '<div class="mid-content-container page-top-margin">';
	if($numphotos > 0){ 
		$output .= '<a class="hover-button" href="'.$first.'" rel="lightbox['.$photoRel.']">
						<span class="btn-text">Impressie van het terrein</span>
						<span class="arrow btn-arrow"></span>
						<span class="btn-green-288"></span>
						<span class="btn-darkgreen-288 hover"></span>
					</a>';
		$output .= $other;
	}
	

	
	// output //
	$leftOutput = '';
	$rightOutput = '';
	$bool = 0;
	
	while($record = $result->fetch_assoc()){
	
		$title = fromDatabase($record['title']);
		$description = fromDatabase($record['description']);
		$description = replaceShortcodes($description, 352);
		if($bool == 1){
			$leftOutput .= '<div class="page-item-holder">';
				$leftOutput .= '<h3>'.$title.'</h3>';
				$leftOutput .= $description;
			$leftOutput .= '</div>';
			$bool = 0;
		}
		else{
			$rightOutput .= '<div class="page-item-holder">';
				$rightOutput .= '<h3>'.$title.'</h3>';
				$rightOutput .= $description;
			$rightOutput .= '</div>';
		
			$bool = 1;	
		}
	}
	
		$output .= '<div class="page-column margin-right-40">';
			$output .= $leftOutput;
		$output .= '</div>';
	
		$output .= '<div class="page-column">';
			$output .= $rightOutput;
		$output .= '</div>';
	$output .= '<div class="clear"></div>';
	
	if($numphotos > 0){ 
		$output .= '<a class="hover-button" href="'.$first2.'" rel="lightbox['.$photoRel.'2]">
						<span class="btn-text">Impressie van het terrein</span>
						<span class="arrow btn-arrow"></span>
						<span class="btn-green-288"></span>
						<span class="btn-darkgreen-288 hover"></span>
					</a>';
		$output .= $other2;
	}
	$output .= '<div class="clear"></div>';
	
	$output .= '</div>';
	
	//// return output \\\\
	return $output; 
	
}

?>