Bonjour,
J'ai pas mal cherché sur les différends forum et j'ai rien trouver de concluant. Je vous expose mon problème, je cherche à faire une page web ou il y a un tableau qui affiche le contenu d'une table client. L'utilisateur de la page à la possibilité de choisir un client à l'aide d'un bouton radio pour ensuite envoyer les information du client sur la page principale du site.
Voici le code de la page affichante le contenu de la table.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <body> <h1> Les clients présents dans la base de donnée </h1> <form action="" method="post"> <?php require_once("bd.php"); require_once("client.php"); $bd = new Connect(); $co = $bd->connexion(); $req1= mysqli_query($co,"SELECT numClient,nomClient,adresse,ville,codepostale,telephone FROM client") or die("Erreur dans la requete "); echo '<table class="table table-bordered" class="tab" > <tr> <th scope="col"></th> <th scope="col">Num Client</th> <th scope="col">Nom Client</th> <th scope="col">Adresse</th> <th scope="col">Ville</th> <th scope="col">Codepostale</th> <th scope="col">Telephone</th> </tr> <tr>'; while ($data = mysqli_fetch_assoc($req1)) { echo '<td><input type="radio" name="choix" value=""/></td> <td>'.$data['numClient']. '</td> <td>'.$data['nomClient'].'</td> <td>'.$data['adresse'].'</td> <td>'.$data['ville'].'</td> <td>'.$data['codepostale'].'</td> <td>'.$data['telephone'].'</td> </tr>'; } echo '</table>'; ?> <div class="form-group"> <a href="formulaireclient.php.php"><button type="button" class="btn btn-primary">Choisir</button></a> <a href="ajoutclient.php"><button type="button" class="btn btn-primary">Ajouter un client</button></a> <a href="formulaireclient.php"><button type="button" class="btn btn-primary">Retour</button></a> </div> </form> </body>
Partager