OUT OF THE BOX PUBLISHING Find a Retail Store Near You!
Home Product Showcase Awards and Reviews Classroom Games Fun! About Out Of The Box Publishing News Download Resources Order
Free Catalog Join Our Email List Retailer Locator


Home
$value) { if ($tmp_state == $key){ // return state day value $add_amount = $value; break; }else{ // return 0 because state not found $add_amount = 0; } } // calculate UPS Ground delivery date list($month, $day, $year) = explode('/', $tmp_date); $tmp_new = date("m/d/y", mktime(0, 0, 0, $month, $day + $add_amount, $year)); // calculate if it is a day UPS Delivers list($month, $day, $year) = explode('/', $tmp_new); $tmp_new_date = date("m/d/y", mktime(0, 0, 0, $month, $day + UPS_Day($tmp_new), $year)); // check if it is on a no delivery date $new_date = UPS_NoDelivery($tmp_new_date); return $new_date; } function UPS_Day($tmp_date){ // check to see if day falls on a day ups does not ship and if so add days next ship date list($month, $day, $year) = explode('/', $tmp_date); $tmp_long_date = mktime(0, 0, 0, $month, $day, $year); // use timestamp to make date $tmp_wkday = date('w',$tmp_long_date); // determine day of week number switch ($tmp_wkday){ // if order date is on certain day of week ... case 0: // sunday $tmp_shipdate = 1; break; case 6: // saturday $tmp_shipdate = 2; break; default: // mon - fri $tmp_shipdate = 0; } // End Switch return $tmp_shipdate; } // end function function UPS_NoPickup($tmp_date){ // date passed in is in m/d/y format // build array of dates with no pickup and enter the next pickup day $no_pickup_array["12/18/04"]="12/20/04"; $no_pickup_array["12/24/04"]="12/27/04"; $no_pickup_array["12/31/04"]="1/3/05"; $no_pickup_array["1/1/05"]="1/3/05"; // search if date passed in is in array foreach($no_pickup_array as $key=>$value) { if ($key == $tmp_date){ // return new date because in array $new_date = $value; break; }else{ // return date passed in because not in array $new_date = $tmp_date; } } return $new_date; } // end function function UPS_NoDelivery($tmp_date){ // date passed in is m/d/y format // determine if date is a date when there is not delivery // build array of dates with no delivery and enter the next delivery day $no_delivery_array["12/18/04"]="12/20/04"; $no_delivery_array["12/31/04"]="1/3/05"; $no_delivery_array["1/1/05"]="1/3/05"; // search if date passed in is in array foreach($no_delivery_array as $key=>$value) { if ($key == $tmp_date){ // return new date because in array $new_date = $value; break; }else{ // return date passed in because not in array $new_date = $tmp_date; } } return $new_date; } // end function function Postal_Holiday($tmp_date){ // date passed in is in m/d/y format // build array of dates with no pickup and enter the next pickup day $postal_holiday_array["12/25/04"]="12/27/04"; $postal_holiday_array["1/1/05"]="1/3/05"; $postal_holiday_array["1/17/05"]="1/18/05"; $postal_holiday_array["2/21/05"]="2/22/05"; $postal_holiday_array["5/30/05"]="5/31/05"; $postal_holiday_array["7/4/05"]="7/6/05"; $postal_holiday_array["9/5/05"]="9/6/05"; $postal_holiday_array["10/10/05"]="10/11/05"; $postal_holiday_array["11/11/05"]="11/14/05"; $postal_holiday_array["11/24/05"]="11/25/05"; $postal_holiday_array["12/26/05"]="12/27/05"; $postal_holiday_array["1/2/06"]="1/3/06"; // search if date passed in is in array foreach($postal_holiday_array as $key=>$value) { if ($key == $tmp_date){ // return new date because in array $new_date = $value; break; }else{ // return date passed in because not in array $new_date = $tmp_date; } } return $new_date; } // end function function WeekDay($tmp_day){ // $tmp_day passed in is actual day of week number // calculate actual day of week name switch ($tmp_day){ case 0: // Sunday $tmp_dayname = "Sun."; break; case 1: // Monday $tmp_dayname = 'Mon.'; break; case 2: // Tuesday $tmp_dayname = 'Tue.'; break; case 3: // Wednesday $tmp_dayname = 'Wed.'; break; case 4: // Thursday $tmp_dayname = 'Thu.'; break; case 5: // Friday $tmp_dayname = 'Fri.'; break; case 6: // Saturday $tmp_dayname = 'Sat.'; break; Default: $tmp_dayname = 'Value not a weekday'; } // End Switch return $tmp_dayname; } // End Function function date_shipped($tmp_date){ // Calculate how many days to add to the order date to get ship date. list($month, $day, $year) = explode('/', $tmp_date); $tmp_long_date = mktime(0, 0, 0, $month, $day, $year); $tmp_wkday = date('w',$tmp_long_date); // get day of week switch ($tmp_wkday){ // if order date is on certain day of week ... case 0: // sunday $tmp_shipdate = 1; break; case 5: // friday $tmp_shipdate = 3; break; case 6: // saturday $tmp_shipdate = 2; break; default: // mon - thrs $tmp_shipdate = 1; } // End Switch return $tmp_shipdate; } // End Function function UPS_Date($tmp_date){ // Calculate how many days to add to the order date to get UPS dates list($month, $day, $year) = explode('/', $tmp_date); $tmp_long_date = mktime(0, 0, 0, $month, $day, $year); $tmp_wkday = date('w',$tmp_long_date); // determine day of week number switch ($tmp_wkday){ // if ship date is on certain day of week ... case 0: // sunday $tmp_shipdate = 1; break; case 5: // friday $tmp_shipdate = 3; break; case 6: // saturday $tmp_shipdate = 2; break; default: // mon - thrs $tmp_shipdate = 1; } // End Switch return $tmp_shipdate; } // End Function function Postal_Date($tmp_date){ // Calculate how many days to add to the order date to get United States Postal Service Date list($month, $day, $year) = explode('/', $tmp_date); $tmp_long_date = mktime(0, 0, 0, $month, $day, $year); $tmp_wkday = date('w',$tmp_long_date); // determine day of week number switch ($tmp_wkday){ // if ship date is on certain day of week ... case 0: // sunday $tmp_shipdate = 3; break; case 4: // thursday $tmp_shipdate = 4; break; case 5: // friday $tmp_shipdate = 4; break; case 6: // saturday $tmp_shipdate = 4; break; default: // Mon - Wed $tmp_shipdate = 3; } // End Switch return $tmp_shipdate; } // End Function function monthday($tmp_date){ // format date into month/day (m/d) list($month, $day, $year) = explode('/', $tmp_date); return date("m/d", mktime(0, 0, 0, $month, $day, $year)); } // Get Today's Date Variables $tdate = date("m/d/Y"); $tdate_name = WeekDay(date('w')); // calculate date shipped $tmp_date_ship = date("m/d/y", mktime(0, 0, 0, date("m") , date("d") + date_shipped(date("m/d/y")), date("y"))); // check if it falls on a no pickup day $date_ship = UPS_NoPickup($tmp_date_ship); list($month, $day, $year) = explode('/', $date_ship); $date_ship_name = WeekDay (date("w", mktime(0, 0, 0, $month, $day, $year))); // calculate UPS Next Day list($month, $day, $year) = explode('/', $date_ship); $tmp_ups_nextday = date("m/d/y", mktime(0, 0, 0, $month, $day + UPS_Date($date_ship), $year)); // check if it is on a no delivery date $ups_nextday = UPS_NoDelivery($tmp_ups_nextday); list($month, $day, $year) = explode('/', $ups_nextday); $ups_nextday_name = WeekDay (date("w", mktime(0, 0, 0, $month, $day, $year))); // calculate UPS 2 Day list($month, $day, $year) = explode('/', $ups_nextday); $tmp_ups_2day = date("m/d/y", mktime(0, 0, 0, $month, $day + UPS_Date($ups_nextday), $year)); // check if it is on a no delivery date $ups_2day = UPS_NoDelivery($tmp_ups_2day); list($month, $day, $year) = explode('/', $ups_2day); $ups_2day_name = WeekDay(date("w", mktime(0, 0, 0, $month, $day, $year))); // calculate UPS 3 Day list($month, $day, $year) = explode('/', $ups_2day); $tmp_ups_3day = date("m/d/y", mktime(0, 0, 0, $month, $day + UPS_Date($ups_2day), $year)); // check if it is on a no delivery date $ups_3day = UPS_NoDelivery($tmp_ups_3day); list($month, $day, $year) = explode('/', $ups_3day); $ups_3day_name = WeekDay(date("w", mktime(0, 0, 0, $month, $day, $year))); // calculate Postal Priority list($month, $day, $year) = explode('/', $date_ship); $tmp_postal_priority = date("m/d/y", mktime(0, 0, 0, $month, $day + Postal_Date($date_ship), $year)); $postal_priority = Postal_Holiday($tmp_postal_priority); list($month, $day, $year) = explode('/', $postal_priority); $postal_priority_name = WeekDay(date("w", mktime(0, 0, 0, $month, $day, $year))); ?>

Order
Received
Order
Shipped
Estimated Delivery Dates1
UPS
Next Day
UPS
2nd Day
UPS
3 Day Select
UPS 2
Ground
USPS 3
Priority Mail
" . monthday($tdate); ?> " . monthday($date_ship); ?> " . monthday($ups_nextday); ?> " . monthday($ups_2day); ?> " . monthday($ups_3day); ?> "; print "
"; print ""; print "
"; print ""; print ""; }else{ // state is passed in so run routine and dispaly "new state" link $tmp_state=$_POST['new_state']; $ups_ground_date = UPS_Ground($tmp_state, $date_ship); list($month, $day, $year) = explode('/', $ups_ground_date); $ups_ground_date_name = WeekDay(date("w", mktime(0, 0, 0, $month, $day, $year))); print "$ups_ground_date_name
" . monthday($ups_ground_date) . "
"; print "Calculate New State"; } ?>
" . monthday($postal_priority); ?>
Delivery Schedule Notes:
1. Delivery times listed are estimates only.
2. In the United States, UPS observes the following holidays:
 
  • Memorial Day - May 28, 2007
  • Independence Day - July 4, 2007
  • Labor Day - September 3, 2007
  • Thanksgiving Day - November 22, 2007
  • Day after Thanksgiving - November 23, 2007
  • Christmas Day - December 25, 2007
  • New Year´s Eve - December 31, 2007
  • New Year's Day - January 1, 2008
3. US Postal Service Priority Mail estimated time of 2-3 days is not guaranteed.
Shipping Information Resources:
UPS Time-In-Transit Map
UPS Days of Operation