public static function isLoggedIn()
 {
     if (!empty($_SESSION['Email']) && !empty($_SESSION['Wachtwoord'])) {
         $email = $_SESSION['Email'];
         $pass = $_SESSION['Wachtwoord'];
         $registerSession = false;
     } else {
         if (!empty($_POST['txtEmail']) && !empty($_POST['txtWachtwoord'])) {
             $email = $_POST['txtEmail'];
             $pass = encrypt($_POST['txtWachtwoord']);
             $registerSession = true;
         } else {
             return false;
         }
     }
     if (($gebruiker = Gebruiker::getByEmailAndPass($email, $pass)) !== false) {
         if ($registerSession) {
             $_SESSION['GebruikerID'] = $gebruiker->getProperty('GebruikerID');
             $_SESSION['GroepID'] = $gebruiker->getProperty('GroepID');
             $_SESSION['BedrijfID'] = $gebruiker->getProperty('BedrijfID');
             $_SESSION['Aanmaker'] = $gebruiker->getProperty('Aanmaker');
             $_SESSION['Email'] = $email;
             $_SESSION['Wachtwoord'] = $pass;
         }
         return true;
     } else {
         return false;
     }
 }
 public function detailAction($id)
 {
     // find id of selected appointment
     $afspraak = Afspraak::findById($id);
     // variable to display all users from the model Gebruiker
     $this->view->gebruiker = Gebruiker::find();
     // variable to display all Behandelingen from the model Behandeling
     $this->view->behandeling = Behandeling::find();
     // make variable accessible for the view
     $this->view->setVar('afspraak', $afspraak);
     $this->view->setVar('id', $id);
 }
 public function indexAction()
 {
     // set title page
     Tag::setTitle("maak afspraak");
     // make rows from model accessible to the view
     $this->view->afspraak = Afspraak::find();
     $this->view->gebruiker = Gebruiker::find();
     $this->view->behandeling = Behandeling::find();
     $user = $this->session->get('auth');
     // check if role is user
     $rol = $user['rol'];
     if ($rol != "user") {
         $this->response->redirect("account/index");
     }
 }
					</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 {
            ?>
if (isset($_POST['submit'])) {
    if (!empty($_POST['iptGebEmail']) && !empty($_POST['iptGebStraat']) && !empty($_POST['iptGebHuisnummer']) && !empty($_POST['iptGebPostcode']) && !empty($_POST['iptGebWoonplaats']) && !empty($_POST['iptGebTelefoon']) && !empty($_POST['iptBedBedrijfsnaam']) && !empty($_POST['iptBedStraat']) && !empty($_POST['iptBedHuisnummer']) && !empty($_POST['iptBedPostcode']) && !empty($_POST['iptBedVestigingsplaats']) && !Gebruiker::emailAlreadyExists($_POST['iptGebEmail'])) {
        $properties_values = array('Bedrijfsnaam' => $_POST['iptBedBedrijfsnaam'], 'Straat' => $_POST['iptBedStraat'], 'Huisnummer' => $_POST['iptBedHuisnummer'], 'HuisnummerToevoeging' => $_POST['iptBedHuisnummerToevoeging'], 'Postcode' => $_POST['iptBedPostcode'], 'Vestigingsplaats' => $_POST['iptBedVestigingsplaats'], 'Email' => $_POST['iptBedEmail']);
        Bedrijf::create($properties_values);
        global $db;
        $stmt = $db->query("SELECT MAX(BedrijfID) FROM bedrijf");
        $stmt->execute();
        $res = $stmt->fetch(PDO::FETCH_ASSOC);
        $bedrijfId = $res['MAX(BedrijfID)'];
        $randPass = getUniqueCode(15);
        mailPassword($_POST['iptGebEmail'], $randPass);
        $properties_values = array('Email' => $_POST['iptGebEmail'], 'Wachtwoord' => encrypt($randPass), 'GroepID' => 3, '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'], 'Aanmaker' => $_SESSION['GebruikerID']);
        Gebruiker::create($properties_values);
        echo '<br /><div class="notification_ok">De groothandel 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 groothandel kon niet worden aangemaakt.</div>';
        }
    }
} else {
    ?>
	<div id="form">
		<form name="groothandelAdd" method="post">
			<fieldset class="info_fieldset">
				<div id="fields">
					<label style="font-weight: bold; width: 415px;">Gebruiker informatie</label>
					<label>Email*</label><input class="textbox" type="text" name="iptGebEmail" value="" /><br />
					<label>Voornaam*</label><input class="textbox" type="text" name="iptGebVoornaam" value="" /><br />
					<label>Tussenvoegsel</label><input class="textbox" type="text" name="iptGebTussenvoegsel" value="" /><br />
		});
		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." : " &#x20AC; " . $gebruiker->getProperty('Budget');
<?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." : " &#x20AC; " . $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>
<?php

if (isset($_POST['forgotPass'])) {
    if (!empty($_POST['txtEmail'])) {
        if (filter_var($_POST['txtEmail'], FILTER_VALIDATE_EMAIL)) {
            $email = $_POST['txtEmail'];
            $gebruiker = Gebruiker::getByEmail($email);
            if (!empty($gebruiker) && $gebruiker !== false) {
                $uniq = getUniqueCode(15);
                $gebruiker->updateProperty('Wachtwoord', encrypt($uniq));
                $headers = 'From: beheerder@kms.nl';
                mail($email, 'KMS aanvraag gebruikergegevens', '
						U heeft via onze website een nieuw wachtwoord aangevraagd.
						Uw nieuwe tijdelijke wachtwoord is: ' . $uniq . '.

						Wij adviseren u dit wachtwoord zo snel mogelijk te veranderen zodra u bent ingelogd.
						Dit doet u door naar het gebruikerspaneel te gaan en daar te klikken op "Wachtwoord wijzigen".
						', $headers);
                echo notification('Er is een wachtwoord naar uw e-mail adres verstuurd.', 'ok');
            } else {
                echo '<div class="notification_error">Uw e-mail adres komt niet voor in onze database.</div>';
            }
        }
    }
}
echo notification('Vul uw e-mailadres in, zodra u op versturen klikt wordt er een wachtwoord naar uw e-mailadres toegestuurd.', 'alert');
?>
<div id="form">
	<form name="forgotPass" method="post">
		<fieldset class="info_fieldset">
			<div id="fields">
require "Gebruiker.inc.php";
require "connectToDataBase.inc.php";
if (isset($_REQUEST['save'])) {
    // handle ajax save request (do not show the interface)
    $ID = @$_REQUEST['ID'];
    // we posted . characters, but something converts them to _ (HTTP 1.1 standard)
    $r = array();
    foreach ($_REQUEST as $i => $v) {
        $r[join('.', explode('_', $i))] = $v;
        //convert _ back to .
    }
    $sessies = array();
    for ($i0 = 0; isset($r['0.' . $i0]); $i0++) {
        $sessies[$i0] = @$r['0.' . $i0 . ''];
    }
    $Gebruiker = new Gebruiker($ID, $sessies);
    if ($Gebruiker->save() !== false) {
        die('ok:' . serviceref($_REQUEST['content']) . '&Gebruiker=' . urlencode($Gebruiker->getId()));
    } else {
        die('Please fix errors!');
    }
    exit;
    // do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {
function delGebruiker($id)
{
    $tobeDeleted = new Gebruiker($id);
    if ($tobeDeleted->isNew()) {
        return true;
    }
    // item never existed in the first place
    if ($tobeDeleted->del()) {
        return true;
    } else {
        return $tobeDeleted;
    }
}
                ?>
</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();
					<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 
 public function createAccountAction()
 {
     // checks if a post is committed
     if ($this->request->isPost()) {
         // check for CSRF security
         if ($this->security->checkToken() == false) {
             $this->flash->error("invalid CSRF token ");
             $this->response->redirect('account/index');
         }
         // saves input from form in a variable
         $email = $this->request->getPost('email');
         $username = $this->request->getPost('username');
         $voornaam = $this->request->getPost('voornaam');
         $tussenvoegsel = $this->request->getPost('tussenvoegsel');
         $achternaam = $this->request->getPost('achternaam');
         $telefoonnummer = $this->request->getPost('telefoonnummer');
         $password = $this->request->getPost('password');
         $confirm_password = $this->request->getPost('confirm_password');
         // checks if both password fields are equal
         if ($password != $confirm_password) {
             $this->flash->warning('de ingevulde wachtwoorden zijn niet gelijk');
             $this->response->redirect('account/register');
         }
         // initiate model
         $gebruiker = new Gebruiker();
         // assign post input to a field form the table
         $gebruiker->rol = "user";
         $gebruiker->email = $email;
         $gebruiker->username = $username;
         $gebruiker->tussenvoegsel = $tussenvoegsel;
         $gebruiker->voornaam = $voornaam;
         $gebruiker->achternaam = $achternaam;
         $gebruiker->telefoonnummer = $telefoonnummer;
         $gebruiker->password = $password;
         // save the inputs in the table
         $result = $gebruiker->save();
         // checks if any invalid values are past
         if (!$result) {
             $output = [];
             foreach ($gebruiker->getMessages() as $message) {
                 $output[] = $message;
             }
             $output = implode("<br><br>", $output);
             // displays incorrect input
             $this->flash->error($output);
             $this->response->redirect('account/register');
             return;
         }
         $this->registerSession($gebruiker);
         $this->response->redirect('afspraak/index');
     }
 }
<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 || empty($_GET['id'])) {
    header('location: index.php');
}
$gebruiker = Gebruiker::get($_GET['id']);
if (isset($_POST['submit'])) {
    if (!empty($_POST['iptGebEmail']) && !empty($_POST['iptGebStraat']) && !empty($_POST['iptGebHuisnummer']) && !empty($_POST['iptGebPostcode']) && !empty($_POST['iptGebPersoneelsnummer']) && !Gebruiker::emailAlreadyExists($_POST['iptGebEmail'])) {
        $properties_values = array('Email' => $_POST['iptGebEmail'], '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'], 'Budget' => $_POST['iptBudget']);
        $gebruiker->update($properties_values);
        echo '<br /><div class="notification_ok">De medewerker is succesvol aangepast.</div>';
    } else {
        echo '<br /><div class="notification_error">De medewerker kon niet worden aangepast.</div>';
    }
} else {
    ?>
	<div id="form">
			<form name="medewerkerEdit" method="post">
				<fieldset class="info_fieldset">

					<div id="note">
						<div class="notification_warning">Alle velden zijn verplicht!</div>
					</div>

					<div id="fields">
						<label>Email</label><input class="textbox" type="text" name="iptGebEmail" value="<?php 
    echo $gebruiker->getProperty('Email');
    ?>
" /><br />
						<label>Voornaam</label><input class="textbox" type="text" name="iptGebVoornaam" value="<?php 
<?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>
<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		oTable = $('#table').dataTable({
			"bJQueryUI": true,
			"sPaginationType": "full_numbers"
		});
	});
</script>
<a href="index.php?c=productlijst&p=add" class="button">Productlijst aanmaken</a>
<a href="index.php?c=productlijst&p=list" class="button">Lijstweergave</a><br />
<?php 
if (!defined('isIncluded') || $_SESSION['GroepID'] != 4) {
    header('location: index.php');
}
$productlijsten = Productlijst::getAll();
$gebruikers = Gebruiker::getAll();
if (isset($_POST['submit'])) {
    unset($_POST['table_length']);
    unset($_POST['submit']);
    $productlijstId = $_POST['iptProductlijst'];
    unset($_POST['iptProductlijst']);
    if (!empty($_POST)) {
        foreach ($_POST as $value) {
            $exists = false;
            /* @TODO: Zet ID van geselecteerde groothandel in var $groothandel. (alleen als nog niet gekoppeld is)*/
            $gebruiker_productlijst = Gebruiker_Productlijst::getByGebruikerId($value);
            foreach ($gebruiker_productlijst as $productlijst) {
                if ($productlijst->getProperty('ProductlijstID') == $productlijstId) {
                    $exists = true;
                }
            }
Example #19
0
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>
<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><br />
<?php 
if (!defined('isIncluded') || $_SESSION['GroepID'] != 3 || empty($_GET['id'])) {
    header('location: index.php');
}
$gebruiker = Gebruiker::get($_GET['id']);
$bedrijf = Bedrijf::get($gebruiker->getProperty('BedrijfID'));
if (isset($_POST['submit'])) {
    if (!empty($_POST['iptGebEmail']) && !empty($_POST['iptGebStraat']) && !empty($_POST['iptGebHuisnummer']) && !empty($_POST['iptGebPostcode']) && !empty($_POST['iptGebWoonplaats']) && !empty($_POST['iptGebTelefoon']) && !empty($_POST['iptBedBedrijfsnaam']) && !empty($_POST['iptBedStraat']) && !empty($_POST['iptBedHuisnummer']) && !empty($_POST['iptBedPostcode']) && !empty($_POST['iptBedVestigingsplaats']) && !Gebruiker::emailAlreadyExists($_POST['iptGebEmail'])) {
        $properties_values = array('Bedrijfsnaam' => $_POST['iptBedBedrijfsnaam'], 'Straat' => $_POST['iptBedStraat'], 'Huisnummer' => $_POST['iptBedHuisnummer'], 'HuisnummerToevoeging' => $_POST['iptBedHuisnummerToevoeging'], 'Postcode' => $_POST['iptBedPostcode'], 'Vestigingsplaats' => $_POST['iptBedVestigingsplaats'], 'Email' => $_POST['iptBedEmail']);
        $bedrijf->update($properties_values);
        $properties_values = array('Email' => $_POST['iptGebEmail'], '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']);
        $gebruiker->update($properties_values);
        echo '<br /><div class="notification_ok">Het bedrijf is succesvol aangepast.</div>';
    } else {
        echo '<br /><div class="notification_error">Het bedrijf kon niet worden aangepast.</div>';
    }
} else {
    ?>
	<div id="form">
			<form name="bedrijfEdit" method="post">
				<fieldset class="info_fieldset">

					<div id="note">
						<div class="notification_warning">Alle velden zijn verplicht!</div>
					</div>

					<div id="fields">
						<label style="font-weight: bold; width: 415px;">Gebruiker informatie</label>
						<label>Email</label><input class="textbox" type="text" name="iptGebEmail" value="<?php