Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <?php
  5. include("head.php");
  6. session_start();
  7. $bdd = new PDO('mysql:host=localhost;dbname=zesteetpoomenu', 'root', '');
  8. ?>
  9.  
  10. <body>
  11. <div class="bodytest">
  12.  
  13. <!-- menu/icone -->
  14. <div class="row" style="padding-top:3%; text-align:center;">
  15. <div class="col-md-2">
  16. <a href="index.php"><img width=160px; height=80px; src="images/logo.png"></a>
  17. </div>
  18. <div class="col-md-2">
  19. </div>
  20. <div class="col-md-4">
  21. </div>
  22. <div class="col-md-2">
  23. </div>
  24. <div class="col-md-2">
  25. <?php if (!empty($_SESSION['id'])) : ?>
  26. <div class="btn-group">
  27. <button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  28. Mon compte&nbsp; <span class="caret"></span>
  29. </button>
  30.  
  31. <ul class="dropdown-menu">
  32. <li><a href="profil.php?id='.$_SESSION['id'].'">Mes informations</a></li>
  33. <li><a href="#">Mes commandes</a></li>
  34. <li><a href="#">Mode de paiement</a></li>
  35. <li role="separator" class="divider"></li>
  36. <li><a href="#">Se déconnecter</a></li>
  37. </ul>
  38. </div>
  39. <?php else: ?>
  40. <?php endif; ?>
  41. </div>
  42. </div>
  43.  
  44. <!-- Ligne -->
  45. <div class="row" style="padding-top:3%; width:95%; margin:auto">
  46.  
  47. <!-- Première colonne de la Ligne Alias les produits-->
  48. <div class="col-md-8">
  49.  
  50. <!-- Tableau -->
  51. <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  52.  
  53. <?php
  54. $query = $bdd->prepare("SELECT * FROM jour ORDER by id_jour ASC");
  55. $query->execute();
  56. $a = 1;
  57. $b = 100;
  58. while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
  59. $date_us = $row["libelle"];
  60. $date_fr = strftime('%d %m %y', strtotime($date_us));
  61. $date_commande = strftime('%d/%m', strtotime($date_us));
  62. $a++;
  63. $b++;
  64. ?>
  65. <div class="panel panel-default">
  66. <div class="panel-heading" role="tab" id="<?php print ($b); ?>">
  67. <h4 class="panel-title">
  68. <a role="button" data-toggle="collapse" data-parent="#accordion" href="#<?php print ($a); ?>" aria-expanded="true" aria-controls="<?php print ($a); ?>" style="font-weight: bold;">
  69. <!-- affiche la date en francais -->
  70. <?php print ($date_fr); ?>
  71. </a>
  72. </h4>
  73. </div>
  74.  
  75. <div id="<?php print ($a); ?>" class="panel-collapse
  76. <?php if ($a == 2) {
  77. echo ('collapse in');
  78. } else {
  79. echo ('collapse');
  80. }
  81. ?>" role="tabpanel" aria-labelledby="<?php print ($b); ?>">
  82. <div class="panel-body">
  83.  
  84. <?php
  85. $query = $bdd->prepare("SELECT categorie_produit.libelle, produit.nom, produit.description, disponible.prix
  86. FROM jour, disponible, produit, categorie_produit
  87. WHERE jour.id_jour = " . $row["id_jour"] . "
  88. AND jour.id_jour = disponible.id_jour
  89. AND disponible.id_produit = produit.id_produit
  90. AND produit.id_categorie = categorie_produit.id_categorie");
  91. $query->execute();
  92. while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
  93. ?>
  94.  
  95. <div class="row" style="padding-bottom:2%; margin-top:-1%;">
  96. <!-- Nom et prix produit -->
  97. <div class="simpleCart_shelfItem" style="margin-left:1%;">
  98.  
  99. <div class="col-md-12" style="margin-top:1%; text-align:center;">
  100. <!-- Entrée/plat/dessert -->
  101. <?php echo ('<span style="font-weight: bold; color: #BDBDBD;"><div class="item_name">' . $row['libelle'] . '</div></span> <span style="font-weight: bold; color: #F2C214; font-size:130%;">' . $row['nom'] . '</span> '); ?>
  102. <br>
  103. <!-- Entrée/Plat/Dessert du jour -->
  104. <?php echo ('<div style="font-size:80%">' . $row['description'] . '</div>'); ?>
  105. </div>
  106.  
  107. </div>
  108. </div>
  109.  
  110.  
  111. <div style="border-top: 1px solid grey; padding-bottom: 2px;"></div>
  112. <?php
  113. }
  114.  
  115. $query = $bdd->prepare("SELECT nom, prix
  116. FROM (
  117. SELECT type_formule.libelle AS nom, formule.prix, formule.ordre_affichage
  118. FROM type_formule, formule
  119. WHERE formule.id_jour = '1'
  120. AND formule.id_type_formule = type_formule.id_type_formule
  121. UNION
  122. SELECT produit.nom, produit.prix_conseille AS prix, '9' AS ordre_affichage
  123. FROM categorie_produit, produit
  124. WHERE categorie_produit.id_categorie = '4'
  125. AND categorie_produit.id_categorie = produit.id_categorie) AS t
  126. ORDER BY ordre_affichage");
  127.  
  128. $query->execute();
  129.  
  130.  
  131. while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
  132. if (isset($row)) {
  133. ?>
  134. <div class="row" style="padding-bottom:2%; margin-top:-1%;">
  135. <div class="simpleCart_shelfItem" style="margin-left:1%;">
  136. <div class="col-md-8" style="margin-top:2%;">
  137. <!-- affiche les formules -->
  138. <?php echo ('<span style="font-weight: bold; color: #A4A4A4; font-size:120%;"><div class="col-md-8">' . $row['nom'] . '</div></span><span class="item_name" style="font-size:0px;">' . $row['nom'] . ' ' . $date_commande . '</span>'); ?>
  139. </div>
  140. <div class="col-md-2" style="margin-top:2%;">
  141. <!-- affiche les prix -->
  142. <?php echo('<span style="font-weight: bold; color: #A4A4A4; font-size:120%;" class="item_price">' . $row['prix'] . ' &euro;</span>') ?>
  143. </div>
  144. <div class="col-md-2" style="margin-top:2%;">
  145. <!-- quantité/ajouter -->
  146. <span>
  147. <div class="col-md-4" style="padding-bottom:2%; padding-right:1%;"><input type="text" class="item_quantity form-control" value="1" /></div>
  148. <input type="button" class="item_add btn btn-default" value="Ajouter" />
  149. </span>
  150.  
  151. </div>
  152. </div>
  153. </div>
  154. <?php } ?>
  155. <?php } ?>
  156. </div>
  157. </div>
  158. </div>
  159. <?php } ?>
  160.  
  161.  
  162. </div>
  163.  
  164. </div>
  165.  
  166. <!-- Deuxième collone de la ligne, alias le panier -->
  167. <div class="col-md-4" style="padding-left:1%; padding-right:1%;">
  168. <div class="panel panel-primary">
  169. <div class="panel-heading">
  170. <h3 class="panel-title">Panier: <span class="simpleCart_total"></span></h3>
  171. </div>
  172. <div class="panel-body">
  173. <div class="row">
  174.  
  175. <div class="simpleCart_items">
  176. </div>
  177.  
  178. </div>
  179. <div class="row" style="padding-top:7%;">
  180. <div class="col-md-3" style="padding-bottom:2px; text-align:right">
  181.  
  182. </div>
  183. <div class="col-md-9" style="text-align:right">
  184. <a href="coordonnee.php" type="submit" class="btn btn-primary">Valider</a>
  185. </div>
  186. </div>
  187.  
  188. </div>
  189. </div>
  190. </div>
  191.  
  192. </div>
  193. </div>
  194. </body>
  195. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement