"; //echo "purchase_type: ".$purchase_type."
"; //echo "quantity: ".$quantity."
"; //echo "productid: ".$productid."
"; //echo "name: ".$name."
"; //echo "manufacturer: ".$manufacturer."
"; //echo "ourprice: ".$ourprice."
"; //echo "sess_c: ".$sess_c."
"; $name = str_replace("'", "", $name); $manufacturer = str_replace("'", "", $manufacturer); $query_o7 = "select cartid, productid, id, name, manufacturer, ourprice, freeshipping, cart_pic, weight, quantity, size, color, purchase_type from carts where sess_car = '$sess_c' "; $result_o7 = mysql_query($query_o7,$connection); $prod_o7 = mysql_fetch_array($result_o7); $cartid_o7 = $prod_o7['cartid']; if($cartid_o7 == ""){ $sess_c = ""; } if($sess_c == ""){ if($sess_userid == ""){ $sess_cer = $d1.$d2.$d3.$d4.$d5; $sess_c = $sess_cer; session_register("sess_c"); }else{ $sess_cer = $sess_userid.$d1.$d2.$d3.$d4.$d5; $sess_c = $sess_cer; session_register("sess_c"); } $query = "insert into carts (sess_car, productid, id, name, manufacturer, ourprice, freeshipping, cart_pic, weight, quantity, size, color, purchase_type, created_date) values ('$sess_c', $productid, 0, '$name', '$manufacturer', $ourprice, '$freeshipping', '$image01', 0, $quantity, '$size', '$color', '$purchase_type', now())"; $result = mysql_query($query,$connection); $DB_Err = mysql_error(); $uid = mysql_insert_id(); // echo "query: ".$query."

"; }else{ $sameproduct_cartid = ""; $sameproduct_quantity = 0; $query_2 = "select cartid, productid, quantity, purchase_type from carts where sess_car = '$sess_c' "; $result_2 = mysql_query($query_2,$connection); while (list($cartid_s, $productid_s, $quantity_s, $purchase_type_s) = mysql_fetch_row($result_2)){ if($productid == $productid_s && $purchase_type == $purchase_type_s){ $sameproduct_cartid = $cartid_s; $sameproduct_quantity = $quantity_s; } } // echo "query_2: ".$query_2."
"; // echo "productid: ".$productid."
"; // echo "productid_s: ".$productid_s."
"; // echo "purchase_type: ".$purchase_type."
"; // echo "purchase_type_s: ".$purchase_type_s."
"; // echo "sameproduct_cartid: ".$sameproduct_cartid."

"; if($sameproduct_cartid == ""){ $query = "insert into carts (sess_car, productid, id, name, manufacturer, ourprice, freeshipping, cart_pic, weight, quantity, size, color, purchase_type, created_date) values ('$sess_c', $productid, 0, '$name', '$manufacturer', $ourprice, '$freeshipping', '$image01', 0, $quantity, '$size', '$color', '$purchase_type', now())"; $result = mysql_query($query,$connection); $DB_Err = mysql_error(); $uid = mysql_insert_id(); }else{ $quantity = $quantity + $sameproduct_quantity; //remove Quantity function Only //$quantity = 1; $query = "update carts set quantity = $quantity where cartid = $sameproduct_cartid "; $result = mysql_query($query,$connection); $DB_Err = mysql_error(); $uid = mysql_insert_id(); } } // echo "query: ".$query."

"; ?> :: Textbook Max ::
You have items in your shopping cart.
* Free Shipping!"; }else{ $free_shipping = ""; $total_q = $total_q + $quantity; $shippingprice = $shippingprice + ($quantity * 5); } if($purchase_type == "1"){ $purchase_type_2 = "Purchase New Book"; }else if($purchase_type == "2"){ $purchase_type_2 = "Purchase Used Book"; }else if($purchase_type == "3"){ $purchase_type_2 = "Rent New Book"; }else if($purchase_type == "4"){ $purchase_type_2 = "Rent Used Book"; } $size = GetImageSize("admin/products/".$cart_pic); $width = $size[0]; $height = $size[1]; if($width > $height){ if($width > 100){ $tablewidth = "width=100"; }else{ $tablewidth = "width=".$width; } }else{ if($height > 100){ $width = $width * 100 / $height; $tablewidth = "width=".$width; }else{ $tablewidth = "width=".$width; } } if($cart_pic == ""){ $cart_pics = ""; //$cart_pics = "admin/products/upload/".$cart_pic.""; }else{ $cart_pics = ""; } echo ""; //echo " "; echo " "; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; $total_i = $total_i + ($quantity * $ourprice); } //$tax = ceil(($total_i * 0.0775) / 0.01) * 0.01; $tax = ceil(($total_i * 0.08) / 0.01) * 0.01; //updated by may on 6/4/2013 //$shippingprice = $total_q * 12; $totalprice = $total_i + $tax + $shippingprice; //$totalprice = $total_i + $shippingprice; ?>
"; echo " $name    ISBN: $manufacturer


"; echo " Course: $color


"; echo " Purchase Type: $purchase_type_2


"; echo " PRICE: $$ourprice"; echo "
"; echo " QUANTITY:


"; echo " UPDATE ITEM

"; echo " DELETE ITEM
"; echo "
SUBTOTAL: $0.00
TAX: $0.00