forked from science-ation/science-ation
Add defaults and descriptions to fundraising types and sponsorship levels
Start working on the sponsors main page for when a sponsor logs in
This commit is contained in:
parent
fb53a2cb2c
commit
3ab46da3d5
@ -4,6 +4,7 @@ CREATE TABLE `fundraising` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
|
||||
`type` VARCHAR( 32 ) NOT NULL ,
|
||||
`name` VARCHAR( 128 ) NOT NULL ,
|
||||
`description` TEXT NULL DEFAULT NULL ,
|
||||
`system` ENUM( 'no', 'yes' ) DEFAULT 'no' NOT NULL ,
|
||||
`goal` INT UNSIGNED NOT NULL ,
|
||||
`year` INT NOT NULL ,
|
||||
@ -11,8 +12,8 @@ CREATE TABLE `fundraising` (
|
||||
) TYPE = MYISAM ;
|
||||
|
||||
ALTER TABLE `fundraising` ADD UNIQUE (type,year);
|
||||
INSERT INTO `fundraising` ( `id` , `type` , `name` , `system` , `goal` , `year` ) VALUES ( '', 'general', 'General Funds', 'yes', '0', '-1');
|
||||
INSERT INTO `fundraising` ( `id` , `type` , `name` , `system` , `goal` , `year` ) VALUES ( '', 'awards', 'Award Sponsorships', 'yes', '0', '-1');
|
||||
INSERT INTO `fundraising` ( `id` , `type` , `name` , `description`, `system` , `goal` , `year` ) VALUES ( '', 'general', 'General Funds', 'General funds donated to the fair may be allocated as the fair organizers see fit','yes', '0', '-1');
|
||||
INSERT INTO `fundraising` ( `id` , `type` , `name` , `description`, `system` , `goal` , `year` ) VALUES ( '', 'awards', 'Award Sponsorships', 'Award Sponsorships are provided to allow an organization to sponsor a specific award that is given out at the fair', 'yes', '0', '-1');
|
||||
|
||||
ALTER TABLE `award_sponsors` RENAME `sponsors` ;
|
||||
ALTER TABLE `sponsors` DROP `confirmed`;
|
||||
@ -56,3 +57,9 @@ CREATE TABLE `sponsorships_levels` (
|
||||
`year` INT NOT NULL ,
|
||||
PRIMARY KEY ( `id` )
|
||||
) TYPE = MYISAM ;
|
||||
|
||||
INSERT INTO sponsorships_levels (`level`,`min`,`max`,`year`) VALUES ('Bronze','100','499',-1);
|
||||
INSERT INTO sponsorships_levels (`level`,`min`,`max`,`year`) VALUES ('Silver','500','999',-1);
|
||||
INSERT INTO sponsorships_levels (`level`,`min`,`max`,`year`) VALUES ('Gold','1000','10000',-1);
|
||||
|
||||
|
||||
|
@ -29,9 +29,14 @@
|
||||
user_auth_required('sponsor');
|
||||
|
||||
send_header("Sponsor Main", array());
|
||||
$u=user_load($_SESSION['users_id']);
|
||||
//print_r($u);
|
||||
$q=mysql_query("SELECT * FROM sponsors WHERE id='".$u['sponsors_id']."'");
|
||||
$sponsor=mysql_fetch_object($q);
|
||||
|
||||
//only display the named greeting if we have their name
|
||||
echo i18n("Hello <b>%1</b>",array($_SESSION['name']));
|
||||
if($sponsor->organization) echo " ".i18n("from %1",array($sponsor->organization));
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
@ -39,9 +44,50 @@
|
||||
echo " <tr>\n";
|
||||
echo " <td><a href=\"user_personal.php\">".theme_icon("edit_profile")."<br />".i18n("Edit My Profile")."</a></td>";
|
||||
echo " <td><a href=\"user_password.php\">".theme_icon("change_password")."<br />".i18n("Change My Password")."</a></td>";
|
||||
echo " <td><a href=\"user_activate.php\">".theme_icon("")."<br />".i18n("Manage My Roles")."</a></td>";
|
||||
// echo " <td><a href=\"user_activate.php\">".theme_icon("")."<br />".i18n("Manage My Roles")."</a></td>";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<h2>Your sponsorships</h2>\n";
|
||||
|
||||
$sq=mysql_query("SELECT sponsorships.id,
|
||||
sponsors.organization,
|
||||
sponsorships.value,
|
||||
sponsorships.status,
|
||||
sponsorships.probability,
|
||||
fundraising.name
|
||||
FROM sponsorships
|
||||
JOIN sponsors ON sponsorships.sponsors_id=sponsors.id
|
||||
JOIN fundraising ON sponsorships.fundraising_type=fundraising.type
|
||||
AND sponsorships.year='{$config['FAIRYEAR']}'
|
||||
AND fundraising.year='{$config['FAIRYEAR']}'
|
||||
AND sponsors.id='".$u['sponsors_id']."'
|
||||
ORDER BY status DESC, probability DESC, organization");
|
||||
echo mysql_error();
|
||||
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr>";
|
||||
echo " <th>".i18n("Sponsorship Category")."</th>\n";
|
||||
echo " <th>".i18n("Status")."</th>\n";
|
||||
echo " <th>".i18n("Amount")."</th>\n";
|
||||
echo " <th>".i18n("Action")."</th>";
|
||||
echo "</tr>\n";
|
||||
while($sr=mysql_fetch_object($sq)) {
|
||||
echo "<tr id=\"sponsorships_$sr->id\" class=\"fundraising{$sr->status}\">";
|
||||
echo "<td>$sr->name</td>\n";
|
||||
echo "<td>$sr->status</td>";
|
||||
echo "<td style=\"text-align: right\">".format_money($sr->value)."</td>";
|
||||
echo "<td align=\"center\">";
|
||||
if($sr->status=="confirmed") {
|
||||
echo "<a href=\"paynow.php\">Pay Online</a>\n";
|
||||
}
|
||||
else if($sr->status=="pending") {
|
||||
echo "<a onclick=\"return confirmClick('".i18n("By confirming funding, you are guaranteeing that you/your organization will provide said funds to the fair. Please only confirm the funds here once final approval has been granted by you and/or your organization")."')\" href=\"sponsor_main.php?confirm=$sr->id\">Confirm Funding</a>\n";
|
||||
}
|
||||
echo " ";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user