mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-06-07 13:05:30 +02:00
100 lines
4.4 KiB
PHTML
100 lines
4.4 KiB
PHTML
<p>
|
|
<?php if (0 < $nbAlertes = count($alerts)) : ?>
|
|
<strong><?php echo $nbAlertes ?> <?php
|
|
echo $nbAlertes > 1?"alertes enregistrées":"alerte enregistrée"; ?></strong> |
|
|
<?php endif; ?>
|
|
<a href="?mod=mail&a=form" class="link-create-alert">Ajouter une alerte</a> |
|
|
<a href="?mod=mail&a=reset">Tout renvoyer</a>
|
|
</p>
|
|
|
|
<?php if ($groups) : ?>
|
|
<?php foreach ($groups AS $group) : ?>
|
|
<?php if (count($groups) > 1 || $group != "Sans groupe") : ?>
|
|
<h2><?php echo $group != "Sans groupe"?"Groupe : ":""; ?><?php echo htmlspecialchars($group); ?></h2>
|
|
<?php endif; ?>
|
|
<?php $alerts = $alertsByGroup[$group]; ?>
|
|
<table style="width: 100%;">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 20px"></th>
|
|
<th style="width: 250px"><?php if ($sort == "email") :
|
|
?><img src="static/images/sort-<?php echo $order; ?>.png" alt="" /> <?php
|
|
endif; ?><a href="?mod=mail&sort=email">Envoyer à</a></th>
|
|
<th><?php if ($sort == "title") :
|
|
?><img src="static/images/sort-<?php echo $order; ?>.png" alt="" /> <?php
|
|
endif; ?><a href="?mod=mail&sort=title">Titre</a></th>
|
|
<th style="width: 100px">Intervalle</th>
|
|
<?php if ($showPrice) : ?>
|
|
<th style="width: 100px">Prix</th>
|
|
<?php endif; ?>
|
|
<?php if ($showCities) : ?>
|
|
<th style="width: 200px">Villes</th>
|
|
<?php endif; ?>
|
|
|
|
<?php foreach ($data_notifications AS $name => $notification) : ?>
|
|
<?php if (!$notification["enabled"]) continue; ?>
|
|
<th style="width: 140px"><?php echo $notification["list_label"]; ?></th>
|
|
<?php endforeach; ?>
|
|
|
|
<th style="width: 70px">Actif</th>
|
|
<th style="width: 170px"> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $i = 1; foreach ($alerts AS $alert) : ?>
|
|
<tr>
|
|
<td><?php echo $i++; ?></td>
|
|
<td><?php echo str_replace(",", "<br />", htmlspecialchars($alert->email)); ?></td>
|
|
<td class="title"><a href="<?php echo htmlspecialchars($alert->url); ?>" target="_blank"><?php
|
|
echo $alert->title?htmlspecialchars($alert->title):"-"; ?></a></td>
|
|
<td class="intervalle"><?php echo (int)$alert->interval; ?> mins</td>
|
|
<?php if ($showPrice) : ?>
|
|
<td>
|
|
<?php if ($alert->price_min != -1 && $alert->price_max != -1) : ?>
|
|
entre <?php echo $alert->price_min; ?>€ et <?php echo $alert->price_max; ?>€
|
|
<?php elseif ($alert->price_min != -1) : ?>
|
|
à partir de <?php echo $alert->price_min; ?>€
|
|
<?php elseif ($alert->price_max != -1) : ?>
|
|
jusque <?php echo $alert->price_max; ?>€
|
|
<?php else: ?>
|
|
-
|
|
<?php endif; ?>
|
|
</td>
|
|
<?php endif; ?>
|
|
<?php if ($showCities) : ?>
|
|
<td>
|
|
<?php if ($alert->cities) : ?>
|
|
<ul style="margin: 0; padding: 0 0 0 15px;"><li>
|
|
<?php echo str_replace("\n", "</li><li>", htmlspecialchars($alert->cities)); ?>
|
|
</li></ul>
|
|
<?php else: ?>
|
|
-
|
|
<?php endif; ?>
|
|
</td>
|
|
<?php endif; ?>
|
|
|
|
<?php foreach ($data_notifications AS $name => $notification) : ?>
|
|
<?php if (!$notification["enabled"]) continue; ?>
|
|
<td>
|
|
<a href="?mod=mail&a=toggle_status&s=<?php
|
|
echo $notification["form_name"]; ?>&id=<?php
|
|
echo $alert->id; ?>"><img src="static/images/<?php
|
|
echo !$alert->{$notification["form_name"]} ? "disable" : "enable";
|
|
?>.png" alt="" /></a>
|
|
</td>
|
|
<?php endforeach; ?>
|
|
<td>
|
|
<a href="?mod=mail&a=toggle_status&s=suspend&id=<?php echo $alert->id;
|
|
?>"><img src="static/images/<?php
|
|
echo $alert->suspend?"disable":"enable"; ?>.png" alt="" /></a>
|
|
</td>
|
|
<td>
|
|
<a href="?mod=mail&a=form&id=<?php echo $alert->id; ?>">modifier</a> |
|
|
<a href="?mod=mail&a=form-delete&id=<?php echo $alert->id; ?>">supprimer</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?> |