Skip to content

Commit

Permalink
Extra criterea for submission check
Browse files Browse the repository at this point in the history
  • Loading branch information
benthetechguy committed Oct 8, 2022
1 parent cfd6536 commit 242fa0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions includes/applications.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function age_check($min_age, $min_join) {
return 0;
}

// Check if user has already submitted an application
// Check if user has already submitted an application and it hasn't been accepted
function submission_check($id, $type, $mongo_db, $mongo_uri) {
// Initialize database of applications
$collection = (new MongoDB\Client($mongo_uri)) -> $mongo_db -> applications;

// Check for applications from the user
$result = $collection -> findOne(['id' => $id, 'type' => $type]);
$result = $collection -> findOne(['id' => $id, 'type' => $type, 'accepted' => 'no']);
return $result;
}
?>
6 changes: 3 additions & 3 deletions submit-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
];
$insert = [
"id" => $_POST['id'],
"name" => $_POST['username'],
"type" => "support_team",
"accepted" => "no",
"q1" => $_POST['q1'],
"q2" => $_POST['q2'],
"q3" => substr($specialty, 2),
Expand Down Expand Up @@ -115,8 +115,8 @@
];
$insert = [
"id" => $_POST['id'],
"name" => $_POST['username'],
"type" => "moderator",
"accepted" => "no",
"q1" => $_POST['q1'],
"q2" => $_POST['q2'],
"q3" => $_POST['q3'],
Expand Down Expand Up @@ -157,9 +157,9 @@
];
$insert = [
"id" => $_POST['id'],
"name" => $_POST['username'],
"email" => $_POST['email'],
"type" => "appeal",
"accepted" => "no",
"q1" => $_POST['q1'],
"q2" => $_POST['q2']
];
Expand Down

0 comments on commit 242fa0d

Please sign in to comment.