cms.lottery-winners.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. $dataLottery = lottery::getInscriptionData(core::getGet("id"));
  3. $sortLottery = lottery::getCloture(core::getGet("id"));
  4. ?>
  5. <div class="card text-center">
  6. <div class="card-header" style="font-size: 1.3em;">
  7. Informations sur les inscrits
  8. </div>
  9. <div class="card-body">
  10. <div class="row">
  11. <div class="col">
  12. <label style="color: gray;">Nombre d'inscrits</label>
  13. <input type="text" value="<?php
  14. if (isset($dataLottery["inscrits"])) {
  15. echo $dataLottery["inscrits"];
  16. }
  17. ?>" class="form-control text-center" disabled>
  18. </div>
  19. <div class="col">
  20. <label style="color: gray;">Eligible(s)</label>
  21. <input type="text" value="<?php
  22. if (isset($dataLottery["eligible"])) {
  23. echo $dataLottery["eligible"];
  24. }
  25. ?>" style="background-color:#d4edda; color:green;" class="form-control text-center" disabled>
  26. </div>
  27. <div class="col">
  28. <label style="color: gray;">Non éligible(s)</label>
  29. <input type="text" value="<?php
  30. if (isset($dataLottery["ineligible"])) {
  31. echo $dataLottery["ineligible"];
  32. }
  33. ?>" style="background-color:#f8d7da; color:red;" class="form-control text-center" disabled>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <br />
  39. <?php
  40. if($sortLottery["sortDate"] == NULL) {
  41. ?>
  42. <div class="card text-center">
  43. <div class="card-header" style="font-size: 1.3em;">
  44. Combien de personnes doivent être tirées au sort ?
  45. </div>
  46. <div class="card-body">
  47. <form method="post" action="/submit.php">
  48. <input type="hidden" name="from" value="lottery-winners">
  49. <input type="hidden" name="lottery" value="<?php echo core::getGet("id") ?>">
  50. <div class="form-group">
  51. <label>Saisissez un nombre entre 1 et <?php echo $dataLottery["eligible"] ?></label>
  52. <input type="number" pattern="\d*" min="1" max="<?php echo $dataLottery["eligible"] ?>" style="font-size:30px" value="" class="form-control text-center" name="nb_winners" required>
  53. </div>
  54. <br />
  55. <input class="btn btn-primary btn-lg" style="width: 100%" type="submit" value="Tirer au sort">
  56. </form>
  57. </div>
  58. </div>
  59. <?php
  60. } else {
  61. ?>
  62. <div class="card text-center" style="border-color:green;">
  63. <div class="card-header" style="font-size: 1.3em; background-color:#d4edda; color:green;">
  64. Résultat du tirage au sort
  65. </div>
  66. <div class="card-body">
  67. <div class="row">
  68. <div class="col">
  69. <label style="color: gray;">Date du tirage au sort</label>
  70. <input type="text" value="<?php
  71. if (isset($sortLottery["sortDate"])) {
  72. echo $sortLottery["sortDate"];
  73. }
  74. ?>" class="form-control text-center" disabled>
  75. </div>
  76. <div class="col">
  77. <label style="color: gray;">Réalisé par</label>
  78. <input type="text" value="<?php
  79. if (isset($sortLottery["sortBy"])) {
  80. echo $sortLottery["sortBy"];
  81. }
  82. ?>" class="form-control text-center" disabled>
  83. </div>
  84. <div class="col">
  85. <label style="color: gray;">Paramètre</label>
  86. <input type="text" value="<?php
  87. if (isset($sortLottery["sortNb"])) {
  88. if($sortLottery["sortNb"] > 1){ echo $sortLottery["sortNb"] . " gagnants"; }
  89. else { echo $sortLottery["sortNb"] . " gagnant"; }
  90. }
  91. ?>" class="form-control text-center" disabled>
  92. </div>
  93. </div>
  94. <br />
  95. <table
  96. id="table"
  97. class="table-striped table-hover table-sm"
  98. data-page-size="25"
  99. data-toggle="table"
  100. data-buttons-align="left"
  101. data-pagination="true"
  102. data-filter-control="true"
  103. data-flat="true"
  104. data-url="/json.php?jsonData=lottery-winners&id=<?php echo core::getGet("id") ?>">
  105. <thead>
  106. <tr>
  107. <th data-sortable="true" data-field="id_dossier" data-filter-control="input" data-width="50" data-formatter="selectDossier">Id Dossier</th>
  108. <th data-sortable="true" data-field="id_salarie" data-filter-control="input" data-width="50">Id Salarié</th>
  109. <th data-sortable="true" data-field="login" data-filter-control="input">Login</th>
  110. <th data-sortable="true" data-field="prenom" data-filter-control="input">Prénom</th>
  111. <th data-sortable="true" data-field="nom" data-filter-control="input">Nom</th>
  112. <th data-sortable="true" data-field="selected">Date du tirage</th>
  113. </tr>
  114. </thead>
  115. </table>
  116. </div>
  117. </div>
  118. <script>
  119. function selectDossier(value) {
  120. return '<a href="https://www.cse-invent.com/gestion/prestations/dossiers/' + value + '/edit?pagesize=20&page=1" target="_blank"><button type="submit" class="btn btn-outline-primary btn-sm">' + value + '</button></a>';
  121. }
  122. function selectPrestation(value, row) {
  123. return '<a href="https://www.cse-invent.com/gestion/prestations/' + value + '/edit?search=avance&page=1&pagesize=20" target="_blank"><button type="submit" class="btn btn-outline-primary btn-sm">' + value + '</button></a>';
  124. }
  125. </script>
  126. <?php
  127. }
  128. ?>