diff --git a/admin/index.php b/admin/index.php index 32a372cf..79c6c2a8 100644 --- a/admin/index.php +++ b/admin/index.php @@ -78,6 +78,9 @@ echo "
"; echo ""; echo " "; + if($config['score_entry_enable'] == 'yes') { + echo ""; + } echo " "; echo " "; echo " "; diff --git a/admin/judging_score_edit.php b/admin/judging_score_edit.php new file mode 100644 index 00000000..ebf2529e --- /dev/null +++ b/admin/judging_score_edit.php @@ -0,0 +1,118 @@ + + Copyright (C) 2005-2006 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. +*/ +?> + 0) { + mysql_query("UPDATE judges_teams_timeslots_projects_link + SET score=" . mysql_real_escape_string($_POST["team_" . $curr_team . "_score"]) . + " WHERE judges_teams_id = " . mysql_real_escape_string($_POST["team_" . $curr_team . "_id"]) . + " and projects_id =$project_id and year=$year"); + echo mysql_error(); + $curr_team--; + } + } + + send_header("Judging Score Entry - Update", + array('Committee Main' => 'committee_main.php', + 'Administration' => 'admin/index.php', + 'Judging Score Entry' => 'admin/judging_score_entry.php') + ); + ?> +id]=$r->category; + +$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); + + + $q=mysql_query("SELECT judges_teams_timeslots_projects_link.judges_teams_id, + score, + judges_teams.num + FROM judges_teams_timeslots_projects_link, + judges_teams + WHERE judges_teams_timeslots_projects_link.judges_teams_id = judges_teams.id + AND projects_id = ".mysql_real_escape_string($project_id)." ORDER BY judges_teams_id" + ); + echo mysql_error(); + + echo "
"; + echo ""; + echo ""; + echo "
".theme_icon("judging_score_entry")."
".i18n("Judging Score Entry")."
".theme_icon("enter_winning_projects")."
".i18n("Enter Winning Projects")."
".theme_icon("one-click_cwsf_registration")."
".i18n("One-Click CWSF Registration")."
".theme_icon("one-click_ysf_affiliation_stats")."
".i18n("One-Click YSF Affiliation Stats")."
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $i = 1; + while($r=mysql_fetch_object($q)) { + $s = mysql_query("SELECT CONCAT(judges.firstname, ' ', judges.lastname) as name + FROM judges, + judges_teams_link + WHERE judges_teams_link.judges_id = judges.id + AND judges_teams_link.judges_teams_id = " . $r->judges_teams_id + ); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $i++; + } + echo "
".i18n("Team Number")."".i18n("Judges")."".i18n("Score")."".i18n("New Score")."
\n"; + echo $r->num; + echo "judges_teams_id\"/>\n"; + echo ""; + echo mysql_fetch_object($s)->name; + echo "\n"; + if($r->score) { + echo $r->score; + } else { + echo "None"; + } + echo "\n\n"; + echo "score\"/>\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +} else { + echo i18n("Invalid Project ID."); +} + diff --git a/admin/judging_score_entry.php b/admin/judging_score_entry.php new file mode 100644 index 00000000..84519b9d --- /dev/null +++ b/admin/judging_score_entry.php @@ -0,0 +1,122 @@ + + Copyright (C) 2005-2006 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. +*/ +?> + 'committee_main.php', + 'Administration' => 'admin/index.php') + ); + } + ?> +id]=$r->category; + +$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); +while($r=mysql_fetch_object($q)) + $divs[$r->id]=$r->division; + +$ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.title"; + + $q=mysql_query("SELECT registrations.id AS reg_id, + registrations.num AS reg_num, + projects.id as projectid, + projects.title, + projects.projectnumber, + projects.projectcategories_id, + projects.projectdivisions_id, + judges_teams_id as res_team_id, + avg(score) as score, + avg(score + (SELECT 70-avg(score) + FROM judges_teams_timeslots_projects_link + WHERE judges_teams_id = res_team_id)) + AS norm_score + FROM + registrations + left outer join projects on projects.registrations_id=registrations.id + left outer join judges_teams_timeslots_projects_link on projects.id=judges_teams_timeslots_projects_link.projects_id + WHERE + registrations.year='$year' " + . getJudgingEligibilityCode() . " + GROUP BY projectid + ORDER BY + $ORDERBY + "); + echo mysql_error(); + + if($_GET['csv'] != 'yes') { + echo "" . i18n("Generate CSV Report") . "\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + while($r=mysql_fetch_object($q)) + { + if($_GET['csv'] == 'yes') { + echo "$r->projectnumber \t $r->title \t" . $cats[$r->projectcategories_id] . "\t" . $divs[$r->projectdivisions_id] . " \t $r->score \t $r->norm_score \n"; + } else { + echo ""; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + } + if($_GET['csv'] != 'yes') { + echo "
".i18n("Proj Num")."".i18n("Project Title")."".i18n("Age Category")."".i18n("Division")."".i18n("Score")."".i18n("Normalized Score")."".i18n("Action")."
$r->projectnumber$r->title".i18n($cats[$r->projectcategories_id])."".i18n($divs[$r->projectdivisions_id])."" . number_format($r->score, 2) . "" . number_format($r->norm_score, 2) . ""; + if($year==$config['FAIRYEAR']) { + echo "projectid\">"; + echo i18n("Edit Scores"); + echo ""; + } + echo "
\n"; + echo "
"; + + send_footer(); + } +?> diff --git a/theme/default/theme.php b/theme/default/theme.php index 0914673d..ad939880 100644 --- a/theme/default/theme.php +++ b/theme/default/theme.php @@ -43,6 +43,7 @@ $theme['icons']['tour_management']="preferences-system-performance.png"; $theme['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png"; $theme['icons']['registration_fee_items_management']="transfers_list.png"; + $theme['icons']['judging_score_entry']="transfers_list.png"; $theme['icons']['enter_winning_projects']="legalmoves.png"; $theme['icons']['one-click_cwsf_registration']="flag-blue.png"; $theme['icons']['one-click_ysf_affiliation_stats']="flag-green.png";