2
0

cms.lottery-winners.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. $dataLottery = lottery::getInscriptionData(core::getGet("id"));
  3. $sortLottery = lottery::getCloture(core::getGet("id"));
  4. if($sortLottery["sortDate"] == NULL) {
  5. ?>
  6. <div class="card text-center">
  7. <div class="card-header" style="font-size: 1.3em;">
  8. Combien de personnes doivent être tirées au sort ?
  9. </div>
  10. <div class="card-body">
  11. <form method="post" action="/submit.php">
  12. <input type="hidden" name="from" value="lottery-winners">
  13. <input type="hidden" name="lottery" value="<?php echo core::getGet("id") ?>">
  14. <div class="form-group">
  15. <label>Saisissez un nombre entre 1 et <?php echo $dataLottery["eligible"] ?></label>
  16. <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>
  17. </div>
  18. <br />
  19. <input class="btn btn-primary btn-lg" style="width: 100%" type="submit" value="Tirer au sort">
  20. </form>
  21. </div>
  22. </div>
  23. <?php
  24. } else {
  25. ?>
  26. <div class="card text-center" style="border-color:green;">
  27. <div class="card-header" style="font-size: 1.3em; background-color:#d4edda; color:green;">
  28. Résultat du tirage au sort
  29. </div>
  30. <div class="card-body">
  31. <div class="row">
  32. <div class="col">
  33. <label style="color: gray;">Date du tirage au sort</label>
  34. <input type="text" value="<?php
  35. if (isset($sortLottery["sortDate"])) {
  36. echo $sortLottery["sortDate"];
  37. }
  38. ?>" class="form-control text-center" disabled>
  39. </div>
  40. <div class="col">
  41. <label style="color: gray;">Réalisé par</label>
  42. <input type="text" value="<?php
  43. if (isset($sortLottery["sortBy"])) {
  44. echo $sortLottery["sortBy"];
  45. }
  46. ?>" class="form-control text-center" disabled>
  47. </div>
  48. <div class="col">
  49. <label style="color: gray;">Paramètre</label>
  50. <input type="text" value="<?php
  51. if (isset($sortLottery["sortNb"])) {
  52. if($sortLottery["sortNb"] > 1){ echo $sortLottery["sortNb"] . " gagnants"; }
  53. else { echo $sortLottery["sortNb"] . " gagnant"; }
  54. }
  55. ?>" class="form-control text-center" disabled>
  56. </div>
  57. </div>
  58. <br />
  59. <table
  60. id="table"
  61. class="table-striped table-hover table-sm"
  62. data-page-size="25"
  63. data-toggle="table"
  64. data-buttons-align="left"
  65. data-pagination="true"
  66. data-filter-control="true"
  67. data-flat="true"
  68. data-url="/json.php?jsonData=lottery-winners&id=<?php echo core::getGet("id") ?>">
  69. <thead>
  70. <tr>
  71. <th data-sortable="true" data-field="id_dossier" data-filter-control="input" data-width="50" data-formatter="selectDossier">Id Dossier</th>
  72. <th data-sortable="true" data-field="id_salarie" data-filter-control="input" data-width="50">Id Salarié</th>
  73. <th data-sortable="true" data-field="login" data-filter-control="input">Login</th>
  74. <th data-sortable="true" data-field="prenom" data-filter-control="input">Prénom</th>
  75. <th data-sortable="true" data-field="nom" data-filter-control="input">Nom</th>
  76. <th data-sortable="true" data-field="selected">Date du tirage</th>
  77. </tr>
  78. </thead>
  79. </table>
  80. </div>
  81. </div>
  82. <script>
  83. function selectDossier(value) {
  84. 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>';
  85. }
  86. function selectPrestation(value, row) {
  87. 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>';
  88. }
  89. </script>
  90. <?php
  91. }
  92. ?>