<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <div class="container-fluid">

    </div><!-- /.container-fluid -->
  </section>

  <section class="content">
    <h5 class="table-title">
      Lista de Membresias
    </h5>
    <table id="DataTable" class="table table-bordered table-striped">

      <thead>
        <tr>
          <th># ID</th>
          <th>Descripción</th>
          <th>Costo (Bs)</th>
          <th>Estado</th>
          <td>
            <button class="btn btn-block btn-primary btn-sm" onclick="MNuevoMembresia()">
              <i class="fas fa-plus"></i>
              Nuevo</button>
          </td>
        </tr>
      </thead>
      <tbody>
        <?php
        $membresia = ControladorMembresia::ctrInformacionMembresia();
        foreach ($membresia as $value) {
        ?>
        <tr>
          <td><?php echo $value["id_membresia"]; ?></td>
          <td><?php echo $value["descripcion"]; ?></td>
          <td><?php echo $value["costo"]; ?></td>
                      <?php 
            if($value["estado"]==1){
              ?>
              <td><span class="badge badge-success">Disponible</span></td>
              <?php
            }else{
              ?>
              <td><span class="badge badge-danger">No Disponible</span></td>
              <?php
            }
            ?>
          <td>
            <div class="btn-group">
              <button class="btn btn-sm btn-secondary" onclick="MEditMembresia(<?php echo $value['id_membresia']; ?>)">
                <i class="fas fa-edit"></i>
              </button>
              <button class="btn btn-sm btn-danger" onclick="MEliMembresia(<?php echo $value['id_membresia']; ?>)">
                <i class="fas fa-trash"></i>
              </button>
            </div>
          </td>
        </tr>
        <?php
        }
        ?>
      </tbody>
    </table>

  </section>
</div>