<table id="datatable" class="table table-bordered">
                      <thead>
                        <tr>
                          <!--<th>Tanggal</th>-->
                          <!--<th>id transaksi</th> -->
                          <th width="15px">NO.</th>
                          <th>Id Santri</th>
                          <th>Nama Santri</th>
                          <th>Status Santri</th>
                          <th>Pembayaran</th>
                          <th>Total Bayar</th>
                          <th width="100">Status</th>
                          <th width="100">Aksi</th>
                        </tr>
                      </thead>
                      <tbody>
                      <?php 
                          $no = 0;
                          $count = 1 ;
                          $total_rekap=0;
                          $query=mysqli_query($conn,"SELECT * FROM santri order by nama ASC ");

                          
                          $ro=0;
                          


                          while($row=mysqli_fetch_array($query)){
                                
                          $no++;
                      ?>

                            <tr style="background: <?php if ($no%2 == 1){ ?>
                          #ececec;
                          <?php }else{ ?>
                            white;
                            <?php } ?>">
                               
                               <!--<td><?php //echo $row['id_transaksi'];?></td>-->
                               <td><?php echo $no; ?></td>
                               <td><?php echo $row['id_santri']; ?></td>
                               <td><?php echo $row['nama']; ?></td>
                               <td><?php
                               $query2  = mysqli_query($conn,"SELECT * FROM jenis_status WHERE id_status='$row[statuus]' ORDER BY id_status");
                               $st = mysqli_fetch_array($query2);
                               echo $st['nama_status'];
                               ?>
                               </td>
                               <td><?php 
                               $keri=mysqli_query($conn,"SELECT * FROM transaksi WHERE id_santri='$row[id_santri]' AND id_jenis='5' AND spp_bulan='$bln' AND spp_tahun='$thn' order by tanggal ASC ");
                               while($ri=mysqli_fetch_array($keri)){
                                   echo $ri['tanggal']."~~".rupiah($ri['debit'])."<br>";
                               }
                               ?></td>

                               <td><?php 
                               $total=mysqli_query($conn,"SELECT sum(debit) AS total_bayar FROM transaksi WHERE id_santri='$row[id_santri]' AND id_jenis='5' AND spp_bulan='$bln' AND spp_tahun='$thn' order by tanggal ASC ");
                               $total1=mysqli_fetch_array($total);
                               echo rupiah($total1['total_bayar']);
                               ?></td>
                               <td><?php 
                               $tet1=mysqli_query($conn,"SELECT * FROM status_lunas WHERE id_santri='$row[id_santri]' AND id_jenis='5' AND spp_bulan='$bln' AND spp_tahun='$thn' ");
                               $tet=mysqli_fetch_array($tet1);
                               if (isset($tet['id_santri'])){
                                   echo "<font color=#0082da><b>lunas</b></font>";
                               }else{
                                    echo "<font color=#f01519><b>Belum Lunas</b></font>";
                               }
                    
                               ?></td>
                               <td>
                               <?php
                               if (isset($tet['id_santri'])){
                                   echo "<a href='' class='btn btn-danger btn-xs'>Batal Lunas</a>";
                               }else{
                                    echo "<a href='' class='btn btn-primary btn-xs'>Lunas</a>";
                               }?>
                               </td>
                               
                               

                               
                               <?php
                               $count++
                               ?>

                            </tr>
                       
                      <?php } ?>
                      
                        

                         
                     
                      </tbody>
                    </table>