HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/molen.komma.pro/wwwroot/kms/bestelling_overzicht.php
<?php

$filter = $_GET['filter'];
$filter = checkData($filter);

$maand = $_GET['maand'];
$maand = checkData($maand);

if($filter != "verzenden" && $filter != "ophalen" && $filter != "geannuleerd"){
	if(empty($maand)){
		if($filter == date('Y')){
			$maand = date('m');
		}else{
			$maand = "01";
		}
	}
}

if(empty($filter)){
	$omschrijving = "openstaand";
	$q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht, kms_orders.verzendkosten, kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.datum, kms_orders.status FROM kms_orders WHERE kms_orders.status = 'wacht op betaling' OR kms_orders.betaald = 'no' AND kms_orders.status != 'geannuleerd' ORDER BY kms_orders.datum, kms_orders.ordernummer ASC";
}else if($filter == "verzenden"){
	$omschrijving = "te verzenden";
	$q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht, kms_orders.verzendkosten, kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.datum, kms_orders.status FROM kms_orders WHERE kms_orders.status = 'wacht op verzending' ORDER BY kms_orders.datum, kms_orders.ordernummer ASC";
}else if($filter == "ophalen"){
	$omschrijving = "op te halen";
	$q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht, kms_orders.verzendkosten, kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.datum, kms_orders.status FROM kms_orders WHERE kms_orders.status = 'nog op te halen' ORDER BY kms_orders.datum, kms_orders.ordernummer ASC";
}else if($filter == "geannuleerd"){
    $omschrijving = "geannuleerd";
    $q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht, kms_orders.verzendkosten, kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.datum, kms_orders.status FROM kms_orders WHERE kms_orders.status = 'geannuleerd' ORDER BY kms_orders.datum, kms_orders.ordernummer ASC";
}else{
	$omschrijving = $maand."-".$filter;
	$q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht, kms_orders.verzendkosten, kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.datum, kms_orders.status FROM kms_orders WHERE YEAR(kms_orders.datum) = ".$filter." AND MONTH(kms_orders.datum) = ".$maand." AND (kms_orders.betaald = 'yes' AND kms_orders.status = 'voltooid') ORDER BY kms_orders.datum, kms_orders.ordernummer ASC";
}

?>


<h1>Bestellingen</h1>
<br />
<a href="index.php?p=bestelling_overzicht" <?php if(empty($filter)){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> >Openstaand</a> | <a href="index.php?p=bestelling_overzicht&amp;filter=verzenden" <?php if($filter == "verzenden"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> >Te verzenden</a> | <a href="index.php?p=bestelling_overzicht&amp;filter=ophalen" <?php if($filter == "ophalen"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> >Op te halen</a> | <a href="index.php?p=bestelling_overzicht&amp;filter=geannuleerd" <?php if($filter == "geannuleerd"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> >Geannuleerd</a>

<?php 

	$ditJaar = date('Y');
	
	$aantalJaar = $ditJaar - 2013;
	for($j = 0; $j <= $aantalJaar; $j++){ 
		$jaartal = 2013 + $j;
	?>
    
    | <a <?php if($filter == $jaartal){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($jaartal); ?>">Verwerkt <?php echo($jaartal); ?></a>
    
    <?php } ?>


    <br /><br />
    
    <?php if(!empty($filter) && $filter != "verzenden" && $filter != "ophalen" && $filter != "geannuleerd"){ ?>
    
    	<a <?php if($maand == "01"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=01">januari</a> | 
        <a <?php if($maand == "02"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=02">februari</a> |
        <a <?php if($maand == "03"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=03">maart</a> |
        <a <?php if($maand == "04"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=04">april</a> |
        <a <?php if($maand == "05"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=05">mei</a> |
        <a <?php if($maand == "06"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=06">juni</a> |
        <a <?php if($maand == "07"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=07">juli</a> |
        <a <?php if($maand == "08"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=08">augustus</a> |
        <a <?php if($maand == "09"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=09">september</a> |
        <a <?php if($maand == "10"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=10">oktober</a> |
        <a <?php if($maand == "11"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=11">november</a> |
        <a <?php if($maand == "12"){ echo("style=\"text-decoration:none; font-weight:bold;\""); } ?> href="index.php?p=bestelling_overzicht&amp;filter=<?php echo($filter); ?>&amp;maand=12">december</a>
    
    <?php } ?>
    
    
<br /><br /><br />
<table cellpadding="20" cellspacing="0" border="0">
    <tr height="40">
    	<th width="20"></th>
        <th width="110">Datum</th>
        <th width="100">Ordernr</th>
        <th width="220">Besteller</th>
        <th width="100">Totaalprijs</th>
        <th width="110">Verzendwijze</th>
        <th width="70">Betaald</th>
        <th width="150">Status</th>
        <th width="90">Meer info</th>
    </tr>

<?php
	
	$r_nieuws = mysql_query($q_nieuws);
	
	$kleur = true;
 	$totaalprijs = 0;
    $verzendkosten = 0;
    $betaald = 0;
    $openstaand = 0;
	
	while($rec_nieuws = mysql_fetch_assoc($r_nieuws)){ 
	
	$totaalprijs = $totaalprijs + $rec_nieuws['totaalprijs'];
	$verzendkosten = $verzendkosten + $rec_nieuws['verzendkosten'];
	
	if($rec_nieuws['betaald'] == "yes"){
		$betaald = $betaald + $rec_nieuws['totaalprijs'];
	}else{
		$openstaand = $openstaand + $rec_nieuws['totaalprijs'];
	}
	
	?>
        <tr height="40" <?php if($kleur) { echo("style=\"background-color:#eee\""); $kleur = false; }else{ $kleur = true; }?>>
            <td>&nbsp;</td>
				<td><?php echo(date_dutch($rec_nieuws['datum'])); ?></td>
            <td><?php echo(html_entity_decode($rec_nieuws['ordernummer'])); ?></td>
            <td><?php if($rec_nieuws['geslacht'] == "man"){ echo("Dhr. "); }else{ echo("Mevr. "); } echo(html_entity_decode($rec_nieuws['voornaam'])." "); if(!empty($rec_nieuws['tussenvoegsel'])){ echo(html_entity_decode($rec_nieuws['tussenvoegsel']." ")); } echo(html_entity_decode($rec_nieuws['achternaam'])); ?></td>
            <td><?php echo("&euro; ".str_replace('.',',',formatPrice($rec_nieuws['totaalprijs']))); ?></td>
            
            <td><?php echo(html_entity_decode($rec_nieuws['verzendwijze'])); ?></td>
            
            <td><?php if($rec_nieuws['betaald'] == "yes"){ echo("ja"); }else{ echo("nee"); } ?> </td>
            
            <td><?php echo($rec_nieuws['status']); ?> </td>
            
            <td><a href="index.php?p=bestelling_info&amp;order_id=<?php echo($rec_nieuws['order_id']); ?>&amp;filter=<?php echo($filter);?>&amp;maand=<?php echo($maand); ?>">Meer info &gt;</a></td>
        </tr>
<?php } ?>

</table>

<br /><br />

<table cellpadding="20" cellspacing="0" border="0">
    <tr height="40">
    	<th width="20"></th>
        <th width="100">Totaal</th>
        <th width="220">Omschrijving</th>
        <th width="150">Totaalprijs</th>
        <th width="150">Verzendkosten</th>
        <th width="150">Betaald</th>
        <th width="150">Openstaand</th>
        <th width="20"></th>
        <th width="10"></th>
    </tr>
    <tr height="40" style="background-color:#eee">
        <td>&nbsp;</td>
        <td>Totaal</td>
        <td><strong><?php echo($omschrijving); ?></strong></td>
        <td><?php echo("&euro; ".str_replace('.',',',formatPrice($totaalprijs))); ?></td>
        <td><?php echo("&euro; ".str_replace('.',',',formatPrice($verzendkosten))); ?></td>
        <td><?php echo("&euro; ".str_replace('.',',',formatPrice($betaald))); ?></td>
        <td><?php echo("&euro; ".str_replace('.',',',formatPrice($openstaand))); ?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>        
    </tr>
    
</table>