<?php

class Page {

    public function header() {
        
    }

    public function content() {

        $file = __DIR__.'/../../datastore/program-fi.json';
        if(file_exists($file)){
            try {
                $programs = json_decode(file_get_contents($file), true);
            } catch (\Error $e) {

            }
        }

echo '
<section id="program">
';

foreach($programs as $program){
/*
echo '
    <article style="display: flex; flex-direction: row; height: 250px; padding: 25px; background-color: #111111; margin: 50px; border-radius: 25px;">
        <img src="assets/images/stream-layout.png" style="padding: 10px; margin: 25px; border-radius: 25px;">
        <header style="display: flex; flex-direction: column; text-align: left; align-items: initial;">
            <h3>'.$program['name'].'</h3>
            <p class="schedule">
';
    if(isset($program['schedule'])){

        foreach($program['schedule'] as $schedule){
            echo '<span style="background-color: #ffffff; border-radius: 25px; padding: 5px; color: #000000;">00.00.0000 klo 00:00</span> ';
        }

    } else {
        echo '<span>Tulossa</span>';
    }

echo '</p>
            <p class="host">Juontaja: ';

    foreach($program['host'] as $host){
        echo $host.', ';
    }

echo '</p>
            <p class="producer">Tuottaja: '.$program['producer'].'</p>
        </header>
    </article>
';
*/
}

echo '
</section>
';


    }
}
  
?>