function InsertReviewers($idPaper, $tabMails, $db) { // Is there something to check ? // Access to the database SQLReview($idPaper, $tabMails, $db); return ""; }
function commitAssignment($idMin, $idMax, $db) { // Delete existing reviews and existing review marks if ($idMin == -1) { // Remove all current assignment $qCleanReview = "DELETE FROM Review WHERE submission_date IS NULL"; } else { // Remove all asignments of the current group $qCleanReview = "DELETE FROM Review " . "WHERE idPaper BETWEEN {$idMin} AND {$idMax} AND submission_date IS NULL"; } $db->execRequete($qCleanReview); // Loop on papers $qPapers = "SELECT * FROM Paper ORDER BY id"; $rPapers = $db->execRequete($qPapers); while ($paper = $db->objetSuivant($rPapers)) { // Take all the reviewers assigned to the paper $qAssignment = "SELECT * FROM Assignment WHERE idPaper='{$paper->id}'"; $rAssignment = $db->execRequete($qAssignment); $tabIds = array(); while ($assignment = $db->objetSuivant($rAssignment)) { $tabIds[] = $assignment->id_user; } // Insert the assignment in the Review table SQLReview($paper->id, $tabIds, $db); } }