science-ation/admin/sponsorship_levels.php
james 01fde584be Do a lot of database re-working, renaming and reorganization
Database now refers to everything by donor/donation .. and apparently just as i complete this, carolyn has decided to go to both donor/sponsor instead of just donor.. ugh..
2009-10-02 16:46:13 +00:00

72 lines
2.3 KiB
PHP

<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2008 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("../common.inc.php");
require("../tableeditor.class.php");
require_once("../user.inc.php");
//first, insert any defaults
$q=mysql_query("SELECT * FROM fundraising_donor_levels WHERE year='".$config['FISCALYEAR']."'");
if(!mysql_num_rows($q)) {
$q=mysql_query("SELECT * FROM fundraising_donor_levels WHERE year='-1'");
while($r=mysql_fetch_object($q)) {
mysql_query("INSERT INTO fundraising_donor_levels (`level`,`min`,`max`,`description`,`year`) VALUES (
'".mysql_real_escape_string($r->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();
?>