Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shipping SChedule Problem?

Status
Not open for further replies.

subminimal

Programmer
Jan 11, 2004
7
US
I was just hired on to a major .com company as an artistic director/webmaster. I was hired on with "basic" PHP experience, thier words. I have experience with CMS design. mySQL PHP integration, etc. But the problem they have hit me with has stumped me a bit, just asking for advice.

They have a shipping schedule which at the moment is done by hand. At the top of the page, are two calanders, last month and this month. Below is a view last month link. Below that is orders. All orders are shipped on the friday of the week ordered. So the lines read:

december 1: Your order will be shipped on Friday december 10 (Est. arrival date is: december 11-14)

On down the line until the friday, then the date moves to the following friday. The problem is its all done by hand now, and they want to make it either a) "really easy to update" or b) never touch it again. I think b is possible, I just have very little experience with the PHP date funtions. Basically, I need the calanders up top to be dynamic, as well as the schedule text below. The calanders will then have each date link to an anchor on the page (this is easy I know just describing.) Hope I explained that right, any thoughts?
 
OK so I have gotten so far as to find some classes that generate calendars. Looked into them, not so bad. Still stumped on creating that list of fridays for when purchaced items will ship. How do you pass that date to a text list? Grr..
 
OK I have gotten this far:
Code:
<?php
$tomorrow  = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); 
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); 
$nextyear = mktime(0, 0, 0, date("m"), date("d"), date("Y")+1); 
$today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$firstday=01;
$td=date("d");
echo "<b>Today is ",date("l M.d",$today),"</b><br /><br />";
echo "<b>Tomorrow = ",date("l M.d",$tomorrow),"</b><br />";
echo "<b>Last Month = ",date("l M.d",$lastmonth),"</b><br />";
echo "<b>Next Year = ",date("l M.d, Y",$nextyear),"</b><br /><br />";

if (date ('l') == 'Friday')
{
   echo "Today is Friday<br>n";
}
$time = time ();
for ($i = 0; $i < 7; $i++)
{
   if (date ('l', $time += (60*60*24)) == 'Friday')
   {
       echo "Next Friday is on the ".date ("jS of F", $time), "<br/><br />";
       break;
   }
}  

for ($x = 0; $x <30; $x++)
{
	$newday=$td + $x;
	if($newday < 30){
echo "Date:", date("l M.$newday",$today),"<br />";
}
}
?>

Can anyone please help? Im a mess lol.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top