Remove much of the awkwareness of the awards management interface

This commit is contained in:
james 2007-03-28 18:03:15 +00:00
parent 1bdba54ed5
commit 6fa1a01fe6
2 changed files with 14 additions and 6 deletions

View File

@ -27,13 +27,19 @@
send_header("Administration - Awards Awards");
if($_GET['award_sponsors_id']) $award_sponsors_id=$_GET['award_sponsors_id'];
else if($_POST['award_sponsors_id']) $award_sponsors_id=$_POST['award_sponsors_id'];
if($_GET['award_sponsors_id'] && $_GET['award_sponsors_id']!="all")
$_SESSION['award_sponsors_id']=$_GET['award_sponsors_id'];
if($_GET['award_types_id']) $award_types_id=$_GET['award_types_id'];
else if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id'];
if($_GET['award_types_id'] && $_GET['award_types_id']!="all")
$_SESSION['award_types_id']=$_GET['award_types_id'];
if($_GET['award_sponsors_id']=="all")
unset($_SESSION['award_sponsors_id']);
if($_GET['award_types_id']=="all")
unset($_SESSION['award_types_id']);
$award_types_id=$_SESSION['award_types_id'];
$award_sponsors_id=$_SESSION['award_sponsors_id'];
echo "<a href=\"index.php\">&lt;&lt; ".i18n("Back to Administration")."</a>\n";
echo "<a href=\"awards.php\">&lt;&lt; ".i18n("Back to Awards Main")."</a>\n";
@ -316,7 +322,7 @@ echo mysql_error();
$q=mysql_query("SELECT id,organization FROM award_sponsors ORDER BY organization");
echo "<select name=\"award_sponsors_id\" onchange=\"document.forms.filterchange.submit()\">";
echo "<option value=\"\">".i18n("All Sponsors")."</option>";
echo "<option value=\"all\">".i18n("All Sponsors")."</option>";
while($r=mysql_fetch_object($q))
{
if($r->id == $award_sponsors_id)
@ -333,7 +339,7 @@ echo mysql_error();
$q=mysql_query("SELECT id,type FROM award_types WHERE year='{$config['FAIRYEAR']}' ORDER BY type");
echo "<select name=\"award_types_id\" onchange=\"document.forms.filterchange.submit()\">";
echo "<option value=\"\">".i18n("All Award Types")."</option>";
echo "<option value=\"all\">".i18n("All Award Types")."</option>";
while($r=mysql_fetch_object($q))
{
if($r->id == $award_types_id)

View File

@ -218,6 +218,7 @@ function addclicked()
AND award_types_id!='1'
ORDER BY
award_types_order,
award_awards.order,
name");
$num=1;
while($r=mysql_fetch_object($q))
@ -225,6 +226,7 @@ function addclicked()
// print_r($r);
$name=mysql_escape_string("($r->award_type) $r->name");
mysql_query("INSERT INTO judges_teams(num,name,autocreate_type_id,year) VALUES ('$num','$name','$r->award_types_id','".$config['FAIRYEAR']."')");
echo mysql_error();
$team_id=mysql_insert_id();
//now link the new team to the award
mysql_query("INSERT INTO judges_teams_awards_link (award_awards_id,judges_teams_id,year) VALUES ('$r->id','$team_id','".$config['FAIRYEAR']."')");