Only show projects that are eligible for an award that the team is judging for

This commit is contained in:
james 2005-05-06 20:26:15 +00:00
parent e91dbdf4c9
commit c7e1ec708c

View File

@ -238,15 +238,28 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
echo mysql_error();
$eligibleprojects=getProjectsEligibleForAwards($award_ids);
echo nl2br(print_r($eligibleprojects,true));
$numprojects=mysql_num_rows($pq);
//the keys are the project numbers, so lets get an array of those too so we can use in_array below
$eligibleprojectsnumbers=array_keys($eligibleprojects);
// echo nl2br(print_r($eligibleprojects,true));
$numprojects=0;
echo "<select name=\"project_id\">";
echo "<option value=\"\">Choose Project to Assign to Timeslot</option>\n";
while($pr=mysql_fetch_object($pq))
{
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
if($_SESSION['viewstate']['judges_projects_list_eligible']=='true')
{
if(in_array($pr->projectnumber,$eligibleprojectsnumbers))
{
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
$numprojects++;
}
}
else
{
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
$numprojects++;
}
}
echo "</select>";
echo "</td><td>";