Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> 'committee_main.php', 'Administration' => 'admin/index.php' ), "committee_management"); $_SESSION['last_page'] = 'committee_management'; ?> $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_uid='$u'"; // echo $q; mysql_query($q); } } echo happy(i18n("Committees successfully saved")); } if($_POST['action']=="assign") { if($_POST['committees_id'] && $_POST['users_uid']) { $cid = intval($_POST['committees_id']); $q=mysql_query("SELECT * FROM committees_link WHERE committees_id='$cid' AND users_uid='$uid'"); if(!mysql_num_rows($q)) { mysql_query("INSERT INTO committees_link (committees_id,users_uid) VALUES ('$cid','$uid')"); echo happy(i18n("Successfully added member to committee")); } else echo error(i18n("That member already exists in that committee")); } else echo error(("You must choose both a member and a committee")); } if($_GET['deletecommittee']) { $del = intval($_GET['deletecommittee']); mysql_query("DELETE FROM committees WHERE id='$del'"); echo happy(i18n("Committee removed")); } if($_POST['action']=="remove") { /* user_delete takes care of unlinking the user in other tables */ user_delete($uid, 'committee'); echo happy(i18n("Committee member deleted")); } if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) { $mem = intval($_GET['unlinkmember']); $com = intval($_GET['unlinkcommittee']); //unlink the member from the committee mysql_query("DELETE FROM committees_link WHERE users_uid='$mem' AND committees_id='$com'"); echo happy(i18n("Committee member unlinked from committee")); } echo ""; echo ""; echo "
"; echo "

".i18n("Add Committee")."

\n"; echo "
\n"; echo "\n"; echo ""; echo " \n"; echo "
".i18n("Committee Name").":
\n"; echo "
\n"; echo "
 "; echo "

".i18n("Add Committee Member")."

\n"; echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "
".i18n("Member Email").": "; echo "\n"; echo "
\n"; echo "".i18n("Reload committee list (needed after adding a new member)")."\n"; echo "
\n"; echo "
"; echo "
"; echo "

".i18n("Committee Member Management")."

\n"; echo "
\n"; echo ""; echo ""; echo "
"; echo ""; echo ""; $q=mysql_query("SELECT uid,MAX(year),firstname,lastname,email,deleted FROM users WHERE types LIKE '%committee%' GROUP BY uid ORDER BY firstname"); echo ""; echo ""; //The Assign Div echo "
"; echo i18n("To Committee").": "; $q=mysql_query("SELECT * FROM committees ORDER BY ord,name"); echo ""; echo "
"; //The Edit or Remove Div echo "
"; echo "
"; echo ""; echo "
"; $q=mysql_query("SELECT * FROM committees ORDER BY ord,name"); if(mysql_num_rows($q)) { echo "

".i18n("Committees")."

"; echo "
\n"; echo ""; echo ""; echo ""; echo ""; while($r=mysql_fetch_object($q)) { echo ""; echo "\n"; echo mysql_error(); while($r2=mysql_fetch_object($q2)) { $u = user_load_by_uid($r2->uid); echo ""; echo "\n"; } echo "\n"; } echo "\n"; echo "
".i18n('Title')."".i18n('Order')."".i18n("Public Email / Private Email")."
"; echo "id\" />"; echo "ord\" />"; echo "  $r->name"; $q2=mysql_query("SELECT committees_link.title, committees_link.ord, users.uid, MAX(users.year) AS my, users.lastname FROM committees_link JOIN users ON users.uid = committees_link.users_uid WHERE committees_id='{$r->id}' GROUP BY users.uid ORDER BY ord, users.lastname "); if(mysql_num_rows($q2)==0) { echo "   "; echo "id\">\"Remove"; } echo "
    "; echo "\"Edit\""; echo " "; echo "id}\">\"Unlink\""; echo ""; echo "{$u['name']}"; echo ""; echo "title}\" name=\"title[{$r->id}][{$u['uid']}]\" size=\"15\">"; echo ""; echo "ord}\" name=\"order[{$r->id}][{$u['uid']}]\" size=\"2\">"; echo ""; if($u['email']) { list($b,$a)=split("@",$u['email']); echo ""; } if($u['emailprivate']) { if($u['email']) echo " / "; list($b,$a)=split("@",$u['emailprivate']); echo ""; } echo "
 
"; echo "
\n"; } send_footer(); ?>