add student name and school to the winners page

This commit is contained in:
james 2005-05-12 21:23:50 +00:00
parent 6d5f794e05
commit 1428c42f00

View File

@ -81,7 +81,8 @@ if($_GET['year'] && $_GET['type'])
award_prizes.scholarship,
winners.projects_id,
projects.projectnumber,
projects.title
projects.title,
projects.registrations_id AS reg_id
FROM
award_prizes
LEFT JOIN winners ON winners.awards_prizes_id=award_prizes.id
@ -120,26 +121,51 @@ if($_GET['year'] && $_GET['type'])
if($pr->projectnumber)
{
echo " ";
echo " ";
echo " ";
echo " ";
echo "&nbsp   ";
echo "($pr->projectnumber) $pr->title";
$sq=mysql_query("SELECT students.firstname,
students.lastname,
students.schools_id,
schools.school
FROM
students,
schools
WHERE
students.registrations_id='$pr->reg_id'
AND students.schools_id=schools.id
");
$studnum=0;
while($studentinfo=mysql_fetch_object($sq))
{
if($studnum>0) $students.=", ";
$students.="$studentinfo->firstname $studentinfo->lastname";
$studnum++;
//we will assume that they are coming from the same school, so lets just grab the last students school
//and use it.
$school=$studentinfo->school;
}
echo "<br />";
echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "Students: $students";
echo "<br />";
echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "School: $school";
echo "<br />";
}
else
{
/*
echo "&nbsp;";
echo "&nbsp;";
echo "&nbsp;";
echo "&nbsp;";
echo "<font color=\"red\">No winner(s) specified</font>";
*/
}
echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "Prize not awarded";
echo "<br />";
}
echo "<br />";
}
}
}
}