<?php
require_once("conn.php");

$idpel=$_GET['idpel'];
$tanggal=$_GET['tanggal'];
$jenis=$_GET['jenis'];

$conn=mysqli_connect("$host","$user","$pass") or die("koneksi gagal");
mysqli_select_db($conn,"$db");
$exe = mysqli_query($conn,"SELECT * FROM t_struk where jenis = '$jenis' and idpel= '$idpel' and tanggal= '$tanggal' order by kode asc");

while($record = mysqli_fetch_array($exe)){
                       
	$kode = $record['kode'];
	$jenis = $record['jenis'];
	$idpel = $record['idpel'];
	$nama = $record['nama'];
	$tarif = $record['tarif'];
	$daya = $record['daya'];
	$kwh = $record['kwh'];
	$hargabeli = $record['hargabeli'];
	$nominal = $record['nominal']*1000;

	$iadmin=$record['admin'];
	$admin = number_format($record['admin'],2,",",".");

	$ref = $record['ref'];
	$meter = $record['meter'];
	$bulan = $record['bulan'];

	$itagihan = $record['tagihan'];
	$tagihan = number_format($itagihan,2,",",".");

	$ippn=$record['ppn'];
	$ppn = number_format($ippn,2,",",".");

	$ippj=$record['ppj'];
	$ppj = number_format($ippj,2,",",".");

	$irptoken=number_format($nominal-$ippn-$ippj,2,",",".");
	$irpbayartoken=number_format($nominal+$iadmin,2,",",".");
	$irpbayartagihan=number_format($itagihan+$iadmin,2,",",".");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cetak Struk</title>
<meta name="generator" content="WYSIWYG Web Builder 10 - http://www.wysiwygwebbuilder.com">
<link href="Untitled1.css" rel="stylesheet" type="text/css">
<link href="halo1.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="wb_Text1" style="position:absolute;left:115px;top:5px;width:718px;height:31px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:'Courier New';font-size:27px;"><strong>STRUK PEMBAYARAN TAGIHAN HALO</strong></span></div>
<div id="wb_Text2" style="position:absolute;left:85px;top:245px;width:738px;height:34px;text-align:center;z-index:1;">
<span style="color:#000000;font-family:'Courier New';font-size:15px;">Terimakasih atas kepercayaan Anda membayar melalui loket kami<br>Simpanlah struk ini sebagai bukti pembayaran yang sah.<br><br><hr></span></div>
<table style="position:absolute;left:115px;top:65px;width:804px;height:150px;z-index:2;" cellpadding="0" cellspacing="1" id="Table1">
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">TANGGAL</span></div>
</td>
<td colspan="3" style="background-color:transparent;text-align:left;vertical-align:top;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: <?php echo $tanggal ?></span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">PERIODE</span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: <?php echo $bulan ?></span></div>
</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">NO MSISDN</span></div>
</td>
<td colspan="3" style="background-color:transparent;text-align:left;vertical-align:top;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: <?php echo $idpel ?></span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">NAMA</span></div>
</td>
<td colspan="3" style="background-color:transparent;text-align:left;vertical-align:top;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: <?php echo $nama ?></span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">TAGIHAN</span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:62px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: Rp.</span></div>
</td>
<td style="background-color:transparent;text-align:right;vertical-align:top;width:124px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;"><?php echo $tagihan ?></span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:97px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">ADMIN BANK</span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:62px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: Rp.</span></div>
</td>
<td style="background-color:transparent;text-align:right;vertical-align:top;width:124px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;"><?php echo $admin ?></span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:97px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">RP BAYAR</span></div>
</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:62px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: Rp.&nbsp;&nbsp; </span></div>
</td>
<td style="background-color:transparent;text-align:right;vertical-align:top;width:124px;height:20px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;"><?php echo $irpbayartagihan ?></span></div>
</td>
<td style="background-color:transparent;text-align:right;vertical-align:top;width:97px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:126px;height:20px;">&nbsp;</td>
<td style="background-color:transparent;text-align:left;vertical-align:top;height:20px;">&nbsp;</td>
</tr>
<tr>
<td style="background-color:transparent;text-align:left;vertical-align:top;width:140px;height:22px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">REF</span></div>
</td>
<td colspan="5" style="background-color:transparent;text-align:left;vertical-align:top;height:22px;"><div><span style="color:#000000;font-family:'Courier New';font-size:16px;">: <?php echo $ref ?></span></div>
</td>
</tr>
</table>
</div>
</body>
</html>
<body onload="window.print()">