$username = $_GET['username'];
}
if (isset($_POST['password'])) {
    $password = $_POST['password'];
} else {
    $password = $_GET['password'];
}
if ($username == CHESS_USERNAME && $password == CHESS_PASSWORD) {
    // Everything is OK
} else {
    die('Access denied');
}
if (isset($_POST['save'])) {
    for ($i = 0, $count = count($_POST['event_name']); $i < $count; $i++) {
        if (isset($_POST['event_name'][$i]) && strlen($_POST['event_name'][$i])) {
            RelayEvent::saveFromForm($i);
        }
    }
}
?>
<style type="text/css">
body{
	font-family: Trebuchet MS;
}
td{
	font-size:0.8em;
}
.errorRow td{
    color:#F00;
    font-style:italic;
}
 public function getLastBuildDates($ids)
 {
     if (!count($ids)) {
         return array();
     }
     $ret = array();
     $res = mysql_query("select * from chess_live_relay where id in(" . implode(",", $ids) . ")");
     while ($row = mysql_fetch_array($res)) {
         $event = RelayEvent::createInstanceFromDbRow($row);
         $ret[] = array('id' => $event->getId(), 'date' => $event->getDateOfLastBuild());
     }
     return $ret;
 }