add check for tickets on sale

This commit is contained in:
Chris Smith
2019-03-09 21:43:22 -06:00
parent 26b44d653b
commit ae66a1ba6b
3 changed files with 19 additions and 0 deletions

View File

@@ -84,4 +84,15 @@ function shoppingCartTotal($price)
<span>Total</span>
<strong>' . '$' . number_format(($price / 100), 2) . '</strong>
</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'));
}
}