prepare($qry_checkinsertion))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } $stmt->bind_param("ii", $_SESSION['uid'], $_POST['tid']); $stmt->execute(); $count = $stmt->num_rows; $stmt->close(); // if a record already exists, reload the page for a new target to evaluate if($count > 0) { header("Location:evaluate.php"); } // otherwise, insert new evaluation record into database $qry = "INSERT INTO evaluations (t_id, u_id, decision, dec_time) VALUES(?, (SELECT id FROM users WHERE username=?), ?, ?)"; $decision = $_POST['submit']; $time = microtime(true) - floatval($_POST['time']); if (!($stmt = $mysqli->prepare($qry))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } $stmt->bind_param("sssd", $_POST['tid'], $_SESSION['user'], $decision, $time); $stmt->execute(); $stmt->close(); $qry = "SELECT DISTINCT id, filename FROM targets WHERE (id) NOT IN (SELECT t_id FROM `evaluations` WHERE u_id=(SELECT id FROM users WHERE username=?)) LIMIT 1"; if (!($stmt = $mysqli->prepare($qry))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } $stmt->bind_param("s", $_SESSION['user']); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($targetID, $targetName); $stmt->fetch(); $count = $stmt->num_rows; $stmt->close(); if($count == 0) { ?>
All Targets Evaluated
Thanks for Participating!

jQuery Slider
">
Administrator Summary"; } ?>