//define( 'CODE_SNIPPETS_SAFE_MODE', true );
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
define( "WP_USE_THEMES", true );
require_once "lib.php";
DBInfo();
if(isset($_GET['id'])){
$id = $_GET['id'];
} else {
$id = 985;
}
require_once "wp-load.php";
require_once "wp-content/plugins/monarch/monarch.php";
$today = date("m/d/Y");
$ros = ''; // Rain or shine text - added below if needed.
$handle = new mysqli($DBHost, $DBUser, $DBPass, $DBName)
or die ("
Database Error!
");
$handle->select_db($DBName);
$sql = ("SELECT nIndex, DAYNAME(dStartDate), DAYNAME(dEndDate), DATE_FORMAT(dStartDate, '%c/%d/%Y'), DATE_FORMAT(dEndDate, '%c/%d/%Y'), vDescText, DATE_FORMAT(dSignupDate, '%c/%d/%Y'), bRain, DATE_FORMAT(dRainDate, '%c/%d/%Y'), vRainText, bCORI, vAltCORI, vTimeText, vRegURL, nVolunteersNeeded, bPreviousVolunteer, vMinVolunteerAge, vWhatText, vHomeImgURL, vHomeText, vLocationText, vDetailText, vDetailImgURL, vWhyText, vHowText, vRainTimeText, vQuoteText, vDonateTagLine, vDeadlineText, tWhoText, bShowLocationMsg, bShowNoGroupsMsg, vDonateText, vFBDonateURL, DATE_FORMAT(dDonatePublishDate, '%c/%d/%Y'), DATE_FORMAT(dDonateExpireDate, '%c/%d/%Y')
FROM tblEvents
WHERE nIndex = $id");
$result = $handle->query($sql);
$row = $result->fetch_row();
$id = $row[0];
$SDAY = $row[1];
$EDAY = $row[2];
$dStartDate = $row[3];
$dEndDate = $row[4];
$vDescText = $row[5];
$dSignup = $row[6];
$bRain = $row[7];
$dRainDate = $row[8];
$vRainText = $row[9];
$bCORI = $row[10];
$vAltCORI = $row[11];
$vTimeText = $row[12];
$vRegURL = $row[13];
$nVolunteers = $row[14];
$bPreviousVolunteer = $row[15];
$vMinVolunteerAge = $row[16];
$vWhatText = $row[17];
$vHomeImgURL = $row[18];
$vHomeText = $row[19];
$vLocationText = $row[20];
$vDetailText = $row[21];
$vDetailImgURL = $row[22];
$vWhyText = $row[23];
$vHowText = $row[24];
$vRainTimeText = $row[25];
$vQuoteText = $row[26];
$vDonateTagLine = $row[27];
$vDeadlineText = $row[28];
$vWhoText = $row[29];
$bShowLocationMsg = $row[30];
$bShowNoGroupsMsg = $row[31];
$vDonateText = $row[32];
$vFBDonateURL = $row[33];
$dDonatePublishDate = $row[34];
$dDonateExpireDate = $row[35];
if($bRain == 1) {
$ros = "Rain or shine.";
}
if($dRainDate > 0) {
$vRainTimeText ? $vRainTimeText = ", ".$vRainTimeText : "";
$rain_date_text = "
Rain Date: $dRainDate $vRainTimeText
$vRainText ";
} else {
$rain_date_text = $ros;
}
if($bCORI == 1) {
$cori_text = <<< _EndOfCORI
Note: Individual adults (not third parties) must complete and email
this form along with a scan of current,
government-issued photo ID to
Lori@pmd.org by $dSignup to complete this
registration.
Alternatively, one can send hardcopies of both to PMD as long as
they ARRIVE by $dSignup at PMD's secure post office box:
P.O. Box 120189, Boston, MA 02112-0189.
_EndOfCORI;
} else {
$cori_text = "";
}
if($bShowLocationMsg == 0) {
$pmd_note = '';
} else {
$pmd_note = 'Note: PMD only shares specific directions, maps, and other details with registered volunteers since we cannot accommodate any walk-ins, i.e., unregistered volunteers simply showing up.';
}
if($bPreviousVolunteer == 1) {
$previous_volunteer_message = "Participation in this project is limited to people who have previously volunteered with PMD.
";
} else {
$previous_volunteer_message = "";
}
if($vWhoText == ''){
$vWhoText = <<< _EndOfWho
People Making a Difference (PMD) is a nonprofit organization that promotes informed and responsible volunteerism by involving people in tangible work that meets local needs and by assisting companies in building successful community involvement programs that:
- Produce appreciable results while conserving recipients' limited resources.
- Educate volunteers about broader issues.
- Bring people together to make a difference.
_EndOfWho;
}
if($bShowNoGroupsMsg == 1) {
$bShowNoGroupsMsg = <<< _EOM
For Individual Volunteers, NOT Groups
_EOM;
} else {
$bShowNoGroupsMsg = '';
}
// This is not used at this time -- 10/1/2022
$temp_how_text = <<< _EndOfHow
Call PMD if you cannot sign up using our form.
If you experience any difficult registering online to volunteer with PMD, please immediately CALL THE PMD OFFICE at (*82) 1-781-963-0373 so that we can help you AND troubleshoot the problem so that other potential volunteers will not face the same problem. Thanks!
_EndOfHow;
$signup = "SIGN UP";
switch ($nVolunteers){
case 99:
// do nothing special
$volunteer_message = "";
$signup = "SIGN UP";
break;
case 0:
// backup list stuff
$volunteer_message = "Join the Backup List if you can reserve this day/time.
";
$signup = "JOIN BACKUP LIST";
break;
default:
// when > 0 but not 99
$volunteer_message = "~$nVolunteers volunteers are still needed.";
$signup = "SIGN UP";
break;
}
if ($vDeadlineText != ""){ $vDeadlineText .= "
"; }
$signup_button = <<< _EndOfButton
_EndOfButton;
if (($vFBDonateURL === null && $vDonateText === null) ||
($dDonatePublishDate > $today) || ($today > $dDonateExpireDate))
{
$donate_button = "";
} else {
if($vFBDonateURL === null){
$vFBDonateURL = "/donate/#ways_to_donate";
}
$donate_button = <<< _EndOfButton
_EndOfButton;
}
if($today > $dEndDate) {
$signup_button = "";
}
get_header();
// ===================================================
echo <<< _EndOfProject
$bShowNoGroupsMsg
$vDescText
WHEN
- $SDAY $dStartDate, $vTimeText
$rain_date_text
-
Sign up by $dSignup
$vDeadlineText $volunteer_message
$cori_text
WHAT
$vWhatText
$previous_volunteer_message
WHERE
$vLocationText
$pmd_note
WHY
$vWhyText
HOW
$vHowText
WHO
$vWhoText
$signup_button
$donate_button
$vQuoteText
_EndOfProject;
get_footer();
exit(0);
/*
$arr = get_defined_functions();
//echo ("
");
//print_r($arr);
//echo ("
");
wp_maybe_load_widgets();
//et_monarch_init_plugin();
*/
?>