2
0

cms.parametres-debug.php 3.7 KB

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