- Add text boxes for order and title for each member on each committee

This commit is contained in:
dave 2007-11-20 20:46:05 +00:00
parent 7e45665d6c
commit 9a2c37f7f0

View File

@ -128,12 +128,28 @@ if($_POST['committees_id'] && $_POST['committees_ord'])
$ids=$_POST['committees_id'];
$ords=$_POST['committees_ord'];
$titles=$_POST['title'];
$pords = $_POST['order'];
while($ids[$x])
{
mysql_query("UPDATE committees SET ord='".$ords[$x]."' WHERE id='".$ids[$x]."'");
$cid = intval($ids[$x]);
mysql_query("UPDATE committees SET ord='".intval($ords[$x])."' WHERE id='$cid'");
$x++;
$ctitle = $titles[$cid];
$cord = $pords[$cid];
foreach($ctitle as $uid=>$title) {
$o = intval($cord[$uid]);
$t = mysql_escape_string(stripslashes($title));
$u = intval($uid);
$q = "UPDATE committees_link SET title='$t', ord='$o'
WHERE committees_id='$cid' AND users_id='$u'";
mysql_query($q);
}
}
echo happy(i18n("Committees successfully re-ordered"));
echo happy(i18n("Committees successfully saved"));
}
@ -275,13 +291,15 @@ if($_POST['add_member_to_committees_id'])
echo "<h4>".i18n("Committees")."</h4>";
echo "<form method=\"post\" action=\"committees.php\">\n";
echo "<table>";
echo "<tr><td colspan=\"2\"></td><td><b>".i18n("Public Email / Private Email")."</b></td></tr>";
echo "<tr><td colspan=\"2\"></td><td><b>".i18n('Title')."</b></td>";
echo "<td><b>".i18n('Order')."</b></td>";
echo "<td><b>".i18n("Public Email / Private Email")."</b></td></tr>";
while($r=mysql_fetch_object($q))
{
echo "<tr>";
echo "<td colspan=\"3\">";
echo "<input type=\"hidden\" name=\"committees_id[]\" value=\"$r->id\" />";
echo "<input size=\"2\" type=\"text\" name=\"committees_ord[]\" value=\"$r->ord\" />";
echo "<input size=\"1\" type=\"text\" name=\"committees_ord[]\" value=\"$r->ord\" />";
echo "&nbsp; <b>$r->name</b>";
$q2=mysql_query("SELECT
@ -316,10 +334,11 @@ if($_POST['add_member_to_committees_id'])
echo "<a title=\"Unlink Member from Committee\" onclick=\"return confirmClick('Are you sure you want to unlink this member from this committee?');\" href=\"committees.php?unlinkmember=$r2->id&amp;unlinkcommittee={$r->id}\"><img src=\"{$config['SFIABDIRECTORY']}/images/16/undo.{$config['icon_extension']}\" border=\"0\" alt=\"Unlink\" /></a>";
echo "</td>";
echo "<td valign=\"top\">";
$name = $r2->firstname.' '.$r2->lastname;
echo " <b>$name</b>";
if($r2->title) echo " - $r2->title &nbsp; &nbsp;";
echo "<b>{$r2->firstname} {$r2->lastname}</b>";
echo "</td><td>";
echo "<input type=\"text\" value=\"{$r2->title}\" name=\"title[{$r->id}][{$r2->id}]\" size=\"15\">";
echo "</td><td>";
echo "<input type=\"text\" value=\"{$r2->ord}\" name=\"order[{$r->id}][{$r2->id}]\" size=\"2\">";
echo "</td><td>";
@ -340,7 +359,7 @@ if($_POST['add_member_to_committees_id'])
}
echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
}
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"".i18n("Re-Order Committees")."\" /></td></tr>\n";
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"".i18n("Save Committee Orders and Titles")."\" /></td></tr>\n";
echo "</table>";
echo "</form>\n";
}