utilitaires.inc.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. // Menu des administrateurs/utilisateurs
  3. if (isValidConstant() != 1) {
  4. fermeSessionUtilisateur();
  5. }
  6. $modeAdmin= ($_SESSION['gestion_site']>="Oui"?"Oui":"Non");
  7. if ($modeAdmin!=="Oui") {
  8. exit;
  9. }
  10. $datedebut = getPeriodeCourante("début");
  11. $datefin = getPeriodeCourante("fin");
  12. $periode_en_cours = $datedebut . " au " . $datefin;
  13. $jeton = filter_input(INPUT_POST, 'jeton');
  14. if (empty($jeton)) {
  15. $jeton = filter_input(INPUT_GET, 'jeton');
  16. }
  17. function creer_menu_item_admin($modeAdmin, $etiquette, $menuName, $jeton, $icone) {
  18. if ($modeAdmin === "Oui") {
  19. $alignement = "center";
  20. print "<td style='vertical-align: top;' style='min-width:315px; max-width:315px;'>\n";
  21. print "<div style='text-align: $alignement;'>\n";
  22. print "<button class='styled bouton_menu' onclick='versMenu(\"$menuName\", \"$jeton\");' tabindex='$menuName' type='button'>\n";
  23. print "<div align='center'><i class='fa $icone'><span class='espace_icone_menu'>$etiquette</span></i></div>\n";
  24. print "</button>\n";
  25. print "</div>\n";
  26. print "</td>\n";
  27. } else {
  28. print "<td style='width:300px;'></td>";
  29. }
  30. }
  31. ?>
  32. <table style='border:0px; text-align:center; margin:auto; width:auto;' cellpadding='0' cellspacing='0'>
  33. <tbody>
  34. <tr>
  35. <td>
  36. <form action='' name='horloge' enctype='text/plain'>
  37. <table style='width:900px; margin:0; padding:0; height:850px;' cellpadding='0' cellspacing='0'>
  38. <thead>
  39. <tr>
  40. <td class="img_center" colspan='3'>
  41. <img id="logoweb" src="images/logoweb.png" alt="<?php print $APPLICATION; ?>">
  42. </td>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <tr>
  47. <!-- Ligne vide pour espacement vertical -->
  48. <td style='vertical-align: top;' colspan='2'>&nbsp;</td>
  49. </tr>
  50. <tr>
  51. <td style='vertical-align: top;' colspan='2'>
  52. <div style='width:360px; height:163px; margin:auto; padding:0;'>
  53. <?php
  54. print "<img alt='SYNDICAT' src='logo/" . $_SESSION["syndicat"] . "." . $_SESSION['logo'] . "' width='360px;' height='163px;'>\n";
  55. print "</div>\n";
  56. ?>
  57. </td>
  58. </tr>
  59. <?php
  60. print "<tr>\n";
  61. //Configuration du syndicat
  62. creer_menu_item_admin($modeAdmin, "Paramètres de la centrale syndicale", "parametres_centrale", $jeton, "fa-wpforms");
  63. //Réactivation de compte bloqués
  64. //creer_menu_item_admin($modeAdmin, "Réactivation de tous les comptes actifs bloqués", "compte_bloques", $jeton, "fa-unlock-alt");
  65. //Copie de sauvegarde
  66. creer_menu_item_admin($modeAdmin, "Copie de sauvegarde", "copie_sauvegarde", $jeton, "fa-life-saver");
  67. print "</tr>\n";
  68. // print "<tr>\n";
  69. //
  70. // //Billet de service
  71. // //creer_menu_item_admin($modeAdmin, "Ouvrir un billet de service", "billet_service", $jeton, "fa-wpforms");
  72. // print "</tr>\n";
  73. //Sortie
  74. print "<tr>\n";
  75. print "<td style='vertical-align: top;' colspan='3'>\n";
  76. print " <form name='horloge' action='index2.php' method='POST'>\n";
  77. print " <input class='styled' type=\"submit\" style='cursor:pointer;' value=\"Fermer\">\n";
  78. print " <input type='hidden' name='jeton' value='" . $_SESSION['jeton'] . "'>\n";
  79. print " </form>";
  80. print "</td>\n";
  81. print "</tr>\n";
  82. ?>
  83. <tr>
  84. <td colspan='3'>
  85. <table style='text-align:center; margin:auto; padding-top:30px;'>
  86. <tr>
  87. <td style="vertical-align: top;">
  88. <div style="text-align:left;">Période en cours : </div>
  89. </td>
  90. <td style="vertical-align: top;" colspan="2">
  91. <div style="text-align:left;">
  92. <input style="direction: ltr; background-color: rgb(204, 204, 204);" size="30" readonly="readonly" name="info2" value="<?= $periode_en_cours; ?>">
  93. </div>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td style='vertical-align: top;'>
  98. <div style='text-align:left;'>Utilisateur branché : </div>
  99. </td>
  100. <td style='vertical-align: top;'>
  101. <div style='text-align:left;'>
  102. <input style='background-color: rgb(204, 204, 204);' size='30' readonly='readonly' name='info3' value='<?= htmlspecialchars($_SESSION['utilisateur'], ENT_SUBSTITUTE, "UTF-8"); ?>'>
  103. </div>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td style='vertical-align: top;'>
  108. <div style='text-align:left;'>Prénom et nom : </div>
  109. </td>
  110. <td style='vertical-align: top;'>
  111. <div style='text-align:left;'>
  112. <input style='background-color: rgb(204, 204, 204);' size='30' readonly='readonly' name='info4' value='<?= htmlentities($_SESSION['nomreel'], ENT_SUBSTITUTE, "UTF-8"); ?>'>
  113. </div>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td style='vertical-align: top;'>
  118. <div align='left'>Temps restant :</div>
  119. </td>
  120. <td style='vertical-align: top;'>
  121. <div align='left'>
  122. <input readonly='readonly' style='background-color: rgb(204, 204, 204);' name='clock' value='' size='3' dir='rtl' type='text'>
  123. min:sec avant la fermeture automatique de la session.
  124. </div>
  125. </td>
  126. </tr>
  127. </table>
  128. </td>
  129. <td style='vertical-align: middle;'>
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. </form>
  135. </td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <script type='text/javascript' language='JavaScript'>
  140. function versMenu(lien, jeton) {
  141. if (lien === "fermer") {
  142. lien = "fermer.php";
  143. } else {
  144. lien = 'index2.php?page=' + lien + "&jeton=" + jeton;
  145. }
  146. window.location = lien;
  147. }
  148. </script>