Add an actual form to the ceremony script setup page.

This commit is contained in:
justin 2007-12-17 23:20:21 +00:00
parent c514d7910a
commit 2363a38120
2 changed files with 50 additions and 13 deletions

View File

@ -8,9 +8,16 @@
if($_GET['year']) $foryear=$_GET['year'];
else $foryear=$config['FAIRYEAR'];
if($_GET['awardtype']) $awardtype=" AND award_types.type='".mysql_escape_string($_GET['awardtype'])."'";
if($_GET['awardtype']=="All") $awardtype="";
else if($_GET['awardtype']) $awardtype=" AND award_types.type='".mysql_escape_string($_GET['awardtype'])."'";
else $awardtype="";
if($_GET['show_unawarded_awards']=="on") $show_unawarded_awards="yes";
else $show_unawarded_awards="no";
if($_GET['show_unawarded_prizes']=="on") $show_unawarded_prizes="yes";
else $show_unawarded_prizes="no";
$type=$_GET['type'];
if(!$type) $type="pdf";
@ -78,7 +85,7 @@
`order`");
echo mysql_error();
if($config['reports_show_unawarded_awards']==no)
if($show_unawarded_awards=="no")
{
$skipAward=true;
while($pr=mysql_fetch_object($pq))
@ -106,7 +113,7 @@
$prevprizeid=-1;
while($pr=mysql_fetch_object($pq))
{
if($pr->projectnumber || $config['reports_show_unawarded_prizes']==yes)
if($pr->projectnumber || $show_unawarded_prizes=="yes")
{
if($prevprizeid!=$pr->id)
{

View File

@ -31,17 +31,47 @@
'Administration' => 'admin/index.php')
);
echo "<br />";
echo "<form action=\"reports_acscript.php\" method=\"get\">";
echo "<table class=\"tableedit\">";
echo "<tr><td><b>".i18n("Year").":</b></td><td>";
echo "<a href=\"reports_acscript.php?type=pdf\">FULL PDF</a> &nbsp;";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Divisional\">(Divisional)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Special\">(Special)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Interdisciplinary\">(Interdisciplinary)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Other\">(Other)</a> &nbsp; ";
echo "<a href=\"reports_acscript.php?type=pdf&awardtype=Grand\">(Grand)</a> &nbsp; ";
echo "<br />";
echo i18n("Award Ceremony Script").": ";
echo "<a href=\"reports_acscript.php?type=csv\">CSV</a> &nbsp; ";
echo "<br />";
//get the year information, use fairname since it should be there for all years[right?]
$results = mysql_query("SELECT year FROM config WHERE var='fairname' AND year > 0 ORDER BY year DESC");
echo "<select name=\"year\" size=1>";
while($r=mysql_fetch_object($results)) {
echo "<option>$r->year</option>";
}
echo "</select></td></tr>";
//list output formats
echo "<tr><td>
<b>".i18n("Type").":</b>
</td>
<td>
<select name=\"type\" size=1>
<option value=\"pdf\">PDF</option>
<option value=\"csv\">CSV</option>
</select></td>";
//list award subsets to output
echo "<td><b>".i18n("Award Type").":</b></td> <td> <select name=\"awardtype\" size=1>";
$results = mysql_query("SELECT type FROM award_types WHERE year=".$config['FAIRYEAR']." ORDER BY type");
echo "<option value=\"All\">".i18n("All")."</option>";
while($r=mysql_fetch_object($results)) {
echo "<option value=\"$r->type\">".i18n("$r->type")."</option>";
}
echo "</select></td></tr>";
echo "<tr><td colspan=3><b>".i18n("Show awards without winners").":</b></td>";
echo "<td><input name=\"show_unawarded_awards\" type=\"checkbox\" ".($config['reports_show_unawarded_awards'] = 'yes' ? "checked" : "")."/></td></tr>";
echo "<tr><td colspan=3><b>".i18n("Show prizes without winners").":</b></td>";
echo "<td><input name=\"show_unawarded_prizes\" type=\"checkbox\" ".($config['reports_show_unawarded_prizes'] = 'yes' ? "checked" : "")."/></td></tr>";
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Generate Script")."\" />";
echo "</form>";
send_footer();
?>