Display errors if at least one age category and one division arent selected

This commit is contained in:
james 2008-03-27 08:06:14 +00:00
parent 6a1f51d3dd
commit d190d4f0b7

@ -291,12 +291,14 @@ echo mysql_error();
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>";
echo "<th>".i18n("Divisions")."</th>";
echo "</tr>";
echo "<tr><td>";
if(count($currentcategories)==0) $class="class=\"error\""; else $class="";
echo "<tr><td $class>";
//now select all the categories so we can list them all
$cq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY mingrade");
@ -311,8 +313,8 @@ echo mysql_error();
echo "<input $ch type=\"checkbox\" name=\"eligiblecategories[]\" value=\"$cr->id\" />".i18n($cr->category)."<br />";
}
echo "</td>";
echo "<td>";
if(count($currentdivisions)==0) $class="class=\"error\""; else $class="";
echo "<td $class>";
$dq=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY division");
echo mysql_error();
@ -327,7 +329,10 @@ echo mysql_error();
echo "</td>";
echo "</tr>";
if(count($currentcategories)==0 || count($currentdivisions)==0)
echo "<tr><td colspan=\"2\" class=\"error\">".i18n("At least one age category and one division must be selected")."</td></tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td align=\"right\">";