Allow setting a mingrade of 0 (kindergarden) for the categories, also center the columns in the table to look nicer

This commit is contained in:
james 2006-01-28 17:53:26 +00:00
parent dbaf4d9b4e
commit 6832bdc572

View File

@ -30,7 +30,8 @@
if($_POST['action']=="edit")
{
if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade'])
//ues isset($_POST['mingrade']) instead of just $_POST['mingrade'] to allow entering 0 for kindergarden
if($_POST['id'] && $_POST['category'] && isset($_POST['mingrade']) && $_POST['maxgrade'])
{
$q=mysql_query("SELECT id FROM projectcategories WHERE id='".$_POST['id']."' AND year='".$config['FAIRYEAR']."'");
echo mysql_error();
@ -57,7 +58,8 @@
if($_POST['action']=="new")
{
if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade'])
//ues isset($_POST['mingrade']) instead of just $_POST['mingrade'] to allow entering 0 for kindergarden
if($_POST['id'] && $_POST['category'] && isset($_POST['mingrade']) && $_POST['maxgrade'])
{
$q=mysql_query("SELECT id FROM projectcategories WHERE id='".$_POST['id']."' AND year='".$config['FAIRYEAR']."'");
if(mysql_num_rows($q))
@ -130,11 +132,11 @@
while($r=mysql_fetch_object($q))
{
echo "<tr>";
echo " <td>$r->id</td>";
echo " <td align=\"center\">$r->id</td>";
echo " <td>".i18n($r->category)."</td>";
echo " <td>$r->mingrade</td>";
echo " <td>$r->maxgrade</td>";
echo " <td>";
echo " <td align=\"center\">$r->mingrade</td>";
echo " <td align=\"center\">$r->maxgrade</td>";
echo " <td align=\"center\">";
echo "<a title=\"Edit\" href=\"".$_SERVER['PHP_SELF']."?action=edit&amp;edit=$r->id\"><img src=\"".$config['SFIABDIRECTORY']."/images/16/edit.".$config['icon_extension']."\" border=0></a>";
echo "&nbsp; &nbsp;";
echo "<a title=\"Remove\" onClick=\"return confirmClick('Are you sure you want to remove this age category?');\" href=\"".$_SERVER['PHP_SELF']."?action=remove&amp;remove=$r->id\"><img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=0></a>";