<?php
include "stuff.php";
$con = mysqli_connect($server,$user,$password,$db);
$now = date("d/m/Y h:i:s");
if($_GET['cancel'] == "Y"){
  mysqli_query($con,"UPDATE results SET result = 8, requested_at = '{$now}' WHERE id = {$_GET['id']}");
  echo("UPDATE results SET result = 8, requested_at = {$now} WHERE id = {$_GET['id']}");
  header("location: ../dashboard.php");
}elseif($_GET['abandon'] == "Y"){
  mysqli_query($con,"UPDATE results SET result = 4, requested_at = '{$now}' WHERE id = {$_GET['id']}");
  echo("UPDATE results SET result = 4, requested_at = {$now} WHERE id = {$_GET['id']}");
  header("location: ../dashboard.php");
}else{
  mysqli_query($con,"UPDATE results SET result = 0, requested_at = '{$now}' WHERE id = {$_GET['id']}");
  echo("UPDATE results SET result = 0, requested_at = {$now} WHERE id = {$_GET['id']}");
  header("location: ../assmnt_req.php");
}
?>
