" . "\r\n";
$headers .= 'Bcc: $commissioner <$ADMIN_EMAIL>' . "\r\n";
function notify_admin($mailto, $mailmessage, $mail_headers) {
mail($mailto, "Super Bowl Squares", $mailmessage, $mail_headers);
}
?>
ADMINISTRATOR APPROVAL
|
Confirm user selected square when payment is verified, or release the square if allowed time for payment has expired.
|
|
|
0) {
$input = "";
$whereclause = "(";
for ($e = 0; $e < count($SQUARE); $e++) {
$whereclause .= "SQUARE = '" . trim($SQUARE[$e]) . "' OR ";
$square_list = $square_list . ", " . $SQUARE[$e];
}
$whereclause = substr_replace($whereclause, "", -3); // strip off ' OR'
$whereclause = $whereclause . ")";
$square_list = substr_replace($square_list, "", 0, 2);
$query = "SELECT * FROM VNSB_squares WHERE $whereclause";
$result = mysqli_query($conn, $query);
if (!$result) {
echo mysqli_error();
exit;
}
$USER_EMAIL_LIST = '';
while ($record = mysqli_fetch_assoc($result)) {
$USER_EMAIL = $record["EMAIL"];
$pos = strpos($USER_EMAIL_LIST, $USER_EMAIL);
if ($pos === false) {
$USER_EMAIL_LIST = $USER_EMAIL_LIST . ", " . $USER_EMAIL;
}
}
$USER_EMAIL_LIST = substr_replace($USER_EMAIL_LIST, "", 0, 2);
$bodyMessage = "\r\nNOTIFICATION:
\r\n";
if ($CONFIRM == 1 && $RELEASE != 1) {
$query = "UPDATE VNSB_squares SET CONFIRM='1' WHERE $whereclause";
$bodyMessage .= "Your square $square_list is now confirmed.\r\n\n";
} else if ($RELEASE == 1 && $CONFIRM != 1) {
$query = "UPDATE VNSB_squares SET NAME='AVAILABLE', EMAIL='', NOTES='', DATE='', CONFIRM='0' WHERE $whereclause";
$bodyMessage .= "Your square $square_list selection is now released due to non payment.\r\n";
$bodyMessage .= "
If this is an error, please contact the commissioner or re-select your square/squares.
\r\n\n";
} else if (($CONFIRM != 1 && $RELEASE != 1) || ($RELEASE == 1 && $CONFIRM == 1)) {
echo "Must select ONLY one 'Confirm' or 'Release' !!!
";
echo "Back
";
exit;
}
$result = mysqli_query($conn, $query);
if (!$result) {
echo mysqli_error();
} else {
$bodyMessage .= "
Reason given:
\r\n";
$bodyMessage .= $NOTES . "\r\n\n";
$bodyMessage .= "
Good Luck and enjoy the game!\r\n";
$bodyMessage .= "
- $commissioner\r\n";
$bodyMessage .= "
$sb_URL\r\n";
notify_admin($USER_EMAIL_LIST, $bodyMessage, $headers);
echo "Square(s) " . $square_list . " updated successfully
";
echo "Emailed to: " . $USER_EMAIL_LIST . "
";
echo "
";
unset($confirmation, $SQUARE, $CONFIRM, $RELEASE, $NOTES, $ADM_EMAIL, $ADM_PASSWORD);
}
} else {
echo "Must select at least one Square to Confirm or Release' !!!
";
echo "Back
";
exit;
}
}
require "footer.inc";
?>