'; $path='bizshop.com'; //include("checkvars.php"); extract($_SESSION); //echo "$UID $CII"; if($_POST['pickup']=='1'){ //echo "YES - unset variable zip"; $Zip='None'; //echo 'Session ZIP'.$_SESSION['Zip']; } ## Get Items In Cart ----------------------------------- $sql="SELECT * FROM CartItems WHERE UserID='$memberID' ORDER BY Date"; //echo "$sql"; $stmt = $dbCart->prepare($sql); $res=$stmt->execute(); if ($res) { $record = $stmt->fetchAll(); /* Check the number of rows that match the SELECT statement */ if (count($record) > 0) { # ------------------------------------------------------------format Contents Display --------------------------- //echo "

Your shopping cart contains the following items:

"; echo ""; echo ""; echo ""; echo ""; echo ""; // echo ""; echo ""; echo ""; $subtotal=0; $disc_count=0; foreach ($record as $row) { print ""; print ""; print ""; print ""; $totcost=$row['ItemQuantity']*$row['ItemCost']; $subtotal=$subtotal+$totcost; setlocale(LC_MONETARY, 'en_US.UTF-8'); print ""; } echo ""; //------------------------------------------Discount Row ----------------------- $fullfirst=$disc_count-1; if($disc_count<='4'){ $discount=$fullfirst*5.00; } else { $discount=$fullfirst*5.00; $adddiscount=($fullfirst-4)*5; $discount=$discount+$adddiscount; } $discount=number_format($discount,"2",".","thousands_sep"); if($discount>=5.00){ $_SESSION['Discount']=$discount; echo ""; } //------------------------------------------Discount Row ----------------------- /* $fullfirst=$disc_count-1; $discount=$fullfirst*5.00; $discount=number_format($discount,"2",".","thousands_sep"); if($discount>=5.00){ $_SESSION['Discount']=$discount; echo ""; } */ //------------------------------------------Shipping Row ----------------------- if(isset( $_SESSION['Zip'] ) ) { $zipup="Update Members set PostalCode='".$_SESSION['Zip']."' where member_id='".$_SESSION['memberID']."'"; echo ""; echo ""; //--------------------------------------------Sales Tax if($Zip>98000 AND $Zip<98500){ //-----------------------------------------------------------------Washington State Zip Codes echo ""; $tax=($total+$shipcharge)*$Taxrate; $tax=number_format($tax,"2",".","thousands_sep"); echo ""; $_SESSION['Tax']=$tax; } if($Zip=='None'){ $grandtotal=$total-$discount+$tax; } else { $grandtotal=$total-$discount+$shipcharge+$tax; } echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
"; echo "Product Code"; echo ""; echo "Product Name"; echo ""; echo "Qty"; echo ""; echo "Cost"; echo ""; // echo "Weight"; // echo ""; echo "Subtotal"; echo "
".$row['ItemID'] . "".$row['ItemName']."".intval($row['ItemQuantity']); $disc_count=$disc_count+intval($row['ItemQuantity']); echo "
"; echo ""; //echo ""; echo ""; echo "
".$row['ItemCost']."".money_format('%.2n', $totcost)."
"; echo "
"; echo ""; //echo ""; //echo ""; echo ""; echo "
"; include("shipcalc.php"); //echo "Shipping to zip: ".$Zip; echo "
"; echo "
SubTotal:
"; echo "
"; $total=number_format($subtotal,"2",".","thousands_sep"); echo "
$$total"; echo "
Discount for multiple items applied"; echo "-$$discount"; echo "
Discount for multiple items applied"; echo "-$$discount"; echo "
Priority Mail Shipping & Handling To $Zip"; $wt=explode(".","$totweight"); $lb=$wt[0]; $oz=$wt[1]; if($oz>16){ $addpounds=$oz/16; $lb=floor($lb+$addpounds); $oz=$oz%16; $oz=str_pad($oz,2,"0",STR_PAD_LEFT); } if($totweight>0.00){ echo " Weight $lb pounds $oz ounces to zone $zone"; } echo ""; $shipweight="$lb.$oz"; /* if ($disc_count>='1'){ $shipcharge='6.25'; } else { $shipcharge='0'; } */ if(is_numeric("$Zip")){ echo "$$shipcharge"; } else { echo "No Shipping Charge"; } echo "
Washington Sales Tax$$tax
Total$$grandtotal
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //echo "

TheShipping Charge".$shipcharge."

"; echo ""; echo ""; echo ""; echo ""; // echo ""; // echo ""; // echo ""; // echo ""; echo "
"; echo ""; } /* No rows matched -- do something else */ else { print "Nothing in your cart."; } } include("footer.php"); ?>