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

229 lines
9.3 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 $model->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_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%"><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>
<tr>
<td><strong>TAEG:</strong></td>
<td><?php echo $taux_debiteur ?>%</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><strong>But du prêt hypotécaire :</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>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 à 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>
<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><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>
<?php if ($who === 'emprunteur') : ?>
<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>
<!-- <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><strong>Etat civil:</strong></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><strong>Date de naissance:</strong></td>
<td><?php echo date('d/m/Y', strtotime($person->date_naissance)) ?></td>
</tr>
<tr>
<td><strong>Nationalité:</strong></td>
<td><?php echo $person->nationalité ?></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>Localité - Pays:</strong></td>
<td><?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><strong>Profession:</strong></td>
<td><?php echo $profession ?></td>
</tr>
<tr>
<td><strong>Type de contrat:</strong></td>
<td>
<?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>
</tr>
<tr>
<td><strong><?php echo $profession === 'Independant' ? 'Revenu imposable annuel' : 'Salaire net mensuel' ?>:</strong></td>
<td><?php echo $person->salaire ?> €</td>
</tr>
<?php if ($who === 'emprunteur'): ?>
<tr>
<td><strong>Avec un co-emprunteur:</strong></td>
<td><?php echo array_key_exists('coemprunteur', $people) && is_object($people['coemprunteur']) ? 'oui' : 'non' ?></td>
</tr>
<?php endif ?>
</tbody>
<?php endforeach ?>
</table>
</div>
<div 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.
</div>
</div>
</body>
</html>