Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. <div class="card-body">
  2. <div class="table-responsive">
  3. <table class="table">
  4. <thead class=" text-primary">
  5. <th>
  6. Fita
  7. </th>
  8. <th>
  9. Punts
  10. </th>
  11. <th>
  12. Codi
  13. </th>
  14. </thead>
  15. <tbody>
  16.  
  17.  
  18. <?php if (!$_POST) { ?>
  19. <!-- modal -->
  20.  
  21. <?php
  22.  
  23. $sentencia_fites = $pdo->query("SELECT id_fita, numero_fita, valor_fita, codi_fita FROM `fites` WHERE id_fita != 0;");
  24.  
  25. $fitas = $sentencia_fites->fetchAll(PDO::FETCH_OBJ);
  26.  
  27. foreach($fitas as $fita){ ?>
  28.  
  29. <tr style="<?php $color ?>">
  30. <td><?php echo $fita->id_fita ?></td>
  31. <td><?php echo $fita->numero_fita ?></td>
  32. <td>
  33. <input class="form-control" type="text" name="codi_fita">
  34. </td>
  35. <td>
  36. <div class="col-md-6">
  37. <form method="post">
  38. <input name="codi_fita" value="codi" hidden/>
  39. <button class="btn btn-primary btn-block" onclick="md.showNotification('top','center')" type="submit">
  40. Validar
  41. </button>
  42. </form>
  43. </div>
  44. </td>
  45. </tr>
  46.  
  47. <?php } ?>
  48.  
  49. <?php }else { ?>
  50.  
  51.  
  52. <?php
  53.  
  54. //color para las fitas correctas
  55. $color = "background-color:#CEFF92";
  56.  
  57. $sentencia_fites = $pdo->query("SELECT id_fita, numero_fita, valor_fita, codi_fita FROM `fites` WHERE id_fita != 0;");
  58. $fitas = $sentencia_fites->fetchAll(PDO::FETCH_OBJ);
  59.  
  60.  
  61. foreach($fitas as $fita){ ?>
  62.  
  63. <tr style="<?= $color ?>">
  64. <td><?php echo $fita->id_fita ?></td>
  65. <td><?php echo $fita->numero_fita ?></td>
  66. <td>
  67. <input class="form-control" type="text" name="codi_fita">
  68. </td>
  69. <td>
  70.  
  71. <div class="col-md-6">
  72. <form method="post">
  73. <input name="codi_fita" value="2" type="hidden"/>
  74. <button class="btn btn-primary btn-block" onclick="md.showNotification('top','center')" type="submit">
  75. Validar
  76. </button>
  77. </form>
  78. </div>
  79.  
  80. </td>
  81. </tr>
  82. <?php } ?>
  83.  
  84. <?php } ?>
  85.  
  86. </tbody>
  87.  
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement