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' )); $_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_id='$u'"; mysql_query($q); } } echo happy(i18n("Committees successfully saved")); } if($_POST['action']=="assign") { if($_POST['committees_id'] && $_POST['users_id']) { $cid = intval($_POST['committees_id']); $q=mysql_query("SELECT * FROM committees_link WHERE committees_id='$cid' AND users_id='$uid'"); if(!mysql_num_rows($q)) { mysql_query("INSERT INTO committees_link (committees_id,users_id) 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($uid, 'committee'); mysql_query("DELETE FROM committees_link WHERE users_id='$uid'"); echo happy(i18n("Committee member removed")); } 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_id='$mem' AND committees_id='$com'"); echo happy(i18n("Committee member unlinked from committee")); } /* This seems to be unused (there would also be an sql error on the INSERT :p) : if($_POST['add_member_to_committees_id']) { $add = intval($_POST['add_member_to_committees_id']); mysql_query("INSERT INTO committees_link (committees_id,users_id) VALUES ('$add')"); $edit=$_POST['committees_members_id']; } */ 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 Name").": "; echo "\n"; echo "
\n"; echo "
\n"; echo "
"; echo "
"; echo "

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

\n"; echo "
\n"; echo ""; echo ""; echo "
"; echo ""; echo ""; $q=mysql_query("SELECT * FROM users WHERE types LIKE '%committee%' 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)) { 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 users.id, users.firstname,users.lastname, users.email, users_committee.emailprivate, committees_link.title, committees_link.ord FROM users, users_committee, committees_link WHERE users_committee.users_id=users.id AND committees_link.users_id=users.id AND committees_link.committees_id='$r->id' ORDER BY ord,firstname"); if(mysql_num_rows($q2)==0) { echo "   "; echo "id\">\"Remove"; } echo "
    "; echo "id}\">\"Edit\""; echo " "; echo "id&unlinkcommittee={$r->id}\">\"Unlink\""; echo ""; 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 ""; if($r2->email) { list($b,$a)=split("@",$r2->email); echo ""; } if($r2->emailprivate) { if($r2->email) echo " / "; list($b,$a)=split("@",$r2->emailprivate); echo ""; } echo "
 
"; echo "
\n"; } send_footer(); ?>