71 lines
3.0 KiB
PHP
71 lines
3.0 KiB
PHP
<?php
|
|
?>
|
|
|
|
<div class="wrap">
|
|
<h1>Import de crédits</h1>
|
|
|
|
<p>Importez un fichier CSV conforme au modèle <code>modèle mailing.csv</code>. Séparateur attendu: point-virgule (;).</p>
|
|
|
|
<?php if (!empty($import_errors)): ?>
|
|
<div class="notice notice-error">
|
|
<p><strong>Erreurs d'import:</strong></p>
|
|
<ul>
|
|
<?php foreach ($import_errors as $err): ?>
|
|
<li><?php echo esc_html($err); ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($import_summary)): ?>
|
|
<div class="notice notice-success">
|
|
<p><strong>Import terminé.</strong></p>
|
|
<p>Enregistrements insérés: <strong><?php echo intval($import_summary['inserted']); ?></strong> | Ignorés/Erreurs: <strong><?php echo intval($import_summary['skipped']); ?></strong></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form method="post" enctype="multipart/form-data">
|
|
<?php wp_nonce_field('credit_import_action', 'credit_import_nonce'); ?>
|
|
|
|
<table class="form-table" role="presentation">
|
|
<tbody>
|
|
<tr>
|
|
<th scope="row"><label for="csv_file">Fichier CSV</label></th>
|
|
<td>
|
|
<input type="file" id="csv_file" name="csv_file" accept=".csv" required>
|
|
<p class="description">Utilisez le fichier modèle pour l'ordre des colonnes: TITRE;NOM - Prénom;ADRESSE;LOCALITE;Adresse E-Mail;Tel. Client;GSM Client;Sté de Crédit;Montant €;Date signature;N° de dossier / compte remb.;Code;Remarques</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Statut à appliquer</th>
|
|
<td>
|
|
<fieldset>
|
|
<label><input type="radio" name="status" value="1" checked> Validé non signé</label><br>
|
|
<label><input type="radio" name="status" value="2"> Validé signé</label><br>
|
|
<label><input type="radio" name="status" value="-1"> Refusé</label>
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Statut du client</th>
|
|
<th>
|
|
<fieldset>
|
|
<label><input type="radio" name="client_status" value="habitation_locataire"> Locataire</label><br>
|
|
<label><input type="radio" name="client_status" value="habitation_proprietaire"> Propriétaire</label>
|
|
</fieldset>
|
|
</th>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p class="submit">
|
|
<button type="submit" name="credit_import_submit" class="button button-primary">Importer</button>
|
|
<a href="<?php echo esc_url(admin_url('admin.php?page=credit-manager')); ?>" class="button">Retour à la liste</a>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
|
|
<?php
|
|
?>
|
|
|