Remove old warning, fix default and database update mechanism

This commit is contained in:
patrick 2025-01-30 18:58:30 +00:00
parent 4b6e9abefe
commit d3d73d23fa

View File

@ -138,7 +138,7 @@ if (!$dbdbversion) {
exit;
}
if ($dbcodeversion != $dbdbversion) {
if (!$_SERVER['REQUEST_URI'] == "db_update.php" && ($dbcodeversion != $dbdbversion)) {
echo '<html><head><title>SFIAB ERROR</title></head><body>';
echo '<h1>Science Fair In A Box - ERROR</h1>';
echo 'SFIAB database and code are mismatched';
@ -285,8 +285,8 @@ function i18n($str, $args = array(), $argsdesc = array(), $forcelang = '')
} else
$argsdescstring = 'null';
$stmt = $pdo->prepare('INSERT INTO translations (lang,strmd5,str,argsdesc) VALUES (?,?,?,?)');
$stmt->execute([$_SESSION['lang'], md5($str), $pdo->quote($str), $argsdescstring]);
$stmt = $pdo->prepare('INSERT INTO translations (lang,strmd5,str,argsdesc,val) VALUES (?,?,?,?,?)');
$stmt->execute([$_SESSION['lang'], md5($str), $pdo->quote($str), $argsdescstring, '']);
for ($x = 1; $x <= count($args); $x++) {
$str = str_replace("%$x", $args[$x - 1], $str);
}
@ -1136,8 +1136,6 @@ function committee_warnings()
echo error(i18n("It has been more than 4 months since your fair. In order to prepare the system for the next year's fair, you should go to the SFIAB Configuration page, and click on 'Rollover Fair Year'. Do not start updating the system with new information until the year has been properly rolled over."));
}
$warn = false;
$q = $pdo->prepare('SELECT * FROM award_prizes WHERE `external_identifier` IS NOT NULL
AND external_identifier=prize');
$q->execute();
@ -1147,24 +1145,15 @@ function committee_warnings()
* if we find that case for a non-sfiab external fair
*/
while (($p = $q->fetch(PDO::FETCH_ASSOC))) {
$qq = $pdo->prepare("SELECT * FROM award_awards $r->rollovercheck
$qq = $pdo->prepare("SELECT * FROM award_awards
LEFT JOIN fairs ON fairs.id=award_awards.award_source_fairs_id
WHERE award_awards.id='{$p['award_awards_id']}'
AND year='{$config['FAIRYEAR']}'
AND award_awards.award_source_fairs_id IS NOT NULL
AND fairs.type='ysc' ");
$qq->execute();
if ($qq->rowCount() > 0) {
$warn;
break;
}
}
}
if ($warn) {
// let everyone know about the need to re-download awards before being able to upload
echo notice(i18n("March 30, 2010 - There was a minor issue with uploading award results that has now been corrected, however, you will need to re-download your awards from all external sources, before you will be able to upload the award winners back to those external sources. Re-downloading the awards will not affect the awards in any visible way, it will just allow the winners to be uploaded properly. Click on Fair Administration -> Awards Management -> Download awards from external sources -> and click 'check' for each award source"));
}
}
$CWSFDivisions = array(