<style type="text/css">
._head{
	margin-top: 20px;
	margin-left: 20px;
	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{
	margin-top: 10px;
}
._isiDet{
	border-top: 2px solid #000;
	border-left: 2px solid #000;
	font-size: 10px;
}
._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: 10px;
	border-bottom: 2px solid #000;
	border-right: 2px solid #000;
	vertical-align: top;
	padding: 2px;
	width: 200px;
}
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">
			FORM DATA CUSTOMER & PROYEK &nbsp;
			<span style="font-size: 13px"><?php echo $this->data->data->noso ?></span>
			<span style="font-size: 13px">(<?php echo date("d/m/Y", strtotime($this->data->data->tgl)) ?>)</span>
		</div>
		<table class="_tabHed">
			<tr>
				<td class="_hedTitle">&nbsp;</td>
				<td class="_spasi">&nbsp;</td>
				<td class="_isiHead">&nbsp;</td>
				<td class="_hedTitle">&nbsp;</td>
				<td class="_spasi">&nbsp;</td>
				<td class="_isiHead">&nbsp;</td>
			</tr>
			<tr>
				<td class="_hedTitle">Nama</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->nm_sub ?></td>
				<td class="_hedTitle">No. Cust</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->kd_sub ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Alamat</td>
				<td class="_spasi">:</td>
				<td class="_isiHead">
					<?php 
					echo $this->data->sub->alamat;
					if(!empty($this->data->sub->alamat2)){
						echo $this->data->sub->alamat2;
					}
					if(!empty($this->data->sub->alamat3)){
						echo $this->data->sub->alamat3;
					}
					?>
				</td>
				<td class="_hedTitle">Marketing</td>
				<td class="_spasi">:</td>
				<td class="_isiHead" colspan="4"><?php echo $this->data->data->nm_sales ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Alamat Proyek</td>
				<td class="_spasi">:</td>
				<td class="_isiHead" colspan="4">
					<?php 
					echo $this->data->proyek->alamat;
					if(!empty($this->data->proyek->alamat2)){
						echo $this->data->proyek->alamat2;
					}
					if(!empty($this->data->proyek->alamat3)){
						echo $this->data->proyek->alamat3;
					}
					?>
				</td>
			</tr>
			<tr>
				<td class="_hedTitle">Email</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->sub->email ?></td>
				<td class="_hedTitle">CP</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->proyek->cp ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">No.HP</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->sub->telp.' '.$this->data->sub->hp ?></td>
				<td class="_hedTitle">No. Telp Kontraktor</td>
				<td class="_spasi">:</td>
				<td class="_isiHead"><?php echo $this->data->data->telp_kontraktor ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Finish Deadline</td>
				<td class="_spasi">:</td>
				<td class="_isiHead" colspan="4"><?php echo date("d/m/Y", strtotime($this->data->data->tgl_jt)) ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Tipe Proyek</td>
				<td class="_spasi">:</td>
				<td class="_isiHead" colspan="4"><?php echo $this->data->data->model ?></td>
			</tr>
			<tr>
				<td class="_hedTitle">Style Design</td>
				<td class="_spasi">:</td>
				<td class="_isiHead" colspan="4"><?php echo $this->data->data->style ?></td>
			</tr>
		</table>
    </page_header>
	<table cellspacing="0" cellpadding="0" class="_isiDet">
		<thead>
			<tr>
				<th style="width: 20px">No</th>
				<th style="width: 200px">Ruang</th>
				<th style="width: 40px">Tinggi Plafond</th>
				<th style="width: 50px">Kondisi Ruangan</th>
				<th style="width: 200px">Keterangan</th>
				<th style="width: 50px">Gambar 3D</th>
				<th style="width: 50px">Layout</th>
				<th style="width: 50px">Reference</th>
			</tr>
		</thead>
		<tbody>
			<?php 
			$no = 1;
			foreach($this->data->det as $row){
			?>
				<tr>
					<td class="_td" style="width: 20px"><?php echo $no++ ?></td>
					<td class="_td" style="width: 150px"><?php echo $row->nm_ruang ?></td>
					<td class="_td" style="width: 40px;text-align: right"><?php echo $row->tp ?></td>
					<td class="_td" style="width: 50px">
						<?php
						if(!empty($row->file_ruang)){
							echo "<a href='".$this->baseUrl."assets/upload/".$row->file_ruang."' target='_blank'>";
							echo "<img src='".$this->baseUrl."assets/upload/".$row->file_ruang."' style='width: 48px'>";
							echo "</a>";
						}
						?>
					</td>
					<td class="_td" style="width: 200px"><?php echo $row->ket_det ?></td>
					<td class="_td" style="width: 50px">
						<?php
						if(!empty($row->file_3d)){
							echo "<a href='".$this->baseUrl."assets/upload/".$row->file_3d."' target='_blank'>";
							echo "<img src='".$this->baseUrl."assets/upload/".$row->file_3d."' style='width: 48px'>";
							echo "</a>";
						}
						?>
					</td>
					<td class="_td" style="width: 50px">
						<?php
						if(!empty($row->file_3d2)){
							echo "<a href='".$this->baseUrl."assets/upload/".$row->file_3d2."' target='_blank'>";
							echo "<img src='".$this->baseUrl."assets/upload/".$row->file_3d2."' style='width: 48px'>";
							echo "</a>";
						}
						?>
					</td>
					<td class="_td" style="width: 50px">
						<?php
						if(!empty($row->file_3d3)){
							echo "<a href='".$this->baseUrl."assets/upload/".$row->file_3d3."' target='_blank'>";
							echo "<img src='".$this->baseUrl."assets/upload/".$row->file_3d3."' style='width: 48px'>";
							echo "</a>";
						}
						?>
					</td>
				</tr>
			<?php 
				$no++;
			} 
			?>
		</tbody>
	</table>
</page>
