add check for tickets on sale
This commit is contained in:
@@ -47,6 +47,7 @@ $router->get('/', function () {
|
|||||||
header('Location: /sold-out');
|
header('Location: /sold-out');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkIfTicketsAreOnSale();
|
||||||
include 'views/common/head.php';
|
include 'views/common/head.php';
|
||||||
include 'views/family.php';
|
include 'views/family.php';
|
||||||
include 'views/common/footer.php';
|
include 'views/common/footer.php';
|
||||||
@@ -59,6 +60,7 @@ $router->get('/notify', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/step-1', function () {
|
$router->get('/step-1', function () {
|
||||||
|
checkIfTicketsAreOnSale();
|
||||||
include 'views/common/head.php';
|
include 'views/common/head.php';
|
||||||
include 'views/step1.php';
|
include 'views/step1.php';
|
||||||
include 'views/common/footer.php';
|
include 'views/common/footer.php';
|
||||||
|
|||||||
@@ -85,3 +85,14 @@ function shoppingCartTotal($price)
|
|||||||
<strong>' . '$' . number_format(($price / 100), 2) . '</strong>
|
<strong>' . '$' . number_format(($price / 100), 2) . '</strong>
|
||||||
</li>';
|
</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkIfTicketsAreOnSale() {
|
||||||
|
$todaysDate = new DateTime('now', new DateTimeZone('America/Chicago'));
|
||||||
|
$dateOnSale = new DateTime('3/15/2019 9:00am', new DateTimeZone('America/Chicago'));
|
||||||
|
$interval = $todaysDate->diff($dateOnSale);
|
||||||
|
|
||||||
|
if($interval->days >= 0 && $interval->invert === 0) {
|
||||||
|
header('Location: /notify?d='.$dateOnSale->format('c'));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,12 @@
|
|||||||
<div class="mb-12 text-center">
|
<div class="mb-12 text-center">
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<h3>Sorry - tickets are not on sale to the public yet.</h3>
|
<h3>Sorry - tickets are not on sale to the public yet.</h3>
|
||||||
|
<?php
|
||||||
|
if (isset($_GET['d'])) {
|
||||||
|
$date = new DateTime($_GET['d']);
|
||||||
|
echo '<h5>Tickets go on sale ' . $date->format('F jS, Y \a\t h:ia') . '</h5>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!-- Begin Mailchimp Signup Form -->
|
<!-- Begin Mailchimp Signup Form -->
|
||||||
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
|
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|||||||
Reference in New Issue
Block a user