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

591 lines
45 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'
];
$taeg = str_replace('%', '', $currentCredit->taux_nominal_annuel);
$taux_debiteur = number_format(($taeg * 0.11) + $taeg, 2);
$exemple_info = $model->get_exemples_infos($currentCredit->type_credit);
?>
<section class="credit-step-header">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Introduction de votre demande de crédit</h2>
</div>
</div>
</div>
</section>
<section class="infos-credits-top">
<div class="container">
<section class="row">
<section class="type_credit_title">
<h3>Type de crédit: <?= (string) ($creditOptionsLabels ?? '') ?></h3>
</section>
<div class="bg-light credit-recap-holder">
<div class="credit-recap col-md-12 p-3">
<div class="credit-recap-container">
<div class="credit-info">
<div class="credit-item">
<span class="credit-label">Montant:</span>
<span class="credit-value"><?= (string) ($currentCredit->capital ?? '') ?> €</span>
</div>
<div class="credit-item">
<span class="credit-label">Taux débiteur:</span>
<span class="credit-value highlight"><?= (string) ($currentCredit->taux_nominal_annuel ?? '') ?></span>
</div>
<div class="credit-item">
<span class="credit-label">Durée:</span>
<span class="credit-value"><?= (string) ($currentCredit->duree ?? '') ?>
<?php if ($currentCredit->type_credit === 'am'): ?>ans<?php else: ?>mois<?php endif ?></span>
</div>
<div class="credit-item">
<span class="credit-label">Mensualité:</span>
<span class="credit-value highlight"><?= (string) ($currentCredit->mensualite ?? '') ?>€</span>
</div>
<div class="credit-item">
<span class="credit-label">Coût total:</span>
<span class="credit-value highlight"><?= (string) ($currentCredit->cout_total ?? '') ?>€</span>
</div>
<div class="credit-item">
<span class="credit-label">TAEG:</span>
<span class="credit-value"><?= (string) ($taux_debiteur ?? '') ?>%</span>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</section>
<div class="container">
<div class="wp-credit-form">
<form class="form-submit" method="POST" action="#" enctype="multipart/form-data">
<input type="hidden" name="credit-direct-token" value="<?php echo (string) ($currentCredit->token ?? '') ?>">
<fieldset>
<legend>Informations de contact</legend>
<div class="form-row">
<div class="form-group col-md-6">
<label for="IDlastname">Nom</label>
<input name="lastname" type="text" class="form-control" id="IDlastname" required>
</div>
<div class="form-group col-md-6">
<label for="IDfirstname">Prénom</label>
<input name="firstname" type="text" class="form-control" id="IDfirstname" required>
</div>
<div class="form-group col-md-6">
<label for="IDphone">Téléphone</label>
<input name="phone" type="tel" class="form-control" id="IDphone" required>
</div>
<div class="form-group col-md-6">
<label for="IDemail">Email</label>
<input name="email" type="email" class="form-control" id="IDemail" required>
</div>
<!-- <div class="form-group col-md-4">
<label for="IDagency">Agence</label>
<select name="agency" id="IDagency" class="form-control" required>
<option value="">Veuillez faire un choix</option>
<?php foreach($agencies as $agency) : ?>
<option value="<?php echo $agency->idAgences ?>">
Agence <?php echo $agency->Nom_agence ?>
<?php if (!is_null($agency->description_agence) && $agency->description_agence !== '') : ?>
: <?php echo $agency->description_agence ?>
<?php endif ?>
</option>
<?php endforeach ?>
</select>
</div> -->
<div class="form-group col-md-4">
<label for="IDbirthdate">Date de naissance</label>
<input name="birthdate" type="text" class="form-control input-date" id="IDbirthdate" pattern="\d{1,2}/\d{1,2}/\d{4}" placeholder="JJ/MM/AAAA" data-inputmask="'mask': '99/99/9999'" required>
</div>
<div class="form-group col-md-3">
<label for="IDnationality">Nationalité</label>
<?php
// Pays principaux/frontaliers avec noms français
$main_countries = [
'BE' => 'Belgique',
'LU' => 'Luxembourg',
'FR' => 'France',
'DE' => 'Allemagne',
'NL' => 'Pays-Bas',
];
// Liste de traduction FR pour les autres pays (extrait, à compléter si besoin)
$country_fr = [
'AD' => 'Andorre', 'AL' => 'Albanie', 'AT' => 'Autriche', 'BA' => 'Bosnie-Herzégovine', 'BG' => 'Bulgarie', 'BY' => 'Biélorussie', 'CH' => 'Suisse', 'CZ' => 'Tchéquie', 'DK' => 'Danemark', 'EE' => 'Estonie', 'ES' => 'Espagne', 'FI' => 'Finlande', 'GB' => 'Royaume-Uni', 'GR' => 'Grèce', 'HR' => 'Croatie', 'HU' => 'Hongrie', 'IE' => 'Irlande', 'IS' => 'Islande', 'IT' => 'Italie', 'LT' => 'Lituanie', 'LV' => 'Lettonie', 'MC' => 'Monaco', 'MD' => 'Moldavie', 'ME' => 'Monténégro', 'MK' => 'Macédoine du Nord', 'MT' => 'Malte', 'NO' => 'Norvège', 'PL' => 'Pologne', 'PT' => 'Portugal', 'RO' => 'Roumanie', 'RS' => 'Serbie', 'RU' => 'Russie', 'SE' => 'Suède', 'SI' => 'Slovénie', 'SK' => 'Slovaquie', 'SM' => 'Saint-Marin', 'UA' => 'Ukraine', 'VA' => 'Vatican',
// ... compléter si besoin ...
];
// Liste CSV (code => nom anglais)
$csv_countries = [
'AD' => 'Andorra', 'AE' => 'United Arab Emirates', 'AF' => 'Afghanistan', 'AG' => 'Antigua and Barbuda', 'AI' => 'Anguilla', 'AL' => 'Albania', 'AM' => 'Armenia', 'AN' => 'Netherlands Antilles', 'AO' => 'Angola', 'AQ' => 'Antarctica', 'AR' => 'Argentina', 'AS' => 'American Samoa', 'AT' => 'Austria', 'AU' => 'Australia', 'AW' => 'Aruba', 'AZ' => 'Azerbaijan', 'BA' => 'Bosnia and Herzegovina', 'BB' => 'Barbados', 'BD' => 'Bangladesh', 'BE' => 'Belgium', 'BF' => 'Burkina Faso', 'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BI' => 'Burundi', 'BJ' => 'Benin', 'BM' => 'Bermuda', 'BN' => 'Brunei', 'BO' => 'Bolivia', 'BR' => 'Brazil', 'BS' => 'Bahamas', 'BT' => 'Bhutan', 'BV' => 'Bouvet Island', 'BW' => 'Botswana', 'BY' => 'Belarus', 'BZ' => 'Belize', 'CA' => 'Canada', 'CC' => 'Cocos [Keeling] Islands', 'CD' => 'Congo [DRC]', 'CF' => 'Central African Republic', 'CG' => 'Congo [Republic]', 'CH' => 'Switzerland', 'CI' =>
"Côte d'Ivoire", 'CK' => 'Cook Islands', 'CL' => 'Chile', 'CM' => 'Cameroon', 'CN' => 'China', 'CO' => 'Colombia', 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CV' => 'Cape Verde', 'CX' => 'Christmas Island', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'DE' => 'Germany', 'DJ' => 'Djibouti', 'DK' => 'Denmark', 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'DZ' => 'Algeria', 'EC' => 'Ecuador', 'EE' => 'Estonia', 'EG' => 'Egypt', 'EH' => 'Western Sahara', 'ER' => 'Eritrea', 'ES' => 'Spain', 'ET' => 'Ethiopia', 'FI' => 'Finland', 'FJ' => 'Fiji', 'FK' => 'Falkland Islands [Islas Malvinas]', 'FM' => 'Micronesia', 'FO' => 'Faroe Islands', 'FR' => 'France', 'GA' => 'Gabon', 'GB' => 'United Kingdom', 'GD' => 'Grenada', 'GE' => 'Georgia', 'GF' => 'French Guiana', 'GG' => 'Guernsey', 'GH' => 'Ghana', 'GI' => 'Gibraltar', 'GL' => 'Greenland', 'GM' => 'Gambia', 'GN' => 'Guinea', 'GP' => 'Guadeloupe', 'GQ' => 'Equatorial Guinea', 'GR' => 'Greece', 'GS' => 'South Georgia and the South Sandwich Islands', 'GT' => 'Guatemala', 'GU' => 'Guam', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'GZ' => 'Gaza Strip', 'HK' => 'Hong Kong', 'HM' => 'Heard Island and McDonald Islands', 'HN' => 'Honduras', 'HR' => 'Croatia', 'HT' => 'Haiti', 'HU' => 'Hungary', 'ID' => 'Indonesia', 'IE' => 'Ireland', 'IL' => 'Israel', 'IM' => 'Isle of Man', 'IN' => 'India', 'IO' => 'British Indian Ocean Territory', 'IQ' => 'Iraq', 'IR' => 'Iran', 'IS' => 'Iceland', 'IT' => 'Italy', 'JE' => 'Jersey', 'JM' => 'Jamaica', 'JO' => 'Jordan', 'JP' => 'Japan', 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia', 'KI' => 'Kiribati', 'KM' => 'Comoros', 'KN' => 'Saint Kitts and Nevis', 'KP' => 'North Korea', 'KR' => 'South Korea', 'KW' => 'Kuwait', 'KY' => 'Cayman Islands', 'KZ' => 'Kazakhstan', 'LA' => 'Laos', 'LB' => 'Lebanon', 'LC' => 'Saint Lucia', 'LI' => 'Liechtenstein', 'LK' => 'Sri Lanka', 'LR' => 'Liberia', 'LS' => 'Lesotho', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'LV' => 'Latvia', 'LY' => 'Libya', 'MA' => 'Morocco', 'MC' => 'Monaco', 'MD' => 'Moldova', 'ME' => 'Montenegro', 'MG' => 'Madagascar', 'MH' => 'Marshall Islands', 'MK' => 'Macedonia [FYROM]', 'ML' => 'Mali', 'MM' => 'Myanmar [Burma]', 'MN' => 'Mongolia', 'MO' => 'Macau', 'MP' => 'Northern Mariana Islands', 'MQ' => 'Martinique', 'MR' => 'Mauritania', 'MS' => 'Montserrat', 'MT' => 'Malta', 'MU' => 'Mauritius', 'MV' => 'Maldives', 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia', 'MZ' => 'Mozambique', 'NA' => 'Namibia', 'NC' => 'New Caledonia', 'NE' => 'Niger', 'NF' => 'Norfolk Island', 'NG' => 'Nigeria', 'NI' => 'Nicaragua', 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal', 'NR' => 'Nauru', 'NU' => 'Niue', 'NZ' => 'New Zealand', 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru', 'PF' => 'French Polynesia', 'PG' => 'Papua New Guinea', 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland', 'PM' => 'Saint Pierre and Miquelon', 'PN' => 'Pitcairn Islands', 'PR' => 'Puerto Rico', 'PS' => 'Palestinian Territories', 'PT' => 'Portugal', 'PW' => 'Palau', 'PY' => 'Paraguay', 'QA' => 'Qatar', 'RE' => 'Réunion', 'RO' => 'Romania', 'RS' => 'Serbia', 'RU' => 'Russia', 'RW' => 'Rwanda', 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles', 'SD' => 'Sudan', 'SE' => 'Sweden', 'SG' => 'Singapore', 'SH' => 'Saint Helena', 'SI' => 'Slovenia', 'SJ' => 'Svalbard and Jan Mayen', 'SK' => 'Slovakia', 'SL' => 'Sierra Leone', 'SM' => 'San Marino', 'SN' => 'Senegal', 'SO' => 'Somalia', 'SR' => 'Suriname', 'ST' => 'São Tomé and Príncipe', 'SV' => 'El Salvador', 'SY' => 'Syria', 'SZ' => 'Swaziland', 'TC' => 'Turks and Caicos Islands', 'TD' => 'Chad', 'TF' => 'French Southern Territories', 'TG' => 'Togo', 'TH' => 'Thailand', 'TJ' => 'Tajikistan', 'TK' => 'Tokelau', 'TL' => 'Timor-Leste', 'TM' => 'Turkmenistan', 'TN' => 'Tunisia', 'TO' => 'Tonga', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago', 'TV' => 'Tuvalu', 'TW' => 'Taiwan', 'TZ' => 'Tanzania', 'UA' => 'Ukraine', 'UG' => 'Uganda', 'UM' => 'U.S. Minor Outlying Islands', 'US' => 'United States', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VA' => 'Vatican City', 'VC' => 'Saint Vincent and the Grenadines', 'VE' => 'Venezuela', 'VG' => 'British Virgin Islands', 'VI' => 'U.S. Virgin Islands', 'VN' => 'Vietnam', 'VU' => 'Vanuatu', 'WF' => 'Wallis and Futuna', 'WS' => 'Samoa', 'XK' => 'Kosovo', 'YE' => 'Yemen', 'YT' => 'Mayotte', 'ZA' => 'South Africa', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe',
];
// Construction du tableau final pour le 2e groupe
$other_countries = [];
foreach ($csv_countries as $code => $en_name) {
if (!isset($main_countries[$code])) {
$label = isset($country_fr[$code]) ? $country_fr[$code] : $en_name;
$other_countries[$code] = $label;
}
}
asort($other_countries, SORT_LOCALE_STRING);
// Persistance de la sélection
$selected = $model->getFieldValue('nationalite', $borrower);
?>
<select name="nationality" class="form-control" id="IDnationality" required>
<optgroup label="Belgique, Luxembourg et pays frontaliers">
<?php foreach ($main_countries as $code => $label): ?>
<option value="<?php echo $code; ?>"<?php if ($selected === $code) echo ' selected'; ?>><?php echo $label; ?></option>
<?php endforeach; ?>
</optgroup>
<optgroup label="Autres pays du monde">
<?php foreach ($other_countries as $code => $label): ?>
<option value="<?php echo $code; ?>"<?php if ($selected === $code) echo ' selected'; ?>><?php echo $label; ?></option>
<?php endforeach; ?>
</optgroup>
</select>
</div>
<div class="form-group col-md-4">
<label for="IDcivilstatus">État civil</label>
<?php $etatCivil = $wpdb->get_results( "SELECT * FROM cdf_Etat_civil"); ?>
<select name="civilstatus" id="IDcivilstatus" class="form-control" required>
<option value="" selected="">Veuillez faire un choix</option>
<?php foreach ($etatCivil as $ec): ?>
<option value="<?php echo $ec->idetat_civil ?>"><?php echo $ec->nom_etat_civil ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-3">
<label for="IDaddress">Adresse</label>
<input name="address" type="text" class="form-control" id="IDaddress"
placeholder="Rue et numéro" required>
</div>
<div class="form-group col-md-3"><label for="IDzip">Code Postal</label>
<input name="zip" type="number" class="form-control" id="IDzip" required>
</div>
<div class="form-group col-md-3">
<label for="IDcity">Ville</label>
<input name="city" type="text" class="form-control" id="IDcity" required>
</div>
<div class="form-group col-md-3">
<label for="IDcountry">Pays</label>
<input name="country" type="text" class="form-control" id="IDcountry" required>
</div>
</div>
</fieldset>
<fieldset>
<legend>But du prêt hypotécaire</legend>
<div class="row">
<div class="form-group col-md-4">
<label for="IDestateloantype">Raison du prêt</label>
<select name="estateloantype" id="IDestateloantype" class="form-control" required>
<option value="">Veuillez sélectionner votre type de prêt</option>
<?php foreach ($mapHouseCreditTypes as $value => $label):
$selected = '';
if(isset($post['estateloantype']) && !empty($post['estateloantype']) && $post['estateloantype'] == $value)
$selected = ' selected';
?>
<option value="<?php echo $value ?>" <?= $selected; ?>><?php echo $label ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="IDestatebuyingprice">Prix d'achat</label>
<input name="estatebuyingprice" type="number" class="form-control" id="IDestatebuyingprice"
min="0" step="0.01">
</div>
<div class="form-group col-md-4">
<div class="col-form-label">
<b>Compromis signé</b>
</div>
<div class="form-check form-check-inline">
<input name="estatecompromise" type="radio" class="form-check-input"
id="ID1estatecompromise" value="0" checked="">
<label class="form-check-label" for="ID1estatecompromise">Non</label>
</div>
<div class="form-check form-check-inline">
<input name="estatecompromise" type="radio" class="form-check-input"
id="ID2estatecompromise" value="1">
<label class="form-check-label" for="ID2estatecompromise">Oui</label>
</div>
</div>
<div class="form-group col-md-4">
<label for="IDbatiment_emprunt">Montant à emprunter</label>
<input name="batiment_emprunt" type="number" class="form-control" id="IDbatiment_emprunt"
min="0" step="0.01" required value="<?= (string) ($currentCredit->capital ?? '') ?>">
</div>
<div class="form-group col-md-4">
<label for="IDbatiment_duree">Durée (ans)</label>
<input name="batiment_duree" type="number" class="form-control" id="IDbatiment_duree" min="10"
max="30" step="1" required value="<?= (string) ($currentCredit->duree ?? '') ?>">
</div>
<div class="form-group col-md-4">
<label>Apportez-vous des fonds propres ?</label><br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="has_estateequity" id="estateequity_yes" value="1">
<label class="form-check-label" for="estateequity_yes">Oui</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="has_estateequity" id="estateequity_no" value="0" checked>
<label class="form-check-label" for="estateequity_no">Non</label>
</div>
<div class="fonds-propres mt-2" id="estateequity_amount_field" style="display:none;">
<input name="estateequity" type="number" class="form-control" id="IDestateequity" min="0" placeholder="Montant de vos fonds propres" step="0.01">
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Revenus et charges</legend>
<div class="row">
<div class="form-group col-md-6">
<label for="IDjob">Profession</label>
<?php $professions = $wpdb->get_results( "SELECT * FROM cdf_Profession"); ?>
<select name="job" id="IDjob" class="form-control" required>
<option value="">Veuillez faire un choix</option>
<?php foreach ($professions as $p) : ?>
<option value="<?php echo $p->idprofession ?>"><?php echo $p->nom_profession ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-6 withemployer_section">
<section class="contrat employee_section">
<label for="IDcontract_type">Type de contrat</label>
<select name="contract_type" id="IDcontract_type" class="form-control">
<option value=""></option>
<?php foreach($contractTypes as $key => $contractType): ?>
<option value="<?php echo $key ?>"><?php echo $contractType ?></option>
<?php endforeach ?>
</select>
</section>
<section class="independent_since independent_section hidden">
<label for="IDindependent_since">Indépendant depuis</label>
<input name="independent_since" type="text" class="form-control input-date" id="IDindependent_since" placeholder="JJ/MM/AAAA" data-inputmask="'mask': '99/99/9999'">
</section>
</div>
<div class="form-group col-md-6">
<section class="monthly_salary employee_section">
<label for="IDsalary"><span>Salaire net mensuel</span></label>
<input name="salary" type="number" class="form-control" id="IDsalary" min="0" step="0.01" required>
</section>
<section class="annual_taxable_income independent_section hidden">
<label for="IDannual_taxable_income"><span>Revenu imposable annuel</span></label>
<input name="annual_taxable_income" type="number" class="form-control" id="IDannual_taxable_income" min="0" step="0.01">
</section>
</div>
<div class="form-group col-md-6 withemployer_section">
<!-- <section class="paycheck employee_section">
<label for="IDpaycheck">Preuve de revenu (fiche de paie, mutuelle, chômage, etc.)</label>
<input name="paycheck[]" type="file" class="form-control" id="IDpaycheck" multiple>
</section> -->
<!-- <section class="notice_of_assessment independent_section hidden">
<label for="IDnotice_of_assessment">Votre dernier avertissement extrait de rôle</label></label>
<input name="notice_of_assessment" type="file" class="form-control" id="IDnotice_of_assessment">
</section> -->
</div>
</div>
<div class="form-row">
<div class="col-form-label pr-3 pl-0">J'emprunte ?</div>
<div class="form-check form-check-inline">
<input name="hascoborrower" type="radio" class="form-check-input" id="ID1hascoborrower"
value="0" checked="">
<label class="form-check-label" for="ID1hascoborrower">seul</label>
</div>
<div class="form-check form-check-inline">
<input name="hascoborrower" type="radio" class="form-check-input" id="ID2hascoborrower"
value="1">
<label class="form-check-label" for="ID2hascoborrower">avec un co-emprunteur</label>
</div>
</div>
</fieldset>
<section class="co-emprunteur hidden col-md-12 bg-light">
<fieldset>
<legend>Co-emprunteur - Informations de contact</legend>
<div class="form-row">
<div class="form-group col-md-6"><label for="IDcofirstname">Prénom*</label>
<input name="cofirstname" type="text" class="form-control isRequired" id="IDcofirstname">
</div>
<div class="form-group col-md-6">
<label for="IDcolastname">Nom*</label>
<input name="colastname" type="text" class="form-control isRequired" id="IDcolastname">
</div>
<div class="form-group col-md-4">
<label for="IDcocivilstatus">État civil*</label>
<?php $etatCivil = $wpdb->get_results( "SELECT * FROM cdf_Etat_civil"); ?>
<select name="cocivilstatus" id="IDcocivilstatus" class="form-control isRequired">
<option value="" selected="">Veuillez faire un choix</option>
<?php foreach ($etatCivil as $ec): ?>
<option value="<?php echo $ec->idetat_civil ?>"><?php echo $ec->nom_etat_civil ?>
</option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="IDcobirthdate">Date de naissance*</label>
<input name="cobirthdate" type="text" class="form-control isRequired input-date" id="IDcobirthdate" placeholder="JJ/MM/AAAA" data-inputmask="'mask': '99/99/9999'">
</div>
<div class="form-group col-md-3">
<label for="IDconationality">Nationalité</label>
<?php
// Pays principaux/frontaliers avec noms français
$main_countries = [
'BE' => 'Belgique',
'LU' => 'Luxembourg',
'FR' => 'France',
'DE' => 'Allemagne',
'NL' => 'Pays-Bas',
];
// Liste de traduction FR pour les autres pays (extrait, à compléter si besoin)
$country_fr = [
'AD' => 'Andorre', 'AL' => 'Albanie', 'AT' => 'Autriche', 'BA' => 'Bosnie-Herzégovine', 'BG' => 'Bulgarie', 'BY' => 'Biélorussie', 'CH' => 'Suisse', 'CZ' => 'Tchéquie', 'DK' => 'Danemark', 'EE' => 'Estonie', 'ES' => 'Espagne', 'FI' => 'Finlande', 'GB' => 'Royaume-Uni', 'GR' => 'Grèce', 'HR' => 'Croatie', 'HU' => 'Hongrie', 'IE' => 'Irlande', 'IS' => 'Islande', 'IT' => 'Italie', 'LT' => 'Lituanie', 'LV' => 'Lettonie', 'MC' => 'Monaco', 'MD' => 'Moldavie', 'ME' => 'Monténégro', 'MK' => 'Macédoine du Nord', 'MT' => 'Malte', 'NO' => 'Norvège', 'PL' => 'Pologne', 'PT' => 'Portugal', 'RO' => 'Roumanie', 'RS' => 'Serbie', 'RU' => 'Russie', 'SE' => 'Suède', 'SI' => 'Slovénie', 'SK' => 'Slovaquie', 'SM' => 'Saint-Marin', 'UA' => 'Ukraine', 'VA' => 'Vatican',
// ... compléter si besoin ...
];
// Liste CSV (code => nom anglais)
$csv_countries = [
'AD' => 'Andorra', 'AE' => 'United Arab Emirates', 'AF' => 'Afghanistan', 'AG' => 'Antigua and Barbuda', 'AI' => 'Anguilla', 'AL' => 'Albania', 'AM' => 'Armenia', 'AN' => 'Netherlands Antilles', 'AO' => 'Angola', 'AQ' => 'Antarctica', 'AR' => 'Argentina', 'AS' => 'American Samoa', 'AT' => 'Austria', 'AU' => 'Australia', 'AW' => 'Aruba', 'AZ' => 'Azerbaijan', 'BA' => 'Bosnia and Herzegovina', 'BB' => 'Barbados', 'BD' => 'Bangladesh', 'BE' => 'Belgium', 'BF' => 'Burkina Faso', 'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BI' => 'Burundi', 'BJ' => 'Benin', 'BM' => 'Bermuda', 'BN' => 'Brunei', 'BO' => 'Bolivia', 'BR' => 'Brazil', 'BS' => 'Bahamas', 'BT' => 'Bhutan', 'BV' => 'Bouvet Island', 'BW' => 'Botswana', 'BY' => 'Belarus', 'BZ' => 'Belize', 'CA' => 'Canada', 'CC' => 'Cocos [Keeling] Islands', 'CD' => 'Congo [DRC]', 'CF' => 'Central African Republic', 'CG' => 'Congo [Republic]', 'CH' => 'Switzerland', 'CI' =>
"Côte d'Ivoire", 'CK' => 'Cook Islands', 'CL' => 'Chile', 'CM' => 'Cameroon', 'CN' => 'China', 'CO' => 'Colombia', 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CV' => 'Cape Verde', 'CX' => 'Christmas Island', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'DE' => 'Germany', 'DJ' => 'Djibouti', 'DK' => 'Denmark', 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'DZ' => 'Algeria', 'EC' => 'Ecuador', 'EE' => 'Estonia', 'EG' => 'Egypt', 'EH' => 'Western Sahara', 'ER' => 'Eritrea', 'ES' => 'Spain', 'ET' => 'Ethiopia', 'FI' => 'Finland', 'FJ' => 'Fiji', 'FK' => 'Falkland Islands [Islas Malvinas]', 'FM' => 'Micronesia', 'FO' => 'Faroe Islands', 'FR' => 'France', 'GA' => 'Gabon', 'GB' => 'United Kingdom', 'GD' => 'Grenada', 'GE' => 'Georgia', 'GF' => 'French Guiana', 'GG' => 'Guernsey', 'GH' => 'Ghana', 'GI' => 'Gibraltar', 'GL' => 'Greenland', 'GM' => 'Gambia', 'GN' => 'Guinea', 'GP' => 'Guadeloupe', 'GQ' => 'Equatorial Guinea', 'GR' => 'Greece', 'GS' => 'South Georgia and the South Sandwich Islands', 'GT' => 'Guatemala', 'GU' => 'Guam', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'GZ' => 'Gaza Strip', 'HK' => 'Hong Kong', 'HM' => 'Heard Island and McDonald Islands', 'HN' => 'Honduras', 'HR' => 'Croatia', 'HT' => 'Haiti', 'HU' => 'Hungary', 'ID' => 'Indonesia', 'IE' => 'Ireland', 'IL' => 'Israel', 'IM' => 'Isle of Man', 'IN' => 'India', 'IO' => 'British Indian Ocean Territory', 'IQ' => 'Iraq', 'IR' => 'Iran', 'IS' => 'Iceland', 'IT' => 'Italy', 'JE' => 'Jersey', 'JM' => 'Jamaica', 'JO' => 'Jordan', 'JP' => 'Japan', 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia', 'KI' => 'Kiribati', 'KM' => 'Comoros', 'KN' => 'Saint Kitts and Nevis', 'KP' => 'North Korea', 'KR' => 'South Korea', 'KW' => 'Kuwait', 'KY' => 'Cayman Islands', 'KZ' => 'Kazakhstan', 'LA' => 'Laos', 'LB' => 'Lebanon', 'LC' => 'Saint Lucia', 'LI' => 'Liechtenstein', 'LK' => 'Sri Lanka', 'LR' => 'Liberia', 'LS' => 'Lesotho', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'LV' => 'Latvia', 'LY' => 'Libya', 'MA' => 'Morocco', 'MC' => 'Monaco', 'MD' => 'Moldova', 'ME' => 'Montenegro', 'MG' => 'Madagascar', 'MH' => 'Marshall Islands', 'MK' => 'Macedonia [FYROM]', 'ML' => 'Mali', 'MM' => 'Myanmar [Burma]', 'MN' => 'Mongolia', 'MO' => 'Macau', 'MP' => 'Northern Mariana Islands', 'MQ' => 'Martinique', 'MR' => 'Mauritania', 'MS' => 'Montserrat', 'MT' => 'Malta', 'MU' => 'Mauritius', 'MV' => 'Maldives', 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia', 'MZ' => 'Mozambique', 'NA' => 'Namibia', 'NC' => 'New Caledonia', 'NE' => 'Niger', 'NF' => 'Norfolk Island', 'NG' => 'Nigeria', 'NI' => 'Nicaragua', 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal', 'NR' => 'Nauru', 'NU' => 'Niue', 'NZ' => 'New Zealand', 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru', 'PF' => 'French Polynesia', 'PG' => 'Papua New Guinea', 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland', 'PM' => 'Saint Pierre and Miquelon', 'PN' => 'Pitcairn Islands', 'PR' => 'Puerto Rico', 'PS' => 'Palestinian Territories', 'PT' => 'Portugal', 'PW' => 'Palau', 'PY' => 'Paraguay', 'QA' => 'Qatar', 'RE' => 'Réunion', 'RO' => 'Romania', 'RS' => 'Serbia', 'RU' => 'Russia', 'RW' => 'Rwanda', 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles', 'SD' => 'Sudan', 'SE' => 'Sweden', 'SG' => 'Singapore', 'SH' => 'Saint Helena', 'SI' => 'Slovenia', 'SJ' => 'Svalbard and Jan Mayen', 'SK' => 'Slovakia', 'SL' => 'Sierra Leone', 'SM' => 'San Marino', 'SN' => 'Senegal', 'SO' => 'Somalia', 'SR' => 'Suriname', 'ST' => 'São Tomé and Príncipe', 'SV' => 'El Salvador', 'SY' => 'Syria', 'SZ' => 'Swaziland', 'TC' => 'Turks and Caicos Islands', 'TD' => 'Chad', 'TF' => 'French Southern Territories', 'TG' => 'Togo', 'TH' => 'Thailand', 'TJ' => 'Tajikistan', 'TK' => 'Tokelau', 'TL' => 'Timor-Leste', 'TM' => 'Turkmenistan', 'TN' => 'Tunisia', 'TO' => 'Tonga', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago', 'TV' => 'Tuvalu', 'TW' => 'Taiwan', 'TZ' => 'Tanzania', 'UA' => 'Ukraine', 'UG' => 'Uganda', 'UM' => 'U.S. Minor Outlying Islands', 'US' => 'United States', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VA' => 'Vatican City', 'VC' => 'Saint Vincent and the Grenadines', 'VE' => 'Venezuela', 'VG' => 'British Virgin Islands', 'VI' => 'U.S. Virgin Islands', 'VN' => 'Vietnam', 'VU' => 'Vanuatu', 'WF' => 'Wallis and Futuna', 'WS' => 'Samoa', 'XK' => 'Kosovo', 'YE' => 'Yemen', 'YT' => 'Mayotte', 'ZA' => 'South Africa', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe',
];
// Construction du tableau final pour le 2e groupe
$other_countries = [];
foreach ($csv_countries as $code => $en_name) {
if (!isset($main_countries[$code])) {
$label = isset($country_fr[$code]) ? $country_fr[$code] : $en_name;
$other_countries[$code] = $label;
}
}
asort($other_countries, SORT_LOCALE_STRING);
// Persistance de la sélection
$selected = isset($_POST['conationality']) ? $_POST['conationality'] : '';
?>
<select name="conationality" class="form-control" id="IDconationality">
<optgroup label="Belgique, Luxembourg et pays frontaliers">
<?php foreach ($main_countries as $code => $label): ?>
<option value="<?php echo $code; ?>"<?php if ($selected === $code) echo ' selected'; ?>><?php echo $label; ?></option>
<?php endforeach; ?>
</optgroup>
<optgroup label="Autres pays du monde">
<?php foreach ($other_countries as $code => $label): ?>
<option value="<?php echo $code; ?>"<?php if ($selected === $code) echo ' selected'; ?>><?php echo $label; ?></option>
<?php endforeach; ?>
</optgroup>
</select>
</div>
<div class="form-group col-md-3">
<label for="IDcoaddress">Adresse*</label>
<input name="coaddress" type="text" class="form-control isRequired" id="IDcoaddress">
</div>
<div class="form-group col-md-3">
<label for="IDcozip">Code Postal*</label>
<input name="cozip" type="text" class="form-control isRequired" id="IDcozip">
</div>
<div class="form-group col-md-3">
<label for="IDcocity">Ville*</label>
<input name="cocity" type="text" class="form-control isRequired" id="IDcocity">
</div>
<div class="form-group col-md-3">
<label for="IDcocountry">Pays*</label>
<input name="cocountry" type="text" class="form-control isRequired" id="IDcocountry">
</div>
</div>
</fieldset>
<fieldset>
<div class="form-row">
<legend>Co-emprunteur - Revenus et charges</legend>
<div class="form-group col-md-6">
<label for="IDcojob">Profession*</label>
<?php $professions = $wpdb->get_results( "SELECT * FROM cdf_Profession"); ?>
<select name="cojob" id="IDcojob" class="form-control isRequired">
<option value="">Veuillez faire un choix</option>
<?php foreach ($professions as $p) : ?>
<option value="<?php echo $p->idprofession ?>"><?php echo $p->nom_profession ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-6 withemployer_section">
<section class="contrat employee_section">
<label for="IDcocontract_type">Type de contrat*</label>
<select name="cocontract_type" id="IDcocontract_type" class="form-contro isRequiredl">
<option value=""></option>
<?php foreach($contractTypes as $key => $contractType): ?>
<option value="<?php echo $key ?>"><?php echo $contractType ?></option>
<?php endforeach ?>
</select>
</section>
<section class="independent_since independent_section hidden">
<label for="IDcoindependent_since">Indépendant depuis</label>
<input name="coindependent_since" type="text" class="form-control input-date" id="IDcoindependent_since" placeholder="JJ/MM/AAAA" data-inputmask="'mask': '99/99/9999'">
</section>
</div>
<div class="form-group col-md-6">
<section class="monthly_salary employee_section">
<label for="IDcosalary"><span>Salaire net mensuel*</span></label>
<input name="cosalary" type="number" class="form-control isRequired" id="IDcosalary" min="0"
step="0.01">
</section>
<section class="annual_taxable_income independent_section hidden">
<label for="IDcoannual_taxable_income"><span>Revenu imposable annuel*</span></label>
<input name="coannual_taxable_income" type="number" class="form-control" id="IDcoannual_taxable_income" min="0" step="0.01">
</section>
</div>
<div class="form-group col-md-6 withemployer_section">
<section class="paycheck employee_section">
<label for="IDcopaycheck">Preuve de revenu (fiche de paie, mutuelle, chômage, etc.) (Facultatif)</label>
<input name="copaycheck[]" type="file" class="form-control" id="IDcopaycheck" multiple>
</section>
<section class="notice_of_assessment independent_section hidden">
<label for="IDconotice_of_assessment">Votre avertissement extrait de rôle</label></label>
<input name="conotice_of_assessment" type="file" class="form-control" id="IDconotice_of_assessment">
</section>
</div>
</div>
</fieldset>
</section>
<div class="row">
<fieldset class="col-md-12 comment_fieldset">
<legend>Commentaires et informations complémentaires</legend>
<div class="form-group">
<label for="IDcomment">Commentaires</label>
<textarea name="comment" class="form-control" id="IDcomment" rows="6"></textarea>
</div>
</fieldset>
</div>
<div class="form-group">
<input type="hidden" name="wpcfstep" value="step1">
<input type="hidden" name="one_step_form" value="1">
<input type="hidden" name="credit_token" value="<?= $token ?>">
</div>
<div class="form-group">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="rgpd" value="1" id="rgpdID" required>
<label class="form-check-label" for="rgpdID">
J'accepte <a href="https://credit-direct.be/vie-privee/" target="_blank">les conditions
générales de Crédit Direct</a>
</label>
</div>
</div>
<!--hidden fields-->
<input type="hidden" name="capital" value="<?= (string) ($currentCredit->capital ?? '') ?>">
<input type="hidden" name="duree" value="<?= (string) ($currentCredit->duree ?? '') ?>">
<input type="hidden" name="type_credit" value="<?= (string) ($currentCredit->type_credit ?? '') ?>">
<input type="hidden" name="type_credit_selected" value="<?= (string) ($_POST['sub_loan_type'] ?? '') ?>">
<input type="hidden" name="cout_total" value="<?= (string) ($currentCredit->cout_total ?? '') ?>">
<input type="hidden" name="mensualite" value="<?= (string) ($currentCredit->mensualite ?? '') ?>">
<input type="hidden" name="taux_nominal_annuel" value="<?= (string) ($currentCredit->taux_nominal_annuel ?? '') ?>">
<div class="form-group">
<button class="btn btn-primary" type="submit" class="submit-demande" disabled>Envoyer la
demande</button>
</div>
</form>
<section class="info-credits-step">
<div class="col-md-12 py-5">
<div class="row">
<div class="col-md-6">
<p class="font-weight-bold col-md-8">Montant emprunté :</p>
<span class="col-md-4 text-right"><?= (string) ($currentCredit->capital ?? '') ?> €</span>
<p class="font-weight-bold col-md-8">Durée :</p>
<span class="col-md-4 text-right"><?= (string) ($currentCredit->duree ?? '') ?>
<?php if ($currentCredit->type_credit === 'am'): ?>ans<?php else: ?>mois<?php endif ?></span>
<p class="font-weight-bold col-md-8">Mensualité :</p>
<span class="col-md-4 text-right"><?= (string) ($currentCredit->mensualite ?? '') ?> €</span>
</div>
<div class="col-md-6">
<p class="font-weight-bold col-md-8">Coût Total :</p>
<span class="col-md-4 text-right"><?= (string) ($currentCredit->cout_total ?? '') ?> €</span>
<p class="font-weight-bold col-md-8">Taux débiteur :</p>
<span class="col-md-4 text-right"><?= (string) ($currentCredit->taux_nominal_annuel ?? '') ?></span>
<p class="font-weight-bold col-md-8">Taeg :</p>
<span class="col-md-4 text-right"><?= (string) ($taux_debiteur ?? '') ?>%</span>
</div>
</div>
</div>
<!-- <p><u>Exemple représentatif :</u> type de crédit = prêt à tempérament (tous motifs) / montant emprunté =
12.500€ / durée = 60 mois / mensualité = 245,97€ / coût total = 14758,20€ / TAEG* = 6,95% / taux
débiteur fixe = 6,95%.*TAEG = Taux Annuel Effectif Global = Taux Débiteur Fixe. Sous réserve de
changement des taux et d'acceptation de votre dossier par nos partenaires financiers.</p> -->
<?php if(!empty($exemple_info)): ?>
<div class="exemple-info">
<?= $exemple_info ?>
</div>
<?php endif; ?>
</section>
</div>
</div>