441 lines
16 KiB
PHP
441 lines
16 KiB
PHP
<?php
|
|
$map_habitation_type = [
|
|
'tenant' => 'Locataire',
|
|
'owner' => 'Proprietaire',
|
|
'withoutrentalcharge' => 'Sans charge locative'
|
|
];
|
|
|
|
$map_credit_hypothecaire_en_cours = [
|
|
'withmortgageloan' => 'Avec credit hypothecaire',
|
|
'mortgagechargeiber' => 'Libre de charge hypothecaire'
|
|
];
|
|
|
|
$map_sans_charge_locative = [
|
|
'other' => 'Autre',
|
|
'withparents' => 'Chez les parents',
|
|
'cohabitant' => 'Cohabitant',
|
|
'family' => 'Famille'
|
|
];
|
|
|
|
$show_all_mail = false;
|
|
|
|
if($currentCredit->type_credit == 'pat')
|
|
$show_all_mail = true;
|
|
|
|
?>
|
|
<table style="border-collapse: separate; border-spacing: 10px;">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h2>Demande de credit</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td style="max-width: 50%">Type de credit:</td>
|
|
<td style="max-width: 50%"><?php echo array_key_exists($currentCredit->type_credit, $map_credit_type) ? $map_credit_type[$currentCredit->type_credit] : 'Type de credit inconnu' ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Capital:</td>
|
|
<td><?php echo $currentCredit->capital ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Duree:</td>
|
|
<td><?php echo $currentCredit->duree ?> <?php if ($currentCredit->type_credit === 'am'): ?>ans<?php else: ?>mois<?php endif ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Coût total:</td>
|
|
<td><?php echo $currentCredit->cout_total ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Mensualite:</td>
|
|
<td><?php echo $currentCredit->mensualite ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Taux nominal annuel:</td>
|
|
<td><?php echo $currentCredit->taux_nominal_annuel ?></td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h2>Emprunteur</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Nom:</td>
|
|
<td><?php echo $borrower->nom ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Prenom:</td>
|
|
<td><?php echo $borrower->prenom ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Telephone:</td>
|
|
<td><?php echo $borrower->telephone ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Email:</td>
|
|
<td><?php echo $borrower->email ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Agence:</td>
|
|
<td><?php echo array_key_exists($borrower->FK_agence, $agencies) ? $agencies[$borrower->FK_agence]->Nom_agence : 'Agence inconnue' ?></td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
<?php
|
|
if($show_all_mail) {
|
|
|
|
$people = [
|
|
'emprunteur' => $borrower,
|
|
];
|
|
|
|
if (is_object($coBorrower)) {
|
|
$people['coemprunteur'] = $coBorrower;
|
|
}
|
|
|
|
foreach ($people as $who => $person) :
|
|
?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h2><?php echo $who === 'emprunteur' ? 'Emprunteur' : 'Co-emprunteur' ?></h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>Nom:</td>
|
|
<td><?php echo $person->nom ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Prenom:</td>
|
|
<td><?php echo $person->prenom ?></td>
|
|
</tr>
|
|
|
|
<?php if ($who === 'emprunteur') : ?>
|
|
<tr>
|
|
<td>Telephone:</td>
|
|
<td><?php echo $person->telephone ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Email:</td>
|
|
<td><?php echo $person->email ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Agence:</td>
|
|
<td><?php echo array_key_exists($person->FK_agence, $agencies) ? $agencies[$person->FK_agence]->Nom_agence : 'Agence inconnue' ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
|
|
<tr>
|
|
<td>etat civil:</td>
|
|
<td><?php echo array_key_exists($person->FK_etat_civil, $civilStatus) ? $civilStatus[$person->FK_etat_civil]->nom_etat_civil : 'etat civil inconnu' ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Date de naissance:</td>
|
|
<td><?php echo $person->date_naissance ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Lieu de naissance:</td>
|
|
<td><?php echo $person->lieu_naissance ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Nationalite:</td>
|
|
<td><?php echo $person->nationalité ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Numero de carte d'identite:</td>
|
|
<td><?php echo $person->num_carte_identite ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Date de validite:</td>
|
|
<td><?php echo $person->carte_identite_validite ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Numero de registre national:</td>
|
|
<td><?php echo $person->num_registre_national ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Numero de compte bancaire:</td>
|
|
<td><?php echo $person->num_compte_bancaire ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Adresse:</td>
|
|
<td><?php echo $person->adresse ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Code Postal:</td>
|
|
<td><?php echo $person->code_postal ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Localite - Pays:</td>
|
|
<td><?php echo $person->localite ?> - <?php echo $person->pays ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Date d'emmenagement:</td>
|
|
<td><?php echo $person->date_emmenagement ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Nombre d'enfant(s) à charge:</td>
|
|
<td><?php echo $person->enfant_charge ?></td>
|
|
</tr>
|
|
|
|
<?php $profession = array_key_exists($person->FK_profession, $works) ? $works[$person->FK_profession]->nom_profession : 'Profession inconnue' ?>
|
|
<tr>
|
|
<td>Profession:</td>
|
|
<td><?php echo $profession ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Type de contrat:</td>
|
|
<td>
|
|
<?php if (is_null($person->contract_type) || $person->contract_type === ''): ?>
|
|
Non specifie
|
|
<?php elseif (array_key_exists($person->contract_type, $contractTypes)): ?>
|
|
<?php echo $contractTypes[$person->contract_type] ?>
|
|
<?php else: ?>
|
|
Type de contrat de travail inconnu
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Nom <?php echo $profession === 'Independant' ? 'de l\'entreprise' : 'de l\'employeur/organisme de paiement' ?>:</td>
|
|
<td><?php echo $person->nom_employeur ?></td>
|
|
</tr>
|
|
|
|
<?php if ($profession === 'Independant'): ?>
|
|
<tr>
|
|
<td>Numero d'entreprise:</td>
|
|
<td><?php echo $person->numero_entreprise ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
|
|
<tr>
|
|
<td>Adresse <?php echo $profession === 'Independant' ? 'de l\'entreprise' : 'de l\'employeur/organisme de paiement' ?>:</td>
|
|
<td><?php echo $person->adresse_employeur ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Code postal <?php echo $profession === 'Independant' ? 'de l\'entreprise' : 'de l\'employeur/organisme de paiement' ?>:</td>
|
|
<td><?php echo $person->code_postal_employeur ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Localite <?php echo $profession === 'Independant' ? 'de l\'entreprise' : 'de l\'employeur/organisme de paiement' ?>:</td>
|
|
<td><?php echo $person->localite_employeur ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Pays <?php echo $profession === 'Independant' ? 'de l\'entreprise' : 'de l\'employeur/organisme de paiement' ?>:</td>
|
|
<td><?php echo $person->pays_employeur ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Date <?php echo $profession === 'Independant' ? 'de debut d\'activite' : 'd\'engagement' ?>:</td>
|
|
<td><?php echo $person->date_engagement ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><?php echo $profession === 'Independant' ? 'Revenu imposable annuel' : 'Salaire net mensuel' ?>:</td>
|
|
<td><?php echo $person->salaire ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Chèques repas:</td>
|
|
<td>
|
|
<?php if (!is_null($person->cheque_repas) && $person->cheque_repas !== '') : ?>
|
|
<?php echo $person->cheque_repas ?> €
|
|
<?php else : ?>
|
|
non
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Revenus locatifs:</td>
|
|
<td>
|
|
<?php if (!is_null($person->revenus_locatifs) && $person->revenus_locatifs !== '') : ?>
|
|
<?php echo $person->revenus_locatifs ?> €
|
|
<?php else : ?>
|
|
non
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Chômage:</td>
|
|
<td>
|
|
<?php if (!is_null($person->chomage) && $person->chomage !== '') : ?>
|
|
<?php echo $person->chomage ?> €
|
|
<?php else : ?>
|
|
non
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Autre:</td>
|
|
<td>
|
|
<?php if (!is_null($person->autre_revenu_type) && $person->autre_revenu_type !== '') : ?>
|
|
<?php echo $person->autre_revenu_type ?> (<?php echo $person->autre_revenu_montant ?> €)
|
|
<?php else : ?>
|
|
non
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php if ($who === 'emprunteur'): ?>
|
|
<tr>
|
|
<td>Avec un co-emprunteur:</td>
|
|
<td><?php echo array_key_exists('coemprunteur', $people) && is_object($people['coemprunteur']) ? 'oui' : 'non' ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
</tbody>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h3>Credits(s) et charge(s) en cours</h3>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>Habitation:</td>
|
|
<td><?php echo array_key_exists($person->habitation_type, $map_habitation_type) ? $map_habitation_type[$person->habitation_type] : 'Type d\'habitation inconnu' ?></td>
|
|
</tr>
|
|
|
|
<?php if (array_key_exists($person->habitation_type, $map_habitation_type)) : ?>
|
|
<?php if ($person->habitation_type === 'tenant') : ?>
|
|
<tr>
|
|
<td>Montant du loyer à payer:</td>
|
|
<td><?php echo $person->habitation_loyer ?> €</td>
|
|
</tr>
|
|
<?php elseif ($person->habitation_type === 'owner') : ?>
|
|
<tr>
|
|
<td>Credit hypothecaire en cours ?</td>
|
|
<td><?php echo array_key_exists($person->habitation_charge_hypothecaire, $map_credit_hypothecaire_en_cours) ? $map_credit_hypothecaire_en_cours[$person->habitation_charge_hypothecaire] : 'Type de charge hypothecaire inconnu' ?></td>
|
|
</tr>
|
|
<?php elseif ($person->habitation_type === 'withoutrentalcharge') : ?>
|
|
<tr>
|
|
<td>Vous habitez:</td>
|
|
<td><?php echo array_key_exists($person->habitation_sans_charge_locative, $map_sans_charge_locative) ? $map_sans_charge_locative[$person->habitation_sans_charge_locative] : 'Type d\'habitation inconnu' ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
<?php endif ?>
|
|
</tbody>
|
|
|
|
<?php if (property_exists($person, 'other_credits') && !empty($person->other_credits)) : ?>
|
|
<?php foreach ($person->other_credits as $k => $autreCredit) : ?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h4>Credit en cours n°<?php echo $k + 1 ?></h4>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>Type de creance:</td>
|
|
<td><?php echo array_key_exists($autreCredit->FK_type_creance, $existingCreditTypes) ? $existingCreditTypes[$autreCredit->FK_type_creance]->nom_creance : 'Type de creance inconnu' ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Nom de l'organisme / Banque:</td>
|
|
<td><?php echo $autreCredit->banque ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Capital emprunte:</td>
|
|
<td><?php echo $autreCredit->montant ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Duree du credit (en mois):</td>
|
|
<td><?php echo $autreCredit->duree_credit ?> mois</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Mensualite:</td>
|
|
<td><?php echo $autreCredit->mensualite ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Date 1ère echeance:</td>
|
|
<td><?php echo $autreCredit->date_premiere_echeance ?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Solde restant dû (approximatif):</td>
|
|
<td><?php echo $autreCredit->solde_restant_du ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>À clôturer / Solder ?:</td>
|
|
<td>
|
|
<?php if ($autreCredit->cloture == '0'): ?>
|
|
non
|
|
<?php elseif ($autreCredit->cloture == '1'): ?>
|
|
oui
|
|
<?php endif ?>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<?php endforeach ?>
|
|
<?php endif ?>
|
|
<?php
|
|
endforeach;
|
|
?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2">
|
|
<h2>Informations complementaires</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>Remarques - message à nous communiquer:</td>
|
|
<td><?php echo $borrower->remarques ?></td>
|
|
</tr>
|
|
</tbody>
|
|
<?php
|
|
}
|
|
?>
|
|
</table>
|