<?php
require_once('contacts.php');
require_once('inc/debug.php');
require_once('inc/icons.php');
require_once('session/start.php');
require_role(array(ROLE_CUSTOMER));
title("Adressen verwalten");
$contacts = get_contacts();
$kundenkontakte = get_kundenkontakte();
output('<p>Sie haben aktuell diese Adressen gespeichert:</p>
<div class="contact-list">');
$liste = array_merge(array_filter(array($kundenkontakte['kunde'], $kundenkontakte['rechnung'], $kundenkontakte['extern'])), array_keys($contacts));
$already_displayed = array();
foreach ($liste as $id) {
if (in_array($id, $already_displayed)) {
continue;
}
$already_displayed[] = $id;
$cssclass = 'contact-mainlist ';
$contact = $contacts[$id];
$usage = array();
if ($id == $kundenkontakte['kunde']) {
$cssclass .= 'mainaddress';
$usage[] = 'Stamm-Adresse';
}
if ($id == $kundenkontakte['extern']) {
$usage[] = 'Ersatz-Adresse';
}