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[$accounts_id]); $t = mysql_escape_string(stripslashes($title)); $u = intval($accounts_id); $q = "UPDATE committees_link SET title='$t', ord='$o' WHERE committees_id='$cid' AND accounts_id='$u'"; // echo $q; mysql_query($q); } } echo happy(i18n("Committees successfully saved")); } if($_POST['action']=="assign") { if($_POST['committees_id'] && $_POST['accounts_id']) { $cid = intval($_POST['committees_id']); $q=mysql_query("SELECT * FROM committees_link WHERE committees_id='$cid' AND accounts_id='$accounts_id'"); if(!mysql_num_rows($q)) { mysql_query("INSERT INTO committees_link (committees_id,accounts_id) VALUES ('$cid','$accounts_id')"); 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($_POST['action']=="remove") { /* user_delete takes care of unlinking the user in other tables */ user_delete($accounts_id, '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 accounts_id='$mem' AND committees_id='$com'"); echo happy(i18n("Committee member unlinked from committee")); } echo 'Create a new member
'; echo "Manage Committees
"; echo "
\n"; echo ""; echo ""; echo "
"; echo ""; echo ""; $query = " SELECT accounts_id, firstname, lastname, email, deleted FROM users WHERE accounts_id IN( SELECT accounts_id FROM user_roles JOIN roles ON user_roles.roles_id = roles.id WHERE roles.type = 'committee' ) AND conferences_id = " . $conference['id']; $q = mysql_query($query); 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 "
\n"; 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_accounts_id($r2->accounts_id); //if rollover is proper, this shouldnt be necessary, but, the simcoe rollover didnt do this, so lets do it here as a safety if(!$u) { $roleq=mysql_query("SELECT * FROM roles WHERE type='committee'"); $roler=mysql_fetch_object($roleq); //hmm thats okay,w e must have missed something in the rollover... sicne its tied to the accounts_id, we just need to add a record account_add_role($r2->accounts_id,$roler->id,$conference['id']); //and now we should be able to load them $u = user_load_by_accounts_id($r2->accounts_id); } echo ""; echo "\n"; } echo "\n"; } echo "\n"; echo "
".i18n('Title within committee / Sort order')."
"; echo "id\" />"; // echo "ord\" />"; echo "".i18n($r->name).""; $q2=mysql_query("SELECT committees_link.title, committees_link.ord, committees_link.accounts_id FROM committees_link WHERE committees_id='{$r->id}' ORDER BY ord"); echo "
    "; echo "\"Edit\""; echo " "; echo "id}\">\"Unlink\""; echo ""; echo "{$u['firstname']} {$u['lastname']}"; echo ""; echo "title}\" name=\"title[{$r->id}][{$u['accounts_id']}]\" size=\"25\">"; echo ""; echo "ord}\" name=\"order[{$r->id}][{$u['accounts_id']}]\" size=\"2\">"; echo "
 
"; echo "
\n"; } send_footer(); ?>