list.html.php 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php if($title == "Documents" || $title == "Promotions")
  2. {
  3. echo '<div style="text-align:right">
  4. <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#addForm" aria-expanded="false" aria-controls="addForm">
  5. Ajouter
  6. </button>
  7. </div>';
  8. }
  9. ?>
  10. <form class="collapse" id="addForm">
  11. <?php
  12. switch($title)
  13. {
  14. case "Documents":
  15. echo '<div class="well">
  16. <div class="form-group">
  17. <label for="promo">Promotion :</label>
  18. <select id="promo">';
  19. foreach($promos as $promo)
  20. {
  21. echo '<option value="'.$promo["Identifiant"].'">'.$promo["Libellé"].'</option>';
  22. }
  23. echo '<option value=""></option>
  24. </select>
  25. </div>
  26. <div class="form-group">
  27. <label class="control-label" for="rang">Rang :</label>
  28. <input type="number" class="form-control" id="rang" />
  29. </div>
  30. <div class="form-group">
  31. <label class="control-label" for="libelle">Libellé : </label>
  32. <input type="text" class="form-control" id="libelle" placeholder="Libellé" />
  33. </div>
  34. <div class="form-group">
  35. <label class="control-label" for="file">Fichier :</label>
  36. <input type="file" id="file" />
  37. </div>
  38. <div class="form-group">
  39. <input type="submit" class="form-control" value="Ajouter le document" id="formsubmit" />
  40. </div>
  41. </div>';
  42. break;
  43. case "Promotions":
  44. echo '<div class="well">
  45. <div class="form-group">
  46. <label class="control-label" for="id">Identifiant :</label>
  47. <input type="text" class="form-control" id="id" placeholder="Identifiant" />
  48. </div>
  49. <div class="form-group">
  50. <label class="control-label" for="libelle">Libellé : </label>
  51. <input type="text" class="form-control" id="libelle" placeholder="Libellé" />
  52. </div>
  53. <div class="form-group">
  54. <input type="submit" class="form-control" value="Ajouter la promotion" id="formsubmit" />
  55. </div>
  56. </div>';
  57. break;
  58. }
  59. ?>
  60. </form>
  61. <table class="table tablesorter table-striped" id="mainTable">
  62. <thead>
  63. <?php foreach ($data[0] as $key => $value) {
  64. ?>
  65. <th class="th-inner sortable both"><?php echo $key; ?></th>
  66. <?php
  67. }
  68. ?>
  69. <th>Opérations</th>
  70. </thead>
  71. <tbody>
  72. <?php foreach ($data as $element) {
  73. ?>
  74. <tr>
  75. <?php
  76. foreach ($element as $field => $value) {
  77. if (is_array($value)) {
  78. ?>
  79. <td id="<?php echo $value["id"]; ?>"><?php echo $value["libelle"]; ?></td>
  80. <?php
  81. } else {
  82. ?>
  83. <td><?php echo $value; ?></td>
  84. <?php
  85. }
  86. }
  87. ?>
  88. <td><i class="fa fa-pencil" style="cursor:pointer"></i></td>
  89. </tr>
  90. <?php
  91. }
  92. ?>
  93. </tbody>
  94. </table>