<!-- ============================================================== -->
<!-- Info box -->
<!-- ============================================================== -->
<!-- Row -->
<div class="row">
    <!-- Column -->
    <div class="col-xs-12 col-sm-12 col-md-12">
      <div class="card card-cascade narrower z-depth-1 animated bounce">
      <div class="view view-cascade gradient-card-header peach-gradient narrower py-2 mx-4 mb-3 d-flex justify-content-between align-items-center">
        <div>
              <!-- <button type="button" id="hapus_data" class="btn hapus-false btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="Hapus Data"><i class="fas fa-trash-alt mt-0"></i></button> -->
              <!-- <button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="Jumlah Item Terpilih"><span id="jumlah_pilih">0</span></button> -->
            </div>
            <a href="" class="white-text mx-3">Anggota</a>
            <div>
            <a href="<?php echo base_url(); ?>Anggota/Anggota/input" class="float-right">
              <button type="button" class="btn btn-outline-white btn-rounded btn-sm px-2" data-toggle="tooltip" data-placement="top" title="Tambah Data Baru"><i class="fas fa-plus mt-0"></i></button>
            </a>
            </div>
      </div>
      <!-- Tabel -->
      <div class="card-body">
        <div class="table-responsive">
            <table id="client_side" class="table table-striped table-bordered">
              <thead>
                  <tr>
                      <th>No</th>
                      <th>No Anggota</th>
                      <th>Nama Anggota</th>
                      <th>Jenis Kelamin</th>
                      <th>Nomor telepon</th>
                      <th width="20%">Alamat</th>
                      <th>Rekening</th>
                      <th>Opsi</th>
                  </tr>
              </thead>
              <tbody>
                 <?php
                 $no = 1;
                 foreach (@$anggota as $value):
                 ?>
                <tr>
                    <td><?php echo $no++?></td>
                    <td><?php echo $value->no_anggota?></td>
                    <td><?php echo $value->nama?></td>
                    <td><?php echo $value->jekel?></td>
                    <td><?php echo $value->telp?></td>
                    <td><?php echo $value->alamat?></td>
                    <td>
                      <div class="btn-group">
                        <?php $tabungan = $this->M_anggota->get_rek_tabungan($value->iddata_user);
                        if ($tabungan->num_rows() > 0): ?>
                          Rekening Tabungan :<br><?php echo $tabungan->row_array()['nomor_rekening'] ?><br>
                          <?php else: ?>
                            <a href="<?php echo base_url().'pembiayaan/Pengajuan/buat_rekening_tabungan/'.$value->iddata_user?>">
                              <button type="button" class="btn btn-success btn-sm" data-toggle="tooltip" title="Buka Rekening Tabungan" data-placment="top">
                                <i class="fas fa-wallet"></i>
                              </button>
                            </a>
                        <?php endif; ?>
                        <?php $pinjaman = $this->M_anggota->get_rek_pinjaman($value->iddata_user);
                        if ($pinjaman->num_rows() > 0): ?>
                          Rekening Pinjaman :<br><?php echo $pinjaman->row_array()['nomor_rekening'] ?>
                          <?php else: ?>
                            <a href="<?php echo base_url().'pembiayaan/Pengajuan/buat_rekening_pinjaman/'.$value->iddata_user?>">
                              <button type="button" class="btn btn-warning btn-sm" data-toggle="tooltip" title="Buka Rekening Pembiayaan" data-placment="top">
                                <i class="fas fa-wallet"></i>
                              </button>
                            </a>
                        <?php endif; ?>
                    </div>
                    </td>
                    <td>
                      <div class="btn-group">

                      <a href="<?php echo base_url().'Anggota/Anggota/detail/'.$value->iddata_user?>">
                        <button type="button" class="btn btn-info btn-sm" data-toggle="tooltip" title="Lihat Detail Anggota" data-placment="top">
                          <i class="fas fa-user"></i>
                        </button>
                      </a>
                      <a href="<?php echo base_url().'Anggota/Detail_hutang_anggota/index/'.$value->iddata_user?>">
                        <button type="button" class="btn btn-primary btn-sm" data-toggle="tooltip" title="Lihat Detail Hutang Anggota" data-placment="top">
                          <i class="fas fa-archive"></i>
                        </button>
                      </a>
                      <a href="<?php echo base_url().'Anggota/Anggota/editKurir/'.$value->iddata_user?>">
                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="tooltip" title="Jadi Kurir" data-placment="top">
                          <i class="fas fa-car"></i>
                        </button>
                      </a>
                    </div>
                    </td>
                </tr>
              <?php endforeach; ?>
              </tbody>
            </table>
          </div>
      </div>
      </div>
    </div>

</div>
<!-- /.row -->
<!-- ============================================================== -->
<!-- End Page Content -->
<!-- ============================================================== -->
