include"include/db_connect.php";
include"admin/include/functions.php";
include"include/functions.php";
$i=1;
$count=0;
while($i<=$_SESSION['bestellingcounter']){
if($_SESSION['active'][$i]=="yes"){
$count++;
}
$i++;
}
if($count==0){
$_SESSION['bestellingcounter']=0;
}
if($_GET['bc']=="1"){
if(!isset($_SESSION['bestellingcounter'])){
$_SESSION['bestellingcounter']=0;
}
$randcheck=0;
$i=1;
$rand=$_GET['rand'];
while($i<=$_SESSION['bestellingcounter']){
if($rand==$_SESSION['rand'][$i]){
$randcheck=1;
}
$i++;
}
if($randcheck==0){
//variabelen
$_SESSION['bestellingcounter'] = $_SESSION['bestellingcounter']+1;
$c=$_SESSION['bestellingcounter'];
$_SESSION['mvc'][$c]=$_GET['mvc'];
$_SESSION['p'][$c]=$_GET['p'];
$_SESSION['active'][$c]="yes";
$_SESSION['px'][$c]=$_GET['px'];
$_SESSION['rand'][$c]=$_GET['rand'];
//bedrukkingen
$i=0;
$_SESSION['bpc'][$c]=$_GET['bpc'];
while($i<$_GET['bpc']){
$_SESSION['bp'.$i][$c] = $_GET['bp'.$i];
$_SESSION['bk'.$i][$c] = $_GET['bk'.$i];
$i++;
}
$i=1;
//kleuren maten aantallen
while($i<$_GET['mvc']){
if(isset($_GET['k'.$i])){
$_SESSION['k'.$i][$c] = $_GET['k'.$i];
$_SESSION['kc'.$i][$c] = $_GET['kc'.$i];
$j=0;
while($j<$_GET['kc'.$i]){
if(isset($_GET['ma'.$i.'_'.$j])){
$_SESSION['ma'.$i.'_'.$j][$c]=$_GET['ma'.$i.'_'.$j];
$_SESSION['mv'.$i.'_'.$j][$c]=$_GET['mv'.$i.'_'.$j];
}
$j++;
}
}
$i++;
}
}
}
?>
t-shirts.be
$i=0;
$j=0;
while($i<=$_SESSION['bestellingcounter']){
if($_SESSION['active'][$i]=="yes"){
$j++;
}
$i++;
}
if($j==0){
echo"";
echo"";
}else{
echo "";
$i=0;
$j=0;
while($i <= $_SESSION['bestellingcounter']){
if($_SESSION['active'][$i]=="yes"){
$j++;
}
$i++;
}
if($j>1){
echo $j." bestellingen in winkelkar
";
}else{
echo $j." bestelling in winkelkar";
}
echo "totaal: ";
$i=0;
$totaalprijs=0;
while($i<=$_SESSION['bestellingcounter']){
if($_SESSION['active'][$i]=="yes"){
$totaalprijs = $totaalprijs + $_SESSION['px'][$i];
}
$i++;
}
echo "€ ".komma($totaalprijs+(instelkostmultiplier()*$_SESSION['instelkost'])*1.21)."
";
$_SESSION['totaalprijs']=($totaalprijs+(instelkostmultiplier()*$_SESSION['instelkost']*1.21));
}
//checkup
/*
$i=0;
while($i<=$_SESSION['bestellingcounter']){
if($_SESSION['active'][$i]=="yes"){
echo $_SESSION['bestellingcounter']."
";
echo $_SESSION['mvc'][$i]."
";
echo $_SESSION['p'][$i]."
";
echo $_SESSION['active'][$i]."
";
echo $_SESSION['px'][$i]."
";
echo $_SESSION['rand'][$i]."
";
//bedrukkingen
$j=0;
echo $_SESSION['bpc'][$i]."
";
while($j<$_SESSION['bpc'][$i]){
echo "plaats bedrukking: ".$_SESSION['bp'.$j][$i]."
";
echo "aantal kleurenbedrukking: ".$_SESSION['bk'.$j][$i]."
";
$j++;
}
$j=1;
//kleuren maten aantallen
while($j<$_SESSION['mvc'][$i]){
echo $_SESSION['k'.$j][$i]."
";
echo $_SESSION['kc'.$j][$i]."
";
$k=0;
while($k<$_SESSION['kc'.$j][$i]){
echo $_SESSION['ma'.$j.'_'.$k][$i]."
";
echo $_SESSION['mv'.$j.'_'.$k][$i]."
";
$k++;
}
$j++;
}
}
echo"
";
$i++;
}
*/
?>