credit-direct/templates/email/credit-step4-mail_client.php
2025-12-18 09:44:42 +01:00

237 lines
9.4 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demande de crédit</title>
</head>
<body style="margin:0; padding:0; background:#001954; font-family:'Plus Jakarta Sans', Arial, Helvetica, sans-serif;">
<div style="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; font-family:'Plus Jakarta Sans', Arial, Helvetica, sans-serif;">
<div style="text-align:center; background:#fff; border-radius:12px 12px 0 0;">
<img src="<?php echo $this->main->asset('img/cred_banniere.jpg'); ?>" alt="Crédit Direct" width="600" height="120" style="display:block; margin:0 auto; width:600px; height:120px; border-radius:12px 12px 0 0;">
</div>
<div style="padding:32px 24px 0 24px;">
<?php
$map_credit_type = [
"pat"=>"Prêt personnel / Tous motifs / Achats divers",
"frais_notaire"=>"Financement frais de notaire",
"but_immo"=>"Credit travaux / Renovation / Energie",
"fin_neuve"=>"Financement vehicule NEUF",
"fin_occ_m3a"=>"Financement vehicule d'occasion MOINS de 3 ans",
"fin_occ_p3a"=>"Financement vehicule d'occasion PLUS de 3 ans",
"am"=>"Credit hypothecaire classique (achat maison, construction, refinancement, regroupement, travaux, achat à l'etranger)"
];
$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'
]
?>
<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%"><strong>Type de crédit:</strong></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 crédit inconnu' ?></td>
</tr>
<tr>
<td><strong>Capital:</strong></td>
<td><?php echo $currentCredit->capital ?> €</td>
</tr>
<tr>
<td><strong>Durée:</strong></td>
<td><?php echo $currentCredit->duree ?> <?php if ($currentCredit->type_credit === 'am'): ?>ans<?php else: ?>mois<?php endif ?></td>
</tr>
<tr>
<td><strong>Coût total:</strong></td>
<td><?php echo $currentCredit->cout_total ?> €</td>
</tr>
<tr>
<td><strong>Mensualité:</strong></td>
<td><?php echo $currentCredit->mensualite ?> €</td>
</tr>
<tr>
<td><strong>Taux nominal annuel:</strong></td>
<td><?php echo $currentCredit->taux_nominal_annuel ?></td>
</tr>
</tbody>
<?php if (in_array($currentCredit->type_credit, ['fin_neuve', 'fin_occ_m3a', 'fin_occ_p3a'])) : ?>
<thead>
<tr>
<th colspan="2" style="text-align:left; padding-top:24px; padding-bottom:12px;">
<h3 style="color:#001954; font-size:20px; margin:0;">Financement véhicule</h3>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Marque + Modèle:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->marque ?></td>
</tr>
<tr>
<td><strong>Date 1ère immatriculation:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->date_immatriculation ?></td>
</tr>
<tr>
<td><strong>Nom du vendeur:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->nom_vendeur ?></td>
</tr>
<tr>
<td><strong>Adresse du vendeur:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->adresse_vendeur ?></td>
</tr>
<tr>
<td><strong>Prix d'achat du véhicule:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->prix_vehicule ?> €</td>
</tr>
<tr>
<td><strong>Montant de l'acompte:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->montant_accompte ?> €</td>
</tr>
<tr>
<td><strong>Montant de la reprise:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->montant_reprise ?> €</td>
</tr>
<tr>
<td><strong>Montant à emprunter:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->montant_emprunt ?> €</td>
</tr>
<tr>
<td><strong>Durée:</strong></td>
<td><?php echo $currentCredit->options_credit_auto->duree ?> mois</td>
</tr>
</tbody>
<?php endif ?>
<?php if (in_array($currentCredit->type_credit, ['am'])) : ?>
<thead>
<tr>
<th colspan="2" style="text-align:left; padding-top:24px; padding-bottom:12px;">
<h3 style="color:#001954; font-size:20px; margin:0;">Crédit hypothécaire</h3>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Type de crédit:</strong></td>
<td><?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><strong>Prix d'achat:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->prix_achat ?> €</td>
</tr>
<tr>
<td><strong>Prix de la construction TVAC:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->prix_construction_tvac ?> €</td>
</tr>
<tr>
<td><strong>Valeur du bâtiment:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->valeur_batiment ?> €</td>
</tr>
<tr>
<td><strong>Fonds propres:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->fonds_propre ?> €</td>
</tr>
<tr>
<td><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><strong>Montant du revenu cadastral:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->montant_revenu_cadastral ?> €</td>
</tr>
<tr>
<td><strong>Montant à emprunter:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->montant_a_emprunter ?> €</td>
</tr>
<tr>
<td><strong>Durée:</strong></td>
<td><?php echo $currentCredit->options_credit_hypothecaire->duree ?> ans</td>
</tr>
</tbody>
<?php endif ?>
<?php
$people = [
'emprunteur' => $borrower,
];
if (is_object($coBorrower)) {
$people['coemprunteur'] = $coBorrower;
}
?>
<?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><strong>Nom:</strong></td>
<td><?php echo $person->nom ?></td>
</tr>
<tr>
<td><strong>Prénom:</strong></td>
<td><?php echo $person->prenom ?></td>
</tr>
<tr>
<td><strong>Type de logement:</strong></td>
<td><?php echo array_key_exists($person->type_logement, $map_habitation_type) ? $map_habitation_type[$person->type_logement] : 'Type de logement inconnu' ?></td>
</tr>
<tr>
<td><strong>Adresse:</strong></td>
<td><?php echo $person->adresse ?></td>
</tr>
<tr>
<td><strong>Code postal:</strong></td>
<td><?php echo $person->code_postal ?></td>
</tr>
<tr>
<td><strong>Ville:</strong></td>
<td><?php echo $person->ville ?></td>
</tr>
<tr>
<td><strong>Pays:</strong></td>
<td><?php echo $person->pays ?></td>
</tr>
<tr>
<td><strong>Téléphone:</strong></td>
<td><?php echo $person->telephone ?></td>
</tr>
<tr>
<td><strong>Email:</strong></td>
<td><?php echo $person->email ?></td>
</tr>
</tbody>
<?php endforeach ?>
</table>
</div>
</div>
</body>
</html>