<?php $angka1 = $profit * 10 / 100; ?>
<div class="content-header justify-content-between">
        <div>
          <h4 class="content-title content-title-xs">Welcome to Dashboard</h4>
        </div>
      </div><!-- content-header -->
      <div class="content-body">
        <div class="row row-sm">
          <div class="col-sm-4 col-xl">
            <div class="card card-hover card-social-one">
              <div class="card-body">
                <div class="d-flex align-items-center justify-content-between mg-b-10">
                  <h1 class="card-value"><?php echo number_format($angka1,0,',','.'); ?></h1>
                  
                </div>
                <h5 class="card-title tx-primary">Profit</h5>
              </div><!-- card-body -->
            </div><!-- card -->
          </div><!-- col -->
          <div class="col-sm-4 col-xl mg-t-15 mg-sm-t-0">
            <div class="card card-hover card-social-one">
              <div class="card-body">
                <div class="d-flex align-items-center justify-content-between mg-b-10">
                  <h1 class="card-value"><?php echo $pengguna; ?></h1>
                </div>
                <h5 class="card-title tx-pink">Pengguna</h5>
              </div><!-- card-body -->
            </div><!-- card -->
          </div><!-- col -->
          <div class="col-sm-4 col-xl mg-t-15 mg-sm-t-0">
            <div class="card card-hover card-social-one">
              <div class="card-body">
                <div class="d-flex align-items-center justify-content-between mg-b-10">
                  <h1 class="card-value"><?php echo $trx; ?></h1>
                </div>
                <h5 class="card-title tx-teal">Transaksi</h5>
              </div><!-- card-body -->
            </div><!-- card -->
          </div><!-- col -->
          <div class="col-sm-4 col-xl-4 mg-t-15 mg-sm-t-20 mg-xl-t-0">
          	<div class="card card-hover card-social-one">
              <div class="card-body">
                <div class="d-flex align-items-center justify-content-between mg-b-10">
                  <h1 class="card-value"><?php echo $galang; ?></h1>
                </div>
                <h5 class="card-title tx-teal">Galang Dana</h5>
              </div><!-- card-body -->
            </div><!-- card -->
          </div><!-- col -->
          <div class="col-sm-6 col-xl-6 mg-t-15 mg-sm-t-20">
            <div class="card card-hover card-connection-one">
              <div class="card-header">
                <h6 class="card-title mg-b-0">Donasi terbaru</h6>
                <a href="admin/donasi" class="tx-12 tx-medium">Show all <i class="icon ion-android-arrow-forward"></i></a>
              </div><!-- card-header -->
              <div class="card-body">
                <div class="table-responsive">
                	<table class="table table-bordered mg-b-0">
                		<thead>
							<tr>
								<th>Dari</th>
								<th>Jumlah</th>
								<th>Tgl</th>
								<th>Status</th>
							</tr>
						</thead>
						<tbody>
							<?php foreach($listdonasi as $ld): ?>
							<tr>
								<td><?php echo $ld['user_nama']; ?></td>
								<td><?php echo number_format($ld['donasi_jml'],0,',','.'); ?></td>
								<td><?php echo date('d-m-Y', strtotime($ld['donasi_tgl'])); ?></td>
								<td>
									<?php if($ld['donasi_status'] == 1) { ?>
										<span class="badge badge-warning">Pending</span>
									<?php }else if($ld['donasi_status'] == 2) { ?>
										<span class="badge badge-success">Masuk</span>
									<?php }else { ?>
										<span class="badge badge-danger">Gagal</span>
									<?php } ?>
								</td>
							</tr>
							<?php endforeach; ?>
						</tbody>
                	</table>
                </div>
              </div>
            </div><!-- card -->

          </div><!-- col -->
          <div class="col-sm-6 col-xl-6 mg-t-15 mg-sm-t-20">
            <div class="card card-hover card-connection-one">
              <div class="card-header">
                <h6 class="card-title mg-b-0">Top Donatur</h6>
                <a href="admin/laporan/top-donatur" class="tx-12 tx-medium">Show all <i class="icon ion-android-arrow-forward"></i></a>
              </div><!-- card-header -->
              <div class="card-body">
                <div class="table-responsive">
                	<table class="table table-bordered mg-b-0">
                		<thead>
							<tr>
								<th>Nama</th>
								<th>Total</th>
							</tr>
						</thead>
						<tbody>
							<?php foreach($topdonatur as $td): ?>
							<tr>
								<td><?php echo $td['nama']; ?></td>
								<td><?php echo number_format($td['terkumpul'],0,',','.'); ?></td>
							</tr>
							<?php endforeach; ?>
						</tbody>
                	</table>
                </div>
              </div>
            </div><!-- card -->

          </div><!-- col -->
          
        </div><!-- row -->

        
      </div><!-- content-body -->