Browse Source

cache la table vide

master
vince vince 3 years ago
parent
commit
a54afcdd60
1 changed files with 55 additions and 52 deletions
  1. +55
    -52
      index.php

+ 55
- 52
index.php View File

@ -410,64 +410,67 @@ if (!$isConfig and $hasSupplier) {
</section>
<section class="container-fluid">
<div class="row my-3">
<div class="col">
<div class="table-responsive">
<table class="table table-striped table-hover align-middle">
<thead>
<tr>
<th scope="col">
Nom
</th>
<?php if (!empty($config[$supplier]['choices'])) : ?>
<th scope="col">
Choix
</th>
<?php endif; ?>
<th scope="col">
&nbsp;
</th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $item) : ?>
<?php if (!empty($items)) : ?>
<div class="col-12">
<div class="table-responsive">
<table class="table table-striped table-hover align-middle">
<thead>
<tr>
<td>
<?php echo $item['name']; ?>
</td>
<th scope="col">
Nom
</th>
<?php if (!empty($config[$supplier]['choices'])) : ?>
<td>
<?php if (!empty($item['choice'])) : ?>
<?php echo $item['choice']; ?>
<?php endif; ?>
</td>
<th scope="col">
Choix
</th>
<?php endif; ?>
<td>
<form onsubmit="return confirm('Souhaitez-vous vraiment annuler cette commande ?');">
<input type="hidden" name="supplier" value="<?php echo $supplier; ?>" />
<input type="hidden" name="event" value="<?php echo $event; ?>" />
<input type="hidden" name="name" value="<?php echo $item['name']; ?>" />
<input type="hidden" name="choice" value="<?php echo $item['choice']; ?>" />
<button class="btn btn-secondary float-end" type="submit" name="action" value="delete">Annuler</button>
</form>
</td>
<th scope="col">
&nbsp;
</th>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<ul class="list-group">
</thead>
<tbody>
<?php foreach ($items as $item) : ?>
<tr>
<td>
<?php echo $item['name']; ?>
</td>
<?php if (!empty($config[$supplier]['choices'])) : ?>
<td>
<?php if (!empty($item['choice'])) : ?>
<?php echo $item['choice']; ?>
<?php endif; ?>
</td>
<?php endif; ?>
<td>
<form onsubmit="return confirm('Souhaitez-vous vraiment annuler cette commande ?');">
<input type="hidden" name="supplier" value="<?php echo $supplier; ?>" />
<input type="hidden" name="event" value="<?php echo $event; ?>" />
<input type="hidden" name="name" value="<?php echo $item['name']; ?>" />
<input type="hidden" name="choice" value="<?php echo $item['choice']; ?>" />
<button class="btn btn-secondary float-end" type="submit" name="action" value="delete">Annuler</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<?php endif; ?>
<div class="col-12">
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Commandes
<span class="badge bg-primary rounded-pill"><?php echo count($items); ?></span>
</li>
<?php foreach ($stats as $choice => $count) : ?>
<li class="list-group-item d-flex justify-content-between align-items-center">
Commandes
<span class="badge bg-primary rounded-pill"><?php echo count($items); ?></span>
<?php echo $choice; ?>
<span class="badge bg-secondary rounded-pill"><?php echo $count; ?></span>
</li>
<?php foreach ($stats as $choice => $count) : ?>
<li class="list-group-item d-flex justify-content-between align-items-center">
<?php echo $choice; ?>
<span class="badge bg-secondary rounded-pill"><?php echo $count; ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</section>


Loading…
Cancel
Save