1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| <?php
$mail = (isset($_POST['mail'])) ? $_POST['mail'] : '';
$nom = (isset($_POST['nom'])) ? $_POST['nom'] : '';
$prenom = (isset($_POST['prenom'])) ? $_POST['prenom'] : '';
$adresse = (isset($_POST['adresse'])) ? $_POST['adresse'] : '';
$cp = (isset($_POST['cp'])) ? $_POST['cp'] : '';
$ville = (isset($_POST['ville'])) ? $_POST['ville'] : '';
$pays = (isset($_POST['pays'])) ? $_POST['pays'] : 'France';
$ib = (isset($_POST['ib'])) ? $_POST['ib'] : '';
$bi = (isset($_POST['bi'])) ? $_POST['bi'] : '';
$cnx = new PDO('mysql:host=localhost;dbname=test', 'root', '');
if ($mail !== '')
{
$stmt = $cnx->prepare('SELECT NOMDEB, PRENDEB, ADRDEB, CPDEB, VILLEDEB FROM client WHERE MAILDEB = :mail');
$exec = $stmt->execute(array(':mail'=> $mail));
if ($exec && ($data = $stmt->fetch(PDO::FETCH_ASSOC)))
{
list($nom, $prenom, $adresse, $cp, $ville) = $data; // récupération des valeurs du tableau
$stmt = $cnx->prepare('SELECT IBDEB, BIDEB FROM compte'); // ici il doit manquer une clause WHERE
$exec = $stmt->execute();
if ($exec && ($data = $stmt->fetch(PDO::FETCH_ASSOC)))
{
list($ib, $bi) = $data;
}
}
}
// fonction d'achppement des caractères dangereux avec echo intégré
$hsc = function($p) { echo htmlspecialchars($p, ENT_QUOTES, 'utf-8'); };
?>
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content=width=device=width">
<link rel="stylesheet" href="style.css">
<title>Formulaire</title>
<style>
body {
background-color:#b5daeb;
border:double 4px blue;
min-height:800px;
margin-left:8%;
margin-right:5%
}
</style>
</head>
<body>
<h2>Facture</h2>
<center><input RUM="RUM" size=27 maxlength=27></center>
<p><center><em></em></center><br/></p>
<em><strong>Veuillez compléter les champs marqués*</strong></em></p>
<br>
<form form action="connexion.php" method="post">
<p>Nom <input name="nom" size=30 maxlength=60 value="<?php $hsc($nom) ?>"></p><br>
<p>Prénom <input name="prenom" size=30 maxlength=60 value="<?php $hsc($prenom) ?>"><br>
<em>Nom/Prénoms du client </em><br></p>
<p>Adresse <input name="adresse" size=60 maxlength=80 value="<?php $hsc($adresse) ?>"><br>
<em>Numero et nom de la rue</em><br></p>
<p>Code Postal <input id="cp" name="Cp" size="8" maxlength="5" value="<?php $hsc($cp) ?>"> Ville <input name="ville" size=30 maxlength=30 value="<?php $hsc($ville) ?>"></p>
<p>Pays <input name="pays" size=30 maxlength=30 value="France" disabled=true></p>
<p> Les coordonnées de votre compte<br><br>
IB <input name="ib" size=27 maxlength=27 value="<?php $hsc($ib) ?>"><br>
BI <input name="bi" size=11 maxlength=11 value="<?php $hsc($bi) ?>"><br></p>
<p>Type de paiement * <br><br>
<left><input type="radio" name="paie" value="recurrent">Récurrent/répétitif</left>
<left><input type="radio" name="paie" value="ponctuel">Paiement ponctuel</left></p>
<p>Signé à * <input nname=lieu type="text" size=30 maxlength=30> le <input type="date"></p>
<p>Signature(s) Veuillez signer ici <input type="texte" name="signature" style="width:320px; height:50px;"><br></p>
<left><input type="submit" value="Envoyer"></left>
<left><input type="reset" value="Annuler"></left>
</form>
<center><a href="Deconnexion.php" title="" alt= "">Se deconnecter</a></center><br>
<left><a href="modifier_cpt.php" title="" alt= "">Modifier votre compte</a></left>
</body>
</html> |
Partager