forked from science-ation/science-ation
Add new CUSTOM report: Program Awards List (used for ORSF printed program)
Add award criteria to getJudgingTeams() result Modify CUSTOM report judges teams proejcts, to show each award and the criteria/eligibility for each award that the team is assigned to judge. More ease of use cleanups to awards interface Add new field award order to student report generator
This commit is contained in:
parent
6fa1a01fe6
commit
d209b0648f
@ -221,7 +221,7 @@ echo mysql_error();
|
||||
if($_GET['action']=="edit")
|
||||
echo "<input type=\"hidden\" name=\"id\" value=\"".$_GET['edit']."\">\n";
|
||||
|
||||
echo "<table>\n";
|
||||
echo "<table class=\"tableedit\">\n";
|
||||
echo "<tr><td>".i18n("Name")."</td><td><input type=\"text\" id=\"name\" name=\"name\" value=\"".htmlspecialchars($award_awards_name)."\" size=\"50\" maxlength=\"128\" /><script type=\"text/javascript\">translateButton('name');</script></td></tr>\n";
|
||||
echo "<tr><td>".i18n("Order")."</td><td><input type=\"text\" name=\"order\" value=\"".htmlspecialchars($award_awards_order)."\" size=\"5\" maxlength=\"5\" />(".i18n("presentation order").")</td></tr>\n";
|
||||
echo "<tr><td>".i18n("Sponsor")."</td><td>";
|
||||
@ -394,7 +394,7 @@ echo mysql_error();
|
||||
echo "<form method=\"post\" action=\"award_awards.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"reorder\">";
|
||||
|
||||
echo "<table class=\"summarytable\">";
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr>";
|
||||
echo " <th>".i18n("Order")."</th>";
|
||||
echo " <th>".i18n("Sponsor")."</th>";
|
||||
|
@ -59,6 +59,7 @@ function getJudgingTeams()
|
||||
//get the awards for this team
|
||||
$aq=mysql_query("SELECT award_awards.id,
|
||||
award_awards.name,
|
||||
award_awards.criteria,
|
||||
award_awards.award_types_id,
|
||||
award_types.type AS award_type
|
||||
FROM
|
||||
@ -78,6 +79,7 @@ function getJudgingTeams()
|
||||
$teams[$r->id]['awards'][]=array(
|
||||
"id"=>$ar->id,
|
||||
"name"=>$ar->name,
|
||||
"criteria"=>$ar->criteria,
|
||||
"award_types_id"=>$ar->award_types_id,
|
||||
"award_type"=>$ar->award_type
|
||||
);
|
||||
|
@ -317,6 +317,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
||||
}
|
||||
echo "<input name=\"assignbtn[$r->id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"Assign\">";
|
||||
|
||||
|
||||
echo "</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
@ -383,11 +384,11 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
||||
|
||||
echo "<a href=\"judges_teams_projects.php?action=edit&edit=".$team['id']."\">Edit team project assignments</a>";
|
||||
|
||||
echo "<table class=summarytable style=\"margin-left: 0px; width: 100%;\">";
|
||||
echo "<table class=tableview style=\"margin-left: 0px; width: 100%;\">";
|
||||
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
echo "<tr><td width=\"150\" align=\"center\">";
|
||||
echo "<tr><td width=\"100\" align=\"center\">";
|
||||
|
||||
echo "<nobr>";
|
||||
if($show_date)
|
||||
|
@ -69,7 +69,6 @@ while($catr=mysql_fetch_object($catq))
|
||||
echo "</td>";
|
||||
}
|
||||
*/
|
||||
|
||||
echo "<br />";
|
||||
echo i18n("Mailing Labels").": ";
|
||||
echo "<a href=\"reports_mailinglabels.php\">".i18n("Mailing Label Generator")."</a>";
|
||||
@ -156,10 +155,13 @@ while($catr=mysql_fetch_object($catq))
|
||||
echo "<a href=\"reports_gen.php?id=29\">PDF</a> ";
|
||||
// echo "<a href=\"reports_projects_judgingstickers.php?type=pdf\">PDF</a> ";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
|
||||
echo i18n("Awards list for Program").": ";
|
||||
echo "<a href=\"reports_program_awards.php?type=csv\">CSV</a> ";
|
||||
|
||||
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo i18n("Award Ceremony Script").": ";
|
||||
echo "<a href=\"reports_acscript.php?type=pdf\">PDF</a> ";
|
||||
|
@ -81,6 +81,40 @@
|
||||
}
|
||||
$rep->addText($memberlist);
|
||||
|
||||
if(count($team['awards']))
|
||||
{
|
||||
$rep->heading(i18n("Awards that this team judges").":");
|
||||
foreach($team['awards'] AS $award)
|
||||
{
|
||||
$rep->addText($award['name']);
|
||||
$rep->addText(i18n("Criteria").": ".$award['criteria']);
|
||||
|
||||
//get category eligibility
|
||||
$q=mysql_query("SELECT projectcategories.category FROM projectcategories, award_awards_projectcategories WHERE award_awards_projectcategories.projectcategories_id=projectcategories.id AND award_awards_projectcategories.award_awards_id='{$award['id']}' AND award_awards_projectcategories.year='{$config['FAIRYEAR']}' AND projectcategories.year='{$config['FAIRYEAR']}' ORDER BY category");
|
||||
echo mysql_error();
|
||||
$cats="";
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
if($cats) $cats.=", ".i18n($r->category);
|
||||
else $cats=i18n($r->category);
|
||||
}
|
||||
$rep->addText(i18n("Categories").": $cats");
|
||||
|
||||
|
||||
//get division eligibility
|
||||
$q=mysql_query("SELECT projectdivisions.division_shortform FROM projectdivisions, award_awards_projectdivisions WHERE award_awards_projectdivisions.projectdivisions_id=projectdivisions.id AND award_awards_projectdivisions.award_awards_id='{$award['id']}' AND award_awards_projectdivisions.year='{$config['FAIRYEAR']}' AND projectdivisions.year='{$config['FAIRYEAR']}' ORDER BY division_shortform");
|
||||
echo mysql_error();
|
||||
$divs="";
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
if($divs) $divs.=", ".i18n($r->division_shortform);
|
||||
else $divs=i18n($r->division_shortform);
|
||||
}
|
||||
$rep->addText(i18n("Divisions").": $divs");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$rep->nextLine();
|
||||
|
||||
//get the timeslots that this team has.
|
||||
|
114
admin/reports_program_awards.php
Normal file
114
admin/reports_program_awards.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?
|
||||
require("../common.inc.php");
|
||||
auth_required('admin');
|
||||
require("../lpdf.php");
|
||||
require("../lcsv.php");
|
||||
|
||||
$type=$_GET['type'];
|
||||
if(!$type) $type="pdf";
|
||||
|
||||
if($type=="pdf")
|
||||
{
|
||||
|
||||
$rep=new lpdf( i18n($config['fairname']),
|
||||
i18n("Program Awards"),
|
||||
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
|
||||
);
|
||||
|
||||
$rep->newPage();
|
||||
$rep->setFontSize(11);
|
||||
}
|
||||
else if($type=="csv")
|
||||
{
|
||||
$rep=new lcsv(i18n("Program Awards"));
|
||||
}
|
||||
$q=mysql_query("SELECT
|
||||
award_awards.id,
|
||||
award_awards.name,
|
||||
award_awards.criteria,
|
||||
award_awards.presenter,
|
||||
award_awards.order AS awards_order,
|
||||
award_types.type
|
||||
FROM
|
||||
award_awards,
|
||||
award_types
|
||||
WHERE
|
||||
award_awards.year='".$config['FAIRYEAR']."'
|
||||
AND award_types.year='".$config['FAIRYEAR']."'
|
||||
AND award_awards.award_types_id=award_types.id
|
||||
AND award_awards.excludefromac='0'
|
||||
AND (award_types.type='special' OR award_types.type='grand')
|
||||
ORDER BY awards_order");
|
||||
|
||||
echo mysql_error();
|
||||
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
$rep->heading(i18n($r->name));
|
||||
|
||||
//get teh age categories
|
||||
$acq=mysql_query("SELECT projectcategories.category FROM projectcategories, award_awards_projectcategories WHERE projectcategories.year='".$config['FAIRYEAR']."' AND award_awards_projectcategories.year='".$config['FAIRYEAR']."' AND award_awards_projectcategories.award_awards_id='$r->id' AND award_awards_projectcategories.projectcategories_id=projectcategories.id ORDER BY projectcategories.id");
|
||||
echo mysql_error();
|
||||
$cats="";
|
||||
while($acr=mysql_fetch_object($acq))
|
||||
{
|
||||
$cats.=i18n($acr->category).", ";
|
||||
}
|
||||
$cats=substr($cats,0,-2);
|
||||
$rep->addText("$cats: ".i18n($r->criteria));
|
||||
|
||||
$pq=mysql_query("SELECT
|
||||
award_prizes.prize,
|
||||
award_prizes.number,
|
||||
award_prizes.id,
|
||||
award_prizes.cash,
|
||||
award_prizes.scholarship
|
||||
FROM
|
||||
award_prizes
|
||||
WHERE
|
||||
award_awards_id='$r->id'
|
||||
AND award_prizes.year='".$config['FAIRYEAR']."'
|
||||
AND award_prizes.excludefromac='0'
|
||||
ORDER BY
|
||||
`order`");
|
||||
echo mysql_error();
|
||||
$prevprizeid=-1;
|
||||
while($pr=mysql_fetch_object($pq))
|
||||
{
|
||||
if($prevprizeid!=$pr->id)
|
||||
{
|
||||
$prizetext="";
|
||||
if($pr->number>1)
|
||||
$prizetext.=i18n("%1 prizes of",array($pr->number))." ";
|
||||
|
||||
if($pr->prize)
|
||||
$prizetext.=i18n($pr->prize);
|
||||
|
||||
if($pr->cash || $pr->scholarship)
|
||||
{
|
||||
if($pr->prize)
|
||||
$prizetext.=" (";
|
||||
if($pr->cash && $pr->scholarship)
|
||||
$prizetext.="\$$pr->cash / \$$pr->scholarship ".i18n("scholarship");
|
||||
else if($pr->cash)
|
||||
$prizetext.= "\$$pr->cash";
|
||||
else if($pr->scholarship)
|
||||
$prizetext.= "\$$pr->scholarship ".i18n("scholarship");
|
||||
|
||||
if($pr->prize)
|
||||
$prizetext.= ")";
|
||||
|
||||
|
||||
}
|
||||
$rep->addText($prizetext);
|
||||
|
||||
$prevprizeid=$pr->id;
|
||||
}
|
||||
}
|
||||
$rep->nextLine();
|
||||
}
|
||||
}
|
||||
$rep->output();
|
||||
?>
|
@ -247,6 +247,14 @@ $report_students_fields = array(
|
||||
'table_sort' => 'award_awards.order',
|
||||
'components' => array('awards')),
|
||||
|
||||
'order' => array(
|
||||
'name' => 'Award -- Order',
|
||||
'header' => 'Award Order',
|
||||
'width' => 0.5,
|
||||
'table' => 'award_awards.order',
|
||||
'table_sort' => 'award_awards.order',
|
||||
'components' => array('awards')),
|
||||
|
||||
'pn_awards' => array(
|
||||
'name' => 'Project Num + Award (will be unique)',
|
||||
'header' => 'Award Name',
|
||||
|
Loading…
x
Reference in New Issue
Block a user