Fix sign up checks

This commit is contained in:
patrick 2025-02-12 15:29:52 +00:00
parent f24a5653d9
commit 5680696c2e
3 changed files with 3 additions and 4 deletions

View File

@ -173,7 +173,7 @@ function mentorStatus($reg_id = '')
$q->execute([$rid, $config['FAIRYEAR']]);
$r = $q->fetch(PDO::FETCH_OBJ);
if ($r->nummentors === -1) {
if ($r->nummentors === -1 or $r->nummentors == null) {
return 'incomplete';
}

View File

@ -304,13 +304,12 @@ if (get_value_from_array($_POST, 'action') == 'login' && (get_value_from_array($
$schoolidquery = 'null';
// actually insert it
$stmt = $pdo->prepare('INSERT INTO registrations (num, email, start, status, schools_id, year) VALUES (?, ?, NOW(), ?, ?, ?)');
$stmt = $pdo->prepare("INSERT INTO registrations (num, email, start, status, schools_id, year) VALUES (?, ?, NOW(), ?, $schoolidquery, ?)");
$stmt->execute([
$regnum,
$_SESSION['email'],
'new',
$schoolidquery,
$config['FAIRYEAR']
]);

View File

@ -160,7 +160,7 @@ echo '<form name="nummentorsform" method="get" action="register_participants_men
echo i18n('Number of mentors that helped with the project: ');
echo "<select name=\"nummentors\" onchange=\"document.forms.nummentorsform.submit()\">\n";
if ($registrations_nummentors === -1) {
if ($registrations_nummentors === -1 or $registrations_nummentors == null) {
$sel = 'selected="selected"';
} else
$sel = '';