0){ remove_product($_REQUEST['pid']); } else if($_REQUEST['command']=='clear'){ unset($_SESSION['cart']); } else if($_REQUEST['command']=='update'){ $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['PRODUCT_ID']; $q=intval($_REQUEST['product'.$pid]); $result=mysql_query("select * from product where product_id='$pid'"); $row=mysql_fetch_array($result); $item = $row['stock']; if(($q>0 && $q<=999)&&($q<=$item)){ $_SESSION['cart'][$i]['qty']=$q; } else{ $msg='PFFFT!!'; } } } else if($_REQUEST['command']=='place'){ if(!isset($_SESSION['username'])) { ?> '; } else{ $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['PRODUCT_ID']; $q=intval($_REQUEST['product'.$pid]); $result=mysql_query("select * from product where product_id='$pid'"); $row=mysql_fetch_array($result); $item = $row['stock']; if(($q>0 && $q<=999)&&($q<=$item)){ header('location:choose_ship.php'); } else{ $msg='Some products are not updated!The Number of products must be a number between 1 and 999 or the number of products you want is greater than the stock of the product'; } } } } ?> Stash

S T A S H

'; $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['PRODUCT_ID']; $q=$_SESSION['cart'][$i]['qty']; $pname=get_product_name($pid); if($q==0) continue; $query = mysql_query("SELECT * FROM product where product_id = $pid"); $result = mysql_fetch_array($query); $pic = $result['image']; $stock = $result['stock']; ?> "; } ?>

ITEM

ITEM NAME

GOLD COST

ITEM QUANTITY

GOLD AMOUNT

OPTION

AVAILABLE STOCKS

" width="100" height="80"/>

Total Amount:

There are no Items in your Stash!