forked from science-ation/science-ation
Update default fundraising goals, and insert defaults if none exist
This commit is contained in:
parent
27b2c26c54
commit
cf2affcc03
@ -26,7 +26,7 @@
|
||||
|
||||
user_auth_required('committee', 'admin');
|
||||
|
||||
//first, insert any defaults
|
||||
//first, insert any default fundraising donor levels
|
||||
$q=mysql_query("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='".$config['FISCALYEAR']."'");
|
||||
if(!mysql_num_rows($q)) {
|
||||
$q=mysql_query("SELECT * FROM fundraising_donor_levels WHERE fiscalyear='-1'");
|
||||
@ -40,6 +40,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
//first, insert any default fundraising goals
|
||||
$q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='".$config['FISCALYEAR']."'");
|
||||
if(!mysql_num_rows($q)) {
|
||||
$q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='-1'");
|
||||
while($r=mysql_fetch_object($q)) {
|
||||
mysql_query("INSERT INTO fundraising_goals (`goal`,`name`,`description`,`system`,`budget`,`fiscalyear`) VALUES (
|
||||
'".mysql_real_escape_string($r->goal)."',
|
||||
'".mysql_real_escape_string($r->name)."',
|
||||
'".mysql_real_escape_string($r->description)."',
|
||||
'".mysql_real_escape_string($r->system)."',
|
||||
'".mysql_real_escape_string($r->budget)."',
|
||||
'".$config['FISCALYEAR']."')");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch($_GET['gettab']) {
|
||||
case "levels":
|
||||
|
@ -1 +1 @@
|
||||
142
|
||||
143
|
||||
|
2
db/db.update.143.sql
Normal file
2
db/db.update.143.sql
Normal file
@ -0,0 +1,2 @@
|
||||
UPDATE `fundraising_goals` SET `goal` = 'sfgeneral', `name` = 'Science Fair - General Funds', `description` = 'General funds donated to the science fair may be allocated as the science fair organizers see fit.' WHERE `goal`='general' AND fiscalyear='-1';
|
||||
UPDATE `fundraising_goals` SET `goal` = 'sfawards', `name` = 'Science Fair - Awards', `description` = 'Award Sponsorships are provided to allow an sponsor/donor to give a specific award.' WHERE `goal`='awards' AND fiscalyear='-1';
|
Loading…
Reference in New Issue
Block a user