<?php
session_start();
include('config/koneksi2.php');

if(isset($_POST['add'])){
$qty = $_POST['qty'];
/*$size = $_POST['size'];
$color = $_POST['color'];
$config = $_POST['config'];

$sql=mysql_query("select id from bs_stok where kode_ax='$kode' and size_ax='$size' and config_ax='$config', and colour_ax='$color'");
$data =mysql_fetch_array($sql);*/

	$id = mysql_real_escape_string((int)$_POST['add']);
	$qt = mysql_query("SELECT id, stok FROM bs_stok WHERE id='$id'");
	while($qt_row = mysql_fetch_assoc($qt)){
		//if($qt_row['stok'] != $_SESSION['cart_'.$_GET['add']] && $qt_row['stok'] > 0){
	//	if($qt_row['stok'] != $_SESSION['cart_'.$_POST['add']]){
			$_SESSION['cart_'.$_POST['add']]+=$qty;
	/*	} else {
			echo 'stok habis';
		}*/
	}
}
?>