From 9a2c37f7f004d02c0738eb6b67375a392c9d88c0 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 20 Nov 2007 20:46:05 +0000 Subject: [PATCH] - Add text boxes for order and title for each member on each committee --- admin/committees.php | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/admin/committees.php b/admin/committees.php index d2fc587..069fe0e 100644 --- a/admin/committees.php +++ b/admin/committees.php @@ -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 "

".i18n("Committees")."

"; echo "
\n"; echo ""; - echo ""; + echo ""; + echo ""; + echo ""; while($r=mysql_fetch_object($q)) { echo ""; echo ""; echo "\n"; } - echo "\n"; + echo "\n"; echo "
".i18n("Public Email / Private Email")."
".i18n('Title')."".i18n('Order')."".i18n("Public Email / Private Email")."
"; echo "id\" />"; - echo "ord\" />"; + echo "ord\" />"; echo "  $r->name"; $q2=mysql_query("SELECT @@ -316,10 +334,11 @@ if($_POST['add_member_to_committees_id']) echo "id&unlinkcommittee={$r->id}\">\"Unlink\""; echo ""; - $name = $r2->firstname.' '.$r2->lastname; - echo " $name"; - - if($r2->title) echo " - $r2->title    "; + echo "{$r2->firstname} {$r2->lastname}"; + echo ""; + echo "title}\" name=\"title[{$r->id}][{$r2->id}]\" size=\"15\">"; + echo ""; + echo "ord}\" name=\"order[{$r->id}][{$r2->id}]\" size=\"2\">"; echo ""; @@ -340,7 +359,7 @@ if($_POST['add_member_to_committees_id']) } echo "
 
"; echo "
\n"; }