Add trophy selection (student keeper, student return, school keeper, school return) to prizes

Add description to award & update awards ceremony script to include description if available
This commit is contained in:
james 2007-11-23 21:21:37 +00:00
parent 3479ab4e7f
commit 0551a65e93
4 changed files with 33 additions and 4 deletions

View File

@ -82,7 +82,8 @@
"presenter='".mysql_escape_string(stripslashes($_POST['presenter']))."', ".
"excludefromac='".mysql_escape_string(stripslashes($_POST['excludefromac']))."', ".
"cwsfaward='".mysql_escape_string(stripslashes($_POST['cwsfaward']))."', ".
"criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."' ".
"criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."', ".
"description='".mysql_escape_string(stripslashes($_POST['description']))."' ".
"WHERE id='$id'";
mysql_query($exec);
@ -151,6 +152,7 @@
award_awards.id,
award_awards.name,
award_awards.criteria,
award_awards.description,
award_awards.order,
award_awards.presenter,
award_awards.excludefromac,
@ -178,6 +180,7 @@ echo mysql_error();
$award_awards_name=$r->name;
$award_awards_order=$r->order;
$award_awards_criteria=$r->criteria;
$award_awards_description=$r->description;
$award_types_id=$r->award_types_id;
$award_type=$r->type;
$award_sponsors_id=$r->award_sponsors_id;
@ -212,6 +215,7 @@ echo mysql_error();
if($_POST['name']) $award_awards_name=$_POST['name'];
if($_POST['order']) $award_awards_order=$_POST['order'];
if($_POST['criteria']) $award_awards_criteria=$_POST['criteria'];
if($_POST['description']) $award_awards_criteria=$_POST['description'];
if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id'];
if($_POST['award_sponsors_id']) $award_sponsors_id=$_POST['award_sponsors_id'];
if($_POST['eligiblecategories']) $currentcategories=$_POST['eligiblecategories'];
@ -263,9 +267,9 @@ echo mysql_error();
echo "</select>";
echo "</td></tr>";
echo "<tr><td>".i18n("Criteria")."</td><td><textarea id=\"criteria\" name=\"criteria\" rows=\"4\" cols=\"50\">".htmlspecialchars($award_awards_criteria)."</textarea><script type=\"text/javascript\">translateButton('criteria');</script></td></tr>\n";
echo "<tr><td>".i18n("Criteria")."</td><td><textarea id=\"criteria\" name=\"criteria\" rows=\"3\" cols=\"50\">".htmlspecialchars($award_awards_criteria)."</textarea><script type=\"text/javascript\">translateButton('criteria');</script></td></tr>\n";
echo "<tr><td>".i18n("Description")."</td><td><textarea id=\"description\" name=\"description\" rows=\"3\" cols=\"50\">".htmlspecialchars($award_awards_description)."</textarea><script type=\"text/javascript\">translateButton('description');</script></td></tr>\n";
echo "<tr><td>".i18n("Eligibility")."</td><td>";
echo "<table>";
echo "<tr>";
echo "<th>".i18n("Age Categories")."</th>";

View File

@ -74,6 +74,10 @@
"value='".mysql_escape_string(stripslashes($_POST['value']))."', ".
"number='".mysql_escape_string(stripslashes($_POST['number']))."', ".
"excludefromac='".mysql_escape_string(stripslashes($_POST['excludefromac']))."', ".
"trophystudentkeeper='".mysql_escape_string(stripslashes($_POST['trophystudentkeeper']))."', ".
"trophystudentreturn='".mysql_escape_string(stripslashes($_POST['trophystudentreturn']))."', ".
"trophyschoolkeeper='".mysql_escape_string(stripslashes($_POST['trophyschoolkeeper']))."', ".
"trophyschoolreturn='".mysql_escape_string(stripslashes($_POST['trophyschoolreturn']))."', ".
"`order`='".mysql_escape_string(stripslashes($_POST['order']))."' ".
"WHERE id='$id'";
mysql_query($exec);
@ -137,11 +141,23 @@
echo "<tr><td>".i18n("Prize Value")."</td><td>\$</td><td><input type=\"text\" name=\"value\" value=\"".htmlspecialchars($r->value)."\" size=\"10\" maxlength=\"10\" /></td></tr>\n";
echo "<tr><td>".i18n("Number available")."</td><td></td><td><input type=\"text\" name=\"number\" value=\"".htmlspecialchars($r->number)."\" size=\"3\" maxlength=\"5\" /></td></tr>\n";
echo "<tr><td>".i18n("Order")."</td><td></td><td><input type=\"text\" name=\"order\" value=\"".htmlspecialchars($r->order)."\" size=\"3\" maxlength=\"5\" /></td></tr>\n";
echo "<tr><td valign=\"top\">".i18n("Plaque/Trophy")."</td><td align=\"right\" colspan=\"1\">";
if($r->trophystudentkeeper==1) $ch="checked=\"checked\""; else $ch="";
echo "<input $ch type=\"checkbox\" name=\"trophystudentkeeper\" value=\"1\"></td><td>".i18n("Student(s) keeper trophy")."</td></tr>";
echo "<tr><td align=\"right\" colspan=\"2\">";
if($r->trophystudentreturn==1) $ch="checked=\"checked\""; else $ch="";
echo "<input $ch type=\"checkbox\" name=\"trophystudentreturn\" value=\"1\"></td><td>".i18n("Student(s) annual return/reuse trophy")."</td></tr>";
echo "<tr><td align=\"right\" colspan=\"2\">";
if($r->trophyschoolkeeper==1) $ch="checked=\"checked\""; else $ch="";
echo "<input $ch type=\"checkbox\" name=\"trophyschoolkeeper\" value=\"1\"></td><td>".i18n("School keeper trophy")."</td></tr>";
echo "<tr><td align=\"right\" colspan=\"2\">";
if($r->trophyschoolreturn==1) $ch="checked=\"checked\""; else $ch="";
echo "<input $ch type=\"checkbox\" name=\"trophyschoolreturn\" value=\"1\"></td><td>".i18n("School annual return/reuse trophy")."</td></tr>";
echo "<tr><td>".i18n("Awards Ceremony")."</td><td align=\"right\" colspan=\"1\">";
if($r->excludefromac==1) $ch="checked=\"checked\""; else $ch="";
echo "<input $ch type=\"checkbox\" name=\"excludefromac\" value=\"1\"></td><td>".i18n("Exclude this prize from the award ceremony script")."</td></tr>";
echo "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" value=\"$buttontext\" /></td></tr>\n";
echo "</table>\n";

View File

@ -33,6 +33,7 @@
award_awards.id,
award_awards.name,
award_awards.presenter,
award_awards.description,
award_awards.order AS awards_order,
award_types.type,
award_sponsors.organization
@ -60,6 +61,8 @@
$rep->addText(i18n("Sponsored by: %1",array($r->organization)));
if($r->presenter)
$rep->addText(i18n("Presented by: %1",array($r->presenter)));
if($r->description)
$rep->addText(i18n("Description: %1",array($r->description)));
$pq=mysql_query("SELECT
award_prizes.prize,

6
db/db.update.65.sql Normal file
View File

@ -0,0 +1,6 @@
ALTER TABLE `award_prizes`
ADD `trophystudentkeeper` BOOL DEFAULT '0' NOT NULL ,
ADD `trophystudentreturn` BOOL DEFAULT '0' NOT NULL ,
ADD `trophyschoolkeeper` BOOL DEFAULT '0' NOT NULL ,
ADD `trophyschoolreturn` BOOL DEFAULT '0' NOT NULL ;
ALTER TABLE `award_awards` ADD `description` TEXT NOT NULL AFTER `criteria` ;