Advertisement
Guest User

ceci est un test

a guest
Apr 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Accueil</title>
  5. <link rel="stylesheet" href="style.css"/>
  6. <meta charset="utf-8"/>
  7. </head>
  8. <body>
  9.  
  10. <div id="menu">
  11. <h1> Société LaFleur </h1>
  12. <h2><a href="index.php">Accueil</a></h2><hr>
  13.  
  14. <?php
  15. $cnx = new PDO("mysql:dbname=lafleurv2;host=127.0.0.1; charset=UTF8", 'ts1', 'ts1');
  16. $sql = 'select cat_code, cat_libelle from categorie';
  17.  
  18. foreach ($cnx->query($sql) as $row) {
  19. echo '<h3> <a href="catalogue.php?categ=' . $row['cat_code'] . '"/>' . $row['cat_libelle'] . '</a> </h3>';
  20. }
  21. ?>
  22.  
  23. </div>
  24. <div id="page">
  25. <table id="prodListe">
  26. <br/>
  27. <br/>
  28. <br/>
  29. <br/>
  30. <br/>
  31. <br/>
  32.  
  33. <?php
  34. $cnx = new PDO ('mysql:dbname=lafleurv2;host=127.0.0.1 ;charset=UTF8', 'ts1', 'ts1');
  35. $libcateg = $cnx->quote ($_GET['categ'] );
  36. $requete = 'select cat_libelle, pdt_ref, pdt_designation, pdt_prix, pdt_image
  37. from produit, categorie
  38. where cat_code = pdt_categorie
  39. AND pdt_categorie = '.$_GET['categ'];
  40.  
  41. echo '<thead>
  42. <tr><th colspan="4">'.$_GET['categ'].'</th></tr>
  43. <tr><th>Photos</th><th>Référence</th><th>Désignation</th><th>Prix</th></tr>
  44. </thead>';
  45.  
  46. foreach ($cnx->query($requete) as $row)
  47. {
  48.  
  49. echo '
  50. <tr>
  51. <td><img src="Images/'.$row['pdt_image'].'.jpg"/></td>
  52. <td>'.$row['pdt_ref'].'</td>
  53. <td>'.$row['pdt_designation'].'</td>
  54. <td>'.$row['pdt_prix'].'</td>
  55. </tr>';
  56.  
  57.  
  58. }
  59.  
  60. ?>
  61. </body>
  62. </div>
  63. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement