Agefoddx/view/gestionLigne/afficherListe.php
2025-03-26 10:22:20 +01:00

65 lines
3.2 KiB
PHP

<?php
global $langs, $db;
$langs->loadLangs(array("admin", "Agefoddx@Agefoddx"));
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
$form = new Form($db);
$csrfToken = function_exists('newToken') ? newToken() : $_SESSION['newtoken'];
/** @var $titre */ /** @var $liste */
/** @var $idBD */ /** @var $nomBD */ /** @var $mdp */
/** @var $idTable */ /** @var $nomTableA */ /** @var $nomTableE */
if (!isset($titre)) {
$titre = "Agefoddx";
}
?>
<script src="../js/envoiePost.js"></script>
<table class="centpercent">
<tr class=" left col-left">
<th>
<a href="#" onclick="envoyerPost({action:'afficherListe', controleur:'bd'},'setup.php', '<?= $csrfToken ?>')"><?=$langs->trans("AgefoddxListeBD")?>\</a>
<a href="#" onclick="envoyerPost({action:'afficherListe', controleur:'table', idBD:'<?= $idBD ?>', nomBD:'<?= $nomBD ?>', mdp:'<?=$mdp?>'}, 'setup.php', '<?= $csrfToken ?>')"><?= $nomBD ?>\</a>
<a><?=$langs->trans("AgefoddxListeLigne")?></a>
</th>
</tr>
<tr>
<th scope="col" class=" left col-left">
<h2><?= $titre ?></h2>
</th>
<th scope="col" class=" right col-right">
<a class="btnTitle btnTitlePlus" href="#" onclick="envoyerPost({action:'ajouter', controleur:'ligne', idBD:'<?=$idBD?>',idTable:'<?=$idTable?>', nomBD:'<?=$nomBD?>', nomTableA:'<?=$nomTableA?>', nomTableE:'<?=$nomTableE?>', mdp:'<?=$mdp?>'}, 'setup.php', '<?=$csrfToken?>')">
<span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span>
</a>
</th>
</tr>
</table>
<div class="div-table-responsive">
<table class="tagtable liste">
<thead>
<tr class="liste_titre">
<th scope="col" class="liste_titre center"><?= $langs->trans("AgefoddxIdLigne") ?></th>
<th scope="col" class="liste_titre center"><?=$langs->trans("AgefoddxNomLigneExterne"). " " . $nomTableE?></th>
<th scope="col" class="liste_titre center"><?=$langs->trans("AgefoddxNomLigneAgefodd"). " " . $nomTableA?></th>
<th scope="col" class="liste_titre center" colspan="2"><?= $langs->trans("AgefoddxParametresLigne") ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($liste as $item){ ?>
<tr class="oddeven">
<td class="center nowrap" scope="row"><?=$item["idLigne"]?></td>
<td class="center nowrap"><?= htmlspecialchars($item["nomLigneE"] ?? $langs->trans("AgefoddxValeurFixeItem"))?></td>
<td class="center nowrap"><?= htmlspecialchars($item["nomLigneA"])?></td>
<td class="center nowrap"><a href="#" onclick="envoyerPost({action:'supprimer', controleur:'ligne', idBD:'<?=$idBD?>', idTable:'<?=$idTable?>', idLigne:'<?=$item["idLigne"]?>', nomBD:'<?=$nomBD?>', nomTableA:'<?=$nomTableA?>', nomTableE:'<?=$nomTableE?>', nomLigneE:'<?=$item["nomLigneE"]?>',nomLigneA:'<?=$item["nomLigneA"]?>', mdp:'<?=$mdp?>'}, 'setup.php', '<?=$csrfToken?>')">
<?= $langs->trans("AgefoddxSupprimerLigne") ?>
</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>