3 * Displayes the submitted flowIDs 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-16 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);
 
  15 $query = "SELECT count(*) as count , submitter, service, status FROM flags WHERE (received + INTERVAL '30 minute') > now()  group by submitter, service, status order by count DESC";
 
  17 if (isset($_REQUEST['all'])) $query = "SELECT count(*) as count , submitter, service, status FROM flags group by submitter, service, status order by count DESC";
 
  23     <link rel="stylesheet" type="text/css" href="styles.css"></link>
 
  26     <h1>Submission Board - Services/Exploits and their Flags</h1>
 
  27     <p><a href="./index_serviceflags.php">Service + Exploit flags</a> <a href="./index_serviceflags.php?all">Alltime Service + Exploit flags</a> <a href="./index.php">Flaglist</a> <a href="./index_flag_ids.php">go to flag_ids</a></p>
 
  28     <?php if (!isset($_REQUEST['all'])) echo '<p>Shows all submissions of the last 30 min<br>'; ?>
 
  30     NUM ROWS: <?php echo sizeof($GLOBALS['db']->query($query)->fetchAll()); ?></p>
 
  31     <table style="width: 100%">
 
  42           $stmt = $GLOBALS['db']->query($query);
 
  43           while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
 
  45             <tr class="score-<?php echo $row['status']; ?>">
 
  46               <td><?php echo $row['count']; ?> </td>
 
  47               <td><?php echo $row['service']; ?> </td>
 
  48               <td><?php echo $row['submitter']; ?> </td>
 
  49               <td><?php echo $row['status']; ?></td>
 
  56     <p>Status: 0=submission pending; 1=submitted:OK; 2=submitted:Fail</p>