\n";
echo "\n";
diff --git a/admin/fundraising_types_handler.inc.php b/admin/fundraising_types_handler.inc.php
index 9ed0ee3..2082b46 100644
--- a/admin/fundraising_types_handler.inc.php
+++ b/admin/fundraising_types_handler.inc.php
@@ -26,16 +26,17 @@ if($_POST['action']=="fundedit" || $_POST['action']=="fundadd") {
}
$name=mysql_real_escape_string($_POST['name']);
$type=mysql_real_escape_string($_POST['type']);
+ $description=mysql_real_escape_string($_POST['description']);
$goal=intval($_POST['goal']);
}
if($_POST['action']=="fundedit") {
if( ($system=="yes" && $goal) || ($system=="no" && $goal && $type && $name) ) {
if($system=="yes") {
- mysql_query("UPDATE fundraising SET goal='$goal' WHERE id='$fundraising_id'");
+ mysql_query("UPDATE fundraising SET goal='$goal', description='$description' WHERE id='$fundraising_id'");
}
else {
- mysql_query("UPDATE fundraising SET goal='$goal', type='$type', name='$name' WHERE id='$fundraising_id'");
+ mysql_query("UPDATE fundraising SET goal='$goal', description='$description', type='$type', name='$name' WHERE id='$fundraising_id'");
}
if(mysql_error())
message_push(error(mysql_error()));
@@ -49,7 +50,7 @@ if($_POST['action']=="fundedit") {
}
if($_POST['action']=="fundadd") {
if( $goal && $type && $name) {
- mysql_query("INSERT INTO fundraising (type,name,system,goal,year) VALUES ('$type','$name','no','$goal','{$config['FAIRYEAR']}')");
+ mysql_query("INSERT INTO fundraising (type,name,description,system,goal,year) VALUES ('$type','$name','$description','no','$goal','{$config['FAIRYEAR']}')");
message_push(happy(i18n("Added new fund")));
}
else
diff --git a/admin/sponsor_contacts.php b/admin/sponsor_contacts.php
index cc05c38..d6b9a73 100644
--- a/admin/sponsor_contacts.php
+++ b/admin/sponsor_contacts.php
@@ -172,7 +172,10 @@
echo " ";
$q=mysql_query("SELECT * FROM users LEFT JOIN users_sponsor ON users_sponsor.users_id=users.id
- WHERE year='".$config['FAIRYEAR']."' AND sponsors_id='$sponsors_id' ORDER BY lastname,firstname");
+ WHERE year='".$config['FAIRYEAR']."'
+ AND sponsors_id='$sponsors_id'
+ AND deleted='no'
+ ORDER BY lastname,firstname");
echo mysql_Error();
if(mysql_num_rows($q))
diff --git a/admin/sponsors.php b/admin/sponsors.php
index 07c4b36..6b4ec3d 100644
--- a/admin/sponsors.php
+++ b/admin/sponsors.php
@@ -170,7 +170,7 @@
$numr=mysql_fetch_object($numq);
$numsponsorships=$numr->num;
- $numq=mysql_query("SELECT COUNT(users_id) AS num FROM users_sponsor, users WHERE sponsors_id='$r->id' AND users_sponsor.users_id=users.id AND users.year='".$config['FAIRYEAR']."'");
+ $numq=mysql_query("SELECT COUNT(users_id) AS num FROM users_sponsor, users WHERE sponsors_id='$r->id' AND users_sponsor.users_id=users.id AND users.year='".$config['FAIRYEAR']."' and users.deleted='no'");
$numr=mysql_fetch_object($numq);
$numcontacts=$numr->num;
diff --git a/admin/sponsorship_levels.php b/admin/sponsorship_levels.php
new file mode 100644
index 0000000..dc1e4d3
--- /dev/null
+++ b/admin/sponsorship_levels.php
@@ -0,0 +1,71 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ 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.
+*/
+?>
+
+ require("../common.inc.php");
+ require("../tableeditor.class.php");
+ require_once("../user.inc.php");
+
+ //first, insert any defaults
+ $q=mysql_query("SELECT * FROM sponsorships_levels WHERE year='".$config['FAIRYEAR']."'");
+ if(!mysql_num_rows($q)) {
+ $q=mysql_query("SELECT * FROM sponsorships_levels WHERE year='-1'");
+ while($r=mysql_fetch_object($q)) {
+ mysql_query("INSERT INTO sponsorships_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['FAIRYEAR']."')");
+ }
+ }
+
+ user_auth_required('committee', 'admin');
+ send_header("Sponsorship Levels",
+ array('Committee Main' => 'committee_main.php',
+ 'Administration' => 'admin/index.php',
+ 'Fundraising' => 'admin/fundraising.php'),
+ "internal_document_management"
+ );
+
+ $editor=new TableEditor("sponsorships_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['FAIRYEAR'])
+ );
+
+ $editor->setPrimaryKey("id");
+ $editor->setDefaultSortField("max");
+ $editor->setRecordType("Level");
+ $editor->filterList('year',$config['FAIRYEAR']);
+ $editor->execute();
+
+ send_footer();
+?>