<?php
    function terbilang($satuan) {
		$huruf = array("", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh", "Delapan", "Sembilan", "Sepuluh", "Sebelas");
		if ($satuan < 12)
		return " " . $huruf[$satuan];
		elseif ($satuan < 20)
		return terbilang($satuan - 10) . "Belas";
		elseif ($satuan < 100)
		return terbilang($satuan / 10) . " Puluh" . Terbilang($satuan % 10);
		elseif ($satuan < 200)
		return " seratus" . Terbilang($satuan - 100);
		elseif ($satuan < 1000)
		return terbilang($satuan / 100) . " Ratus" . Terbilang($satuan % 100);
		elseif ($satuan < 2000)
		return " seribu" . Terbilang($satuan - 1000);
		elseif ($satuan < 1000000)
		return terbilang($satuan / 1000) . " Ribu" . Terbilang($satuan % 1000);
		elseif ($satuan < 1000000000)
		return terbilang($satuan / 1000000) . " Juta" . Terbilang($satuan % 1000000);
		elseif ($satuan <= 1000000000)
		echo "Maaf Tidak Dapat di Prose Karena Jumlah Uang Terlalu Besar ";
	} 
	$terbilangs = "# ".strtoupper(terbilang($kwitansi['total']))." #";
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Kwitansi</title> 
    <link href="<?=base_url()?>assets/webadmin/css/print.css" rel="stylesheet" />
</head>
<body>
	<?php $this->load->view('css_pdf.php')?>
	<table width='100%' cellpadding='0' cellspacing='0' class='table'>
		<tr>
			<td align='center' width='150'>
				<img src='<?=$_SERVER["DOCUMENT_ROOT"]?>/assets/webadmin/images/logo.png' width='150'>
			</td>
			<td align='center'>
				<br>
				<h2 style='margin:0px;'><b>NEW ADITYA TOURS</b></h2>
				Jalan Ceremai Ujung No.210 Bantarjati - Bogor Utara<br>
				Hp. 082267788866<br>
				<br>
			</td>
		</tr>
		<tr  >
			<td colspan='2'>
				<div align='center'><h2>K W I T A N S I</h2>
				<table width='100%' cellpadding='0' cellspacing='0' class='clearborder'>
					<tr>
						<td width='100'>Sudah Terima Dari</td>
						<td width='10' align='center'>:</td>
						<td><?=$kwitansi['dari']?></td>
					</tr>
					<tr>
						<td>Terbilang</td>
						<td align='center'>:</td>
						<td><?=$terbilangs;?></td>
					</tr>
					<tr>
						<td>Untuk Pembayaran </td>
						<td align='center'>:</td>
						<td><?=$kwitansi['deskripsi']?></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan='2'>
				<table width='100%' cellpadding='0' cellspacing='0' class='clearborder'>
					<tr>
						<td width='80%'>
							&nbsp;
							<br><br><br><br><br>
							Jumlah Rp. : <?=number_format($kwitansi['total'])?>
						</td>
						<td align='center'>
							Bogor, <?=$kwitansi['tanggal']?>
							<br><br><br><br><br>
							Hendry Ferdiansyah
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>