3 * Displayes the submitted flag_ids of the
4 * last X time with meta information
5 * If the submission to gameserver was successfull (submitsuccess)
6 * and we got points for it (scoresuccess) it should be green bg
8 * 2014-15 by Jan "Someone" Vales <someone@somenet.org>
12 $GLOBALS['db'] = new PDO('pgsql:host=localhost;port=5432;dbname=flagbot;user=flagbot;password=flagbotpw');
13 $GLOBALS['db']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
14 $query = "SELECT * FROM flag_ids WHERE (received + INTERVAL '30 minute') > now() ORDER BY received DESC";
20 <link rel="stylesheet" type="text/css" href="styles.css"></link>
23 <h1>Submission Board - flag_ids</h1>
24 <p><a href="./index.php">go to flags</a></p>
25 <p>Shows all submissions of the last 30 min<br>
26 NUM ROWS: <?php echo sizeof($GLOBALS['db']->query($query)->fetchAll()); ?></p>
27 <table style="width: 100%">
39 $stmt = $GLOBALS['db']->query($query);
40 while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
42 <tr class="score-<?php echo $row['status']; ?>">
43 <td><?php echo $row['service']; ?> </td>
44 <td><?php echo $row['team']; ?> </td>
45 <td><?php echo $row['flag_id']; ?> </td>
46 <td><?php echo $row['host']; ?> </td>
47 <td><?php echo $row['received']; ?></td>
48 <td><?php echo $row['status']; ?></td>
55 <p>Status: 0=new; 1=depleted</p>