cms.host-restore.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
  2. <h2 class="bd-title" id="content">
  3. <span>Restauration des données</span>
  4. <a href="/submit.php?from=host-add-backup" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="plus-square"></span> Créer un nouveau backup</button></a>
  5. </h2>
  6. </header>
  7. <?php
  8. echo core::filAriane(array(
  9. "current" => "Restauration des données",
  10. "arbo" => array(
  11. "Maintenance" => NULL,
  12. "Restauration des données" => "/host-restore.html")
  13. ));
  14. ?>
  15. <div>
  16. <table
  17. id="table"
  18. class="table-striped table-hover table-sm"
  19. data-toggle="table"
  20. data-sort-name="date"
  21. data-sort-order="desc"
  22. data-url="/json.php?jsonData=host-restore">
  23. <thead>
  24. <tr>
  25. <th data-formatter="downloadFile" data-sortable="true" data-field="file" data-filter-control="input" data-align="left">Nom</th>
  26. <th data-sortable="true" data-field="size" data-filter-control="input" data-width="100">Taille</th>
  27. <th data-sortable="true" data-field="date" data-filter-control="input" data-width="170">Date de création</th>
  28. <th data-formatter="restoreBackup" data-width="130"></th>
  29. </tr>
  30. </thead>
  31. </table>
  32. </div>
  33. <script>
  34. function downloadFile(value, row) {
  35. return '<form method="post" action="/submit.php">\n\
  36. <input type="hidden" name="from" value="host-download-backup-zip">\n\
  37. <input type="hidden" name="file" value="' + row.file + '">\n\
  38. <button type="submit" style="border:none; background:none;" title="Télécharger le fichier : ' + row.file + '">' + row.file + '</button>\n\
  39. </form>';
  40. }
  41. function restoreBackup(value, row) {
  42. return '<form method="post" action="/submit.php">\n\
  43. <input type="hidden" name="from" value="host-restore-backup-zip">\n\
  44. <input type="hidden" name="file" value="' + row.file + '">\n\
  45. <button type="submit" onclick="return confirm(\'Etes-vous certain de vouloir restaurer cette version (données et fichiers) ?\')" class="btn btn-outline-danger btn-sm">Restaurer</button>\n\
  46. </form>';
  47. }
  48. </script>