March Special: Order before midnight EST on St. Patrick's Day, March 17, 2010, and get a 50% discount on your order total!"; print "

April Special: Order more than a dozen beers at a time and get a 25% discount. Valid through April 30, 2010.

"; print "

All specials are subject to taxes.

"; print "
\n"; print ""; print ""; print ""; print ""; print ""; $total_for_beer=0; $beer_count=0; foreach ($beers as $beer) { $beer_brand=$beer['brand']; $beer_origin=$beer['origin']; $beer_size=$beer['size']; $beer_price=$beer['price']; $beer_id=$beer['id']; $beer_count=0; #$beer_count=$beer_count+($_GET[$beer_count]); #$ordered=$_GET[$beer_price]; $subtotal=$beer_price*$beer_count; $total_for_beer=$total_for_beer+$subtotal; $tax_total=0; $tax_total=$total_for_beer*.07; $order_total=$total_for_beer+$tax_total; $subtotal_special=$total_for_beer/2; $total_for_special=$subtotal_special+$tax_total; $special=$total_for_beer*.75; $special_total=$special+$tax_total; print ""; print ""; print ""; print ""; print ""; } /*if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[0]['id']]; } if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[1]['id']]; } if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[2]['id']]; } if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[3]['id']]; } if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[4]['id']]; } if(isset($_GET[$beer_count[$beer['id']]])) { $beer_count=$_GET['beer_count'][$beer[5]['id']]; } #$_GET['beer_count'][$beer[1]['id']] #$_GET['beer_count'][$beer[2]['id']] #$_GET['beer_count'][$beer[3]['id']] #$_GET['beer_count'][$beer[4]['id']] #$_GET['beer_count'][$beer[5]['id']] #} #$beer_count++ print ""; print "

Beer

Origin

Price

Quantity

".$beer_brand."".$beer_origin."".$beer_size."".$beer_price."
"; print "
"; print "
"; } if(isset($_GET['submit'])) { print "

Order Confirmation:


"; print "Submitted on:
"; print date('l jS \of F Y g:i:s A'); print "
"; if ($today >=$paddys_day) { print "
"; print "Sorry you missed our St. Patrick's Day Special.
"; print "Please check back next year.
"; print "You purchased: ".$beer_count." bottles of ".$beer_brand."."; print "

The total cost of your order is" ."\$". $order_total."


"; } elseif ($today <= $paddys_day) { print "Happy St. Patrick's Day!
"; print "You ordered ".$beer_count." bottles of ".$beer_brand."
"; print "Your total, including tax, for the St. Paddy's Day special is \$".$total_for_special."."; } else { if ($today==$april_fools) { print "April Fool's! All of the beers have increased in price by 25%!"; print "Your order total is \$".$order_total.""; } else ($today>=$april_fools) { if ($today<=$april_end) { if ($beer_count>=12) { print "Thank you for your order! You get 25% off your order total!"; print "Your total is \$ ".$special_total.""; } } } } } /*if (!isset($_GET['ordered'])) { print "\n"; }*/ ?>

Valid XHTML 1.0!