Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.shinegis.mu
/
htdocs
/
admin910
/
connected
/
/srv/data/web/vhosts/www.shinegis.mu/htdocs/admin910/connected/tarifs.php
<?php require_once("../../config/database.php"); function getServices($database, $category_id) { $stmt = $database->prepare("SELECT * FROM services WHERE category_id = (SELECT id FROM category WHERE id = ?)"); $stmt->execute([$category_id]); $row = $stmt->fetchAll(); return $row; } $categorysId = [2, 3, 4, 5]; $services = []; for ($i = 0; $i < count($categorysId); $i++) { array_push($services, getServices($db_client, $categorysId[$i])); } if (isset($_POST['updatePrice'])) { $id = $_POST['service_id']; if (isset($_POST['service_id'])) { $price_ht_value = floatval(str_replace(',', '.', $_POST['price_ht_value'])); $options_ht_value = floatval(str_replace(',', '.', $_POST['options_ht_value'])); $deplacement = floatval(str_replace(',', '.', $_POST['deplacement'])); $stmt = $db_client->prepare("UPDATE services SET prix_ht = ?, option_ht_rapport = ?, deplacement_ht = ? WHERE id = ?"); $stmt->execute([$price_ht_value, $options_ht_value, $deplacement, $id]); header("Refresh:0"); } } ?> <div class="tarifs mt-5"> <table class="table table-striped table-hover text-center"> <thead> <tr> <th scope="col">PRESTATIONS</th> <th scope="col">PRIX HT</th> <th scope="col">OPTIONS HT RAPPORT</th> <th scope="col">DÉPLACEMENT HT (DEPT 77,78,91)</th> <th scope="col">Action</th> </tr> </thead> <tbody> <tr> <td class="table-dark" colspan="5"> TARIFS EXPERTISES & ASSISTANCES </td> </tr> <?php if (!empty($services)) { foreach ($services[0] as $key => $service) { ?> <form method="post" action=""> <tr> <input type="hidden" id="service_id" name="service_id" value="<?= $service->id ?>" /> <td><?= ($service->prestation !== '0') ? $service->prestation : "" ?></td> <td> <input type="text" id="price_ht_value" name="price_ht_value" value="<?= ($service->prix_ht !== '0') ? $service->prix_ht : "Sur devis" ?>" /> € </td> <td> <input type="text" id="options_ht_value" name="options_ht_value" value="<?= ($service->option_ht_rapport !== '0') ? $service->prix_ht : "--" ?>" /> € </td> <td>+ <input type="text" id="deplacement" name="deplacement" value="<?= $service->deplacement_ht ?>" /> €</td> <td><button type="submit" id="updatePrice" name="updatePrice">Enregistrer</button></td> </tr> </form> <?php } } ?> <tr> <td class="table-dark" colspan="5"> TARIFS ASSISTANCE LIVRAISON VEFA </td> </tr> <?php if (!empty($services)) { foreach ($services[1] as $key => $service) { ?> <form method="post" action=""> <tr> <input type="hidden" id="service_id" name="service_id" value="<?= $service->id ?>" /> <td><?= ($service->prestation !== '0') ? $service->prestation : "" ?></td> <td> <input type="text" id="price_ht_value" name="price_ht_value" value="<?= ($service->prix_ht !== '0') ? $service->prix_ht : "Sur devis" ?>" /> € </td> <td> <input type="text" id="options_ht_value" name="options_ht_value" value="<?= ($service->option_ht_rapport !== '0') ? $service->prix_ht : "--" ?>" /> € </td> <td>+ <input type="text" id="deplacement" name="deplacement" value="<?= $service->deplacement_ht ?>" /> €</td> <td><button type="submit" id="updatePrice" name="updatePrice">Enregistrer</button></td> </tr> </form> <?php } } ?> <tr> <td class="table-dark" colspan="5"> TARIFS ASSISTANCE RECEPTION CCMI </td> </tr> <?php if (!empty($services)) { foreach ($services[2] as $key => $service) { ?> <form method="post" action=""> <tr> <input type="hidden" id="service_id" name="service_id" value="<?= $service->id ?>" /> <td><?= ($service->prestation !== '0') ? $service->prestation : "" ?></td> <td> <input type="text" id="price_ht_value" name="price_ht_value" value="<?= ($service->prix_ht !== '0') ? $service->prix_ht : "Sur devis" ?>" /> € </td> <td> <input type="text" id="options_ht_value" name="options_ht_value" value="<?= ($service->option_ht_rapport !== '0') ? $service->prix_ht : "--" ?>" /> € </td> <td>+ <input type="text" id="deplacement" name="deplacement" value="<?= $service->deplacement_ht ?>" /> €</td> <td><button type="submit" id="updatePrice" name="updatePrice">Enregistrer</button></td> </tr> </form> <?php } } ?> <tr> <td class="table-dark" colspan="5"> GRILLE TARIFAIRES PRESTATIONS EXPERT D'ASSURÉ VS EXPERT D'ASSURANCE<br /> (clichés numériques inclus) </td> </tr> <?php if (!empty($services)) { foreach ($services[3] as $key => $service) { ?> <form method="post" action=""> <tr> <input type="hidden" id="service_id" name="service_id" value="<?= $service->id ?>" /> <td><?= ($service->prestation !== '0') ? $service->prestation : "" ?></td> <td> <input type="text" id="price_ht_value" name="price_ht_value" value="<?= ($service->prix_ht !== '0') ? $service->prix_ht : "Sur devis" ?>" /> € </td> <td> <input type="text" id="options_ht_value" name="options_ht_value" value="<?= ($service->option_ht_rapport !== '0') ? $service->prix_ht : "--" ?>" /> € </td> <td>+ <input type="text" id="deplacement" name="deplacement" value="<?= $service->deplacement_ht ?>" /> €</td> <td><button type="submit" id="updatePrice" name="updatePrice">Enregistrer</button></td> </tr> </form> <?php } } ?> </tbody> </table> </div>