Beispiel #1
0
<?php

include "autoload.php";
use Controller\LightShowController;
// Todo: Start coding here
$controller = new LightShowController();
$controller->getPlaylistContent();
?>

<!-- list them songs -->

<table>

    <?php 
foreach ($controller->getPlaylistContent() as $song) {
    ?>

    <tr><td>

            <?php 
    echo $song;
    ?>

    </td></tr>

    <?php 
}
?>

</table>
Beispiel #2
0
    case "add":
        echo "add";
        $song = $_GET["song"];
        $ctrl->addToPlaylist($song, $song);
        echo "Added {$song} to playlist<br>";
        break;
}
?>

<a href="?action=play">play playlist</a>

<form action="index.php" method="get">

    Add song to playlist:
    <select name="song">
        <?php 
foreach ($ctrl->getSongs() as $song) {
    echo "<option value='{$song}'>{$song}</option>";
}
?>
    </select>

    <button type="submit" name="action" value="add" >add</button>

    <p>Songs in playlist</p>
    <pre><?php 
echo $ctrl->getPlaylistContent();
?>
</pre>
</form>
<?php

include "autoload.php";
use Controller\LightShowController;
// Todo: Start coding here
$controller = new LightShowController();
$controller->getPlaylistContent();
$controller->playPlaylist();