<?php
// Include MySQL class
require_once('inc/mysql.class.php');
// Include database connection
require_once('inc/globaltype.inc.php');
// Include functions
require_once('inc/functionstype.inc.php');
// Start the session
session_start();
// Process actions
$cart1 = $_SESSION['cart1'];
$action = $_GET['action'];
switch ($action) {
case 'add':
if ($cart1) {
$cart1 .= ','.$_GET['id'];
} else {
$cart1 = $_GET['id'];
}
break;
case 'delete':
if ($cart1) {
$items = explode(',',$cart1);
$newcart1 = '';
foreach ($items as $item) {
if ($_GET['id'] != $item) {
if ($newcart1 != '') {
$newcart1 .= ','.$item;
} else {
$newcart1 = $item;
}
}
}
$cart1 = $newcart1;
}
break;
case 'update':
if ($cart1) {
$newcart1 = '';
foreach ($_POST as $key=>$value) {
if (stristr($key,'qty')) {
$id = str_replace('qty','',$key);
$items = ($newcart1 != '') ? explode(',',$newcart1) : explode(',',$cart1);
$newcart1 = '';
foreach ($items as $item) {
if ($id != $item) {
if ($newcart1 != '') {
$newcart1 .= ','.$item;
} else {
$newcart1 = $item;
}
}
}
for ($i=1;$i<=$value;$i++) {
if ($newcart1 != '') {
$newcart1 .= ','.$id;
} else {
$newcart1 = $id;
}
}
}
}
}
$cart1 = $newcart1;
break;
}
$_SESSION['cart1'] = $cart1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MultiWerkplaatsHJ</title>
<style type="text/css">
body {
background-image: url(Images/background.png);
background-repeat: no-repeat;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-attachment: scroll;
background-position: top center;
}
.cushycms {
height: 603px;
width: 503px;
position: relative;
font-family: "Times New Roman", Times, serif;
font-style: normal;
line-height: normal;
font-weight: normal;
}
.cushycms h1 {
font-size: 24px;
}
.cushycms {
font-size: 14px;
position: relative;
padding-top: 80px;
padding-bottom: 80px;
padding-left: 0px;
width: 820px;
}
</style>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body onload="MM_preloadImages('Images/homeb2.png','Images/processenb2.png','Images/productenb2.png','Images/overonsb2.png','Images/contactb2.png')">
<div align="center">
<p><img src="Images/Header.png" alt="" name="Header" width="886" height="181" hspace="0" vspace="0" border="0" align="middle" /></p>
</div>
<div align="center"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Homeb','','Images/homeb2.png',1)"><img src="Images/homeb.png" alt="Home" name="Homeb" width="180" height="53" border="0" id="Homeb" /></a><a href="Producten.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Processen','','Images/productenb2.png',1)"><img src="Images/productenb.png" alt="Processen" name="Processen" width="178" height="53" border="0" id="Processen" /></a><a href="Overons.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Producten','','Images/overonsb2.png',1)"><img src="Images/overonsb.png" alt="Producten" name="Producten" width="178" height="53" border="0" id="Producten" /></a><a href="Contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('OverOns','','Images/contactb2.png',1)"><img src="Images/contactb.png" name="OverOns" width="178" height="53" border="0" id="OverOns" /></a><a href="Inloggen.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Contact','','Images/Inloggenb2.png',1)"><img src="Images/Inloggenb.png" alt="Contact" name="Contact" width="180" height="53" border="0" id="Contact" /></a> </div>
<div style="word-spacing: normal; letter-spacing: normal; color: #000; line-height: normal; font-style: normal; font-size: 18px; font-family: 'Times New Roman', Times, serif; position: relative; background-position: top center; background-repeat: no-repeat; background-attachment: scroll; background-image:url(Images/SpaceAchter.png); font-weight: bold;" align="center" title="Welkom">
<div class="cushycms">
<?php
echo writeShoppingCart1();
?>
<table width="800px">
<tr>
<td width="50px"> </td>
<td width="100px"><h4>Productnummer<h4></td>
<td width="100px"><h4>Omschrijving<h4></td>
<td width="100px"><h4>Text op Plaat<h4></td>
<td width="80px"><h4>Revisie<h4></td>
<td width="80px"><h4>Serien Nummer<h4></td>
<td width="80px"><h4>Aantal<h4></td>
</table>
<?php
$text = $_POST['text'];
$rev = $_POST['rev'];
$serie = $_POST['serie'];
echo showCart1();
?>
<form action="bestellentype.php" method="get">
<input type="submit" id="button1" name="button1" value="Bevestig bestelling!"/>
</form>
<p><a href="Succes.php">Bestel nog een product</a></p>
</div>
</div>
</body>
</html>