forked from science-ation/science-ation
allow multiple awards to be marked as cwsf awards (issue 226)
This commit is contained in:
parent
9ef983c671
commit
4a148a415f
@ -28,11 +28,11 @@ include "xml.inc.php";
|
||||
{
|
||||
global $config;
|
||||
$winners=array();
|
||||
$winners_ids=array();
|
||||
|
||||
$q=mysql_query("SELECT * FROM award_awards WHERE cwsfaward='1' AND year='".$config['FAIRYEAR']."'");
|
||||
if(mysql_num_rows($q)==1)
|
||||
while($award=mysql_fetch_object($q))
|
||||
{
|
||||
$award=mysql_fetch_object($q);
|
||||
$pq=mysql_query("SELECT * FROM award_prizes WHERE award_awards_id='$award->id'");
|
||||
while($prize=mysql_fetch_object($pq))
|
||||
{
|
||||
@ -55,6 +55,11 @@ include "xml.inc.php";
|
||||
echo mysql_error();
|
||||
while($project=mysql_fetch_object($wq))
|
||||
{
|
||||
if(array_key_exists($project->id, $winners_ids)) {
|
||||
continue;
|
||||
} else {
|
||||
$winners_ids[$project->id] = true;
|
||||
}
|
||||
$sq=mysql_query("SELECT * FROM students WHERE registrations_id='$project->registrations_id' AND year='".$config['FAIRYEAR']."'");
|
||||
$students=array();
|
||||
$cwsf_agecategory=0;
|
||||
@ -194,15 +199,14 @@ include "xml.inc.php";
|
||||
echo error(i18n("Cannot find an award that is specified as the Canada-Wide Science Fair Award"));
|
||||
echo i18n("Please go to the awards manager and select which award identifies your CWSF students");
|
||||
}
|
||||
else if(mysql_num_rows($q)>1)
|
||||
{
|
||||
echo error(i18n("There is more than one award that is identified as your Canada-Wide Science Fair award."));
|
||||
echo i18n("Please go to the awards manager and choose only one award that identifies your CWSF students");
|
||||
}
|
||||
else
|
||||
{
|
||||
$award=mysql_fetch_object($q);
|
||||
echo "<b>".i18n("CWSF Award").":</b> ".$award->name."<br />";
|
||||
echo "<b>".i18n("CWSF Awards").":</b> <br />";
|
||||
echo "<ul>";
|
||||
while($award=mysql_fetch_object($q)) {
|
||||
echo "<li>{$award->name}</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
echo i18n("Please review the list of winning projects/students below. If it is all correct then you can click the 'Register for CWSF' button at the bottom of the page to send the information to YSC");
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
Loading…
x
Reference in New Issue
Block a user