Sunday, 8 September 2013

Calculate end date based on # of days and start date

Calculate end date based on # of days and start date

I am working on script where users can make certain type of orders. Now
when users make an order they can choose how long they wont it to last in
# of days. Once the order is placed I need to approve their order and that
approval date is recorded inside my database. Now what I need is to show
inside their user panel how much days their package will last since the
day of my approval. So for example if I approved their order September 08,
2013 and they choosed for the order to last 7 days, I wont them to see
inside they panel for every next day they login how much days they have
left, so 7days, 6days, 5days, etc... all the way to "0 Days" when they
come to their panel on September 16, 2013.
I have following variables for those two values:
$row_ordersResults['date'] - the date I approved the order
$row_ordersResults['drip_feed'] - # of days they wont for their order to
last
I did tried to lots of combinations by myself but I am totally stuck with
this and cant make it work.
Thanks for help!

No comments:

Post a Comment