setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die(« Erreur de connexion : » . htmlspecialchars($e->getMessage()));
}
// Formulaire de demande de crédit
if ($_SERVER[‘REQUEST_METHOD’] == ‘POST’) {
$nom_complet = htmlspecialchars(trim($_POST[‘nom_complet’]));
$date_naissance = $_POST[‘date_naissance’];
$montant = filter_var($_POST[‘montant’], FILTER_VALIDATE_FLOAT);
$duree = filter_var($_POST[‘duree’], FILTER_VALIDATE_INT);
$motif = htmlspecialchars(trim($_POST[‘motif’]));
$adresse = htmlspecialchars(trim($_POST[‘adresse’]));
$pays = htmlspecialchars(trim($_POST[‘pays’]));
$telephone = htmlspecialchars(trim($_POST[‘telephone’]));
$whatsapp = htmlspecialchars(trim($_POST[‘whatsapp’]));
$email = filter_var($_POST[’email’], FILTER_SANITIZE_EMAIL);
$email_confirmation = filter_var($_POST[’email_confirmation’], FILTER_SANITIZE_EMAIL);
if ($nom_complet && $date_naissance && filter_var($email, FILTER_VALIDATE_EMAIL) && $email === $email_confirmation && $montant && $duree && $motif && $adresse && $pays && $telephone && $whatsapp) {
$stmt = $pdo->prepare(« INSERT INTO demandes (nom_complet, date_naissance, montant, duree, motif, adresse, pays, telephone, whatsapp, email) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) »);
$stmt->execute([$nom_complet, $date_naissance, $montant, $duree, $motif, $adresse, $pays, $telephone, $whatsapp, $email]);
header(« Location: confirmation.php »);
exit();
} else {
echo « Erreur dans le formulaire. Veuillez vérifier vos informations. »;
}
}
?>
Demande de Crédit
Formulaire de Demande de Crédit
Interface Administrateur
ID | Nom Complet | Date de Naissance | Montant | Durée | Motif | Adresse | Pays | Téléphone | Contrat | ||
---|---|---|---|---|---|---|---|---|---|---|---|
{$row[‘id’]} | « ; echo «{$row[‘nom_complet’]} | « ; echo «{$row[‘date_naissance’]} | « ; echo «{$row[‘montant’]} | « ; echo «{$row[‘duree’]} | « ; echo «{$row[‘motif’]} | « ; echo «{$row[‘adresse’]} | « ; echo «{$row[‘pays’]} | « ; echo «{$row[‘telephone’]} | « ; echo «{$row[‘whatsapp’]} | « ; echo «{$row[’email’]} | « ; echo «Télécharger | « ; echo «