Fix problem if not all score entries are entered in score entry; and move send_headers earlier to avoid conflict

This commit is contained in:
justin 2009-04-04 13:43:07 +00:00
parent 2328f54721
commit e3b440d8da

View File

@ -26,6 +26,11 @@
require_once("../user.inc.php");
require_once("judges.inc.php");
user_auth_required('committee', 'admin');
send_header("Judging Score Entry - Update",
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php',
'Judging Score Entry' => 'admin/judging_score_entry.php')
);
$year=$config['FAIRYEAR'];
$project_id = NULL;
@ -35,21 +40,18 @@
$project_id = $_POST['projectid'];
$curr_team = $_POST['score_count'];
while($curr_team > 0) {
if($_POST["team_" . $curr_team . "_score"] != "") {
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");