My goal is to post a .gif based on the following:
green.gif=0-2days yellow.gif=2-5days red.gif 5 days and over
Here's where I get my variables:
//this variable will be pulled from the database. I've already written code for it. I've supplied you with an example timestamp.
$inventory_upload_date = "20010704181857";
$five_days_ago=date("YmdHis",time() - 432000);
$two_days_ago=date("YmdHis",time() - 172800);
$today=date("YmdHis");
Here's the code I have so far, but it doesn't work 🙁
//if inventory_upload_date > 5 days, then post red
if($inventory_upload_date < $five_days_ago){
$symbol="red.gif";
}
//if inventory_upload_date between 2-5 days, then post yellow
if(($inventory_upload_date < $two_days_ago) && ($inventory_upload_date > $five_days_go)){
$symbol="yellow.gif";
}
//if inventory_upload_date between 0-2 days, then post green
if(($inventory_upload_date <= $today) && ($inventory_upload_date > $two_days_go)){
$symbol="green.gif";
}
Then I would like a way to print out exactly what's it's doing so I can get a better understanding of how to debug the code. Thanks for all your help in advance.