-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmilestones.php
More file actions
55 lines (52 loc) · 1.79 KB
/
milestones.php
File metadata and controls
55 lines (52 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
session_start();
require_once("require/secure.php");
require_once("require/rplayers.php");
require_once("require/basic.php");
require_once("require/rgame.php");
Secure( true );
$nmiles = get_num_milestones();
$values = get_score_milestones();
if( isset($_REQUEST["action"]) )
{
$action = $_REQUEST["action"];
if( $action == "Kill Unsupplied Humans" )
{
if( count($values) <= 0 ) set_alert("ERROR", "No milestones configured.");
kill_humans_below_score( $values[0] );
set_alert("SUCCESS", "Un-Supplied Humans killed.");
}
}
page_head();
?>
<h2>Milestone Summary</h2>
<p>This page shows all <strong>humans</strong> who have surpassed the first milestone and beyond.</p>
<h3>Kill Un-Supplied</h3>
<p>Hitting this button will kill all humans <i>(<?php echo count_humans_below_score($values[0]); ?>)</i> who have not achieved the first milestone.</p>
<form method="post" action="">
<input class="btn btn-default" type="submit" value="Kill Unsupplied Humans" name="action" />
</form>
<h3>Milestone Lists</h3>
<div class="row">
<div class="col-md-4">
<?php
for( $i = 0; $i < $nmiles; $i++ ) {
$players = get_players_for_milestones($i);
echo "<h2>Milestone " . ($i + 1) . " (" . $values[$i] . " points)";
if (count($players) > 0)
echo " <i>(" . count($players) . ")</i>";
echo "</h2>";
if (count($players) > 0) {
echo "<table class='milestone table table-striped table-bordered table-condensed'><tr><th>Name</th><th>E-Mail</th></tr>";
foreach ($players as $player) {
echo "<tr><td>{$player['first_name']} {$player['last_name']}</td><td>{$player['email']}</td></tr>";
}
echo "</table>";
} else echo "<p>No players in this bracket.</p>";
}
?>
</div>
</div>
<?php
page_foot();
?>