forked from science-ation/science-ation
Remove much of the awkwareness of the awards management interface
This commit is contained in:
parent
1bdba54ed5
commit
6fa1a01fe6
@ -27,13 +27,19 @@
|
|||||||
|
|
||||||
send_header("Administration - Awards Awards");
|
send_header("Administration - Awards Awards");
|
||||||
|
|
||||||
if($_GET['award_sponsors_id']) $award_sponsors_id=$_GET['award_sponsors_id'];
|
if($_GET['award_sponsors_id'] && $_GET['award_sponsors_id']!="all")
|
||||||
else if($_POST['award_sponsors_id']) $award_sponsors_id=$_POST['award_sponsors_id'];
|
$_SESSION['award_sponsors_id']=$_GET['award_sponsors_id'];
|
||||||
|
|
||||||
if($_GET['award_types_id']) $award_types_id=$_GET['award_types_id'];
|
if($_GET['award_types_id'] && $_GET['award_types_id']!="all")
|
||||||
else if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id'];
|
$_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\"><< ".i18n("Back to Administration")."</a>\n";
|
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a>\n";
|
||||||
echo "<a href=\"awards.php\"><< ".i18n("Back to Awards Main")."</a>\n";
|
echo "<a href=\"awards.php\"><< ".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");
|
$q=mysql_query("SELECT id,organization FROM award_sponsors ORDER BY organization");
|
||||||
echo "<select name=\"award_sponsors_id\" onchange=\"document.forms.filterchange.submit()\">";
|
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))
|
while($r=mysql_fetch_object($q))
|
||||||
{
|
{
|
||||||
if($r->id == $award_sponsors_id)
|
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");
|
$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 "<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))
|
while($r=mysql_fetch_object($q))
|
||||||
{
|
{
|
||||||
if($r->id == $award_types_id)
|
if($r->id == $award_types_id)
|
||||||
|
@ -218,6 +218,7 @@ function addclicked()
|
|||||||
AND award_types_id!='1'
|
AND award_types_id!='1'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
award_types_order,
|
award_types_order,
|
||||||
|
award_awards.order,
|
||||||
name");
|
name");
|
||||||
$num=1;
|
$num=1;
|
||||||
while($r=mysql_fetch_object($q))
|
while($r=mysql_fetch_object($q))
|
||||||
@ -225,6 +226,7 @@ function addclicked()
|
|||||||
// print_r($r);
|
// print_r($r);
|
||||||
$name=mysql_escape_string("($r->award_type) $r->name");
|
$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']."')");
|
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();
|
$team_id=mysql_insert_id();
|
||||||
//now link the new team to the award
|
//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']."')");
|
mysql_query("INSERT INTO judges_teams_awards_link (award_awards_id,judges_teams_id,year) VALUES ('$r->id','$team_id','".$config['FAIRYEAR']."')");
|
||||||
|
Loading…
Reference in New Issue
Block a user