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

//Author: Kadir CETINKAYA - breakv0id@0xdeffbeef
require_once "base.php";
if (isActive()) {
    $active = "Active";
} else {
    $active = "Frozen";
}
$left = getLeft();
$left = sprintf("%02d:%02d:%02d", (int) ($left / 3600), $left / 60 % 60, $left % 60);
?>
	<div class="container">
		<div class="panel panel-default">
			<div class="panel-heading"><?php 
echo $board[0];
?>
 [<?php 
echo $active;
?>
: <?php 
echo $left;
?>
]</div>
			<table class="table">
				<thead>
					<tr>
						<th>#</th>
						<th><?php 
echo $board[1];
?>
Пример #2
0
    return $res > 0;
}
function isActive()
{
    global $db;
    $sql = "SELECT * FROM `tasks` WHERE `status`=1 AND ((`point`=500 AND `cat`!='CRYPT') OR (`point`=700 AND `cat`='CRYPT'))";
    $stmt = $db->prepare($sql);
    $stmt->execute();
    $stmt->store_result();
    $stmt->fetch();
    $res = $stmt->num_rows;
    $stmt->close();
    return $res === 0;
}
if (hasStarted()) {
    $passed = 30 * 60 * 60 - getLeft();
    $sql = "UPDATE `tasks` SET `status`=1 WHERE `point`<=" . ($passed / 36 / 5 + 100);
    $stmt = $db->prepare($sql);
    $stmt->execute();
    $stmt->close();
}
session_start();
$_POST = decryptPost($_POST);
logreq($_POST);
$error = "";
if (isset($_SESSION['error'])) {
    $error = $_SESSION['error'];
    unset($_SESSION['error']);
}
$success = "";
if (isset($_SESSION['success'])) {
</style>
    <title>General Questions</title>

    <!-- Google fonts -->
    <link href='http://fonts.googleapis.com/css?family=Fjord+One|Droid+Sans' rel='stylesheet' type='text/css'>

    <!-- Stylesheets -->
    <link rel="stylesheet" type="text/css" href="styles/style.css" />
    <script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript">
//Update the texts in the containers
  function load(){

      var text1 = "<?php 
getLeft($userid);
?>
";
      // var question = "F**K:";
      document.getElementById("left_text").innerHTML = text1;

      var text2="<?php 
getRight($userid);
?>
";
      // var str = "Helo";
      document.getElementById("right_text").innerHTML = text2;

  }

Пример #4
0
 function attempt($flag)
 {
     global $db;
     global $admin;
     if (getLeft() <= 0) {
         throw new Exception("Time is up :((");
     }
     $team = $_SESSION['team'];
     $valid = $this->checkFlag($flag);
     $flag = htmlspecialchars($flag, ENT_QUOTES);
     $sql = "INSERT INTO `attempts` (`teamID`, `taskID`, `time`, `flag`, `status`) VALUES (?, ?, NOW(), ?, ?)";
     $stmt = $db->prepare($sql);
     $stmt->bind_param("iisi", $team->id, $this->id, $flag, $valid);
     $stmt->execute();
     $stmt->close();
     if ($valid === true && $this->hasSolved($team->id) === false && $admin === false) {
         $this->addSolver($team->id);
     }
     return $valid;
 }