add check for tickets on sale
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user