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/SBogers64/klimroosbudel.nl/wwwroot/lib/general/image_reader.class.php
<?php
/**
 * c_home.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 11/02/14
 */


class Image_Reader
{
    private $_page;

    public function __construct($page)
    {
        $this->_page=$page;
    }

    /*
     * Index of the home page
     */
    private function read()
    {
        if ($handle = opendir(DOCUMENT_IMAGE_ROOT . 'static/' . $this->_page))
        {
            $data = array();
            while (false !== ($entry = readdir($handle)))
            {
                if ($entry != "." && $entry != "..")
                {
                     $data[] = $entry;
                }
            }
            closedir($handle);
            return $data;
        }
        return false;
    }

    public function createList()
    {
        $output = '';
        if ($data = $this->read())
        {
            foreach ($data as $image)
            {
                $output .= '<li><img src="' . IMAGE_ROOT . 'static/' . $this->_page . '/' . $image . '" class="slider" /></li>';
            }
        }
        return $output;
    }
}