Copyright (C) 2008 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. */ ?> level)."', '".mysql_real_escape_string($r->min)."', '".mysql_real_escape_string($r->max)."', '".mysql_real_escape_string($r->description)."', '".$config['FISCALYEAR']."')"); } } switch($_GET['gettab']) { case "levels": $q=mysql_query("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY max"); echo "
\n"; while($r=mysql_fetch_object($q)) { echo "

$r->level (".format_money($r->min,false)." to ".format_money($r->max,false).")

\n"; echo "
id\">\n"; echo "
id\" onsubmit=\"return level_save($r->id)\">\n"; echo "id\">\n"; echo i18n("Level Name").": level\">
"; echo i18n("Value Range").": \$min\"> to \$max\">
\n"; echo i18n("Description/Benefits").":
"; echo ""; echo "
\n"; echo "
\n"; $x++; } echo "

Create New Level

\n"; echo "
\n"; echo "
\n"; echo i18n("Level Name").":
"; echo i18n("Value Range").": \$ to \$
\n"; echo i18n("Description/Benefits").":
"; echo ""; echo "
\n"; echo "
\n"; echo "
\n"; exit; break; case "goals": break; } switch($_GET['action']) { case "level_save": $id=$_POST['id']; if($id) { mysql_query("UPDATE fundraising_donor_levels SET min='".mysql_real_escape_string($_POST['min'])."', max='".mysql_real_escape_string($_POST['max'])."', level='".mysql_real_escape_string($_POST['level'])."', description='".mysql_real_escape_string($_POST['description'])."' WHERE id='$id' AND fiscalyear='{$config['FISCALYEAR']}' "); happy_("Level Saved"); } else { if($_POST['level'] && $_POST['min'] && $_POST['max']) { mysql_query("INSERT INTO fundraising_donor_levels (`level`,`min`,`max`,`description`,`fiscalyear`) VALUES ( '".mysql_real_escape_string($_POST['level'])."', '".mysql_real_escape_string($_POST['min'])."', '".mysql_real_escape_string($_POST['max'])."', '".mysql_real_escape_string($_POST['description'])."', '{$config['FISCALYEAR']}')"); happy_("Level Created"); } else { error_("Level name, minimum and maximum value range are required"); } } exit; break; } send_header("Fundraising Setup", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Fundraising' => 'admin/fundraising.php') ); ?>