<style type="text/css">
._head{
	margin-top: 20px;
	margin-left: 250px;
	font-weight: bold;
	font-size: 16px;
}
._tabHed{
	margin-left: 25px;
}
._hedTitle, ._spasi{
	vertical-align: top;
}
._tabHed tr td{
	font-size: 12px;
}
._isiHead{
	width: 350px;
}
._isiDet{
	border-top: 2px solid #000;
	border-left: 2px solid #000;
}
._isiDet tr th{
	font-size: 11px;
	text-align: center;
	border-bottom: 2px solid #000;
	border-right: 2px solid #000;
	vertical-align: top;
	padding: 2px;
}
._isiDet tr td{
	font-size: 11px;
	border-bottom: 2px solid #000;
	border-right: 2px solid #000;
	vertical-align: top;
	padding: 2px;
}
p{
	margin: 3px;
	font-size: 12px;
}
._ttd tr th{
	text-align: center;
	font-size: 12px;
}
._ttd tr td{
	text-align: center;
	font-size: 12px;
}
</style>
<page backtop="50mm" backbottom="5mm" backleft="5mm" backright="5mm">
    <page_header style="height: 100px; margin-left: 20px">
		<div class="_head">
			&nbsp;
		</div>
		<table class="_tabHed">
			<tr>
				<td class="_hedTitle">Tanggal</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo date("d/m/Y", strtotime($this->data->data->tgl)) ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">No. Penawaran</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->nobo ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">No. Customer</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->kd_sub ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Nama</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->nm_sub ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Alamat Proyek</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->proyek->alamat.'<br>'
												.$this->data->proyek->alamat2.'<br>' 
												.$this->data->proyek->alamat3.'<br>' 
									?>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<?php echo $this->data->data->ket.'<br>'
								.$this->data->data->ket2.'<br>' 
								.$this->data->data->ket3.'<br>' 
					?>
				</td>
			</tr>
		</table>
    </page_header>
	<table cellspacing="0" cellpadding="0" class="_isiDet">
		<thead>
			<tr>
				<th style="width: 90px">Ruang</th>
				<th style="width: 20px">No</th>
				<th style="width: 250px" colspan="2">Item</th>
				<th style="width: 80px" colspan="3">Dimesi</th>
				<th style="width: 30px">Qty</th>
				<th style="width: 90px">Harga Satuan (K)</th>
				<th style="width: 90px">Total Harga (K)</th>
			</tr>
		</thead>
		<tbody>
			<?php 
			$det = array();
			foreach($this->data->det as $row){
				$id  = $row->kd_ruang;
				$id1 = $row->nobod;
				$det[$id][$id1] = $row;
			}
			foreach($det as $row){
				$no = 1;
				$nom = 1;
				foreach($row as $r){
					$dNom = '&nbsp;';
					if($r->jenis == 2){
						$dNom = $nom;
						$nom++;
					}else{
						$r2 = $r;
						$r = '';
						$r->kd_inv = $r2->kd_inv;
						$r->nm_inv = $r2->nm_inv;
					}
			?>
				<tr>
					<?php 
					if($no == 1){ 
					?>
						<td rowspan="<?php echo count($row) ?>" class="_td">
							<div style="width: 100px">
								<?php echo $r->kd_ruang.'<br>'.$r->nm_ruang ?>
							</div>
						</td>
					<?php } ?>
					<td class="_td" style="text-align: center"><?php echo $dNom ?></td>
					<td class="_td" style="width: 70px">
						<div style="width: 70px">
							<?php echo $r->kd_inv ?>
						</div>
					</td>
					<td class="_td">
						<div style="width: 200px">
							<?php echo $r->nm_inv ?>
						</div>
					</td>
					<td class="_td" style="text-align: right"><?php echo $r->p ?></td>
					<td class="_td" style="text-align: right"><?php echo $r->l ?></td>
					<td class="_td" style="text-align: right"><?php echo $r->t ?></td>
					<td class="_td" style="text-align: right"><?php echo $r->qty ?></td>
					<td class="_td" style="text-align: right"><?php echo number_format($r->harga) ?></td>
					<td class="_td" style="text-align: right"><?php echo number_format($r->total) ?></td>
				</tr>
			<?php 
					$no++;
				}
			} 
			?>
		</tbody>
	</table>
</page>
