</div>
			
			<div style = "width:300px; margin-left:20px; float:left; border:2px #333 dotted">
			<h3>My Basket</h3><br />
				<?php 
echo KoolScripting::Start();
?>
					<updatepanel id="basket">
						<content>
							<?php 
if (isset($_POST['addItem']) && $_POST['addItem'] != "") {
    $_SESSION['basket'][] = $_POST['addItem'];
}
//add product to basket
if (isset($_POST['removeItem']) && $_POST['removeItem'] != "") {
    array_splice($_SESSION['basket'], FindBasket($_POST['removeItem']), 1);
}
//remove product from basket
echo "<b>Total Cost:</b> \$" . TotalCost() . "<br />";
//show total cost
foreach ($_SESSION['basket'] as $value) {
    //render product in basket
    BasketProductRender(FindProduct($value));
}
?>
							<br/>
							<input type="hidden" id="addItem" name = "addItem" value = "" />
							<input type="hidden" id="removeItem" name = "removeItem" value = "" />
						</content>
						<loading image="<?php 
echo $KoolControlsFolder;
Exemple #2
0
			<div class="indent indent_right topspacing bottomspacing" style = "width:300px; float:left; border:2px #333 dotted">
			<h3>Products</h3> 
			<?php
				foreach ($products as $key => $value) //render product
					ProductRender($products[$key]);
			?>
			</div>
			
			<div style = "width:300px; margin-left:20px; float:left; border:2px #333 dotted">
			<h3>My Basket</h3><br />
				<?php echo KoolScripting::Start();?>
					<updatepanel id="basket">
						<content>
							<?php
							if (isset($_POST['addItem']) && $_POST['addItem'] != "") $_SESSION['basket'][] = $_POST['addItem']; //add product to basket
							if (isset($_POST['removeItem']) && $_POST['removeItem'] != "") array_splice($_SESSION['basket'],FindBasket($_POST['removeItem']),1); //remove product from basket
							
							echo "<b>Total Cost:</b> $".TotalCost()."<br />"; //show total cost
							foreach ($_SESSION['basket'] as $value) //render product in basket
								BasketProductRender(FindProduct($value));
							?>
							<br/>
							<input type="hidden" id="addItem" name = "addItem" value = "" />
							<input type="hidden" id="removeItem" name = "removeItem" value = "" />
						</content>
						<loading image="<?php echo $KoolControlsFolder ?>/KoolAjax/loading/5.gif" />
					</updatepanel>
				<?php echo KoolScripting::End();?>
			</div>
			<br style="clear:both" />
</div>