forked from science-ation/science-ation
add student name and school to the winners page
This commit is contained in:
parent
6d5f794e05
commit
1428c42f00
52
winners.php
52
winners.php
@ -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,25 +121,50 @@ if($_GET['year'] && $_GET['type'])
|
||||
|
||||
if($pr->projectnumber)
|
||||
{
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo "  ";
|
||||
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 "  ";
|
||||
echo "  ";
|
||||
echo "Students: $students";
|
||||
echo "<br />";
|
||||
echo "  ";
|
||||
echo "  ";
|
||||
echo "School: $school";
|
||||
echo "<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo "<font color=\"red\">No winner(s) specified</font>";
|
||||
*/
|
||||
echo "  ";
|
||||
echo "Prize not awarded";
|
||||
echo "<br />";
|
||||
}
|
||||
echo "<br />";
|
||||
}
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user