cms.parametres-debug.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. <h4>Infos serveur</h4>
  23. <div class="element-parametres">
  24. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPHPInfo">Voir le PHP Infos</button>
  25. </div>
  26. <h4>Infos Post Size</h4>
  27. <div class="element-parametres">
  28. <?php
  29. echo '<div>SAPI: ' . PHP_SAPI . PHP_EOL . '</div>';
  30. echo '<div>upload_max_filesize: ' . ini_get('upload_max_filesize') . PHP_EOL . '</div>';
  31. echo '<div>post_max_size: ' . ini_get('post_max_size') . PHP_EOL . '</div>';
  32. echo '<div>Loaded conf: ' . (php_ini_loaded_file() ?: 'none') . PHP_EOL . '</div>';
  33. ?>
  34. </div>
  35. <div class="modal fade" id="modalPHPInfo" tabindex="-1" role="dialog" aria-hidden="true">
  36. <div class="modal-dialog" role="document">
  37. <div class="modal-content">
  38. <div class="modal-header">
  39. <h5 class="modal-title" id="exampleModalLabel">PHP Info</h5>
  40. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  41. <span aria-hidden="true">&times;</span>
  42. </button>
  43. </div>
  44. <div class="modal-body">
  45. <iframe width="970" height="800" src="/parametres-debug-info.vue"></iframe>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </td>
  51. <?php if (session::getType() == 1 and (ENVIRONNEMENT != "PROD")) { ?>
  52. <td>
  53. <h4>Outils de débug</h4>
  54. <div class="element-parametres">
  55. <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>
  56. </div>
  57. </td>
  58. <?php } ?>
  59. </tr>
  60. </tbody>
  61. </table>
  62. <script>
  63. $(document).ready(function() {
  64. $('#modalPHPInfo').on('show.bs.modal', function() {
  65. $(this).find('.modal-body').css({
  66. width: 'auto', //probably not needed
  67. height: 'auto', //probably not needed
  68. 'max-height': '100%'
  69. });
  70. });
  71. $('#checkMaintenance').on('change', function() {
  72. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  73. });
  74. $('#checkDebug').on('change', function() {
  75. window.location.href = "/submit.php?from=parametres-debug&target=debug&actif=" + $("#checkDebug").prop('checked');
  76. });
  77. });
  78. </script>