enhance reporting capabilities for judging score entry

This commit is contained in:
justin 2010-05-27 21:55:10 +00:00
parent c47eb2ac30
commit a586ad8e93
2 changed files with 45 additions and 3 deletions

View File

@ -60,6 +60,9 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
projects.projectcategories_id, projects.projectcategories_id,
projects.projectdivisions_id, projects.projectdivisions_id,
judges_teams_id as res_team_id, judges_teams_id as res_team_id,
count(score) as score_count,
count((SELECT count(*) FROM judges_teams_timeslots_projects_link WHERE
projectid=judges_teams_timeslots_projects_link.projects_id)) as score_total_count,
avg(score) as score, avg(score) as score,
avg(score + (SELECT 70-avg(score) avg(score + (SELECT 70-avg(score)
FROM judges_teams_timeslots_projects_link FROM judges_teams_timeslots_projects_link
@ -79,8 +82,33 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
echo mysql_error(); echo mysql_error();
if($_GET['csv'] != 'yes') { if($_GET['csv'] != 'yes') {
?>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#div-cat-best").click(function() {
// set sorting column and direction, this will sort on the first and third column the column index starts at zero
var sorting = [[2,0],[3,0],[5,1]];
// sort on the first column
$(".tableview").trigger("sorton",[sorting]);
// return false to stop default link action
return false;
});
$("#overall-best").click(function() {
// set sorting column and direction, this will sort on the first and third column the column index starts at zero
var sorting = [[5,1]];
// sort on the first column
$(".tableview").trigger("sorton",[sorting]);
// return false to stop default link action
return false;
});
});
</script>
<?php
echo "<a href='judging_score_entry.php?csv=yes'>" . i18n("Generate CSV Report") . "</a>\n"; echo "<a href='judging_score_entry.php?csv=yes'>" . i18n("Generate CSV Report") . "</a>\n";
echo "<br /><a href='#' id='div-cat-best'>" . i18n("Sort By Best in Division/Category") . "</a>\n";
echo "<br /><a href='#' id='overall-best'>" . i18n("Sort By Best Overall") . "</a>\n";
echo "<table class=\"tableview\">"; echo "<table class=\"tableview\">";
echo "<thead>";
echo "<tr>"; echo "<tr>";
echo "<th>".i18n("Proj Num")."</th>"; echo "<th>".i18n("Proj Num")."</th>";
echo "<th>".i18n("Project Title")."</th>"; echo "<th>".i18n("Project Title")."</th>";
@ -88,8 +116,11 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
echo "<th>".i18n("Division")."</th>"; echo "<th>".i18n("Division")."</th>";
echo "<th>".i18n("Score")."</th>"; echo "<th>".i18n("Score")."</th>";
echo "<th>".i18n("Normalized Score")."</th>"; echo "<th>".i18n("Normalized Score")."</th>";
echo "<th>".i18n("Judgings")."</th>";
echo "<th>".i18n("Action")."</th>"; echo "<th>".i18n("Action")."</th>";
echo "</tr>"; echo "</tr>";
echo "</thead>";
echo "<tbody>";
} else { } else {
echo "Project #\tTitle\tCategory\tDivision\tScore\tNormalized Scores\tJudge Name\tJudges Score\n"; echo "Project #\tTitle\tCategory\tDivision\tScore\tNormalized Scores\tJudge Name\tJudges Score\n";
} }
@ -121,8 +152,16 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
echo "<td>".i18n($cats[$r->projectcategories_id])."</td>\n"; echo "<td>".i18n($cats[$r->projectcategories_id])."</td>\n";
echo "<td>".i18n($divs[$r->projectdivisions_id])."</td>\n"; echo "<td>".i18n($divs[$r->projectdivisions_id])."</td>\n";
echo "<td>" . number_format($r->score, 2) . "</td>\n"; echo "<td class='judging_score'>" . number_format($r->score, 2) . "</td>\n";
echo "<td>" . number_format($r->norm_score, 2) . "</td>\n"; echo "<td class='judging_score'><strong>" . number_format($r->norm_score, 2) . "</strong></td>\n";
if ($r->score_count == $r->score_total_count) {
echo "<td>";
} else if ($r->score_count == 0) {
echo "<td class='caution'>";
} else {
echo "<td class='error'>";
}
echo number_format($r->score_count, 0) . "/" . number_format($r->score_total_count, 0) . "</td>\n";
echo "<td align=\"center\">"; echo "<td align=\"center\">";
if($year==$config['FAIRYEAR']) { if($year==$config['FAIRYEAR']) {
echo "<a href=\"judging_score_edit.php?projectid=$r->projectid\">"; echo "<a href=\"judging_score_edit.php?projectid=$r->projectid\">";
@ -134,6 +173,7 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
} }
} }
if($_GET['csv'] != 'yes') { if($_GET['csv'] != 'yes') {
echo "</tbody>";
echo "</table>\n"; echo "</table>\n";
echo "<br />"; echo "<br />";

View File

@ -439,6 +439,8 @@ div.ui-tabs ul.ui-tabs-nav {
color: #c0c0c0; color: #c0c0c0;
} }
.judging_score {
text-align: right;
}