Location: PHPKode > scripts > IBK Cart > frmAction_IBKCart/myCart.php
<?php
	if (!session_start()){
		session_start();
	}
	
	include("../Config_IBKCart/Config.php");
	include("../class_IBKCart/class.shopping.php");
	
	$Cart = new IBKCart();
	$Cart->initCart($Config, $_SESSION['MyCart']);
	
	
	$tDo = $_GET['tDo'];
	
	switch($tDo){
		case 'AddItem':
			$Cart->addItem($_GET['itemId'], $_GET['Qty']);
		break;
		case 'DelItem':
			$Cart->delItem($_GET['itemId'], $_GET['Qty']);
		break;
		case 'EmptyCart':
			$Cart->EmptyCart();
		break;
		case 'UpdCart':
			$Items = explode(',' , $_GET['itemId']);
			$Qtys = explode(',' , $_GET['Qty']);
			
			for($i=0; $i< count($Qtys); $i++){
				$Cart->updateCart($Items[$i], $Qtys[$i]);
			} 
		break;
	}
	
	
	//Add the info to the session variable..again
	$_SESSION['MyCart'] = $Cart->cart;
	
	sleep(1); //Just wanted to see the rolling images..
	
	///Use a variable to know which pahe the function was called from..
	if ($_GET['pgfrm'] == 'ChkOut'){
		if ($Cart->getCartItems() > 0){
			 $Cart->DisplayCheckOut();
		}
		else{
			$Cart->DisplayEmptyCart('ChkOut');
		}
	}
	else{
		if ($Cart->getCartItems() == 0){ 
			$Cart->DisplayEmptyCart('Small') ;
		} 
		else{
				echo $Cart->ShowCartWtPrd();
			}
	}
	
	$Cart->destroyConn(); 
?>
Return current item: IBK Cart