|
|
|
@ -19,6 +19,15 @@ if (!empty($_POST['email'])) {
|
|
|
|
|
die("We don't have that email on file for any current families.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$familyid = $database->get('families', 'familyid', ['email' => strtolower($_POST['email'])]);
|
|
|
|
|
|
|
|
|
|
// Check expiration date
|
|
|
|
|
$expires = (new Family())->load($familyid)->getExpires();
|
|
|
|
|
if ($expires > strtotime("+6 months")) {
|
|
|
|
|
header("Location: ./?page=renew&msg=tooearly&exp=$expires");
|
|
|
|
|
die("This membership isn't expiring until " . date("F Y", $expires) . " and cannot be renewed yet.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$code = mt_rand(100000, 999999);
|
|
|
|
|
$_SESSION['code'] = $code;
|
|
|
|
|
$_SESSION['maybefamily'] = $familyid;
|
|
|
|
|