2
0

cms.parametres-debug.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. $checkMaintenance = debug::isFile("maintenance");
  3. $checkDebug = debug::isFile("debug");
  4. ?>
  5. <table class="table table-bordered">
  6. <tbody>
  7. <tr>
  8. <td scope="row">
  9. <h4>Activation Modes</h4>
  10. <div class="element-parametres form-check form-switch">
  11. <input class="form-check-input" type="checkbox" role="switch" id="checkMaintenance" <?php core::checkboxSelecter($checkMaintenance) ?>>
  12. <label class="form-check-label" for="checkMaintenance">Site en mode maintenance (les salariés ne pourront plus faire d'action sur le site)</label>
  13. </div>
  14. <div class="element-parametres form-check form-switch">
  15. <input class="form-check-input" type="checkbox" role="switch" id="checkDebug" <?php core::checkboxSelecter($checkDebug) ?>>
  16. <label class="form-check-label" for="checkDebug">Afficher les erreurs (débug)</label>
  17. </div>
  18. <h4>Refresh des données</h4>
  19. <div class="element-parametres">
  20. <a href="/submit.php?from=parametres-json-refresh" onclick="return confirm('Etes-vous certain de vouloir réinitialiser les JSON ?')"><button type="button" class="btn btn-warning">Réinitialisation des JSON</button></a>
  21. </div>
  22. </td>
  23. <?php if (session::getType() == 1 AND (ENVIRONNEMENT != "PROD")) { ?>
  24. <td>
  25. <h4>Outils de débug</h4>
  26. <div class="element-parametres">
  27. <a href="/submit.php?from=parametres-reset-datas" onclick="return confirm('Etes-vous certain de vouloir supprimer les données ?')"><button type="button" class="btn btn-danger">Nettoyer les données</button></a>
  28. </div>
  29. <div class="element-parametres">
  30. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPHPInfo">Voir le PHP Infos</button>
  31. </div>
  32. <div class="modal fade" id="modalPHPInfo" tabindex="-1" role="dialog" aria-hidden="true">
  33. <div class="modal-dialog" role="document">
  34. <div class="modal-content">
  35. <div class="modal-header">
  36. <h5 class="modal-title" id="exampleModalLabel">PHP Info</h5>
  37. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  38. <span aria-hidden="true">&times;</span>
  39. </button>
  40. </div>
  41. <div class="modal-body">
  42. <iframe width="970" height="800" src="/parametres-debug-info.vue"></iframe>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </td>
  48. <?php } ?>
  49. </tr>
  50. </tbody>
  51. </table>
  52. <script>
  53. $(document).ready(function() {
  54. $('#modalPHPInfo').on('show.bs.modal', function() {
  55. $(this).find('.modal-body').css({
  56. width: 'auto', //probably not needed
  57. height: 'auto', //probably not needed
  58. 'max-height': '100%'
  59. });
  60. });
  61. $('#checkMaintenance').on('change', function() {
  62. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  63. });
  64. $('#checkDebug').on('change', function() {
  65. window.location.href = "/submit.php?from=parametres-debug&target=debug&actif=" + $("#checkDebug").prop('checked');
  66. });
  67. });
  68. </script>