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

215 lines
16 KiB
PHP

<fieldset class="credit-cols other-credit-cols">
<div class="col-form-label pr-3">Avez-vous des crédits en cours ?</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-check form-check-inline">
<input name="hascurrentloan" type="radio" class="form-check-input" id="IDhascurrentloan_no" value="0" <?php echo $model->isRadioChecked('hascurrentloan', '0', $borrower); ?>>
<label class="form-check-label" for="IDhascurrentloan_no">Non</label>
</div>
<div class="form-check form-check-inline">
<input name="hascurrentloan" type="radio" class="form-check-input" id="IDhascurrentloan_yes" value="1" <?php echo $model->isRadioChecked('hascurrentloan', '1', $borrower); ?>>
<label class="form-check-label" for="IDhascurrentloan_yes">Oui</label>
</div>
</div>
</div>
<div class="wpcf-currentloan d-none">
<?php if (is_object($coBorrower)) : ?>
<p class="warning-message">Si un crédit est en commun avec le co-emprunteur, merci de ne l'encoder qu'une seule fois.</p>
<?php endif ?>
<!-- Affichage des crédits existants -->
<?php echo $model->getCurrentLoansHTML($borrower); ?>
<div class="py-5 wpcf-currentloan--block wpcf-prototype">
<button type="button" class="close wpcf-currentloan--block--remove wpcf-btn-retirer" aria-label="Retirer">
<span class="wpcf-btn-retirer__icon" aria-hidden="true" style="vertical-align:middle;display:inline-block;width:1em;height:1em;"><svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" style="vertical-align:middle;"><path d="M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z"/></svg></span> Retirer
</button>
<div class="form-row">
<div class="form-group col-md-3">
<label for="ID__number__loantype">Type de créance</label>
<?php $typesCreance = $wpdb->get_results( "SELECT * FROM cdf_Type_creance"); ?>
<select name="currentloans[__number__][loantype]" id="ID__number__loantype" class="form-control" required>
<option value="">Veuillez faire un choix</option>
<?php foreach ($typesCreance as $typeCreance) : ?>
<option value="<?php echo $typeCreance->idtype_creance ?>"><?php echo $typeCreance->nom_creance ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-3">
<label for="ID__number__bankname">Nom de l'organisme / Banque</label>
<input name="currentloans[__number__][bankname]" type="text" class="form-control"
id="ID__number__bankname" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__borrowedcapital">Capital emprunté</label>
<input name="currentloans[__number__][borrowedcapital]" type="number" class="form-control"
id="ID__number__borrowedcapital" min="0" step="0.01" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__durationmonth">Durée du crédit (en mois)</label>
<input name="currentloans[__number__][durationmonth]" type="number" class="form-control"
id="ID__number__durationmonth" min="0" step="1" required>
</div>
<div class="form-group col-md-3"><label for="ID__number__monthlypayment">Mensualité</label>
<input name="currentloans[__number__][monthlypayment]" type="number" class="form-control"
id="ID__number__monthlypayment" min="0" step="0.01" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__firstduedate">Date 1ère échéance</label>
<input name="currentloans[__number__][firstduedate]" type="date" class="form-control"
id="ID__number__firstduedate" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__remainingbalance">Solde restant dû (approximatif)</label>
<input name="currentloans[__number__][remainingbalance]" type="number" class="form-control"
id="ID__number__remainingbalance" min="0" step="0.01" required>
</div>
<div class="col-md-3 form-group">
<div class="col-form-label pr-3">À clôturer / Solder ?</div>
<div class="form-check form-check-inline">
<input name="currentloans[__number__][hasclosed]" type="radio" class="form-check-input"
id="ID__number__1hasclosed" value="0" checked="">
<label class="form-check-label" for="ID__number__1hasclosed">Non</label>
</div>
<div class="form-check form-check-inline">
<input name="currentloans[__number__][hasclosed]" type="radio" class="form-check-input"
id="ID__number__2hasclosed" value="1">
<label class="form-check-label" for="ID__number__2hasclosed">Oui</label>
</div>
</div>
<input type="hidden" class="wpcf-currentloan--block--kuid" name="currentloans[__number__][kuid]" value="">
</div>
</div>
<button class="btn btn-primary wpcf-currentload--add">Ajouter un autre crédit</button>
<input type="hidden" name="delcurrentloan">
</div>
</fieldset>
<fieldset class="d-none col-md-12 credit-cols other-credit-cols co-borrower-section">
<div class="form-row">
<!-- <legend>Co-Emprunteur</legend>
<legend>Crédits(s) en cours</legend> -->
<div class="w-100 d-none d-md-block"></div>
<div class="col-form-label pr-3">Avez-vous des crédits en cours ?</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-check form-check-inline">
<input name="cohascurrentloan" type="radio" class="form-check-input" id="IDcohascurrentloan_no" value="0" <?php echo $model->isRadioChecked('cohascurrentloan', '0', $coBorrower); ?>>
<label class="form-check-label" for="IDcohascurrentloan_no">Non</label>
</div>
<div class="form-check form-check-inline">
<input name="cohascurrentloan" type="radio" class="form-check-input" id="IDcohascurrentloan_yes" value="1" <?php echo $model->isRadioChecked('cohascurrentloan', '1', $coBorrower); ?>>
<label class="form-check-label" for="IDcohascurrentloan_yes">Oui</label>
</div>
</div>
</div>
</div>
<div class="wpcf-cocurrentloan d-none">
<!-- Affichage des crédits existants du co-emprunteur -->
<?php echo $model->getCurrentLoansHTML($coBorrower, 'co'); ?>
<div class="py-5 wpcf-cocurrentloan--block">
<button type="button" class="close wpcf-cocurrentloan--block--remove wpcf-btn-retirer" aria-label="Retirer">
<span class="wpcf-btn-retirer__icon" aria-hidden="true" style="vertical-align:middle;display:inline-block;width:1em;height:1em;"><svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" style="vertical-align:middle;"><path d="M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z"/></svg></span> Retirer
</button>
<div class="form-row">
<div class="form-group col-md-3">
<label for="ID__number__cosplashbacktype">Type de créance</label>
<label for="ID__number__loantype">Type de créance</label>
<?php $typesCreance = $wpdb->get_results( "SELECT * FROM cdf_Type_creance"); ?>
<select name="cocurrentloans[__number__][loantype]" id="ID__number__cosplashbacktype" class="form-control" required>
<option value="">Veuillez faire un choix</option>
<?php foreach ($typesCreance as $typeCreance) : ?>
<option value="<?php echo $typeCreance->idtype_creance ?>"><?php echo $typeCreance->nom_creance ?></option>
<?php endforeach ?>
</select>
</div>
<div class="form-group col-md-3">
<label for="ID__number__cobankname">Nom de l'organisme / Banque</label>
<input name="cocurrentloans[__number__][bankname]" type="text" class="form-control"
id="ID__number__cobankname" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__coborrowedcapital">Capital emprunté</label>
<input name="cocurrentloans[__number__][borrowedcapital]" type="number" class="form-control"
id="ID__number__coborrowedcapital" min="0" step="0.01" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__codurationmonth">Durée du crédit (en mois)</label>
<input name="cocurrentloans[__number__][durationmonth]" type="number" class="form-control"
id="ID__number__codurationmonth" min="0" step="1" required>
</div>
<div class="form-group col-md-3"><label for="ID__number__comonthlypayment">Mensualité</label>
<input name="cocurrentloans[__number__][monthlypayment]" type="number" class="form-control"
id="ID__number__comonthlypayment" min="0" step="0.01" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__cofirstduedate">Date 1ère échéance</label>
<input name="cocurrentloans[__number__][firstduedate]" type="date" class="form-control"
id="ID__number__cofirstduedate" required>
</div>
<div class="form-group col-md-3">
<label for="ID__number__coremainingbalance">Solde restant dû (approximatif)</label>
<input name="cocurrentloans[__number__][remainingbalance]" type="number" class="form-control"
id="ID__number__coremainingbalance" min="0" step="0.01" required>
</div>
<div class="col-md-3 form-group">
<div class="col-form-label pr-3">À clôturer / Solder ?</div>
<div class="form-check form-check-inline">
<input name="cocurrentloans[__number__][hasclosed]" type="radio" class="form-check-input"
id="ID__number__1cohasclosed" value="0" checked="">
<label class="form-check-label" for="ID__number__1cohasclosed">Non</label>
</div>
<div class="form-check form-check-inline">
<input name="cocurrentloans[__number__][hasclosed]" type="radio" class="form-check-input"
id="ID__number__2cohasclosed" value="1">
<label class="form-check-label" for="ID__number__2cohasclosed">Oui</label>
</div>
</div>
<input type="hidden" class="wpcf-cocurrentloan--block--kuid" name="cocurrentloans[__number__][kuid]" value="">
</div>
</div>
<button class="btn btn-primary wpcf-cocurrentload--add">Ajouter un autre crédit</button>
<input type="hidden" name="delcocurrentloan">
<input type="hidden" name="type_credit_selected" value="<?= (string) ($type_credit_selected ?? '') ?>">
</div>
</fieldset>
<section class="bottom-form">
<div class="form-buttons mt-5">
<a href="<?php echo get_site_url() ?>/credit-step1?credit-direct-token=<?php echo (string) ($currentCredit->token ?? '') ?>" class="btn btn-secondary previous-step">Étape précédente</a>
<button class="btn btn-primary" type="submit">Étape suivante</button>
</div>
</section>
</div>
</form>
</div>
<div class="exemple-info">
<?php if (!empty($exemple_info)) : ?>
<?= $exemple_info ?>
<?php endif; ?>
</div>
</div>