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/deensekroon.komma-mediadesign.nl/wwwroot/php/page_over.php
<?php

function overQuery($overId)
{

    /* get mysqli */
    global $mysqli;

    /* get info */
    $query = 'SELECT o.title, o.titleEn, o.image, o.description, o.descriptionEn
			  FROM over AS o, content_status AS s
			  WHERE s.active = 1
			  AND o.id = '.$overId.'
			  AND s.itemId = o.id
			  AND s.linkname = "over"
			  AND o.published = 1 
			  ORDER BY o.itemOrder DESC
			  LIMIT 1';

    if ($result = $mysqli->query($query)) {
        return $result->fetch_assoc();
    }
}


function makeView($title, $description, $image) {
    return '<div class="contained-layout image-text about">
                <div class="col-3 col-image image-holder">
                 '.$image.'          
                </div>
                <div class="col-3 col-text">
                    <div class="text-block">
                        <h1>'.$title.'</h1>
                        '.$description.'                        
                    </div>
                </div>
            </div>';
}

function convertRecordIntoVariables ($record) {

    $_SESSION['lang'] == 'nl' || empty($record['titleEn']) ? $title = fromDatabase($record['title']) : $title = fromDatabase($record['titleEn']);
    $_SESSION['lang'] == 'nl' || empty($record['descriptionEn']) ? $description = fromDatabase($record['description']) : $description = fromDatabase($record['descriptionEn']);
    $image = replaceShortcodes($record['image']);

    return [$title, $description, $image];
}

function about()
{
    $record = overQuery(1);
    list($title, $description, $image) = convertRecordIntoVariables($record);
    return makeView($title, $description, $image);
}

function kopenhagen()
{
    $record = overQuery(2);
    list($title, $description, $image) = convertRecordIntoVariables($record);
    return makeView($title, $description, $image);
}

function shoppenOpAfspraak() {
    $record = overQuery(3);
    list($title, $description, $image) = convertRecordIntoVariables($record);
    return makeView($title, $description, $image);
}