예제 #1
0
<title>Award Judging</title>
<?php 
require 'inc/stylesheet.inc';
?>
<meta http-equiv="refresh" content="300"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/dashboard-ajax.js"></script>
<script type="text/javascript" src="js/checkin.js"></script>
</head>
<body>
<?php 
$banner_title = 'Judging';
require 'inc/banner.inc';
require_once 'inc/standings.inc';
// TODO: Magical '3' for 'other' awards...
$awardTypeOther = read_single_value('SELECT awardtypeid FROM AwardTypes WHERE awardtype = \'Other\'', array(), 3);
$awards = array(array('Most', 'Aerodynamic'), array('Most', 'Amazing'), array('Best', 'Animal Theme'), array('Most', 'Artistic'), array('Most', 'Astonishing'), array('Most', 'Attractive'), array('Most', 'Awesome'), array('Most', 'Box-Like'), array('Most', 'Cheerful'), array('Most', 'Colorful'), array('', 'Coolest Car'), array('Most', 'Cosmic'), array('Most', 'Creative'), array('Most', 'Creative Use of Materials'), array('', 'Cubbiest Car'), array('Most', 'Decals'), array('Best', 'Detail'), array('Most', 'Distinct'), array('Most', 'Distinguished'), array('Best', 'Driver in the Car'), array('Most', 'Elaborate'), array('Most', 'Expensive-Looking'), array('Most', 'Extraordinary'), array('Most', 'Extreme'), array('', 'Fanciest'), array('Most', 'Fascinating'), array('', 'Fastest-Looking Car'), array('Most', 'Funky'), array('', 'Funniest'), array('Most', 'Futuristic'), array('Most', 'Galactic'), array('', 'Glossiest'), array('Most', 'Grandiose'), array('Most', 'Humorous'), array('Most', 'Imaginative Design'), array('Most', 'Impressive'), array('Most', 'Incredible'), array('Most', 'Innovative'), array('Most', 'Interesting'), array('Most', 'Inventive'), array('Most', 'Magnificent'), array('Most', 'Majestic'), array('Most', 'Original'), array('Most', 'Outstanding'), array('Most', 'Patriotic'), array('Most', 'Phenomenal'), array('Most', 'Radical'), array('Most', 'Realistic-Looking'), array('Most', 'Remarkable'), array('Most', 'Resourceful'), array('', 'Scariest'), array('Best', 'Scout Theme'), array('', 'Shiniest Car'), array('', 'Sleekest Car'), array('', 'Smoothest Finish'), array('Most', 'Spirited'), array('', 'Sportiest-Looking'), array('Most', 'Stellar'), array('', 'Strangest Shape'), array('Most', 'Unusual'), array('Best', 'Use of Color'), array('Best', 'Use of the Color Blue'), array('Best', 'Use of the Color Green'), array('Best', 'Use of the Color Orange'), array('Best', 'Use of the Color Purple'), array('Best', 'Use of the Color Red'), array('Best', 'Use of the Color Yellow'), array('Best', 'Use of the Color _____'), array('Best', 'Vehicle Not a Car'), array('Best', 'Wedge Shape'), array('', 'Zaniest'));
$sql = 'SELECT racerid, carnumber, lastname, firstname, class' . ' FROM RegistrationInfo' . ' INNER JOIN Classes' . ' ON Classes.classid = RegistrationInfo.classid' . ' WHERE passedinspection = 1 AND exclude = 0' . ' ORDER BY carnumber';
$racers = array();
$stmt = $db->query($sql);
foreach ($stmt as $rs) {
    $racerid = $rs['racerid'];
    $racers[$racerid] = array('racerid' => $racerid, 'carnumber' => $rs['carnumber'], 'lastname' => $rs['lastname'], 'firstname' => $rs['firstname'], 'class' => $rs['class'], 'awards' => array());
}
$stmt->closeCursor();
$n_den_trophies = read_raceinfo('n-den-trophies', 3);
$n_pack_trophies = read_raceinfo('n-pack-trophies', 3);
require_once 'inc/ordinals.inc';
$speed_trophies = top_finishers_by_class($n_den_trophies);
foreach ($speed_trophies as $classid => $den_trophies) {
    for ($place = 0; $place < count($den_trophies); ++$place) {
예제 #2
0
    }
}
$parsed = parse_photo_url($path_info);
if (!$parsed) {
    // Malformed URL
    http_response_code(404);
    exit(1);
}
$repo = photo_repository($parsed['repository']);
if (!$repo) {
    // No such repository
    http_response_code(404);
    exit(1);
}
if ($parsed['url_type'] == 'racer') {
    $file_path = read_single_value('SELECT ' . $repo->column_name() . ' FROM RegistrationInfo' . ' WHERE racerid = :racerid', array(':racerid' => $parsed['racerid']));
    if (!$file_path) {
        // No such racer
        http_response_code(404);
        exit(1);
    }
} else {
    $render = $repo->lookup($parsed['render']);
    if (!$render) {
        // No such render
        http_response_code(404);
        exit(1);
    }
    $file_path = $render->find_or_make_image_file($parsed['basename']);
}
header('Pragma: public');
예제 #3
0
    echo '<li class="ui-btn ui-btn-icon-right ui-icon-carat-r"' . ' onclick="on_choose_award(this);"' . ' data-awardkey="' . $row['awardkey'] . '"' . ' data-awardtypeid="' . $row['awardtypeid'] . '"' . ' data-classid="' . $classid . '"' . ' data-rankid="' . $rankid . '"' . ' data-awardname="' . htmlspecialchars($row['awardname'], ENT_QUOTES, 'UTF-8') . '"' . ' data-recipient="' . htmlspecialchars($row['firstname'] . ' ' . $row['lastname'], ENT_QUOTES, 'UTF-8') . '"' . ' data-class="' . ($classid ? htmlspecialchars($classes[$classid]['class'], ENT_QUOTES, 'UTF-8') : '') . '"' . ' data-rank="' . ($rankid ? htmlspecialchars($ranks[$rankid]['rank'], ENT_QUOTES, 'UTF-8') : '') . '"' . '>';
    echo '<span>' . htmlspecialchars($row['awardname'], ENT_QUOTES, 'UTF-8') . '</span>';
    echo '<p><strong>' . $row['carnumber'] . ':</strong> ';
    echo htmlspecialchars($row['firstname'] . ' ' . $row['lastname'], ENT_QUOTES, 'UTF-8');
    echo '</p>';
    echo '</li>';
}
?>
</ul>
</div>

<div class="presenter">

<div id="kiosk-summary">
<?php 
$nkiosks = read_single_value('SELECT COUNT(*) FROM Kiosks' . ' WHERE page LIKE \'%award%present%\'', array());
if ($nkiosks == 0) {
    echo '<h3>NOTE:</h3>';
    echo '<h3>There are NO kiosks ready for award presentation.</h3>';
    echo '<p class="moot">Selections on this dashboard won\'t have any observable effect.</p>';
    echo '<p class="moot">Visit the <a href="kiosk-dashboard.php">Kiosk Dashboard</a> to assign displays.</p>';
}
?>
</div>

<h3 id="awardname"></h3>

<h3 id="classname"></h3>
<h3 id="rankname"></h3>

<h3 id="recipient"></h3>