cms.parametres-general.php 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. $checkMaintenance = core::isMaintenance();
  3. $checkDebug = core::isDebug();
  4. $checkLogSuccess = core::getConfig("LOG_SUCCESS");
  5. $checkLogWarning = core::getConfig("LOG_WARNING");
  6. $checkLogError = core::getConfig("LOG_ERROR");
  7. $space_total_documents = disk_total_space(DOCUMENT_DATAS);
  8. $space_free_documents = disk_free_space(DOCUMENT_DATAS);
  9. $space_total_backup = disk_total_space(DIR_BACKUP);
  10. $space_free_backup = disk_free_space(DIR_BACKUP);
  11. ?>
  12. <h4>Espaces disques</h4>
  13. <?php $infosDB = core::getSizeDataBase(); ?>
  14. <div>
  15. <span class="badge" style="background-color:#28a745; width: 130px;"><?php echo $infosDB["moDB"] ?> Mo</span> <label> <?php echo $infosDB["nameDB"] ?> (Mysql)</label>
  16. </div>
  17. <div>
  18. <span class="badge" style="background-color:#28a745; width: 130px;"><?php echo core::convertBytes(disk_free_space(DOCUMENT_ROOT), "o", "Go") . " / " . core::convertBytes(disk_total_space(DOCUMENT_ROOT), "o", "Go") ?></span> <label> Espace ROOT</label>
  19. </div>
  20. <div>
  21. <span class="badge" style="background-color:#28a745; width: 130px;"><?php echo core::convertBytes(disk_free_space(DOCUMENT_DATAS), "o", "Go") . " / " . core::convertBytes(disk_total_space(DOCUMENT_DATAS), "o", "Go") ?></span> <label> Espace DATAS</label>
  22. </div>
  23. <div>
  24. <span class="badge" style="background-color:#17a2b8; width: 130px;"><?php echo core::convertBytes(file::sizeFolder(DIR_BACKUP), "o", "Mo") . " / " . core::convertBytes(disk_total_space(DOCUMENT_DATAS), "o", "Go") ?></span> <label> Dossier Backups</label>
  25. </div>
  26. <div>
  27. <span class="badge" style="background-color:#17a2b8; width: 130px;"><?php echo core::convertBytes(file::sizeFolder(DOCUMENT_DATAS), "o", "Mo") . " / " . core::convertBytes(disk_total_space(DOCUMENT_DATAS), "o", "Go") ?></span> <label> Dossier Documents</label>
  28. </div>
  29. <div>
  30. <span class="badge" style="background-color:#17a2b8; width: 130px;"><?php echo core::convertBytes(file::sizeFolder(DIR_DATAS_JSONDATA), "o", "Mo") . " / " . core::convertBytes(disk_total_space(DOCUMENT_ROOT), "o", "Go") ?></span> <label> Dossier Json</label>
  31. </div>
  32. <div>
  33. <span class="badge" style="background-color:#17a2b8; width: 130px;"><?php echo core::convertBytes(file::sizeFolder(SFTP_LOCAL), "o", "Mo") . " / " . core::convertBytes(disk_total_space(DOCUMENT_ROOT), "o", "Go") ?></span> <label> Dossier SFTP</label>
  34. </div>
  35. <h4>Général</h4>
  36. <div class="element-parametres form-check form-switch">
  37. <input class="form-check-input" type="checkbox" role="switch" id="checkMaintenance" <?php core::checkboxSelecter($checkMaintenance) ?>>
  38. <label class="form-check-label" for="checkMaintenance">Site en mode maintenance (les salariés ne pourront plus faire d'action sur le site)</label>
  39. </div>
  40. <div class="element-parametres form-check form-switch">
  41. <input class="form-check-input" type="checkbox" role="switch" id="checkDebug" <?php core::checkboxSelecter($checkDebug) ?>>
  42. <label class="form-check-label" for="checkDebug">Afficher les erreurs (débug)</label>
  43. </div>
  44. <h4>Historique</h4>
  45. <div class="element-parametres form-check form-switch">
  46. <input class="form-check-input" type="checkbox" role="switch" id="checkLogSuccess" <?php core::checkboxSelecter($checkLogSuccess) ?>>
  47. <label class="form-check-label" for="checkLogSuccess">Historiser les actions réalisées avec succès</label>
  48. </div>
  49. <div class="element-parametres form-check form-switch">
  50. <input class="form-check-input" type="checkbox" role="switch" id="checkLogWarning" <?php core::checkboxSelecter($checkLogWarning) ?>>
  51. <label class="form-check-label" for="checkLogWarning">Historiser les actions réalisées avec warning</label>
  52. </div>
  53. <div class="element-parametres form-check form-switch">
  54. <input class="form-check-input" type="checkbox" role="switch" id="checkLogError" <?php core::checkboxSelecter($checkLogError) ?>>
  55. <label class="form-check-label" for="checkLogError">Historiser les actions en erreur</label>
  56. </div>
  57. <script>
  58. $(document).ready(function() {
  59. $('#checkMaintenance').on('change', function() {
  60. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  61. });
  62. $('#checkDebug').on('change', function() {
  63. window.location.href = "/submit.php?from=parametres-debug-activation&actif=" + $("#checkDebug").prop('checked');
  64. });
  65. $('#checkLogSuccess').on('change', function() {
  66. window.location.href = "/submit.php?from=parametres-config&name=LOG_SUCCESS&value=" + $("#checkLogSuccess").prop('checked');
  67. });
  68. $('#checkLogWarning').on('change', function() {
  69. window.location.href = "/submit.php?from=parametres-config&name=LOG_WARNING&value=" + $("#checkLogWarning").prop('checked');
  70. });
  71. $('#checkLogError').on('change', function() {
  72. window.location.href = "/submit.php?from=parametres-config&name=LOG_ERROR&value=" + $("#checkLogError").prop('checked');
  73. });
  74. });
  75. </script>