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. */ ?> $id)); }else{ $id = $_POST["campaign_id"]; // we are updating an existing campaign. echo "Updating an existing campaign
\n"; // build our query $formfields = array('name', 'type', 'startdate', 'enddate', 'active', 'target', 'fundraising_goal', 'fiscalyear'); $updates = false; $query = "UPDATE fundraising_campaigns SET "; foreach($formfields AS $fieldname){ if(array_key_exists($fieldname, $_POST)){ $updates = true; $query .= $fieldName . "='" . mysql_escape_string(stripslashes($_POST[$fieldname])) . ","; } } if($updates = true){ $query = rtrim($query, ",") . " WHERE id=" . $id; } // and execute it echo $query; //FIXME - not yet tested } } send_header("Campaign Management", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Fundraising' => 'admin/fundraising.php'), "fundraising" ); ?>

">

Campaign 123