Fix the local sfiab side of special awards

Add "numstudents" to top of participant main page
This commit is contained in:
james 2011-03-04 20:07:10 +00:00
parent c6ba56f57a
commit 9caa5b0a17
3 changed files with 46 additions and 13 deletions

View File

@ -599,9 +599,13 @@ function getProject($userId,$registrations_id=null){
$safetyquestions=getSafetyQuestions($regId);
$returnval['safetyquestions']=$safetyquestions;
/*
$noawards=getNominatedForNoSpecialAwardsForProject($returnval['id']);
$returnval['specialawards_none']=$noawards;
*/
$specialawards=getAwardListing($returnval['id']);
$returnval['specialawards']=$specialawards;
return $returnval;
}

View File

@ -32,12 +32,47 @@
send_header("Participant Registration - Summary");
if(!$reg) {
echo "You don't have a valid registration yet, would you like to: <br />\n";
echo "<ul>";
echo "<li>Create a new project/registration</li>\n";
echo "<li>Join an existing project/registration that your partner has already created</li>\n";
echo "</li>\n";
send_footer();
}
if($_POST['numstudents']) {
mysql_query("UPDATE registrations SET numstudents='".intval($_POST['numstudents'])."' WHERE id='{$reg['id']}'");
echo mysql_error();
}
//only display the named greeting if we have their name
if($u['firstname']) {
echo i18n("Hello <b>%1</b>",array($u['firstname']));
echo "<br />";
}
echo "<br />";
echo "<form action=\"register_participants_main.php\" method=\"post\">";
echo "Please indicate how many students worked on your project: ";
echo "<select name=\"numstudents\">";
//get the num students from the registrations table
$q=mysql_query("SELECT numstudents FROM registrations WHERE id='{$reg['id']}'");
$r=mysql_fetch_object($q);
$numstudents=$r->numstudents;
if(!$numstudents)
echo "<option value=\"\">Choose</option>\n";
for($x=$config['minstudentsperproject'];$x<=$config['maxstudentsperproject'];$x++) {
if($numstudents==$x) $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$x\">$x</option>\n";
}
echo "</select>\n";
echo "<input type=\"submit\" value=\"Save\">";
echo "</form>\n";
echo "<br />";
echo "<br />";
if($numstudents) {
if(registrationFormsReceived()) {
//now select their project number
@ -334,8 +369,7 @@ echo "<table><tr><td>";
echo "<br /><br />";
echo "<a href=\"register_participants.php?action=logout\">".i18n("Logout")."</a>";
}
send_footer();
?>

View File

@ -93,19 +93,15 @@ function checkboxclicked(b)
}
$num=count($splist);
if($num>$config['maxspecialawardsperproject'])
{
if($num>$config['maxspecialawardsperproject']) {
echo error(i18n("You can only apply to %1 special awards. You have selected %2",array($config['maxspecialawardsperproject'],$num)));
}
else
{
else {
mysql_query("DELETE FROM project_specialawards_link WHERE projects_id='$project->id' AND conferences_id='".$conference['id']."'");
foreach($splist AS $spaward)
{
$s = ($spaward == -1) ? "NULL" : "'$spaward'";
foreach($splist AS $spaward) {
mysql_query("INSERT INTO project_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES (".
"$s, ".
"$spaward, ".
"'$project->id', ".
"'".$conference['id']."')");
echo mysql_error();
@ -118,8 +114,7 @@ function checkboxclicked(b)
}
}
}
else
{
else {
echo error(i18n("Special award self-nomination is only available from %1 to %2",array($config['dates']['specawardregopen'],$config['dates']['specawardregclose'])));
}