forked from science-ation/science-ation
Add judging score entry for Renfrew County fair
This commit is contained in:
parent
65d568afa7
commit
7bd94c3782
@ -78,6 +78,9 @@
|
|||||||
echo "<hr />";
|
echo "<hr />";
|
||||||
echo "<table class=\"adminconfigtable\">";
|
echo "<table class=\"adminconfigtable\">";
|
||||||
echo " <tr>";
|
echo " <tr>";
|
||||||
|
if($config['score_entry_enable'] == 'yes') {
|
||||||
|
echo "<td><a href=\"judging_score_entry.php\">".theme_icon("judging_score_entry")."<br />".i18n("Judging Score Entry")."</a></td>";
|
||||||
|
}
|
||||||
echo " <td><a href=\"winners.php\">".theme_icon("enter_winning_projects")."<br />".i18n("Enter Winning Projects")."</a></td>";
|
echo " <td><a href=\"winners.php\">".theme_icon("enter_winning_projects")."<br />".i18n("Enter Winning Projects")."</a></td>";
|
||||||
echo " <td><a href=\"cwsfregister.php\">".theme_icon("one-click_cwsf_registration")."<br />".i18n("One-Click CWSF Registration")."</a></td>";
|
echo " <td><a href=\"cwsfregister.php\">".theme_icon("one-click_cwsf_registration")."<br />".i18n("One-Click CWSF Registration")."</a></td>";
|
||||||
echo " <td><a href=\"ysfstats.php\">".theme_icon("one-click_ysf_affiliation_stats")."<br />".i18n("One-Click YSF Affiliation Stats")."</a></td>";
|
echo " <td><a href=\"ysfstats.php\">".theme_icon("one-click_ysf_affiliation_stats")."<br />".i18n("One-Click YSF Affiliation Stats")."</a></td>";
|
||||||
|
118
admin/judging_score_edit.php
Normal file
118
admin/judging_score_edit.php
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
<?
|
||||||
|
/*
|
||||||
|
This file is part of the 'Science Fair In A Box' project
|
||||||
|
SFIAB Website: http://www.sfiab.ca
|
||||||
|
|
||||||
|
Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
|
||||||
|
Copyright (C) 2005-2006 James Grant <james@lightbox.org>
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
require("../common.inc.php");
|
||||||
|
require_once("../user.inc.php");
|
||||||
|
require_once("judges.inc.php");
|
||||||
|
user_auth_required('committee', 'admin');
|
||||||
|
|
||||||
|
$year=$config['FAIRYEAR'];
|
||||||
|
$project_id = NULL;
|
||||||
|
if($_GET['projectid']) {
|
||||||
|
$project_id = $_GET['projectid'];
|
||||||
|
} else if($_POST['projectid']) {
|
||||||
|
$project_id = $_POST['projectid'];
|
||||||
|
$curr_team = $_POST['score_count'];
|
||||||
|
while($curr_team > 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')
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
if($project_id) {
|
||||||
|
$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
|
||||||
|
while($r=mysql_fetch_object($q))
|
||||||
|
$cats[$r->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 "<form action=\"judging_score_edit.php\" method=\"post\">";
|
||||||
|
echo "<input type=\"hidden\" name=\"score_count\" value=\"" . mysql_num_rows($q) . "\"/>";
|
||||||
|
echo "<input type=\"hidden\" name=\"projectid\" value=\"$project_id\"/>";
|
||||||
|
echo "<table class=\"tableview\">";
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<th>".i18n("Team Number")."</th>";
|
||||||
|
echo "<th>".i18n("Judges")."</th>";
|
||||||
|
echo "<th>".i18n("Score")."</th>";
|
||||||
|
echo "<th>".i18n("New Score")."</th>";
|
||||||
|
echo "</tr>";
|
||||||
|
|
||||||
|
$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 "<tr>\n";
|
||||||
|
echo "<td style=\"vertical-align: middle\">\n";
|
||||||
|
echo $r->num;
|
||||||
|
echo "<input type=\"hidden\" name=\"team_" . $i. "_id\" value=\"$r->judges_teams_id\"/>\n";
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "<td style=\"vertical-align: middle\">";
|
||||||
|
echo mysql_fetch_object($s)->name;
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "<td style=\"vertical-align: middle; text-align: center\">\n";
|
||||||
|
if($r->score) {
|
||||||
|
echo $r->score;
|
||||||
|
} else {
|
||||||
|
echo "None";
|
||||||
|
}
|
||||||
|
echo "\n</td>\n";
|
||||||
|
echo "<td style=\"vertical-align: middle; text-align: center\">\n";
|
||||||
|
echo "<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"team_" . $i . "_score\" value=\"$r->score\"/>\n";
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</table>\n";
|
||||||
|
echo "<input type=\"submit\" />\n";
|
||||||
|
echo "</form>\n";
|
||||||
|
} else {
|
||||||
|
echo i18n("Invalid Project ID.");
|
||||||
|
}
|
||||||
|
|
122
admin/judging_score_entry.php
Normal file
122
admin/judging_score_entry.php
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<?
|
||||||
|
/*
|
||||||
|
This file is part of the 'Science Fair In A Box' project
|
||||||
|
SFIAB Website: http://www.sfiab.ca
|
||||||
|
|
||||||
|
Copyright (C) 2005-2006 Sci-Tech Ontario Inc <info@scitechontario.org>
|
||||||
|
Copyright (C) 2005-2006 James Grant <james@lightbox.org>
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
require("../common.inc.php");
|
||||||
|
require_once("../user.inc.php");
|
||||||
|
require_once("judges.inc.php");
|
||||||
|
user_auth_required('committee', 'admin');
|
||||||
|
|
||||||
|
if($_GET['year']) $year=$_GET['year'];
|
||||||
|
else $year=$config['FAIRYEAR'];
|
||||||
|
|
||||||
|
if($_GET['csv'] == 'yes') {
|
||||||
|
header("Content-type: text/csv");
|
||||||
|
} else {
|
||||||
|
send_header("Judging Score Entry",
|
||||||
|
array('Committee Main' => 'committee_main.php',
|
||||||
|
'Administration' => 'admin/index.php')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
|
||||||
|
while($r=mysql_fetch_object($q))
|
||||||
|
$cats[$r->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 "<a href='judging_score_entry.php?csv=yes'>" . i18n("Generate CSV Report") . "</a>\n";
|
||||||
|
echo "<table class=\"tableview\">";
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<th>".i18n("Proj Num")."</th>";
|
||||||
|
echo "<th>".i18n("Project Title")."</th>";
|
||||||
|
echo "<th>".i18n("Age Category")."</th>";
|
||||||
|
echo "<th>".i18n("Division")."</th>";
|
||||||
|
echo "<th>".i18n("Score")."</th>";
|
||||||
|
echo "<th>".i18n("Normalized Score")."</th>";
|
||||||
|
echo "<th>".i18n("Action")."</th>";
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
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 "<tr>";
|
||||||
|
echo "<td>$r->projectnumber</td>\n";
|
||||||
|
echo "<td>$r->title</td>\n";
|
||||||
|
|
||||||
|
echo "<td>".i18n($cats[$r->projectcategories_id])."</td>\n";
|
||||||
|
echo "<td>".i18n($divs[$r->projectdivisions_id])."</td>\n";
|
||||||
|
echo "<td>" . number_format($r->score, 2) . "</td>\n";
|
||||||
|
echo "<td>" . number_format($r->norm_score, 2) . "</td>\n";
|
||||||
|
echo "<td align=\"center\">";
|
||||||
|
if($year==$config['FAIRYEAR']) {
|
||||||
|
echo "<a href=\"judging_score_edit.php?projectid=$r->projectid\">";
|
||||||
|
echo i18n("Edit Scores");
|
||||||
|
echo "</a>";
|
||||||
|
}
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($_GET['csv'] != 'yes') {
|
||||||
|
echo "</table>\n";
|
||||||
|
echo "<br />";
|
||||||
|
|
||||||
|
send_footer();
|
||||||
|
}
|
||||||
|
?>
|
@ -43,6 +43,7 @@
|
|||||||
$theme['icons']['tour_management']="preferences-system-performance.png";
|
$theme['icons']['tour_management']="preferences-system-performance.png";
|
||||||
$theme['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png";
|
$theme['icons']['internal_document_management']="application-vnd.oasis.opendocument.text.png";
|
||||||
$theme['icons']['registration_fee_items_management']="transfers_list.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']['enter_winning_projects']="legalmoves.png";
|
||||||
$theme['icons']['one-click_cwsf_registration']="flag-blue.png";
|
$theme['icons']['one-click_cwsf_registration']="flag-blue.png";
|
||||||
$theme['icons']['one-click_ysf_affiliation_stats']="flag-green.png";
|
$theme['icons']['one-click_ysf_affiliation_stats']="flag-green.png";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user