      <div class='row'>
       <div class='col-md-12'>
            <div class="card">
             <div class="card-header">	
                <div class='right'>
				      <a class="btn btn-outline-success"  href="?pg=setoran" ><i class="fas fa-plus-circle"></i> Menabung</a>
				<a class="btn btn-danger"  href="?pg=penarikan" ><i class="fas fa-minus-circle"></i> Penarikan</a>
		  </div>			 
                  <h5 class="card-title"><i class="fas fa-graduation-cap"></i> Tabungan</h5>
                </div>
			
           <div class='card-body'>
                    <div class='table-responsive'>
                        <table style="font-size: 11px" id='example1' class='table  table-hover'>
                            <thead>
                            <tr>
                               
                                    <th width='5%'>#</th>
                                    <th width='15%'>NIS</th>
                                    <th>Nama Siswa</th>
                                   <th width='15%'>Kelas</th>
								    <th width='15%'>Saldo</th>
									 <th width='5%'>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
							
                            $data = mysqli_query ($koneksi, " select  
																  tabungan.idsiswa,
																  tabungan.setoran,
																  tabungan.penarikan,
																  tabungan.saldo,
																  sum(tabungan.penarikan) as jumlah_penarikan,
																  sum(tabungan.setoran) as jumlah_setoran,
																  
																  siswa.id_siswa,
																  siswa.nama,
																  siswa.nis,
																  siswa.id_kelas
																
																  from 
																  siswa, tabungan
																  where
																  tabungan.idsiswa = siswa.id_siswa
																  group by siswa.id_siswa DESC");
						while ($row = mysqli_fetch_array ($data))
						{
							
                                $no++;
                              
                            ?>
                                <tr>
                                  
					<td>
						<?php echo $no++; ?>
					</td>
					<td>
						<?php echo $row['nis']; ?>
					</td>
					<td>
						<?php echo $row['nama']; ?>
					</td>
					<td>
						<?php echo $row['id_kelas']; ?>
					</td>
					<td>
						<?php echo number_format($row['jumlah_setoran'] - $row['jumlah_penarikan']); ?>
					</td>
									 <td>
									 <a href="?pg=detail&idsiswa=<?php echo $row['id_siswa'] ; ?>" class="btn btn-success btn-sm">Detail</a>
									 </td>
									  </tr>
                            <?php }
                            ?>


                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
 