<?php
require_once "../../../config/settings.inc.php";
require_once "../../../include/cameras.inc.php";

$camselect = "<select id=\"mycam\" name=\"mycam\" onchange=\"myloader();\">";
foreach ($cameras as $key => $dict) {
    if ($dict["removed"] || ($dict["network"] != "KCRG" && $key != 'KCCI-017')) {
        continue;
    }
    $camselect .= "<option value=\"" . $dict["moviebase"] . "\">" . $dict["name"] . " \n";
}
$camselect .= "</select>";

echo <<<EOM
<html>
<head>
<title>Webcam Lapse Player</title>
<link href="/vendor/flowplayer/6.0.2/skin/minimalist.css" rel="stylesheet">
<script type="text/javascript" src="/vendor/flowplayer/6.0.2/flowplayer.min.js"></script>
</head>
<body>

<div style="background: #eee; border: 1px solid #000; margin: 5px; padding: 5px; width: 650px;">
<div id="player"  style="display:block;width:640px;height:490px;"></div>
<form name="theform">
<br /><strong>Select Camera:</strong>
{$camselect}
<strong>Select Lapse:</strong>
<select id="mylapse" name="mylapse" onchange="myloader()">
 <option value="sunrise">Sunrise 
 <option value="morning">Morning (8 AM - 11 AM) 
 <option value="afternoon">Afternoon (1 PM - 4 PM)
 <option value="eve">Sunset 
 <option value="day">Full day
</select>
</div>
</form>

<script src="kcrg.js"></script>
</body>
</html>
EOM;
