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, award_prizes.scholarship,
winners.projects_id, winners.projects_id,
projects.projectnumber, projects.projectnumber,
projects.title projects.title,
projects.registrations_id AS reg_id
FROM FROM
award_prizes award_prizes
LEFT JOIN winners ON winners.awards_prizes_id=award_prizes.id LEFT JOIN winners ON winners.awards_prizes_id=award_prizes.id
@ -120,26 +121,51 @@ if($_GET['year'] && $_GET['type'])
if($pr->projectnumber) if($pr->projectnumber)
{ {
echo " "; echo "&nbsp   ";
echo " ";
echo " ";
echo " ";
echo "($pr->projectnumber) $pr->title"; 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 />"; echo "<br />";
} }
else else
{ {
/* echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "&nbsp;"; echo "Prize not awarded";
echo "&nbsp;"; echo "<br />";
echo "&nbsp;";
echo "&nbsp;";
echo "<font color=\"red\">No winner(s) specified</font>";
*/
}
} }
echo "<br />"; echo "<br />";
} }
}
} }
} }