487 lines
27 KiB
PHP
487 lines
27 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Demande de crédit</title>
|
|
<!--[if mso]>
|
|
<xml>
|
|
<o:OfficeDocumentSettings>
|
|
<o:AllowPNG/>
|
|
<o:PixelsPerInch>96</o:PixelsPerInch>
|
|
</o:OfficeDocumentSettings>
|
|
</xml>
|
|
<![endif]-->
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background-color: #ecf0f1;
|
|
/* background-color: #001954; */
|
|
font-family: 'Plus Jakarta Sans', Arial, Helvetica, sans-serif;
|
|
-webkit-text-size-adjust: 100%;
|
|
-ms-text-size-adjust: 100%;
|
|
}
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 40px auto;
|
|
background: #fff;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 16px 0 rgba(0,0,0,0.08);
|
|
padding: 0 0 24px 0;
|
|
}
|
|
.content-table {
|
|
width: 100%;
|
|
border-collapse: separate;
|
|
border-spacing: 10px;
|
|
color: #333;
|
|
}
|
|
.content-table td {
|
|
padding: 8px 0;
|
|
}
|
|
.header {
|
|
text-align: center;
|
|
background: #fff;
|
|
border-radius: 12px 12px 0 0;
|
|
}
|
|
.header img {
|
|
display: block;
|
|
margin: 0 auto;
|
|
width: 600px;
|
|
height: 120px;
|
|
border-radius: 12px 12px 0 0;
|
|
}
|
|
.section-title {
|
|
color: #001954;
|
|
font-size: 24px;
|
|
margin: 0;
|
|
padding-bottom: 12px;
|
|
}
|
|
.subsection-title {
|
|
color: #001954;
|
|
font-size: 20px;
|
|
margin: 0;
|
|
padding-top: 24px;
|
|
padding-bottom: 12px;
|
|
}
|
|
@media only screen and (max-width: 600px) {
|
|
.container {
|
|
width: 100% !important;
|
|
margin: 0 !important;
|
|
border-radius: 0 !important;
|
|
}
|
|
.header img {
|
|
width: 100% !important;
|
|
height: auto !important;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!--[if mso]>
|
|
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
|
|
<v:fill type="solid" color="#001954"/>
|
|
</v:background>
|
|
<![endif]-->
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 600px; margin: 40px auto;">
|
|
<tr>
|
|
<td>
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" class="container">
|
|
<tr>
|
|
<td class="header">
|
|
<img src="<?php echo $model->main->asset('img/cred_banniere.jpg'); ?>" alt="Crédit Direct" width="600" height="120" style="display:block; margin:0 auto;">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 32px 24px 0 24px;">
|
|
<!-- <p style="margin: 0 0 24px 0; color: #333; line-height: 1.5; mso-line-height-rule: exactly;">
|
|
Cher(e) <?php echo $borrower->prenom ?>,<br><br>
|
|
Nous avons bien reçu votre demande de crédit et nous vous en remercions. Votre dossier est actuellement en cours d'analyse par nos services.<br><br>
|
|
Voici un récapitulatif des informations que vous nous avez fournies :
|
|
</p> -->
|
|
<?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'
|
|
];
|
|
|
|
$map_emprunt_personnes = [
|
|
'Seul','Avec un co-emprunteur'
|
|
];
|
|
|
|
$show_all_mail = false;
|
|
|
|
$people = [
|
|
'emprunteur' => $borrower,
|
|
];
|
|
|
|
if (is_object($coBorrower)) {
|
|
$people['coemprunteur'] = $coBorrower;
|
|
}
|
|
|
|
$taeg = str_replace('%', '', $currentCredit->taux_nominal_annuel);
|
|
$taux_debiteur = number_format(($taeg * 0.11) + $taeg, 2);
|
|
|
|
if($currentCredit->type_credit == 'pat')
|
|
$show_all_mail = true;
|
|
|
|
?>
|
|
<table style="border-collapse: separate; border-spacing: 10px; width:100%; color:#333;">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-bottom:12px;">
|
|
<h2 style="color:#001954; font-size:24px; margin:0;">Demande de crédit</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="max-width: 50%;padding: 10px 0;"><strong>Type de crédit:</strong></td>
|
|
<td style="max-width: 50%;padding: 10px 0;"><?php echo array_key_exists($currentCredit->options_credit_hypothecaire->type_credit, $mapHouseCreditTypes) ? $mapHouseCreditTypes[$currentCredit->options_credit_hypothecaire->type_credit] : 'Type de crédit inconnu' ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Capital:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->capital ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Durée:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->duree ?> <?php if ($currentCredit->type_credit === 'am'): ?>ans<?php else: ?>mois<?php endif ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Coût total:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->cout_total ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Mensualité:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->mensualite ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>TAEG:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $taux_debiteur ?>%</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Taux nominal annuel:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->taux_nominal_annuel ?></td>
|
|
</tr>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:24px; padding-bottom:12px;">
|
|
<h2 style="color:#001954; font-size:20px; margin:0;">Crédit hypothécaire</h2>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>But du prêt hypotécaire :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo array_key_exists($currentCredit->options_credit_hypothecaire->type_credit, $mapHouseCreditTypes) ? $mapHouseCreditTypes[$currentCredit->options_credit_hypothecaire->type_credit] : 'Type de crédit inconnu' ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Prix d'achat:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->options_credit_hypothecaire->prix_achat ?> €</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Fonds propres:</strong></td>
|
|
<?php if($currentCredit->options_credit_hypothecaire->fonds_propre == 0 || $currentCredit->options_credit_hypothecaire->fonds_propre == '') { ?>
|
|
<td style="padding: 10px 0;">Non spécifié</td>
|
|
<?php } else { ?>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->options_credit_hypothecaire->fonds_propre ?> €</td>
|
|
<?php } ?>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Compromis de vente signé:</strong></td>
|
|
<td>
|
|
<?php
|
|
if ($currentCredit->options_credit_hypothecaire->compromis_signe == '0') {
|
|
echo 'non';
|
|
} elseif ($currentCredit->options_credit_hypothecaire->compromis_signe == '1') {
|
|
echo 'oui';
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Montant à emprunter:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->options_credit_hypothecaire->montant_a_emprunter ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Durée:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->options_credit_hypothecaire->duree ?> ans</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Commentaire:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $currentCredit->commentaire ?></td>
|
|
</tr>
|
|
</tbody>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:24px; padding-bottom:12px;">
|
|
<h2 style="color:#001954; font-size:20px; margin:0;">Information de contact</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<?php foreach ($people as $who => $person) : ?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:16px; padding-bottom:8px;">
|
|
<h3 style="color:#001954; font-size:18px; margin:0;"><?php echo $who === 'emprunteur' ? 'Emprunteur' : 'Co-emprunteur' ?></h3>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Nom:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->nom ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Prénom:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->prenom ?></td>
|
|
</tr>
|
|
<?php if ($who === 'emprunteur') : ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Téléphone:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->telephone ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Email:</strong></td>
|
|
<td style="padding: 10px 0;"><?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 style="padding: 10px 0;"><strong>Etat civil:</strong></td>
|
|
<td style="padding: 10px 0;"><?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 style="padding: 10px 0;"><strong>Date de naissance:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo date('d/m/Y', strtotime($person->date_naissance)) ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Nationalité:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->nationalité ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Adresse:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->adresse ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Code Postal:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->code_postal ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Localité - Pays:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->localite ?> - <?php echo $person->pays ?></td>
|
|
</tr>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:16px; padding-bottom:8px;">
|
|
<h3 style="color:#001954; font-size:18px; margin:0;">Revenus et charges</h3>
|
|
</th>
|
|
</tr>
|
|
<?php $profession = array_key_exists($person->FK_profession, $works) ? $works[$person->FK_profession]->nom_profession : 'Profession inconnue' ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Profession:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $profession ?></td>
|
|
</tr>
|
|
<tr>
|
|
<?php
|
|
if($person->FK_profession == 5) {
|
|
?>
|
|
<td style="padding: 10px 0;"><strong>Type de contrat:</strong></td>
|
|
<td style="padding: 10px 0;">
|
|
<?php echo $person->independent_since ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Revenu imposable annuel:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->annual_taxable_income ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Date de début de l'activité:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo date('d/m/Y', strtotime($person->independent_since)) ?></td>
|
|
</tr>
|
|
<?php } else { ?>
|
|
<td style="padding: 10px 0;"><strong>Type de contrat:</strong></td>
|
|
<td style="padding: 10px 0;">
|
|
<?php if (is_null($person->contract_type) || $person->contract_type === ''): ?>
|
|
Non spécifié
|
|
<?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>
|
|
<?php } ?>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong><?php echo $profession === 'Independant' ? 'Revenu imposable annuel' : 'Salaire net mensuel' ?>:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $person->salaire ?> €</td>
|
|
</tr>
|
|
<?php if ($who === 'emprunteur'): ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Avec un co-emprunteur:</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo array_key_exists('coemprunteur', $people) && is_object($people['coemprunteur']) ? 'oui' : 'non' ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
<tr>
|
|
<?php echo $model->generateSimpleUploadedFilesLinksHTML($currentCredit->token); ?>
|
|
</tr>
|
|
</tbody>
|
|
<?php endforeach ?>
|
|
|
|
<?php
|
|
// Récupérer les bâtiments de l'emprunteur
|
|
if (is_object($borrower)) {
|
|
global $wpdb;
|
|
$buildings = $wpdb->get_results($wpdb->prepare(
|
|
"SELECT * FROM cdf_Emprunteur_Batiments WHERE FK_emprunteur = %d",
|
|
$borrower->idemprunteur
|
|
));
|
|
|
|
if (!empty($buildings)) :
|
|
?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:24px; padding-bottom:12px;">
|
|
<h2 style="color:#001954; font-size:20px; margin:0;">Bâtiments</h2>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
$building_num = 1;
|
|
foreach ($buildings as $building) :
|
|
?>
|
|
<thead>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:16px; padding-bottom:8px;">
|
|
<h3 style="color:#001954; font-size:18px; margin:0;">Bâtiment <?php echo $building_num; ?></h3>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Habitation principale :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $building->is_habitation ? 'Oui' : 'Non'; ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Bâtiment de rapport :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $building->Is_rapport ? 'Oui' : 'Non'; ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Situé en Belgique :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $building->en_belgique ? 'Oui' : 'Non'; ?></td>
|
|
</tr>
|
|
<?php if (!$building->en_belgique && !empty($building->batiment_pays)) : ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Pays :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $building->batiment_pays; ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Revenus locatifs :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo $building->revenu_locatif ? 'Oui' : 'Non'; ?></td>
|
|
</tr>
|
|
<?php if ($building->revenu_locatif && $building->montant_locatif > 0) : ?>
|
|
<tr>
|
|
<td style="padding: 10px 0;"><strong>Montant revenus locatifs :</strong></td>
|
|
<td style="padding: 10px 0;"><?php echo number_format($building->montant_locatif, 2, ',', ' '); ?> €/mois</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php
|
|
// Récupérer les crédits associés à ce bâtiment
|
|
$building_loans = $wpdb->get_results($wpdb->prepare(
|
|
"SELECT ac.*, tc.nom_creance
|
|
FROM cdf_Autre_credit ac
|
|
LEFT JOIN cdf_Type_creance tc ON ac.FK_type_creance = tc.idtype_creance
|
|
WHERE ac.FK_autre_batiment = %d AND ac.FK_emprunteur = %d",
|
|
$building->id,
|
|
$borrower->idemprunteur
|
|
));
|
|
|
|
if (!empty($building_loans)) :
|
|
?>
|
|
<tr>
|
|
<th colspan="2" style="text-align:left; padding-top:16px; padding-bottom:8px;">
|
|
<h4 style="color:#001954; font-size:16px; margin:0;">Crédits associés</h4>
|
|
</th>
|
|
</tr>
|
|
<?php
|
|
$loan_num = 1;
|
|
foreach ($building_loans as $loan) :
|
|
?>
|
|
<tr>
|
|
<td colspan="2" style="padding: 15px 0 5px 0;"><strong style="color:#666;">Crédit <?php echo $loan_num; ?></strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Type de créance :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo $loan->nom_creance ?: 'Non spécifié'; ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Banque/Organisme :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo $loan->banque; ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Capital emprunté :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo number_format($loan->montant, 2, ',', ' '); ?> €</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Durée :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo $loan->duree_credit; ?> mois</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Mensualité :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo number_format($loan->mensualite, 2, ',', ' '); ?> €</td>
|
|
</tr>
|
|
<?php if (!empty($loan->date_premiere_echeance)) : ?>
|
|
<tr>
|
|
<td style="padding: 5px 0; padding-left: 20px;"><strong>Date 1ère échéance :</strong></td>
|
|
<td style="padding: 5px 0;"><?php echo date('d/m/Y', strtotime($loan->date_premiere_echeance)); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php
|
|
$loan_num++;
|
|
endforeach;
|
|
?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
<?php
|
|
$building_num++;
|
|
endforeach;
|
|
?>
|
|
<?php
|
|
endif;
|
|
}
|
|
?>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding:24px 24px 0 24px; text-align:center; color:#888; font-size:13px;">
|
|
<hr style="border:none; border-top:1px solid #eee; margin:24px 0 16px 0;">
|
|
Cet email a été envoyé automatiquement, merci de ne pas y répondre.<br>
|
|
© <?php echo date('Y'); ?> Crédit Direct. Tous droits réservés.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|