diff --git a/admin/fundraising_setup.php b/admin/fundraising_setup.php new file mode 100644 index 0000000..860f52b --- /dev/null +++ b/admin/fundraising_setup.php @@ -0,0 +1,183 @@ + + 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') + ); + +?> + + +
+
+
    +
  • +
  • +
+ +
+
+
+
+
+
+ + diff --git a/admin/sponsorship_levels.php b/admin/sponsorship_levels.php deleted file mode 100644 index 2b4206c..0000000 --- a/admin/sponsorship_levels.php +++ /dev/null @@ -1,71 +0,0 @@ - - - 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']."')"); - } - } - - user_auth_required('committee', 'admin'); - send_header("Donation Levels", - array('Committee Main' => 'committee_main.php', - 'Administration' => 'admin/index.php', - 'Fundraising' => 'admin/fundraising.php'), - "internal_document_management" - ); - - $editor=new TableEditor("fundraising_donor_levels", - array("level"=>"Level Name", - "min"=>"Minimum Amount", - "max"=>"Maximum Amount", - ) - , - array("level"=>"Level Name", - "min"=>"Minimum Amount", - "max"=>"Maximum Amount", - "description"=>"Description / Benefits", - ) - ,array("year"=>$config['FISCALYEAR']) - ); - - $editor->setPrimaryKey("id"); - $editor->setDefaultSortField("max"); - $editor->setRecordType("Level"); - $editor->filterList('year',$config['FISCALYEAR']); - $editor->execute(); - - send_footer(); -?> diff --git a/common.inc.php b/common.inc.php index d5cb64a..a3fc9a0 100644 --- a/common.inc.php +++ b/common.inc.php @@ -460,6 +460,7 @@ if(is_array($nav)) { echo "