$reviews[] = $submission->getReview($id);
}
// Check form data
if (!empty($_POST)) {
    $grade = intval($_POST["grades"]);
    $comment = $_POST["comment"];
    // TODO define stages with regards to defenitions for easier reading
    if ($grade < 11 || $grade > 0) {
        $dataSent = 1;
        $submission->addComment($comment);
        $submission->setGrade($grade);
        if ($grade > 2 && $grade < 9) {
            $project->updateStage();
        }
        if ($grade < 4 || $grade > 8) {
            $project->createSubmission();
        }
    } else {
        $dataSent = 0;
    }
    echo '<h3>Success!</h3><a href="?"><button class="btn btn-success">Go back</button></a>';
} else {
    ?>


<h2>Final Grade - Examinator</h2>

<h3><font color="darkblue">
<?php 
    echo $project->subject;
    echo ' | ' . $GLOBALS['stages'][$project->stage] . ' |';