<?php
error_reporting(E_ALL^(E_NOTICE|E_WARNING));
ini_set('display_errors',1);
error_reporting(0);
?>
<!-- Content Header (Page header) -->
<div class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-12">
        <h1 class="m-0 text-dark"></h1>
      </div><!-- /.col -->
    </div><!-- /.row -->
  </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->

<!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-12">
            <!-- Default box -->
            <div class="card">
              <div class="card-header bg-info">
                <h3 class="card-title "> Rekap Opname Harian</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                  <button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
                    <i class="fas fa-times"></i>
                  </button>
                </div>
              </div>
              <!-- /.card-header -->
        <div class="card-body">
          <?php
          
          
          if(isset($_POST['par1'])){

            $par1= date('Y-m-d',strtotime($_POST['par1']));
            $par2= date('Y-m-d',strtotime($_POST['par2']));
            $kode=$_SESSION['kode'];
            

          }
          ?>
          <form role="form" id="quickForm" action="home.php?home=<?php echo md5("lap_rekap");?>" method="post">
            <div class="form-group row">

              


              <label  for="nama" class="col-2 m-2">Periode Tanggal</label>
              <input type="date" name="par1" class="form-control col-2" value="<?=@$par1?>" required="">
              <input type="date" data-date-format="DD/MMM/YYYY"  name="par2" class="form-control col-2" value="<?=@$par2?>" required=""> <!-- required="" jika kosong tidak bisa jalan -->
              <div class="col-1">
                <input type="submit" id="btnSend" name="proses" class="btn btn-info" style="float: right" value="Preview">
              </div>
                 <?php
            if(isset($_POST['par2'])){ 
            ?>
             <a href="./pdf/lap_rekappdf.php?tgl1=<?php echo $_POST['par1']?>&tgl2=<?php echo $_POST['par2']?>" ><i class="fas fa-file-pdf" style="font-size: 36px;"></i></a>
              <?php
              } 
              ?></div>
              </div>
            </div>
           
          </form>

    <script>
         $(".tm").on("change", function() {
    this.setAttribute(
        "data-date",
        moment(this.value, "YYYY-MM-DD")
        .format( this.getAttribute("data-date-format") )
    )
    }).trigger("change")
    </script>

          <hr>
           <?php if(isset($_POST['par2'])){?>
          <!-- <table id="example3" class="table table-bordered table-hover">
           -->

           <table id="sortTable" class="table table-bordered table-hover">
            <thead>
              <tr>
                <th width="6%">No</th>
                <!-- <th width="12%">Akun</th> -->
                <th width="12%" >Nama</th>                
                <th width="13%" style="text-align :center;"><?php echo date('d-m-Y',strtotime('-1 days',strtotime($_POST['par1'])));?></th>
                <th width="13%" style="text-align :center;"><?php echo $_POST['par2'];?></th>
                <th width="13%" style="text-align :center;">Tumbuh</th>
                <th width="13%" style="text-align :center;">%</th>
                
              </tr>
            </thead>
            <tbody>
              <?php
              
              $par2m = date('m',strtotime($_POST['par2']));
              $par1m =-1+ date('m',strtotime($_POST['par1']));
              $parth = date('Y',strtotime($_POST['par2']));
              /*echo $par1m =-1+ date('m',strtotime($_POST['par2']));*/
              function pers($mdata1, $tdata2){
              if($mdata1 ==0 || $tdata2 ==0){
                echo "0.00";
              }else{
            $data=round($mdata1/$tdata2*100,2);
            return $data;
            }
            }
              include 'koneksi.php';
              $kas1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS kas1 ,b.n_akun as akunkas1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '1.100.%' and a.kode='".$_SESSION['kode']."' AND tanggal<'$par1' ")); 
                extract($kas1);

                 $kas2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS kas2 ,b.n_akun as akunkas2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '1.100.%' and a.kode='".$_SESSION['kode']."' AND tanggal<='$par2' ")); 
                extract($kas2);
                $mkas= $kas2-$kas1;
                $bca1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bca1 ,b.n_akun as akunbca1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun='1.105.10' and a.kode='".$_SESSION['kode']."' AND tanggal<'$par1' ")); 
                extract($bca1);
                 $bca2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bca2 ,b.n_akun as akunbca2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.105.10' and a.kode='".$_SESSION['kode']."' AND tanggal<='$par2' ")); 
                extract($bca2);
                $mbca= $bca2-$bca1;
                $bri1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bri1 ,b.n_akun as akunbri1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.105.20' and a.kode='".$_SESSION['kode']."' AND a.tanggal<'$par1' ")); 
                extract($bri1);
                 $bri2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bri2 ,b.n_akun as akunbri2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.105.20' and a.kode='".$_SESSION['kode']."' AND tanggal<='$par2' ")); 
                extract($bri2);
                $mbri= $bri2-$bri1; 

                $bakidebet1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bakidebet1 ,b.n_akun as akunbakidebet1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.120.10' and a.kode='".$_SESSION['kode']."' AND tanggal<='$par1' ")); 
                extract($bakidebet1);
                 $bakidebet2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS bakidebet2 ,b.n_akun as akunbakidebet2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.120.10' and a.kode='".$_SESSION['kode']."' AND tanggal<='$par2' ")); 
                extract($bakidebet2);
                $mbakidebet= $bakidebet2-$bakidebet1;

                $_mbakidebet1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet)AS mbakidebet1 ,b.n_akun as akunbakidebet1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.120.10' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par1m' AND YEAR(a.tanggal)='$parth' ")); 
                extract($_mbakidebet1);
                 $_mbakidebet2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet)AS mbakidebet2 ,b.n_akun as akunbakidebet2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun ='1.120.10' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par2m' AND YEAR(a.tanggal)='$parth'  "));
                extract($_mbakidebet2);
                $_mbakidebet= $mbakidebet2-$mbakidebet1;


                $pnd1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.kredit-a.debet)AS pnd1 ,b.n_akun as akunpnd1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '4.4%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)<='$par1m' AND YEAR(a.tanggal)<='$parth' ")); 
                extract($pnd1);
                 $pnd2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.kredit-a.debet)AS pnd2 ,b.n_akun as akunpnd2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '4.4%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)<='$par2m' AND YEAR(a.tanggal)<='$parth' ")); 
                extract($pnd2);
                $mpnd= $pnd2-$pnd1;

                $_mpnd1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.kredit-a.debet)AS mpnd1 ,b.n_akun as akunpnd1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '4.4%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par1m' AND YEAR(a.tanggal)='$parth' ")); 
                  extract($_mpnd1);
                 $_mpnd2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.kredit-a.debet)AS mpnd2 ,b.n_akun as akunpnd2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '4.4%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par2m' AND YEAR(a.tanggal)='$parth'  "));
                extract($_mpnd2);
                $_mpnd= $mpnd2-$mpnd1;

                $beban1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS beban1 ,b.n_akun as akunbeban1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '5.5%' and a.kode='".$_SESSION['kode']."' AND MONTH(tanggal)='$par2m' AND YEAR(tanggal)='$parth'  ")); 
                extract($beban1);
                 $beban2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS beban2 ,b.n_akun as akunbeban2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '5.5%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)<='$par1m' AND YEAR(a.tanggal)<='$parth' ")); 
                extract($beban2);
                $mbeban= $beban2-$beban1;
                $_mbeban1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS mbeban1 ,b.n_akun as akunbeban1 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '5.5%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par1m' AND YEAR(a.tanggal)='$parth' ")); 
                extract($_mbeban1);
                 $_mbeban2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT SUM(a.debet-a.kredit)AS mbeban2 ,b.n_akun as akunbeban2 FROM bukubesar a left join kode_akun b ON a.kode_akun=b.k_akun WHERE a.kode_akun LIKE '5.5%' and a.kode='".$_SESSION['kode']."' AND MONTH(a.tanggal)='$par2m' AND YEAR(a.tanggal)='$parth'  "));
                extract($_mbeban2);
                $_mbeban= $mbeban2-$mbeban1;


                $hp1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS hp1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='HP' AND bakidebet>0 ")); 
                extract($hp1);
                 $hp2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS hp2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='HP' AND bakidebet>0 ")); 
                extract($hp2);
                $mhp= $hp2-$hp1;
                $leptop1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS leptop1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='LAPTOP' AND bakidebet>0 ")); 
                extract($leptop1);
                 $leptop2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS leptop2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='LAPTOP' AND bakidebet>0 ")); 
                extract($leptop2);
                $mleptop= $leptop2-$leptop1;
                $tv1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS tv1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='TV' AND bakidebet>0 ")); 
                extract($tv1);
                 $tv2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS tv2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='TV' AND bakidebet>0 ")); 
                extract($tv2);
                $mtv= $tv2-$tv1;
                $kendaraan1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS kendaraan1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='KENDARAAN' AND bakidebet>0 ")); 
                extract($kendaraan1);
                 $kendaraan2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS kendaraan2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='KENDARAAN' AND bakidebet>0 ")); 
                extract($kendaraan2);
                $mkendaraan= $kendaraan2-$kendaraan1;
                $spekeraktor1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS spekeraktor1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='SPEKER AKTOR' AND bakidebet>0 ")); 
                extract($spekeraktor1);
                 $spekeraktor2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS spekeraktor2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='SPEKER AKTOR' AND bakidebet>0 ")); 
                extract($spekeraktor2);
                $mspekeraktor= $spekeraktor2-$spekeraktor1;
                $proyektor1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS proyektor1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='PROYEKTOR' AND bakidebet>0 ")); 
                extract($proyektor1);
                 $proyektor2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS proyektor2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='PROYEKTOR' AND bakidebet>0 ")); 
                extract($proyektor2);
                $mproyektor= $proyektor2-$proyektor1;
                $kamera1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS kamera1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='kamera' AND bakidebet>0 ")); 
                extract($kamera1);
                 $kamera2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS kamera2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='kamera' AND bakidebet>0 ")); 
                extract($kamera2);
                $mkamera= $kamera2-$kamera1;
                $speker_aktif1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS speker_aktif1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='speker_aktif' AND bakidebet>0 ")); 
                extract($speker_aktif1);
                 $speker_aktif2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS speker_aktif2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='speker_aktif' AND bakidebet>0 ")); 
                extract($speker_aktif2);
                $mspeker_aktif= $speker_aktif2-$speker_aktif1;
                $printer1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS printer1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='printer' AND bakidebet>0 ")); 
                extract($printer1);
                 $printer2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS printer2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='printer' AND bakidebet>0 ")); 
                extract($printer2);
                $mprinter= $printer2-$printer1;
                $ps1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS ps1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='ps' AND bakidebet>0 ")); 
                extract($ps1);
                 $ps2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS ps2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='ps' AND bakidebet>0 ")); 
                extract($ps2);
                $mps= $ps2-$ps1;
                $sepeda_gunung1= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS sepeda_gunung1 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<'$par1' AND jaminan='sepeda_gunung' AND bakidebet>0 ")); 
                extract($sepeda_gunung1);
                 $sepeda_gunung2= mysqli_fetch_array(mysqli_query($koneksi,"SELECT COUNT(jaminan)AS sepeda_gunung2 FROM pinjaman WHERE kode='".$_SESSION['kode']."' AND tgl<='$par2' AND jaminan='sepeda_gunung' AND bakidebet>0 ")); 
                extract($sepeda_gunung2);
                $msepeda_gunung= $sepeda_gunung2-$sepeda_gunung1;
              ?>
<tr>
 <td width="6%" >1</td>
 <td width="15"><?php echo $akunkas1; ?></td>
 <td width="15%"align="right"><?php echo number_format($kas1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($kas2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($kas2-$kas1,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mkas,$kas2); ?></td>                  
</tr>
<tr>
 <td width="6%" >2</td>
 <td width="15">BANK BCA</td>
 <td width="15%"align="right"><?php echo number_format($bca1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($bca2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($bca2-$bca1,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mbca,$bca2); ?></td>
</tr>
<tr>
 <td width="6%" >2</td>
 <td width="15">BANK BRI</td>
 <td width="15%"align="right"><?php echo number_format($bri1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($bri2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($bri2-$bri1,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mbri,$bri2); ?></td>
</tr>
<tr>
<td width="6%" >3</td>
 <td width="15">AK BAKIDEBET</td>
 <td width="15%"align="right"><?php echo number_format($bakidebet1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($bakidebet2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mbakidebet,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mbakidebet,$bakidebet2); ?></td> 
</tr>
<tr>
<td width="6%" >4</td>
 <td width="15">BAKIDEBET BULAN</td>
 <td width="15%"align="right"><?php echo number_format($mbakidebet1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mbakidebet2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($_mbakidebet,0); ?></td>
 <td width="15%"align="right"><?php echo pers($_mbakidebet,$mbakidebet2); ?></td> 
</tr>
<tr>
<td width="6%" >5</td>
 <td width="15">AK PENDAPATAN</td>
 <td width="15%"align="right"><?php echo number_format($pnd1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($pnd2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mpnd1,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mpnd,$pnd2); ?></td> 
</tr>
<tr>
<td width="6%" >6</td>
 <td width="15">PENDAPATAN BULAN</td>
 <td width="15%"align="right"><?php echo number_format($mpnd1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mpnd2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($_mpnd,0); ?></td>
 <td width="15%"align="right"><?php echo pers($_mpnd,$mpnd2); ?></td> 
</tr>

<tr>
<td width="6%" >7</td>
 <td width="15">AK BEBAN</td>
 <td width="15%"align="right"><?php echo number_format($beban1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($beban2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mbeban,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mbeban,$beban2); ?></td> 
</tr>
<tr>
<td width="6%" >8</td>
 <td width="15">BEBAN PER BULAN</td>
 <td width="15%"align="right"><?php echo number_format($mbeban1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mbeban2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($_mbeban,0); ?></td>
 <td width="15%"align="right"><?php echo pers($_mbeban,$mbeban2); ?></td> 
</tr>
<tr>
<td width="6%" >9</td>
 <td width="15">HP</td>
 <td width="15%"align="right"><?php echo number_format($hp1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($hp2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mhp,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mhp,$hp2); ?></td> 
</tr>
<tr>
<td width="6%" >10</td>
 <td width="15">LEPTOP</td>
 <td width="15%"align="right"><?php echo number_format($leptop1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($leptop2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mleptop,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mleptop,$leptop2); ?></td> 
</tr>

<tr>
<td width="6%" >11</td>
 <td width="15">TV</td>
 <td width="15%"align="right"><?php echo number_format($tv1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($tv2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mtv,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mtv,$tv2); ?></td> 
</tr>

<tr>
<td width="6%" >12</td>
 <td width="15">KENDARAAN</td>
 <td width="15%"align="right"><?php echo number_format($kendaraan1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($kendaraan2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mkendaraan,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mkendaraan,$kendaraan2); ?></td> 
</tr>

<tr>
<td width="6%" >13</td>
 <td width="15">SPEKER AKTOR</td>
 <td width="15%"align="right"><?php echo number_format($spekeraktor1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($spekeraktor2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mspekeraktor,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mspekeraktor,$spekeraktor2); ?></td> 
</tr>

<tr>
<td width="6%" >14</td>
 <td width="15">PROYEKTOR</td>
 <td width="15%"align="right"><?php echo number_format($proyektor1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($proyektor2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mproyektor,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mproyektor,$proyektor2); ?></td> 
</tr>
<tr>
<td width="6%" >14</td>
 <td width="15">SPEKER AKTIF</td>
 <td width="15%"align="right"><?php echo number_format($speker_aktif1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($speker_aktif2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mspeker_aktif,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mspeker_aktif,$speker_aktif2); ?></td> 
</tr>
<tr>
<td width="6%" >14</td>
 <td width="15">KAMERA</td>
 <td width="15%"align="right"><?php echo number_format($kamera1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($kamera2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mkamera,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mkamera,$kamera2); ?></td> 
</tr>
<tr>
<td width="6%" >14</td>
 <td width="15">PRINTER</td>
 <td width="15%"align="right"><?php echo number_format($printer1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($printer2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mprinter,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mprinter,$printer2); ?></td> 
</tr>
<tr>
<td width="6%" >14</td>
 <td width="15">PS</td>
 <td width="15%"align="right"><?php echo number_format($ps1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($ps2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($mps,0); ?></td>
 <td width="15%"align="right"><?php echo pers($mps,$ps2); ?></td> 
</tr>
<tr>
<td width="6%" >14</td>
 <td width="15">SEPEDA GUNUNG</td>
 <td width="15%"align="right"><?php echo number_format($sepeda_gunung1,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($sepeda_gunung2,0); ?></td>
 <td width="15%"align="right"><?php echo number_format($msepeda_gunung,0); ?></td>
 <td width="15%"align="right"><?php echo pers($msepeda_gunung,$sepeda_gunung2); ?></td> 
</tr>
              
              </table>
              </tbody>

              <script type="text/javascript" charset="utf8" src="./assets/jquery.dataTables.js"></script>
              <!-- <script type="text/javascript" charset="utf8" src="./assets/jquery-1.11.0.min"></script> -->
              <link rel="stylesheet" type="text/css" href="./assets/jquery.dataTables.css">
                  <script>
              $('#sortTable').DataTable(); //https://www.sahretech.com/2020/04/cara-membuat-pencarian-sorting-dan.html?m=1/ cara buat sorter table
              </script>
              
                <!-- <a href="laporan/lap_jurnal_umum_pdf.php" target="_blank" style="float: right;margin-top: 10px;" class="btn btn-success"><i class="fa fa-print"></i> </a> -->

              <?php } ?>
            </div>
            <!-- /.card-body -->
          </div>
          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->

