Fix issues with renewal/signup
This commit is contained in:
parent
a76b3907a3
commit
b838fcace4
BIN
database.mwb
BIN
database.mwb
Binary file not shown.
@ -23,7 +23,7 @@ if (empty($_POST['agree_terms'])) {
|
||||
$family = new Family();
|
||||
|
||||
if (!empty($_SESSION['familyid']) && $database->has("families", ['familyid' => $_SESSION['familyid']])) {
|
||||
$family = (new Family())->load($familyid);
|
||||
$family = (new Family())->load($_SESSION['familyid']);
|
||||
} else if (!empty($_POST['renewing'])) {
|
||||
// Session expired, but we're renewing, so kick them back to verification
|
||||
header("Location: ../?page=renew&msg=sessionexpired");
|
||||
@ -147,7 +147,6 @@ $database->action(function($database) {
|
||||
foreach ($childObjects as $child) {
|
||||
$child->save();
|
||||
}
|
||||
|
||||
} catch (Exception $ex) {
|
||||
errorBack($ex->getMessage());
|
||||
}
|
||||
@ -156,15 +155,16 @@ $database->action(function($database) {
|
||||
//
|
||||
// Interests
|
||||
//
|
||||
$database->delete('interests', ['familyid' => $familyid]);
|
||||
$interests = [];
|
||||
foreach ($_POST['events'] as $evt) {
|
||||
if ($database->has("events", ['eventid' => $evt])) {
|
||||
$interests[] = ["familyid" => $familyid, "eventid" => $evt];
|
||||
$database->delete('interests', ['familyid' => $family->getID()]);
|
||||
if (!empty($_POST['events']) && is_array($_POST['events'])) {
|
||||
$interests = [];
|
||||
foreach ($_POST['events'] as $evt) {
|
||||
if ($database->has("events", ['eventid' => $evt])) {
|
||||
$interests[] = ["familyid" => $family->getID(), "eventid" => $evt];
|
||||
}
|
||||
}
|
||||
$database->insert("interests", $interests);
|
||||
}
|
||||
$database->insert("interests", $interests);
|
||||
|
||||
|
||||
|
||||
//
|
||||
@ -199,12 +199,13 @@ $database->action(function($database) {
|
||||
}
|
||||
|
||||
$database->insert("payments", [
|
||||
"familyid" => $familyid,
|
||||
"familyid" => $family->getID(),
|
||||
"amount" => ($membership_cost / 100.0),
|
||||
"paid" => 1,
|
||||
"date" => date("Y-m-d H:i:s")
|
||||
]);
|
||||
|
||||
|
||||
header("Location: ../?page=thanks");
|
||||
return true;
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ if (!empty($_POST['email'])) {
|
||||
$_SESSION['maybefamily'] = $database->get('families', 'familyid', ['email' => strtolower($_POST['email'])]);
|
||||
|
||||
// TODO: send email
|
||||
echo $code;
|
||||
file_put_contents("/var/www/html/code.txt", $code);
|
||||
} else if (!empty($_POST['code'])) {
|
||||
if (empty($_SESSION['code'])) {
|
||||
header("Location: ./?page=renew&msg=sessionexpired");
|
||||
|
Loading…
x
Reference in New Issue
Block a user