<?php 
session_start();
ob_start();

 ?>
<html>
<head>
  <title>Cetak PDF</title>
    
   <style>
   table {border-collapse:collapse; table-layout:fixed;width:106%; }
  /* table td {word-wrap:break-word;width: 20%;}*/
    table td {margin: 0 20px 20px 0;}
</style>
<style>
   /*https://www.dicoding.com/blog/cara-membuat-table-di-html/*/
        table {
            /*border-collapse: collapse;*/
        }    
        th, td {
            padding: 8px;
            font-size: 20px;
        }
        p{ margin-top: 0px; 
        font-size: 18px;           
        }
        h5{ margin-top: 0px;
        }
        h4{ margin-bottom: 1px;
        }
    </style>
   
</head>

<body>
    <page_footer align="right">
    Page[[page_cu]]
  </page_footer> 
  <page_header>
  
  </page_header>

 <!-- <table border="0">
  <tr>
   
<th ><img src="./../gambar/logommu.png" style="width:745px;height:100px"align="center" /></th>

</tr>

   </table>  --> 
<?php
if (isset($_GET['tgl1']) AND ($_GET['tgl2'])) {
$par1= date('Y-m-d',strtotime($_GET['tgl1']));
$par2= date('Y-m-d',strtotime($_GET['tgl2']));
$par2m = date('m',strtotime($_GET['tgl2']));
$par1m =-1+ date('m',strtotime($_GET['tgl2']));
$parth = date('Y',strtotime($_GET['tgl2']));
}
?>

<p align="center" style="margin:0px;font-family : Arial; ">PT. MENARA SEMBILAN SEJAHTERA</p>
<p style="font-size:17px;text-align:center;margin:0px; font-family : Arial;"> KANTOR <?php echo $_SESSION['kantor'];?> </p>
<p style="font-size:17px;text-align:center;margin:0px; font-family : Arial;">LAPORAN REKAPITULASI KEUANGAN </p>
 
<p style="font-size:15px;text-align:center;margin:0px; font-family : Arial;"><?php echo $par2; ?> </p>      

<table border="1" align="center" style="padding-top: 19px;padding-bottom: 16px">
<tr>
<td style="text-align: center; background: #ddd;"><b>No.</b></td>
<td style="text-align: center; background: #ddd;"><b>Akun</b></td>
<td style="text-align: center; background: #ddd;"><b><?php echo date('d-m-Y',strtotime('-1 days',strtotime($_GET['tgl1'])));?></b></td>
<td style="text-align: center; background: #ddd;"><b><?php echo $_GET['tgl2'];?></b></td>
<td style="text-align: center; background: #ddd;"><b>Tumbuh</b></td>
<td style="text-align: center; background: #ddd;"><b>%</b></td>

</tr>

<?php
// Load file koneksi.php
include "./../koneksi.php";
 /*include ('../koneksi.php');*/
 error_reporting(0); //hide php errors
/*error_reporting(E_ALL^(E_NOTICE|E_WARNING));
ini_set('display_errors',1);
error_reporting(0);*/
 $no=0;
 
 
              
              
              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 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 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 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 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 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 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 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 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 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 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 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 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 class ="pertama" style="text-align: center; width: 5%" >1</td>
 <td class ="pertama" style="text-align: left; width: 25%"><?php echo $akunkas1; ?></td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($kas1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($kas2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%;"><?php echo number_format($kas2-$kas1,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 8%;"><?php echo pers($mkas,$kas2); ?></td>                  
</tr>
<tr>
 <td class ="pertama" style="text-align: center; width: 5%">2</td>
 <td class ="pertama" style="text-align: left; width: 16%;">BANK BCA</td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($bca1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($bca2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%;"><?php echo number_format($bca2-$bca1,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 8%;"><?php echo pers($mbca,$bca2); ?></td>
</tr>
<tr>
 <td class ="pertama" style="text-align: center; width: 5%">2</td>
 <td class ="pertama" style="text-align: left; width: 16%;">BANK BRI</td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($bri1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%;"><?php echo number_format($bri2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%;"><?php echo number_format($bri2-$bri1,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 8%;"><?php echo pers($mbri,$bri2); ?></td>
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >3</td>
 <td class ="pertama" style="text-align: left; width: 25%">AK BAKIDEBET</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($bakidebet1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($bakidebet2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mbakidebet,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mbakidebet,$bakidebet2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >4</td>
 <td class ="pertama" style="text-align: left; width: 25%">BAKIDEBET BULAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mbakidebet1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mbakidebet2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($_mbakidebet,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($_mbakidebet,$mbakidebet2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >5</td>
 <td class ="pertama" style="text-align: left; width: 25%">AK PENDAPATAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($pnd1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($pnd2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mpnd,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mpnd,$pnd2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >6</td>
 <td class ="pertama" style="text-align: left; width: 25%">PENDAPATAN BULAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mpnd1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mpnd2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($_mpnd,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($_mpnd,$mpnd2); ?></td> 
</tr>

<tr>
<td class ="pertama" style="text-align: center; width: 5%" >7</td>
 <td class ="pertama" style="text-align: left; width: 25%">AK BEBAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($beban1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($beban2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mbeban2,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mbeban,$beban2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >8</td>
 <td class ="pertama" style="text-align: left; width: 25%">BEBAN PER BULAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mbeban1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($mbeban2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($_mbeban,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($_mbeban,$mbeban2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >9</td>
 <td class ="pertama" style="text-align: left; width: 25%">HP</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($hp1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($hp2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mhp,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mhp,$hp2); ?></td> 
</tr>

<tr>
<td class ="pertama" style="text-align: center; width: 5%" >10</td>
 <td class ="pertama" style="text-align: left; width: 25%">LEPTOP</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($leptop1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($leptop2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mleptop,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6;"><?php echo pers($mleptop,$leptop2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >11</td>
 <td class ="pertama" style="text-align: left; width: 25%">TV</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($tv1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($tv2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mtv,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mtv,$tv2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >12</td>
 <td class ="pertama" style="text-align: left; width: 25%">KENDARAAN</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($kendaraan1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($kendaraan2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mkendaraan,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mkendaraan,$kendaraan2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >13</td>
 <td class ="pertama" style="text-align: left; width: 25%">SPEKER AKTOR</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($spekeraktor1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($spekeraktor2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mspekeraktor2,0); ?></td>
 <td class ="pertama" style="text-align: center; width:6"><?php echo pers($mspekeraktor,$spekeraktor2); ?></td> 
</tr>
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">PROYEKTOR</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($proyektor1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($proyektor2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mproyektor,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mproyektor,$proyektor2); ?></td> 
</tr>  
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">KAMERA</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($kamera1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($kamera2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mkamera,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mkamera,$kamera2); ?></td> 
</tr>  
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">SPEKER AKTIF</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($speker_aktif1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($speker_aktif2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mspeker_aktif,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mspeker_aktif,$speker_aktif2); ?></td> 
</tr>  
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">PRINTER</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($printer1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($printer2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mprinter,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mprinter,$printer2); ?></td> 
</tr>  
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">PS</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($ps1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($ps2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($mps,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($mps,$ps2); ?></td> 
</tr>  
<tr>
<td class ="pertama" style="text-align: center; width: 5%" >14</td>
 <td class ="pertama" style="text-align: left; width: 25%">SEPEDA GUNUNG</td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($sepeda_gunung1,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 16%"><?php echo number_format($sepeda_gunung2,0); ?></td>
 <td class ="pertama" style="text-align: right; width: 14%"><?php echo number_format($msepeda_gunung,0); ?></td>
 <td class ="pertama" style="text-align: center; width: 6%"><?php echo pers($msepeda_gunung,$sepeda_gunung2); ?></td> 
</tr>  

                           
 
</table>

</body>
</html>
<?php
$html = ob_get_contents();
ob_end_clean();
        
require '../html2pdf/autoload.php';
$pdf = new Spipu\Html2Pdf\Html2Pdf('L','A4','en');
$pdf->WriteHTML($html);
$pdf->Output('Laporan Rekapitulasi.pdf', 'D');
?>


<!-- https://www.mynotescode.com/cara-mudah-membuat-laporan-pdf-dengan-php-dan-mysql/ -->