2
0

cms.proweb-dossiers-historique-excel.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. $jsonTarget = "/json.php?file=excel-proweb-dossiers";
  3. if(debug::isFile("debug")){
  4. debug::log(debug::getBadge($jsonTarget, "OUVRIR LE JSON : ".$jsonTarget), "JSON chargé en arrière plan");
  5. }
  6. ?>
  7. <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
  8. <h2 class="bd-title" id="content">
  9. <span>Proweb - Dossiers : Historique des Excels</span>
  10. </h2>
  11. <?php if(access::ifAccesss("proweb-dossiers-upload")){ ?>
  12. <div class="fix-container-button-nav">
  13. <a href="proweb-dossiers-upload.html"><button type="submit" class="btn btn-outline-success btn-sm"><?php icon::getFont(["icon" => "bi bi-file-earmark-plus"]) ?> Importer un fichier Excel</button></a>
  14. <a href="<?= prowebDossiers::getLinkProweb() ?>" target="_blank"><button type="submit" class="btn btn-outline-secondary btn-sm"><?php icon::getFont(["icon" => "bi bi-link-45deg"]) ?> Exporter tous les dossiers depuis Proweb</button></a>
  15. </div>
  16. <?php } ?>
  17. </header>
  18. <?php
  19. echo core::filAriane(array(
  20. "current" => "Historique des dossiers Excels",
  21. "arbo" => array(
  22. "Proweb" => NULL,
  23. "Historique des dossiers Excels" => "/proweb-dossiers-historique-excel.html"),
  24. "refresh-json" => "excel-proweb-dossiers"
  25. ));
  26. ?>
  27. <div>
  28. <table
  29. id="table"
  30. class="table-striped table-hover table-sm"
  31. data-page-size="25"
  32. data-toggle="table"
  33. data-show-columns="true"
  34. data-search="true"
  35. data-buttons-align="left"
  36. data-pagination="true"
  37. data-filter-control="true"
  38. data-flat="true"
  39. data-sort-name="cree"
  40. data-sort-order="desc"
  41. data-url="<?php echo $jsonTarget ?>">
  42. <thead>
  43. <tr>
  44. <th data-sortable="true" data-field="cree" data-filter-control="input" data-width="160">Charger le</th>
  45. <th data-sortable="true" data-field="dateData" data-filter-control="input">Datation des données</th>
  46. <th data-formatter="downloadFileLocal" data-sortable="true" data-field="name" data-filter-control="input">Fichier</th>
  47. <th data-sortable="true" data-field="nbDossiers" data-filter-control="input" data-width="60">Nb. Dossiers</th>
  48. <th data-sortable="true" data-field="size" data-width-unit="Ko" data-width="40">Poids</th>
  49. <th data-sortable="true" data-field="md5" data-filter-control="input" data-width="60">Md5</th>
  50. <th data-sortable="true" data-field="user" data-filter-control="select" data-width="180">Chargé par</th>
  51. <th data-field="id" data-formatter="deleteFile"></th>
  52. </tr>
  53. </thead>
  54. </table>
  55. </div>
  56. <script>
  57. function downloadFileLocal(value, row) {
  58. return '<form method="post" action="/submit.php">\n\
  59. <input type="hidden" name="from" value="file-download">\n\
  60. <input type="hidden" name="file" value="' + row.name + '">\n\
  61. <input type="hidden" name="md5" value="' + row.md5 + '">\n\
  62. <button type="submit" style="border:none; background:none;" title="Télécharger le fichier : ' + row.name + '">' + row.name + '</button>\n\
  63. </form>';
  64. }
  65. function deleteFile(value, row) {
  66. return '<form onSubmit="return confirm(\'Voulez-vous supprimer le fichier ' + row.name + ' ?\')" method="post" action="/submit.php">\n\
  67. <input type="hidden" name="from" value="proweb-delete-dossiers-excel">\n\
  68. <input type="hidden" name="file" value="' + row.name + '">\n\
  69. <input type="hidden" name="id" value="' + row.id + '">\n\
  70. <button type="submit" class="btn btn-outline-danger btn-sm">Supprimer</button>\n\
  71. </form>';
  72. }
  73. </script>