}
if ($login->isUserLoggedIn() === false) {
    exit(1);
}
// Get project id
$pid = getPID();
// Get submission id
if (isset($_GET['sid']) && intval($_GET['sid']) > 0) {
    $sid = intval($_GET['sid']);
} else {
    exit('Invalid id!');
}
// Get the project
$project = new Project($pid);
// Get the submission
$submission = $project->getSubmission($sid);
// Test permissions
if (!$GLOBALS['user']->hasPrivilege("canGradeProjects")) {
    header("Location: ?view=accessdenied");
    exit;
}
$tableTE = array(1 => 'Reviewer', 2 => 'Process', 3 => 'Content', 4 => 'Contribution', 5 => 'Presentation', 6 => 'Grade');
$tablePP = array(1 => 'Reviewer', 2 => 'Process', 3 => 'Content', 4 => 'Presentation', 5 => 'Grade');
$dataSent = 0;
$reviews = array();
foreach ($submission->getReview() as $key => $value) {
    $id = $submission->getLatestReview($key);
    $reviews[] = $submission->getReview($id);
}
// Check form data
if (!empty($_POST)) {