Пример #1
0
<?php

/*
Oh man is this quick and dirty. This makes way too many database calls and could be made
more efficient but we're assuming not many people are going to be using this. A quick
fix would be to cronjob this shit and pipe it to a static html file every 5 min or so.
*/
include 'functions.php';
$checkpoints = get_all_checkpoint_ids();
print "Total Runners in Database: " . total_runners() . "<br />";
print "Registered Runners: " . total_runners_registered(1) . "<br />";
print "Unregistered Runners: " . total_runners_registered(0) . "<br />";
print "<br />";
print "Runners that have been tagged: " . total_runners_tagged() . "<br />";
print "Registered Runners remaining: " . total_runners_registered_untagged(1) . "<br />";
print "Unregistered runners remaining: " . total_runners_registered_untagged(0) . "<br />";
print "<br />";
print "<b>Tag Stats</b><br />";
print "Active Taggers: " . active_chasers() . "<br />";
print "Active Taggers in last 30min: " . active_chasers(30) . "<br />";
print "<br />";
print "<b>Checkpoint Stats:</b><br />";
foreach ($checkpoints as $checkpoint_id) {
    print "<h2>" . get_checkpoint_name($checkpoint_id) . ":</h2>";
    print "&nbsp;&nbsp&nbsp;Checkins: " . total_checkpoint_checkins($checkpoint_id) . "<br />";
    $most_recent = most_recent_checkin($checkpoint_id);
    if (!empty($most_recent)) {
        print "&nbsp;&nbsp&nbsp;Most recent checkin: " . get_runner_name($most_recent['runner_id']) . " (" . $most_recent['runner_id'] . ") at " . $most_recent['checkin_time'] . "<br />";
        print "<img src=\"/photos/" . $most_recent['runner_id'] . ".jpg\" style=\"margin-left: 25px;\"><br />";
    }
    print "<br />";
Пример #2
0
        //start the game
        print "<h1>Start running bitches!</h1>";
        if (mysql_query("INSERT INTO " . OTHER_TBL . " (event, time) VALUES ('start',NOW())", $mysql)) {
            _logger(LOG_GAME, "START", "Journey has started!");
        }
        print "Start time recorded as:<br />" . get_start_time();
    } else {
        if ($_POST['action'] == "END") {
            print "<h1>The game has ended!</h1>";
            if (mysql_query("INSERT INTO " . OTHER_TBL . " (event, time) VALUES ('end',NOW())", $mysql)) {
                _logger(LOG_GAME, "END", "Journey has ended!");
            }
            print "End time recorded as:<br />" . get_end_time();
            print "<br />";
            print "<p>The game lasted: " . time_between(get_start_time(), get_end_time()) . "</p>";
            print "<p>Total Runners Tagged: " . total_runners_tagged() . "</p>";
            $checkpoints = get_all_checkpoint_ids();
            foreach ($checkpoints as $checkpoint_id) {
                print "<p>" . get_checkpoint_name($checkpoint_id) . ":<br />";
                print "&nbsp;&nbsp&nbsp;Checkins: " . total_checkpoint_checkins($checkpoint_id) . "</p>";
                print "<br />";
            }
        }
    }
} else {
    ?>
<h1>Are you ready?</h1>
<div align="center">
<form action="" method="post">
<input type="submit" name="action" value="START" style="width: 50%; height: 75px; font-size: 20pt;">
<br /><br /><br /><br />