예제 #1
0
<?php

#----------------------------------------------------------------------
#   Initialization and page contents.
#----------------------------------------------------------------------
$currentSection = 'persons';
require 'includes/_header.php';
analyzeChoices();
showBody();
require 'includes/_footer.php';
#----------------------------------------------------------------------
function analyzeChoices()
{
    #----------------------------------------------------------------------
    global $chosenPersonId;
    $chosenPersonId = strtoupper(getNormalParam('personId'));
}
#----------------------------------------------------------------------
function showBody()
{
    #----------------------------------------------------------------------
    global $chosenPersonId;
    // simple validation first...
    if (!preg_match('/\\d{4}\\w{4}\\d{2}/', $chosenPersonId)) {
        showErrorMessage('Invalid WCA id Format <strong>[</strong>' . o($chosenPersonId) . '<strong>]</strong>');
        print '<p><a href="persons.php">Click here to search for people.</a></p>';
        return;
    }
    #--- Get all incarnations of the person.
    $persons = dbQuery("\n    SELECT person.name personName, country.name countryName, day, month, year, gender\n    FROM Persons person, Countries country\n    WHERE person.id = '{$chosenPersonId}' AND country.id = person.countryId\n    ORDER BY person.subId\n  ");
    #--- If there are none, show an error and do no more.
2004CHAN04	5	61	6.80%
*/
#--- Output the page header.
echo "<h1>Missing Averages</h1>\n\n";
echo "<p style='padding-left:20px;padding-right:20px;font-weight:bold'>Some events don't have official averages, only singles. They have best-of-3 rounds, though, so we can compute mean-of-3. This page does that. Since mean-of-3 is pretty hard for 4x4 and 5x5 blindfolded, means of 2 (out of 2 or 3) are shown instead for those who don't have a mean-of-3 yet. Note this is just for fun, officially we only rank by best-of-X single results. </p>";
echo "<p style='padding-left:20px;padding-right:20px;color:gray;font-size:10px'>Generated on " . wcaDate() . ".</p>";
#--- Tabbing div and links
$tabLinks = '';
foreach (array('444bf', '555bf') as $eventId) {
    $tabLinks .= "<li><a href=\"#container_{$eventId}\">{$eventId}</a></li>\n";
}
echo "\n<div id=\"tabs\" style=\"font-size:1.0em; width:980px; margin:auto; background:white \">\n<ul>\n{$tabLinks}</ul>\n";
#--- Tabbing contents
foreach (array('444bf', '555bf') as $eventId) {
    echo "<div id=\"container_{$eventId}\">";
    showBody($eventId);
    echo "</div>\n";
}
#--- Finish/store/show the page
echo "</div>";
require '../../includes/_footer.php';
$html = ob_get_clean();
#$html = preg_replace( "/'p.php/", "'../p.php", $html );
echo $html;
if (!wcaDebug()) {
    file_put_contents('index.php', $html);
}
#----------------------------------------------------------------------
function showBody($eventId)
{
    #----------------------------------------------------------------------
예제 #3
0
파일: index.php 프로젝트: brtknr/Dilkit
<?php

include "global.php";
// Include the globally shared module
$p = $_GET[p];
//------ Retrieve information on which page has been requested
$m = $_GET[m];
//------ Retrieve if the page has been requested in Printable mode
if (!$theInterface[$_SESSION[userRank]][Pages][$p]) {
    // If the requested page isn't a valid page, set the page as the default page for that particular user
    $p = "welcomePage";
}
if (!$m) {
    showHeader();
}
// Only if not in Printable mode, show the header.
showBody($p);
// Show the body of the page.
if (!$m) {
    showFooter();
}
// Only if not in Printable mode, show the footer.