예제 #1
0
      <a href="./admin-shop-history.php" class="btn" style="text-decoration:none;">Historiques des achats</a>
      <!--<a href="./admin-shop-add.php" class="btn" style="text-decoration:none;">Ajouter un article au shop</a>-->
      <table style="margin-top:15px;margin-bottom:15px;width:100%; padding:15px;border:1px solid #9da3a6; border-radius:5px; background-color:#fff;">
          <tr style="padding:5px;font-size:1.2em;">
           <td style="width:60%;">Nom de l'article</td>
           <td>Prix</td>
           <td>Vendus</td>

          </tr>
      <?php 
$db = new PDO('mysql:host=' . $mysql_hostname . ';dbname=' . $mysql_database, $mysql_username, $mysql_password);
$sql = "SELECT * FROM `web_shop`";
$req = $db->prepare($sql);
$req->execute();
$req->setFetchMode(PDO::FETCH_ASSOC);
while ($row = $req->fetch()) {
    echo '<form action="admin-shop-remove.php" method="POST">';
    echo '<input type="hidden" name="update_id" value="' . $row['id'] . '";';
    echo '<tr style="padding:5px;">';
    echo '<td>' . utf8_decode(stripslashes($row['name'])) . '</td>';
    echo '<td>' . $row['price'] . '€</td>';
    echo '<td>' . $dev->getSoldCount($row['name']) . '</td>';
    echo '</tr>';
    echo '</form>';
}
?>
        </table>
    </div>
  </body>
</html>