<?php if ($_SESSION['GroepID'] > 1) { ?> <a href="index.php?c=nieuwsitem&p=list" class="button">Lijstweergave</a> <a href="index.php?c=nieuwsitem&p=add" class="button">Nieuwsitem aanmaken</a><br /><br /> <?php } if (!defined('isIncluded')) { header('location: index.php'); } if (!empty($_GET['id'])) { $nieuwsitem = Nieuwsitem::get($_GET['id']); $gebruiker = Gebruiker::get($nieuwsitem->getProperty('OntvangerID')); if ($nieuwsitem->getProperty('AuteurID') == $_SESSION['GebruikerID']) { ?> <table class="list"> <tr> <th>#</th> <td><?php echo $nieuwsitem->getProperty('NieuwsitemID'); ?> </td> </tr> <tr> <th>Datum</th> <td><?php echo $nieuwsitem->getProperty('Datum'); ?> </td>
echo $bedrijf->getProperty('Postcode'); ?> <br /></td></tr> <tr><td>Vestigingsplaats:</td><td> <?php echo $bedrijf->getProperty('Vestigingsplaats'); ?> <br /></td></tr> <tr><td>Email:</td><td> <?php echo $bedrijf->getProperty('Email'); ?> <br /></td></tr> </dd> <?php if ($_SESSION['GroepID'] == 2) { $groothandel = Gebruiker::get($gebruiker->getProperty('Aanmaker')); $bedrijf = Bedrijf::get($groothandel->getProperty('BedrijfID')); ?> </table> <dt style=" background-color: green; color:white">Leverancier gegevens</dt> <dd> <table style=" margin-top: 10px"> <tr><td>Bedrijfsnaam:</td><td> <?php echo $bedrijf->getProperty('Bedrijfsnaam'); ?> <br /></td></tr> <tr><td>Adres:</td><td> <?php echo $bedrijf->getProperty('Straat') . ' ' . $bedrijf->getProperty('Huisnummer') . $bedrijf->getProperty('HuisnummerToevoeging'); ?> <br /></td></tr>
}); oTable = $('#table2').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); }); </script> <a href="index.php?c=bedrijf&p=list" class="button">Lijstweergave</a> <a href="index.php?c=bedrijf&p=add" class="button">Bedrijf aanmaken</a> <a href="index.php?c=product&p=bedrijfkoppel" class="button">Producten koppelen</a><br /><br /> <?php if (!defined('isIncluded') || $_SESSION['GroepID'] != 3 || empty($_GET['id'])) { header('location: index.php'); } $gebruiker = Gebruiker::get($_GET['id']); $betaalMethode = $gebruiker->getProperty("BetaalMethode"); if (!empty($gebruiker)) { ?> <h3>Bedrijf informatie</h3> <table cellpadding="0" cellspacing="0" border="0" class="display" id="table1"> <thead> <tr> <th>#</th> <th>Bedrijfsnaam</th> <th>Budget</th> <th>Email</th> </tr> </thead> <?php $budget = $betaalMethode == "punten" ? $gebruiker->getProperty('Budget') . " ptn." : " € " . $gebruiker->getProperty('Budget');
</div> <table class="list"> <tr> <th>#</th> <th>Groothandel</th> <th>Productlijst</th> </tr> <tr> <td><?php echo $gebruiker_productlijst->getProperty('Gebruiker_ProductlijstID'); ?> </td> <td><?php echo Bedrijf::get(Gebruiker::get($gebruiker_productlijst->getProperty('GebruikerID'))->getProperty('BedrijfID'))->getProperty('Bedrijfsnaam'); ?> </td> <td><?php echo Productlijst::get($gebruiker_productlijst->getProperty('ProductlijstID'))->getProperty('Naam'); ?> </td> </tr> </table> <form name="frmDelete" method="POST"> <input type="submit" name="submit" class="button" value="Ontkoppelen" /> </form><br /> <?php } else { ?>
<th>Bedrijfnr</th> <th>Bedrijfsnaam</th> <th>Artikelnr</th> <th>Artikelnaam</th> <th>Aantal</th> <th>Verkoopprijs</th> <th>Totaal</th> <th>Datum</th> </tr> </thead> <tbody> <?php if ($db->query($sql)) { foreach ($db->query($sql) as $row) { $gebruiker = Gebruiker::get($row['GebruikerID']); $bedrijf = Bedrijf::get($gebruiker->getProperty('BedrijfID')); $product = Product::get($row['ProductID']); $strPrint .= '<tr> <td>' . $bedrijf->getProperty('BedrijfID') . '</td> <td>' . $bedrijf->getProperty('Bedrijfsnaam') . '</td> <td>' . $product->getProperty('Artikelnummer') . '</td> <td>' . $product->getProperty('Artikelnaam') . '</td> <td>' . $row['Aantal'] . '</td> <td>' . $row['Verkoopprijs'] . '</td> <td>' . $row['Totaalprijs'] . '</td> <td>' . $row['Datum'] . '</td> </tr>'; ?> <tr> <td><?php
<?php if (!defined('isIncluded') || $_SESSION['GroepID'] != 1) { header('location: index.php'); } $gebruiker = Gebruiker::get($_SESSION['GebruikerID']); // $gebruikerCash = $gebruiker->getProperty("Budget"); $puntenKoers = $gebruiker->getProperty("PuntenKoers"); $betaalMethode = $gebruiker->getProperty("BetaalMethode"); $totaalPuntenOfEuros = $betaalMethode == "punten" ? $gebruikerCash . " ptn." : " € " . $gebruikerCash; echo "<span style=\"font-size:14px; color:gray;\">Uw huidige budget is: " . $totaalPuntenOfEuros . "</span>"; ?> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { oTable = $('#table').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); }); </script> <form name="productList" method="post" action="index.php?c=product&p=winkelwagen"> <div id="demo"> <table cellpadding="0" cellspacing="0" border="0" class="display" id="table"> <thead> <tr> <th>Artikelnaam</th> <th>Kleur</th> <th>Maat</th> <th>Omschrijving</th>
?> </td> <td><?php echo $nieuwsitem->getProperty('Titel'); ?> </td> <td><?php echo substr($nieuwsitem->getProperty('Bericht'), 0, 25); ?> ...</td> <td><?php echo $nieuwsitem->getProperty('Datum'); ?> </td> <td><?php echo Bedrijf::get(Gebruiker::get($nieuwsitem->getProperty('OntvangerID'))->getProperty('BedrijfID'))->getProperty('Bedrijfsnaam'); ?> </td> <td> <a href='index.php?c=nieuwsitem&p=delete&id=<?php echo $nieuwsitem->getProperty('NieuwsitemID'); ?> '><img src='tpl/img/delete-icon.png' alt='verwijderen' title="verwijderen"/></a> <a href='index.php?c=nieuwsitem&p=edit&id=<?php echo $nieuwsitem->getProperty('NieuwsitemID'); ?> '><img src='tpl/img/edit-icon.png' alt='wijzigen' title="wijzigen"/></a> <a href='index.php?c=nieuwsitem&p=single&id=<?php echo $nieuwsitem->getProperty('NieuwsitemID'); ?> '><img src='tpl/img/view-icon.png' alt='bekijken' title="bekijken"/></a>
$sth = $db->prepare("INSERT INTO bestelling_product (BestellingID, ProductID, Aantal, Verkoopprijs, Totaalprijs) VALUES (:lastid, :ProductID, :Aantal, :Verkoopprijs, :Totaalprijs)"); $sth->bindParam(":lastid", $lastInsertId); $sth->bindParam(":ProductID", $productid); $sth->bindParam(":Aantal", $aantal); $sth->bindParam(":Verkoopprijs", $VerkoopPrijs); $sth->bindParam(":Totaalprijs", $Totaal); $sth->execute(); } $gebruiker = Gebruiker::get($_SESSION['GebruikerID']); $gebruikerCash = $gebruiker->getProperty("Budget"); $eindCash = $gebruikerCash - $_SESSION['Winkelwagen']['Totaal']; $cash = array('Budget' => $eindCash); $gebruiker->update($cash); $properties_values = array('Datum' => curDate(), 'Titel' => 'Nieuwe bestelling', 'Bericht' => 'Bestelling door de heer/mevrouw ' . substr(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Voornaam'), 0, 1) . '. ' . Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Achternaam'), 'OntvangerID' => Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Aanmaker'), 'AuteurID' => $_SESSION['GebruikerID']); Nieuwsitem::create($properties_values); $properties_values = array('Datum' => curDate(), 'Titel' => 'Nieuwe bestelling', 'Bericht' => 'Bestelling door de heer/mevrouw ' . substr(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Voornaam'), 0, 1) . '. ' . Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Achternaam'), 'OntvangerID' => Gebruiker::get(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Aanmaker'))->getProperty('Aanmaker'), 'AuteurID' => $_SESSION['GebruikerID']); Nieuwsitem::create($properties_values); unset($_SESSION['Winkelwagen']); header("location: index.php?c=product&p=winkelwagen&success=true"); } else { if (isset($_POST['table_length'])) { if (!isset($_POST['submit'])) { unset($_POST['table_length']); foreach ($_POST as $key => $value) { $_SESSION['Winkelwagen'][$key]['Aantal'] = $value; } } } } if (isset($_POST['submit'])) { unset($_POST['example_length']);
<thead> <tr> <th>Artikelnummer</th> <th>Artikelnaam</th> <th>Kleur</th> <th>Maat</th> <th>Afbeelding</th> <th>Verkoopprijs</th> <th>Aantal</th> <th>Subtotaal</th> </tr> </thead> <tbody> <?php $gebruiker = Gebruiker::get(Bestelling::get($_GET['id'])->getProperty("GebruikerID")); $BetaalMethode = $gebruiker->getProperty("BetaalMethode"); $Koers = $gebruiker->getProperty("PuntenKoers"); $startBedrag = $gebruiker->getProperty("Budget"); global $db; $sth = $db->prepare("SELECT product.* FROM bestelling_product JOIN product ON (bestelling_product.ProductID=product.ProductID) WHERE bestelling_product.BestellingID = :bestellingid"); $sth->bindParam(":bestellingid", $_GET['id']); $sth->execute(); $result = $sth->fetchAll(PDO::FETCH_ASSOC); $Totaal = 0; if (!empty($result)) { foreach ($result as $key => $value) { $sth = $db->prepare("SELECT Aantal, Totaalprijs FROM bestelling_product WHERE BestellingID = :bestellingid AND ProductID = :productid"); $sth->bindParam(":bestellingid", $_GET['id']); $sth->bindParam(":productid", $value["ProductID"]); $sth->execute();
<a href="index.php?c=medewerker&p=list" class="button">Lijstweergave</a> <a href="index.php?c=medewerker&p=add" class="button">Medewerker aanmaken</a><br /> <?php if (!defined('isIncluded') || $_SESSION['GroepID'] != 2) { header('location: index.php'); } if (isset($_POST['submit'])) { if (!empty($_POST['iptGebEmail']) && !empty($_POST['iptGebStraat']) && !empty($_POST['iptGebHuisnummer']) && !empty($_POST['iptGebPostcode']) && !empty($_POST['iptGebPersoneelsnummer']) && !Gebruiker::emailAlreadyExists($_POST['iptGebEmail'])) { $bedrijfId = Gebruiker::get($_SESSION['GebruikerID'])->getProperty('BedrijfID'); $BetaalMethode = Gebruiker::get($_SESSION['GebruikerID'])->getProperty('BetaalMethode'); $Puntenkoers = Gebruiker::get($_SESSION['GebruikerID'])->getProperty('PuntenKoers'); $randPass = getUniqueCode(15); mailPassword($_POST['iptGebEmail'], $randPass); $properties_values = array('Email' => $_POST['iptGebEmail'], 'Wachtwoord' => encrypt($randPass), 'GroepID' => 1, 'BedrijfID' => $bedrijfId, 'Voornaam' => $_POST['iptGebVoornaam'], 'Tussenvoegsel' => $_POST['iptGebTussenvoegsel'], 'Achternaam' => $_POST['iptGebAchternaam'], 'Straat' => $_POST['iptGebStraat'], 'Huisnummer' => $_POST['iptGebHuisnummer'], 'HuisnummerToevoeging' => $_POST['iptGebHuisnummerToevoeging'], 'Postcode' => $_POST['iptGebPostcode'], 'Woonplaats' => $_POST['iptGebWoonplaats'], 'Telefoon' => $_POST['iptGebTelefoon'], 'Personeelsnummer' => $_POST['iptGebPersoneelsnummer'], 'Aanmaker' => $_SESSION['GebruikerID'], 'BetaalMethode' => $BetaalMethode, 'PuntenKoers' => $Puntenkoers, 'Budget' => $_POST['iptStartBedrag']); Gebruiker::create($properties_values); echo '<br /><div class="notification_ok">De medewerker is succesvol aangemaakt.</div>'; } else { if (Gebruiker::emailAlreadyExists($_POST['iptGebEmail'])) { echo '<br /><div class="notification_error">Dit e-mailadres is al in gebruik.</div>'; } else { echo '<br /><div class="notification_error">De medewerker kon niet worden aangemaakt.</div>'; } } } else { ?> <div id="form"> <form name="medewerkerAdd" method="post"> <fieldset class="info_fieldset"> <div id="fields"> <label>Email*</label><input class="textbox" type="text" name="iptGebEmail" value="" /><br /> <label>Voornaam*</label><input class="textbox" type="text" name="iptGebVoornaam" value="" /><br />
<th>Voornaam</th> <th>Achternaam</th> <th>Bekijk bestelling</th> </tr> </thead> <tbody> <?php global $db; $sth = $db->prepare("SELECT bestelling.* FROM bestelling WHERE GebruikerID IN\r\n\t\t\t\t\t(SELECT GebruikerID FROM gebruiker WHERE Aanmaker = :aanmaker)"); $sth->bindParam(":aanmaker", $_SESSION['GebruikerID']); $sth->execute(); $result = $sth->FetchAll(PDO::FETCH_ASSOC); if (!empty($result)) { foreach ($result as $key => $value) { $gebruiker = Gebruiker::get($value["GebruikerID"]); ?> <tr style="text-align: center"> <td style="width: 85px"><?php echo $gebruiker->getProperty("Personeelsnummer") . "-" . $value["BestellingID"]; ?> </td> <td><?php echo $value["Datum"]; ?> </td> <td><?php echo $gebruiker->getProperty("Voornaam"); ?> </td> <td><?php