" style="width: 300px;"> </a> <div id="phone-colors" style="text-align: center; margin-top: 15px;"> <?php $colors = explode(',', $phone->color); foreach ($colors as $color) { $c = Color::getColorById($color); echo '<div class="color" style="width:20px; height:20px; display: inline-block; border-radius: 20px; margin-right:5px; background-color:' . $c->hex . '; border:solid 1px silver;" onmouseover="this.style.cursor=\'pointer\';" onmouseout="this.style.cursor=\'\';" value="' . $c->id . '" title="' . $c->name . '"></div>'; } ?> </div> </div> <div class="col-md-4 col-sm-6 col-xs-12"> <?php if ($promotion) { echo '<span style="font-weight:bolder; font-size:3em;">' . Promotion::getNewPrice($promotion->phone) . ' €</span>'; echo ' Au lieu de ' . $phone->price . ' € <span class="badge" style="background-color: #e85142;">Promotion</span><br />'; echo 'Économisez ' . Promotion::getPromotionByPhoneId($phone->id)->percent . ' %'; } else { echo '<span style="font-weight:bolder; font-size:3em;">' . $phone->price . ' €</span><br />'; } ?> <form action="index.php?page=cart" method="POST"> <div id="amount" style="margin-top: 30px;"> Quantité : <select name="amount"> <?php for ($i = 1; $i < 11; $i++) { echo '<option>' . $i . '</option>'; } ?>
<table class="table table-striped"> <thead> <th>Téléphone</th> <th>Pourcentage</th> <th>Prix de base</th> <th>Prix réduit</th> <th></th> <th></th> </thead> <?php foreach (Promotion::getPromotionsList() as $promotion) { echo '<tr data-id="' . $promotion->id . '">'; echo '<td><a href="index.php?page=admin/promotion-edit&id=' . $promotion->id . '">' . Phone::getPhoneById($promotion->phone)->name . '</a></td>'; echo '<td>' . $promotion->percent . ' %</td>'; echo '<td>' . Phone::getPhoneById($promotion->phone)->price . ' €</td>'; echo '<td>' . Promotion::getNewPrice($promotion->phone) . ' €</td>'; echo '<td><a href="index.php?page=admin/promotion-edit&id=' . $promotion->id . '"><i class="fa fa-pencil" data-toggle="tooltip" title="Modifier"></i></a></td>'; echo '<td><a href="#" title="Supprimer" data-toggle="tooltip" data-action="delete" title="Supprimer"><i class="fa fa-trash"></i></a></td>'; echo '</tr>'; } ?> </table> <a href="index.php?page=admin/add-promotion" class="btn btn-primary">Ajouter une promotion</a> <?php } else { echo '<p>Aucune promotion n\'a été ajouté.</p>'; } ?> </div> <script> $('[data-action="delete"]').click(function(e) {