| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/laragon3/www/perpusweb/admin/ |
Upload File : |
<?php
//Define relative path from this script to mPDF
$nama_file='Laporan-Cuti'; //Beri nama file PDF hasil.
define('_MPDF_PATH','../mpdf60/');
//define("_JPGRAPH_PATH", '../mpdf60/graph_cache/src/');
//define("_JPGRAPH_PATH", '../jpgraph/src/');
include(_MPDF_PATH . "mpdf.php");
//include(_MPDF_PATH . "graph.php");
//include(_MPDF_PATH . "graph_cache/src/");
$mpdf=new mPDF('utf-8', 'A4'); // Create new mPDF Document
//Beginning Buffer to save PHP variables and HTML tags
ob_start();
$mpdf->useGraphs = true;
?>
<!DOCTYPE html>
<html>
<head>
<title>Aplikasi Perpustakaan Berbasis Web (PERPUS) |www.rcsolusi.com</title>
<style>
*
{
margin:0;
padding:0;
font-family: calibri;
font-size:10pt;
color:#000;
}
body
{
width:100%;
font-family: calibri;
font-size:8pt;
margin:0;
padding:0;
}
p
{
margin:0;
padding:0;
margin-left: 200px;
}
#wrapper
{
width:200mm;
margin:0 5mm;
}
.page
{
height:297mm;
width:210mm;
page-break-after:always;
}
table
{
border-left: 1px solid #fff;
border-top: 1px solid #fff;
font-family: calibri;
border-spacing:0;
border-collapse: collapse;
}
table td
{
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
padding: 2mm;
}
table.heading
{
height:50mm;
}
h1.heading
{
font-size:10pt;
color:#000;
font-weight:normal;
font-style: italic;
}
h2.heading
{
font-size:10pt;
color:#000;
font-weight:normal;
}
hr
{
color:#ccc;
background:#ccc;
}
#invoice_body
{
height: auto;
}
#invoice_body , #invoice_total
{
width:100%;
}
#invoice_body table , #invoice_total table
{
width:100%;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
border-spacing:0;
border-collapse: collapse;
margin-top:5mm;
}
#invoice_body table td , #invoice_total table td
{
text-align:center;
font-size:8pt;
border-right: 1px solid black;
border-bottom: 1px solid black;
padding:2mm 0;
}
#invoice_body table td.mono , #invoice_total table td.mono
{
text-align:right;
padding-right:3mm;
font-size:8pt;
}
#footer
{
width:200mm;
margin:0 5mm;
padding-bottom:3mm;
}
#footer table
{
width:100%;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
background:#eee;
border-spacing:0;
border-collapse: collapse;
}
#footer table td
{
width:25%;
text-align:center;
font-size:9pt;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
</style>
</head>
<body>
<div id="wrapper">
<?php
include "../conn.php";
?>
<table class="heading" style="width:100%;">
<tr>
<td> <center><p style="text-align:center; font-size: 18px; font-weight:bold;">LAPORAN AKUMULASI PEMINJAMAN</p></center></td>
</tr>
<tr>
<td> <center><p style="text-align:center; font-size: 14px; font-weight:bold;">Perpustakaan Besbasis Web (PERPUS)</p></center></td>
</tr>
</table><br />
<table>
<tr>
<td><td><p style="text-align:left; font-size: 12px; font-weight:bold;">Dari Tanggal : <?php echo $_GET['tglawal']; ?> </p></td></td>
<td><td><p style="text-align:left; font-size: 12px; font-weight:bold;">Sampai Tanggal : <?php echo $_GET['tglakhir']; ?> </p></td></td>
</tr>
</table>
<div id="content">
<div id="invoice_body">
<?php
$tglawal=$_GET['tglawal'];
$tglakhir=$_GET['tglakhir'];
$query1="SELECT trans_pinjam.*, data_buku.* FROM trans_pinjam, data_buku
where trans_pinjam.id_peminjam=data_buku.id AND (tgl_pinjam between '$tglawal'
and '$tglakhir')";
$tampil=mysqli_query($koneksi, $query1) or die(mysqli_error());
?>
<table border="1">
<tr>
<td style="width:5%;"><b>NO</b></td>
<td style="width:25%;"><b>JUDUL</b></td>
<td style="width:20%;"><b>PEMINJAM</b></td>
<td style="width:10%;"><b>TGL PINJAM</b></td>
<td style="width:10%;"><b>TGL KEMBALI</b></td>
<td style="width:10%;"><b>STATUS</b></td>
<td style="width:20%;"><b>KETERANGAN</b></td>
</tr>
<?php
$no=0;
while($data1=mysqli_fetch_array($tampil))
{ $no++;
?>
<tr>
<td style="width:10%;"><b><?php echo $no; ?></b></td>
<td style="width:10%;"><b><?php echo $data1['judul']; ?></b></td>
<td style="width:10%;"><b><?php echo $data1['nama_peminjam']; ?></b></td>
<td style="width:10%;"><b><?php echo $data1['tgl_pinjam']; ?></b></td>
<td style="width:10%;"><b><?php echo $data1['tgl_kembali']; ?></b></td>
<td style="width:10%;"><b><?php echo $data1['status']; ?></b></td>
<td style="width:20%;"><b><?php echo $data1['ket']; ?></b></td>
</tr>
<?php
}
?>
</table>
</div>
<div id="invoice_body">
</div>
<?php
$tampil=mysqli_query($koneksi, "SELECT * FROM trans_pinjam
where (tgl_pinjam between '$tglawal'
and '$tglakhir')");
$total1=mysqli_num_rows($tampil); ?>
<tr>
<td colspan="8"><center><b>TOTAL PEMINJAM : <?php echo $total1; ?></center></b></td>
</tr>
</div>
<br />
</div>
<?php
$html = ob_get_contents(); //Proses untuk mengambil data
ob_end_clean();
//Here convert the encode for UTF-8, if you prefer the ISO-8859-1 just change for $mpdf->WriteHTML($html);
$mpdf->WriteHTML(utf8_encode($html));
// LOAD a stylesheet
$stylesheet = file_get_contents('mpdfstyletables.css');
$mpdf->WriteHTML($stylesheet,1); // The parameter 1 tells that this is css/style only and no body/html/text
$mpdf->WriteHTML($html,1);
$mpdf->Output($nama_file."-".date("Y/m/d H:i:s").".pdf" ,'I');
exit;
?>
</body>
</html>