session_start();
$Section="Store";
$SectionImage="top_media.gif";
include("includes/header.inc.php");
include_once("admin/mysql.inc.php");
$maxPerPage = 50;
?>
iDance Official Merchandise

if ($action == "removeItem") {
$itemID = $_REQUEST['itemID'];
$orderID = $_SESSION['orderID'];
$query = "DELETE FROM order_items WHERE itemID=$itemID AND orderID=$orderID";
mysql_query($query) or die("Query Failed: " . mysql_error());
}
if ($action == "updateItem") {
$itemID = $_REQUEST['itemID'];
$orderID = $_SESSION['orderID'];
$query = "UPDATE order_items SET quantity=$quantity WHERE itemID=$itemID AND orderID=$orderID";
mysql_query($query) or die("Query Failed: " . mysql_error());
}
if ($action == "empty") {
$orderID = $_SESSION['orderID'];
$query = "DELETE FROM order_items WHERE orderID=$orderID";
mysql_query($query) or die("Query Failed: " . mysql_error());
}
if (isset($_SESSION['orderID'])) {
$orderID = $_SESSION['orderID'];
$query = "SELECT * FROM order_items WHERE orderID=$orderID";
$result = mysql_query($query) or die("Query Failed: " . mysql_error());
$numrows = mysql_num_rows($result);
if ($numrows != 0) {
echo "";
echo "| SKU# | Name | Qty | Each | Total | Actions |
";
$query = "SELECT * FROM order_items WHERE orderID=$orderID";
$result = mysql_query($query) or die("Query Failed: " . mysql_error());
$numrows = mysql_num_rows($result);
$bgcolor = "#cccccc";
for ($i = 0; $i < $numrows; $i ++) {
$itemID = mysql_result($result,$i,"itemID");
$sku_num = mysql_result($result,$i,"sku_num");
$description = mysql_result($result,$i,"description");
$quantity = mysql_result($result,$i,"quantity");
$price = mysql_result($result,$i,"price");
$itemtotal = $quantity * $price;
$subTotal = $subTotal + $itemtotal;
echo "
| $sku_num |
$description |
";
$bgcolor = ($bgcolor == "#cccccc") ? "#dddddd" : "#cccccc";
}
$salesTax = number_format($subTotal * 0.14,2);
//if ($subTotal <= 250) $shipping = 25;
//else if ($subTotal > 250 && $subTotal <= 500) $shipping = 19.95;
//else if ($subTotal > 500 && $subTotal <= 850) $shipping = 12.95;
//else if ($subTotal > 850) $shipping = 0.0;
$total = $salesTax + $subTotal + $shipping;
$q = "UPDATE orders SET total='$total' WHERE orderID=$orderID";
mysql_query($q) or die("Query Failed: " . mysql_error());
echo "| Sub-total | $".number_format($subTotal,2)." |
";
echo "| Sales Tax | $$salesTax |
";
echo "| Shipping | $$shipping * |
";
echo "| Total | $".number_format($total,2)." |
";
echo "| Proceed to Checkout |
";
echo "| Empty Cart |
";
echo "**This shopping cart system will not require credit card information from you. Payment will be confirmed upon order processing when you are contacted. Click here for more on shopping. *Shipping rates are determined by size and weight of pacakge as well as geographic location. This will be calculated and added to the order upon processing and confirmed upon contact.
|
";
echo "
";
}
else {
echo "Your Shopping Cart is Empty
";
}
}
else {
echo "Your Shopping Cart is Empty
";
}
include ("includes/footer.inc.php");
?>