<div id="customer">

<span class="moduleTitle">
    <?php
    ?>
<a class="button" href="<?php print $_SERVER['PHP_SELF'].'?mod=customers';?>"><img src="images/list_12x12.png"/></a><?php
    ?>
<a class="button" href="<?php print $_SERVER['PHP_SELF'].'?mod=customer&a=edit&ap='.$this->gd('customer')->id;?>"><img src="images/edit_12x12.png"/></a><?php
    
if (((int)$this->gd('customer')->id) > 0) {
        
?><!--a class="button" href="<?php print $_SERVER['PHP_SELF'].'?mod=customer&ap='.$this->gd('customer')->id;?>"><img src="images/details_12x12.png"/></a--><?php
        
if (CustomerModel::hasSystem($this->gd('customer')->id)) {
            
?><a class="button" onclick="catchEvent(event);"><img src="images/delete_12x12_disabled.png"/></a><?php
        
} else {
            
?><a class="button" href="<?php print $_SERVER['PHP_SELF'].'?mod='.RootController::getModuleName().'&a='.RootController::getModuleAction().'&ap='.$this->gd('customer')->id;?>&confirmDelete"><img src="images/delete_12x12.png"/></a><?php
        
}
    }
    
?>&nbsp;<?php $this->pd('title');?>
</span>

<label for="title"><?php $this->pd('labelTitle');?></label>
<span name="title"><?php print $this->gd('customer')->title;?></span>
<br/>
<label for="firstname"><?php $this->pd('labelFirstname');?></label>
<span name="firstname"><?php print $this->gd('customer')->firstname;?></span>
<br/>
<label for="name" class="<?php print ($this->isInvalid('name''customer') ? 'invalidField' '');?>"><?php $this->pd('labelName');?></label>
<span name="name"><?php print $this->gd('customer')->name;?></span>
<br/>
<br/>

<label class="sectionLabel"><?php $this->pd('labelAddresses')?></label>
<br>
<br>
<br>
<?php
    
foreach ($this->gd('customer')->address as $address) {
        
?>
            <label for="street"><?php $this->pd('labelStreet');?></label>
            <span name="street"><?php print $address->street;?></span>
            <br/>
            <label for="streetNumber"><?php $this->pd('labelStreetNumber');?></label>
            <span name="streetNumber"><?php print $address->streetNumber;?></span>
            <br/>
            <label for="postalCode"><?php $this->pd('labelPostalCode');?></label>
            <span name="postalCode"><?php print $address->postalCode;?></span>
            <br/>
            <label for="city"><?php $this->pd('labelCity');?></label>
            <span name="city"><?php print $address->city;?></span>
            <br/>
            <label for="countyName"><?php $this->pd('labelCountyName');?></label>
            <span name="countyName"><?php print $address->countyName;?></span>
            <br/>
            <label for="maintenanceContractNumber"><?php $this->pd('labelMaintenanceContractNumber');?></label>
            <span name="maintenanceContractNumber" id="maintenanceContractNumber" ><?php print $address->maintenanceContractNumber;?></span>
            <br/>
            <label for="maintenanceDate"><?php $this->pd('labelMaintenanceDate');?></label>
            <span  name="maintenanceDate" id="maintenanceDate" class="topspace"><?php print Helper::dateFormat($address->maintenanceDate);?></span>
            <br/>
            <label for="maintenanceDone"><?php $this->pd('labelMaintenanceDone');?></label>
            <input type="checkbox" name="maintenanceDone" <?php print ((((int)$address->maintenanceDone)>0) ? 'checked="checked"' '' );?> readonly="readonly" disabled="disabled">
            <br/>
            <!--<label></label><hr class="shortSeparator"/><br>-->
            <br/>
        <?php
    
}
?>
<br>
<label class="sectionLabel"><?php $this->pd('labelTelephoneNumbers')?></label>
<?php
    $tNr 
0;
    foreach (
$this->gd('customer')->telephone as $telephone) {
        
?>
            <?php if ($tNr 0) { ?><label for="telephone"></label><?php ?>
            <span name="telephone"><?php print $telephone->telephone;?></span><br/>
        <?php
        $tNr
++;
    }
?>
<!--<label></label><hr class="shortSeparator"/><br>-->
<br/>
<label class="sectionLabel"><?php $this->pd('labelEmailAddresses')?></label>
<?php
    $eNr 
0;
    foreach (
$this->gd('customer')->emailAddress as $emailAddress) {
        
?>
            <?php if ($eNr 0) { ?><label for="emailAddress"></label><?php ?>
            <span name="emailAddress"><?php print $emailAddress->emailAddress;?></span><br/>
        <?php
        $eNr
++;
    }
?>
<!--<label></label><hr class="shortSeparator"/><br>-->
<br/>

<form id="formGotoCreateInvoice" action="<?php print $_SERVER['PHP_SELF'];?>" method="get" onsubmit="return _stdonsubmit();" >
<input name="mod" type="hidden" value="invoice"/>
<input name="a" type="hidden" value="create"/>
<input name="ap" type="hidden" value="<?php print $this->gd('customer')->id;?>"/>
<br/>
<label for="submitGotoCreateInvoice"></label>
<input name="submitGotoCreateInvoice" type="submit" value="<?php $this->pd('txtGotoCreateInvoice');?>" />
</form>

<form id="formGotoCreateQuotation" action="<?php print $_SERVER['PHP_SELF'];?>" method="get" onsubmit="return _stdonsubmit();" >
<input name="mod" type="hidden" value="quotation"/>
<input name="a" type="hidden" value="create"/>
<input name="ap" type="hidden" value="<?php print $this->gd('customer')->id;?>"/>
<br/>
<label for="submitGotoCreateQuotation"></label>
<input name="submitGotoCreateQuotation" type="submit" value="<?php $this->pd('txtGotoCreateQuotation');?>" />
</form>

<?php
    
# for customers invoices list
    # see invoices.tpl.php (printed by customerView.php)
?>

</div>