StephenGeorge
04-05-2010, 02:17 PM
I am a PHP novice. Could you please help me with this script!
I am trying to create an automatic reverse auction, whereby the price reduces by a set amount each day!
The price will start high and reduce by a set amount each day.
The start price, start date and reduction amount values will all be assigned by me and entered into a database as fixed ‘variables’. The only true variable ‘variable’ will be the Date, which will change on a daily basis.
PHP will use the information in the database, and the actual Date, to calculate and display the price each day on the website.
I think the formula will be (StartPrice – ((Date – StartDate) x ReductionAmount))
The reduction will occur at the same time each day, when the Date officially changes, and will stay at the new lower price for the rest of the day.
Another reduction will occur the next day etc.
There will only be one instance of ‘bidding’ – when someone buys the item.
If the item does not sell before it reaches the reduction amount, it will be withdrawn.
Having watched the price for this item reduce on a regular daily basis, someone decides on a particular day they can afford to buy the item on offer at the price displayed on that day (rather than wait for the price to reduce further at the risk of losing the item to someone else with a deeper pocket!). They add the item to the cart and pay for it at the checkout. The sale is over and the item is removed from the website.
I hope this explains what I am trying to achieve! If, for example, I assign the values:
StartDate=Apr 3 2010
StartPrice=5000
ReductionAmount=50
then hopefully, using PHP, StartPrice – ((Date – StartDate) x ReductionAmount)) will produce the following:
On April 4, 2010 the website showed “Price today is $4950”
On April 5, 2010 the website shows “Price today is $4900”
On April 6, 2010 the website will show “Price today is $4850”
etc ...
Thank you for your help.
I am trying to create an automatic reverse auction, whereby the price reduces by a set amount each day!
The price will start high and reduce by a set amount each day.
The start price, start date and reduction amount values will all be assigned by me and entered into a database as fixed ‘variables’. The only true variable ‘variable’ will be the Date, which will change on a daily basis.
PHP will use the information in the database, and the actual Date, to calculate and display the price each day on the website.
I think the formula will be (StartPrice – ((Date – StartDate) x ReductionAmount))
The reduction will occur at the same time each day, when the Date officially changes, and will stay at the new lower price for the rest of the day.
Another reduction will occur the next day etc.
There will only be one instance of ‘bidding’ – when someone buys the item.
If the item does not sell before it reaches the reduction amount, it will be withdrawn.
Having watched the price for this item reduce on a regular daily basis, someone decides on a particular day they can afford to buy the item on offer at the price displayed on that day (rather than wait for the price to reduce further at the risk of losing the item to someone else with a deeper pocket!). They add the item to the cart and pay for it at the checkout. The sale is over and the item is removed from the website.
I hope this explains what I am trying to achieve! If, for example, I assign the values:
StartDate=Apr 3 2010
StartPrice=5000
ReductionAmount=50
then hopefully, using PHP, StartPrice – ((Date – StartDate) x ReductionAmount)) will produce the following:
On April 4, 2010 the website showed “Price today is $4950”
On April 5, 2010 the website shows “Price today is $4900”
On April 6, 2010 the website will show “Price today is $4850”
etc ...
Thank you for your help.