File: D:/HostingSpaces/SBogers10/molen.komma.pro/wwwroot/kms/bestelling_info.php
<?php
$order_id = $_GET['order_id'];
$order_id = checkData($order_id);
$filter = $_GET['filter'];
$filter = checkData($filter);
$maand = $_GET['maand'];
$maand = checkData($maand);
$q_nieuws = "SELECT kms_orders.order_id, kms_orders.ordernummer, kms_orders.bedrijfsnaam, kms_orders.voornaam, kms_orders.tussenvoegsel, kms_orders.achternaam, kms_orders.geslacht,
kms_orders.emailadres, kms_orders.telefoonnummer, kms_orders.straatnaam, kms_orders.huisnummer, kms_orders.toevoeging, kms_orders.postcode, kms_orders.woonplaats, kms_orders.land,
kms_orders.bezorgadresWijktAf, kms_orders.bedrijfsnaamBezorg, kms_orders.voornaamBezorg, kms_orders.tussenvoegselBezorg, kms_orders.achternaamBezorg, kms_orders.geslachtBezorg,
kms_orders.straatnaamBezorg, kms_orders.huisnummerBezorg, kms_orders.toevoegingBezorg, kms_orders.postcodeBezorg, kms_orders.woonplaatsBezorg, kms_orders.landBezorg, kms_orders.subtotaalprijs, kms_orders.verzendkosten,
kms_orders.totaalprijs, kms_orders.verzendwijze, kms_orders.betaald, kms_orders.status, kms_orders.afleverdatum, kms_orders.parcel_id, kms_orders.datum, kms_orders.tijd FROM kms_orders WHERE kms_orders.order_id = '".$order_id."'";
$r_nieuws = mysql_query($q_nieuws);
$rec_nieuws = mysql_fetch_assoc($r_nieuws);
?>
<?php if($rec_nieuws['status'] != "geannuleerd" && $rec_nieuws['status'] != "voltooid" ){ ?>
<?php if($rec_nieuws['betaald'] == "no"){ ?>
<a class="submit_knop" href="index.php?p=bestelling_wijzigen&status=betaald&order_id=<?php echo($order_id);?>&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Betaald">Betaald</a>
<?php } ?>
<?php if($rec_nieuws['status'] != "verzonden" && empty($rec_nieuws['parcel_id']) && $rec_nieuws['verzendwijze'] == "bezorgen" ){ ?>
<a class="submit_knop" href="index.php?p=bestelling_verzending_aanmaken&status=verzonden&order_id=<?php echo($order_id);?>&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Zending aanmaken">Zending aanmaken</a>
<?php } ?>
<?php if($rec_nieuws['status'] != "verzonden" && !empty($rec_nieuws['parcel_id']) && $rec_nieuws['verzendwijze'] == "bezorgen" ){ ?>
<a class="submit_knop" target="_blank" href="/kms/bestelling_label_printen.php?parcel_id=<?php echo($rec_nieuws['parcel_id']);?>" title="Label printen">Label printen</a>
<?php } ?>
<?php if($rec_nieuws['status'] != "verzonden" && !empty($rec_nieuws['parcel_id']) && $rec_nieuws['verzendwijze'] == "bezorgen" ){ ?>
<a class="submit_knop" href="index.php?p=bestelling_wijzigen&status=verzonden&order_id=<?php echo($order_id);?>&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Verzonden">Verzonden</a>
<?php } ?>
<?php if($rec_nieuws['status'] != "opgehaald" && $rec_nieuws['verzendwijze'] == "ophalen" ){ ?>
<a class="submit_knop" href="index.php?p=bestelling_wijzigen&status=opgehaald&order_id=<?php echo($order_id);?>&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Opgehaald">Opgehaald</a>
<?php } ?>
<?php if($rec_nieuws['status'] != "verzonden" && $rec_nieuws['status'] != "geannuleerd"){ ?>
<a class="submit_knop" href="index.php?p=bestelling_wijzigen&status=geannuleerd&order_id=<?php echo($order_id);?>&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Geannuleerd">Geannuleerd</a>
<?php } ?>
<?php } ?>
<a class="submit_knop" target="_blank" href="bestelling_factuur.php?order_id=<?php echo($order_id);?>" title="Factuur">Factuur</a>
<a class="submit_knop" target="_blank" href="bestelling_pakbon.php?order_id=<?php echo($order_id);?>" title="Pakbon">Pakbon</a>
<br /><br /><br /><br /><br />
<h1>Gegevens bestelling <?php echo(html_entity_decode($rec_nieuws['ordernummer'])); ?></h1>
<p><br /><a href="index.php?p=bestelling_overzicht&filter=<?php echo($filter);?>&maand=<?php echo($maand); ?>" title="Bestellingen">< Terug naar het overzicht</a></p><br />
<div class="columnLeft">
<strong>Besteller:</strong> <?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'])); ?><br /><br />
<strong>Telefoonnumer:</strong> <?php echo(html_entity_decode($rec_nieuws['telefoonnummer'])); ?><br />
<strong>E-mailadres:</strong> <a href="mailto:<?php echo(html_entity_decode($rec_nieuws['emailadres'])); ?>"><?php echo(html_entity_decode($rec_nieuws['emailadres'])); ?></a><br /><br />
<strong>Factuuradres:</strong><br />
<?php if(!empty($rec_nieuws['bedrijfsnaam'])){ echo(html_entity_decode($rec_nieuws['bedrijfsnaam'])); ?><br /><?php } ?>
<?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'])); ?><br />
<?php echo(html_entity_decode($rec_nieuws['straatnaam']." ")); echo(html_entity_decode($rec_nieuws['huisnummer'])); echo(html_entity_decode($rec_nieuws['toevoeging']));?><br />
<?php echo(html_entity_decode($rec_nieuws['postcode']." ")); echo(html_entity_decode($rec_nieuws['woonplaats'])); ?><br />
<?php echo(html_entity_decode($rec_nieuws['land'])); ?><br /><br />
<?php if($rec_nieuws['bezorgadresWijktAf'] == "yes"){ ?>
<strong>Bezorgadres:</strong><br />
<?php if(!empty($rec_nieuws['bedrijfsnaamBezorg'])){ echo(html_entity_decode($rec_nieuws['bedrijfsnaamBezorg'])); ?><br /><?php } ?>
<?php if($rec_nieuws['geslachtBezorg'] == "man"){ echo("Dhr. "); }else{ echo("Mevr. "); } echo(html_entity_decode($rec_nieuws['voornaamBezorg'])." "); if(!empty($rec_nieuws['tussenvoegselBezorg'])){ echo(html_entity_decode($rec_nieuws['tussenvoegselBezorg']." ")); } echo(html_entity_decode($rec_nieuws['achternaamBezorg'])); ?><br />
<?php echo(html_entity_decode($rec_nieuws['straatnaamBezorg']." ")); echo(html_entity_decode($rec_nieuws['huisnummerBezorg'])); echo(html_entity_decode($rec_nieuws['toevoegingBezorg'])); ?><br />
<?php echo(html_entity_decode($rec_nieuws['postcodeBezorg']." ")); echo(html_entity_decode($rec_nieuws['woonplaatsBezorg'])); ?><br />
<?php echo(html_entity_decode($rec_nieuws['landBezorg'])); ?><br /><br />
<?php } ?>
</div>
<div class="columnRight">
<strong>Ordernummer:</strong> <?php echo(html_entity_decode($rec_nieuws['ordernummer'])); ?> <br /><br />
<strong>Verzendkosten:</strong> <?php echo("€ ".html_entity_decode(str_replace('.',',',formatPrice($rec_nieuws['verzendkosten'])))); ?><br />
<strong>Subtotaalprijs:</strong> <?php echo("€ ".html_entity_decode(str_replace('.',',',formatPrice($rec_nieuws['subtotaalprijs'])))); ?><br /><br />
<strong>Totaalprijs:</strong> <?php echo("€ ".html_entity_decode(str_replace('.',',',formatPrice($rec_nieuws['totaalprijs'])))); ?><br /><br />
<strong>Verzendwijze:</strong> <?php echo(html_entity_decode($rec_nieuws['verzendwijze'])); ?><br />
<?php if($rec_nieuws['verzendwijze'] == "bezorgen"){ ?>
<strong>Verzonden op:</strong> <?php echo(date_dutch($rec_nieuws['afleverdatum'])); ?><br /><br />
<?php }else{ ?>
<strong>Opgehaald op:</strong> <?php echo(date_dutch($rec_nieuws['afleverdatum'])); ?><br /><br />
<?php } ?>
<strong>Betaald:</strong> <?php if($rec_nieuws['betaald'] == "yes"){ echo("ja"); }else{ echo("nee"); } ?><br />
<strong>Status:</strong> <?php echo($rec_nieuws['status']); ?><br /><br />
<strong>Datum:</strong> <?php echo(date_dutch($rec_nieuws['datum'])); ?> <br />
<strong>Tijd:</strong> <?php echo($rec_nieuws['tijd']); ?><br /><br />
</div>
<div class="clear_both"></div>
<br /><br />
<h1>Bestelde artikelen</h1>
<table cellpadding="20" cellspacing="0" border="0">
<tr height="40">
<th style="padding-left: 20px;" width="200">Naam</th>
<th width="140">Artikelnr</th>
<th width="140">Prijs</th>
<th width="160">Gewicht</th>
<th width="160">Aantal stuks</th>
</tr>
<?php
$q_order_articles = "SELECT kms_orders_articles.article_id, kms_orders_articles.naam, kms_orders_articles.artikelnummer, kms_orders_articles.categorie_id, kms_orders_articles.prijs, kms_orders_articles.order_aantal, kms_orders_articles.gewicht FROM kms_orders_articles WHERE kms_orders_articles.order_id = '".$order_id."' ORDER BY kms_orders_articles.naam ASC";
$r_order_articles = mysql_query($q_order_articles);
$kleur = true;
while($rec_order_articles = mysql_fetch_assoc($r_order_articles)){ ?>
<tr height="90" <?php if($kleur) { echo("style=\"background-color:#eee\""); $kleur = false; }else{ $kleur = true; }?>>
<td style="padding-left: 20px;"><?php echo(html_entity_decode($rec_order_articles['naam'])); ?></td>
<td><?php echo(html_entity_decode($rec_order_articles['artikelnummer'])); ?></td>
<td>€ <?php echo(html_entity_decode(str_replace('.',',',$rec_order_articles['prijs']))); ?></td>
<td><?php echo(html_entity_decode($rec_order_articles['gewicht'])); ?> kg</td>
<td><?php echo(html_entity_decode($rec_order_articles['order_aantal'])); ?>
<?php if($rec_order_articles['order_aantal'] > 1){ echo(" stuks"); }else{ echo(" stuk"); } ?>
</td>
<?php /* <td>
<?php
$q_categorie = sprintf("SELECT kms_categories.categorie_name FROM kms_categories WHERE categorie_id='%s'", $rec_order_articles['categorie_id']);
$r_categorie = mysql_query($q_categorie);
$rec_categorie = mysql_fetch_assoc($r_categorie);
$categorie_naam = $rec_categorie['categorie_name'];
echo(html_entity_decode($categorie_naam));
?>
</td>
<?php */ ?>
</tr>
<?php } ?>
</table>