"); $count ++; if($qty !='' && strlen (ereg_replace('[*-/(.)a-zA-Z]', '',$qty)) < 1){ $err_msg= 'Your Quantity must be numbers only.'; break; } if($qty2 !='' && strlen (ereg_replace('[*-/(.)a-zA-Z]', '',$qty2)) < 1){ $err_msg= 'Your Quantity must be numbers only.'; break; } if($qty2!='' && $qty2!=0) $qty=$qty2*$UnitOfMeasure; else $qty=$qty; if ($qty!=''&& $qty!=0){ $empty="No"; $t4 = "sub" . $count; $sub_pro = mysql_real_escape_string($_POST[$t4]); if($sub_pro=='') $sql_subPro = "SELECT pd_id FROM tbl_cart WHERE pd_id = $productId AND ct_session_id ='" . $sid . "'"; else $sql_subPro = "SELECT pd_id FROM tbl_cart WHERE pd_id = $productId and sub_pd=$sub_pro AND ct_session_id ='" . $sid . "'"; $result_subPro = mysql_db_query("coffee_db", $sql_subPro); if (mysql_num_rows($result_subPro) == 0) // put the product in cart table $sql_insert = "INSERT INTO tbl_cart (pd_id, sub_pd, ct_qty, ct_session_id, ct_date) VALUES ('$productId', '$sub_pro', '$qty', '" . $sid . "', NOW())"; else // update product quantity in cart table $sql_insert = "UPDATE tbl_cart SET ct_qty = ct_qty + $qty WHERE ct_session_id ='" . $sid . "' AND pd_id = '$productId'"; mysql_db_query("coffee_db", $sql_insert) or die("Insert error"); }//Empty }//outerwhile if($err_msg=='') if($empty=="Yes") $err_msg = "No items were selected."; if($err_msg=='') header('Location: cart.php'); else $form = $_POST; }//post if if ($_SERVER['REQUEST_METHOD']=='POST' && $_POST['Add_Cart']="Add Cart") { $empty="Yes"; $sql_subcat = "select * from tbl_products where Pro_Code in(" . $_POST['CrossSell'] . ")"; $result_subcat = mysql_db_query("coffee_db", $sql_subcat); $num = mysql_num_rows($result_subcat); $count=0; //Guest Session if($sid=="") $sid = "Temp" . rand(9999,99999); while ($count<$num) { $count ++; //$t1= "hidCartId" . $i; //$cart_id= mysql_real_escape_string($_POST[$t1]); $t2 = "ProductId" . $count; $productId = mysql_real_escape_string($_POST[$t2]); $t3 = "qty" . $count; $qty=''; $qty = mysql_real_escape_string($_POST[$t3]); if($qty !='' && strlen (ereg_replace('[*-/(.)a-zA-Z]', '',$qty)) < 1){ $err_msg= 'Your Quantity must be numbers only.'; break; } if ($qty!=''&& $qty!=0){ $empty="No"; $sql_subPro = "SELECT pd_id FROM tbl_cart WHERE pd_id = $productId AND ct_session_id ='" . $sid . "'"; $result_subPro = mysql_db_query("coffee_db", $sql_subPro); if (mysql_num_rows($result_subPro) == 0) // put the product in cart table $sql_insert = "INSERT INTO tbl_cart (pd_id, sub_pd, ct_qty, ct_session_id, ct_date) VALUES ('$productId', '$sub_pro', '$qty', '" . $sid . "', NOW())"; else // update product quantity in cart table $sql_insert = "UPDATE tbl_cart SET ct_qty = ct_qty + $qty WHERE ct_session_id ='" . $sid . "' AND pd_id = '$productId'"; mysql_db_query("coffee_db", $sql_insert) or die("Insert error"); }//if empty }//outerwhile header('Location: products/cart.php'); $form = $_POST; die(); }//post if ?> HotelCoffee.com - Keurig K cups coffee, in room hotel coffee amenities
<? echo $row['Pro_Desc'];?>
... more info




...

Price: $


Qty: