<?php
session_start();
include('config/koneksi2.php');
if(isset($_POST['update'])){
	$id = mysql_real_escape_string((int)$_POST['update']);
				$new_jum=$_POST['jum'];
				
					$qt = mysql_query("SELECT id, stok FROM bs_stok WHERE id='$id'");
					while($qt_row = mysql_fetch_assoc($qt)){
						if($_SESSION['cart_'.$_POST['update']]){
							$_SESSION['cart_'.$_POST['update']]=$new_jum;
						} else {
							echo '<script language="javascript">alert("Stok barang tidak mencukupi"); document.location="detail.php";</script>';
						}
					}
				
				}
?>