diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php index 10a3986..8815211 100644 --- a/admin/judges_teams_projects.php +++ b/admin/judges_teams_projects.php @@ -25,7 +25,7 @@ require("../common.inc.php"); auth_required('admin'); require("judges.inc.php"); - require("projects.inc.php"); + require("../projects.inc.php"); send_header("Judging Teams Projects"); ?> @@ -343,7 +343,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit) foreach($teams AS $team) { echo ""; - echo ""; + echo ""; echo "".$team['name']." (#".$team['num'].")
"; $memberlist=""; foreach($team['members'] AS $member) @@ -383,7 +383,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit) while($r=mysql_fetch_object($q)) { - echo ""; + echo ""; echo ""; if($show_date) diff --git a/admin/winners.php b/admin/winners.php index 564cfb2..e3fbfeb 100644 --- a/admin/winners.php +++ b/admin/winners.php @@ -23,7 +23,7 @@ ?> id]=array( + "id"=>$r->id, + "criteria"=>$r->criteria, + "name"=>$r->name + ); + } + return $awards; +} + +function getSpecialAwardsNominatedForProject($projectid) +{ + global $config; + + //FIXME: this query isnt done yet, its still a copy from above + $awardsq=mysql_query("SELECT + award_awards.id, + award_awards.name, + award_awards.criteria, + projects.id AS projects_id + FROM + award_awards, + project_specialawards_link, + projects + WHERE + project_specialawards_link.projects_id='$projectid' + AND project_specialawards_link.award_awards_id=award_awards.id + AND projects.year='".$config['FAIRYEAR']."' + AND projects.id='$projectid' + ORDER BY + award_awards.name + "); + $awards=array(); + echo mysql_error(); + while($r=mysql_fetch_object($awardsq)) + { + $awards[$r->id]=array( + "id"=>$r->id, + "criteria"=>$r->criteria, + "name"=>$r->name + ); + } + return $awards; +} + +function getSpecialAwardsNominatedByRegistrationID($id) +{ + global $config; + + $awardq=mysql_query("SELECT award_awards.id, award_awards.name, award_awards_projectcategories.projectcategories_id, @@ -112,20 +190,9 @@ function getAwardsEligibleForProject($projectnumber) ); } return $projects; + } -function getAwardsEligibleForProjects($awards_ids_array) -{ - $projects=array(); - foreach($awards_ids_array AS $award_id) - { - $awardprojects=array(); - $awardprojects=getProjectsEligibleForAward($award_id); - //this will just overwrite ones that already exist, but still keep things in order because the main key is the projectnumber (i hope) - foreach($awardprojects AS $proj) - $projects[$proj['projectnumber']]=$proj; - } - return $projects; -} + ?> diff --git a/register_participants.inc.php b/register_participants.inc.php index 337d555..34771b7 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -185,5 +185,31 @@ function safetyStatus($reg_id="") } +function spawardStatus($reg_id="") +{ + if($reg_id) $rid=$reg_id; + else $rid=$_SESSION['registration_id']; + + return false; + //grab all of their answers + $q=mysql_query("SELECT * FROM safety WHERE registrations_id='$rid'"); + while($r=mysql_fetch_object($q)) + { + $safetyanswers[$r->safetyquestions_id]=$r->answer; + } + + //now grab all the questions + $q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord"); + while($r=mysql_fetch_object($q)) + { + if($r->required=="yes" && !$safetyanswers[$r->id]) + { + return "incomplete"; + } + } + return "complete"; + +} + ?> diff --git a/register_participants_main.php b/register_participants_main.php index 84f97fb..239fe5c 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -84,93 +84,117 @@ echo mysql_error(); echo "
"; echo "
"; - echo ""; - echo ""; +echo "
".i18n("Registration Item")."".i18n("Status")."
"; + echo "
"; -//participant information -echo "
"; -echo ""; -echo i18n("Student Information"); -echo ""; -echo ""; -//check to see if its complete -$statusstudent=studentStatus(); -echo outputStatus($statusstudent); -echo "
"; + echo ""; -//participant emergency contact information -echo ""; + echo ""; -//project information - project requires students, so only show the link if the students is complete -echo ""; + + //project information - project requires students, so only show the link if the students is complete + echo ""; + + //mentor information + echo ""; + echo ""; -//mentor information -echo ""; - -//safety information -echo ""; - -//signature page -echo ""; + echo ""; -//received information -echo ""; -//check to see if its complete -echo ""; + //received information + echo ""; + echo "
".i18n("Registration Item")."".i18n("Status")."
"; -if($statusstudent=="complete") - echo ""; -echo i18n("Emergency Contact Information"); -if($statusstudent=="complete") + //participant information + echo "
"; + echo ""; + echo i18n("Student Information"); echo ""; -echo ""; -//check to see if its complete -$statusemergencycontact=emergencycontactStatus(); -echo outputStatus($statusemergencycontact); -echo "
"; + //check to see if its complete + $statusstudent=studentStatus(); + echo outputStatus($statusstudent); + echo "
"; -if($statusstudent=="complete") - echo ""; -echo i18n("Project Information"); -if($statusstudent=="complete") + //participant emergency contact information + echo "
"; + if($statusstudent=="complete") + echo ""; + echo i18n("Emergency Contact Information"); + if($statusstudent=="complete") + echo ""; + echo ""; + //check to see if its complete + $statusemergencycontact=emergencycontactStatus(); + echo outputStatus($statusemergencycontact); + echo "
"; + if($statusstudent=="complete") + echo ""; + echo i18n("Project Information"); + if($statusstudent=="complete") + echo ""; + echo ""; + //check to see if its complete + $statusproject=projectStatus(); + echo outputStatus($statusproject); + echo "
"; + echo ""; + echo i18n("Mentor Information"); echo ""; -echo ""; -//check to see if its complete -$statusproject=projectStatus(); -echo outputStatus($statusproject); -echo "
"; + //check to see if its complete + $statusmentor=mentorStatus(); + echo outputStatus($statusmentor); + echo "
"; -echo ""; -echo i18n("Mentor Information"); -echo ""; -echo ""; -//check to see if its complete -$statusmentor=mentorStatus(); -echo outputStatus($statusmentor); -echo "
"; -echo ""; -echo i18n("Safety Information"); -echo ""; -echo ""; -//check to see if its complete -$statussafety=safetyStatus(); -echo outputStatus($statussafety); -echo "
"; -if($statusstudent=="complete" && $statusproject=="complete" && $statusmentor=="complete" && $statussafety=="complete") - echo ""; -echo i18n("Signature Page"); -if($statusstudent=="complete" && $statusproject=="complete" && $statusmentor=="complete" && $statussafety=="complete") + //safety information + echo "
"; + echo ""; + echo i18n("Safety Information"); echo ""; -echo ""; -echo i18n("Print"); -//check to see if its complete -echo "
"; + //check to see if its complete + $statussafety=safetyStatus(); + echo outputStatus($statussafety); + echo "
".i18n("Signature Page Received").""; -if(registrationFormsReceived()) - echo outputStatus("complete"); -else - echo outputStatus("incomplete"); + //signature page + echo "
"; + if($statusstudent=="complete" && $statusproject=="complete" && $statusmentor=="complete" && $statussafety=="complete") + echo ""; + echo i18n("Signature Page"); + if($statusstudent=="complete" && $statusproject=="complete" && $statusmentor=="complete" && $statussafety=="complete") + echo ""; + echo ""; + echo i18n("Print"); + //check to see if its complete + echo "
".i18n("Signature Page Received").""; + if(registrationFormsReceived()) + echo outputStatus("complete"); + else + echo outputStatus("incomplete"); + + //check to see if its complete + echo "
" ; + + echo ""; + echo ""; + if($config['specawardnom']!="none") + { + echo ""; + echo ""; + if(registrationFormsReceived()) + { + echo ""; + // $awards=getSpecialAwardsNominatedByRegistrationID($_SESSION['registration_id']); + } + else + { + echo ""; + } + + echo "
".i18n("Special Award Nominations")."
".i18n("Self-nominate for special awards")."
".error(i18n("We must receive your signature form before you can nominate yourself for special awards"),"inline")."
"; + } + + echo ""; echo ""; - + echo "

"; echo "

".i18n("Registration Instructions")."

"; diff --git a/register_participants_spawards.php b/register_participants_spawards.php new file mode 100644 index 0000000..9d03daa --- /dev/null +++ b/register_participants_spawards.php @@ -0,0 +1,167 @@ + + Copyright (C) 2005 James Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> +<< ".i18n("Back to Participant Registration Summary")."
"; + echo "
"; + + if($_POST['action']=="save") + { + //FIXME: check the date when they have to have this in by and dont let them submit after that date +// if(registrationFormsReceived()) +// { +// echo error(i18n("Cannot make changes to forms once they have been received by the fair")); +// } +// else +// { + //first we will delete all their old answer, its easier to delete and re-insert in this case then it would be to find the corresponding answers and update them + mysql_query("DELETE FROM project_specialawards_link WHERE projects_id='$project->id' AND year='".$config['FAIRYEAR']."'"); + $count=0; + foreach($_POST['spaward'] AS $spaward) + { + mysql_query("INSERT INTO project_specialawards_link (award_awards_id,projects_id,year) VALUES (". + "'$spaward', ". + "'$project->id', ". + "'".$config['FAIRYEAR']."')"); + echo mysql_error(); + $count++; + } + echo happy(i18n("Successfully registered for %1 special awards",array($count))); +// } + } + + + +//output the current status +$newstatus=spawardStatus(); +if($newstatus!="complete") +{ + echo error(i18n("Special Awards Self-Nomination Incomplete")); +} +else if($newstatus=="complete") +{ + echo happy(i18n("Safety Awards Self-Nomination Complete")); + +} + + echo "
\n"; + echo "\n"; + echo "\n"; + + $q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$_SESSION['registration_id']."'"); + while($r=mysql_fetch_object($q)) + { + $safetyanswers[$r->safetyquestions_id]=$r->answer; + } + + $eligibleawards=getSpecialAwardsEligibleForProject($project->id); + $nominatedawards=getSpecialAwardsNominatedForProject($project->id); + + echo "eligible awards
"; + echo nl2br(print_r($eligibleawards,true)); + echo "nominated awards
"; + echo nl2br(print_r($nominatedawards,true)); + + $nominatedawards_list=array(); + foreach($nominatedawards AS $naward) + { + $nominatedawards_list[]=$naward['id']; + } + + echo "
"; + foreach($eligibleawards AS $eaward) + { + echo ""; + echo ""; + } + echo "
"; + if(in_array($eaward['id'],$nominatedawards_list)) $ch="checked=\"checked\""; else $ch=""; + echo ""; + echo ""; + echo "".$eaward['name'].""; + echo "
"; + echo $eaward['criteria']; + echo "

"; + echo "
"; + /* + $num=1; + while($r=mysql_fetch_object($q)) + { + echo "$num. ".i18n($r->question).""; + echo ""; + if($r->type=="check") + { + if($safetyanswers[$r->id]=="checked") $ch="checked=\"checked\""; else $ch=""; + echo "id]\" value=\"checked\" />"; + } + echo ""; + echo ""; + $num++; + } + echo ""; + */ + echo "\n"; + echo "
"; + + + send_footer(); +?> diff --git a/sfiab.css b/sfiab.css index c6a5f7c..c26fcea 100644 --- a/sfiab.css +++ b/sfiab.css @@ -142,6 +142,7 @@ a { margin: 0px; padding: 0px; margin-left: 30px; + margin-right: 30px; }