scenario:
there are 4 items:
30day pass
60day pass
180day pass
365day pass
there is a monthly (30 day) credit cap. so if you use the credit up before the end of the month you need to purchase another 30day pass, or wait till the next renewal period.
A person purchases a 30day pass today, purchase date is recorded to DB. Expiry date is also recorded.
if ($todaysdate >= $expirydate) //DONE.
but whAt about for 60day and 180day passes ?
we have purchasedate & expiry date. every 30days, the credit needs to be reset for the next month.
I am really lost how to best approach this problem.