<?php 
	$this->load->helper('az_core');
?>
<!DOCTYPE html>
<html>
<head>
	<title>Detail</title>
</head>
<body>
	<input type="hidden" id="hd_idtrx" value="<?php echo az_encode_url($data['idtransaction_group']);?>">
	<table width="100%">
		<tr>
			<td width="50%" valign="top">
				<table>
					<tr>
						<td>Outlet</td>
						<td width="10px" align="center">:</td>
						<td><?php echo $outlet['outlet_name'];?></td>
					</tr>
					<tr>
						<td>Tgl Transaksi</td>
						<td align="center">:</td>
						<td><?php echo Date('d-m-Y H:i', strtotime($data['date']));?></td>
					</tr>
					<tr>
						<td>Tgl Selesai</td>
						<td align="center">:</td>
						<td>
							<?php 
								$duedate = '';
								if (strlen($data['duedate']) > 0) {
									$duedate = Date('d-m-Y H:i', strtotime($data['duedate']));
								}
								echo $duedate;
							?>
						</td>
					</tr>
					<tr>
						<td valign="top">Pelanggan</td>
						<td valign="top" width="10px" align="center">:</td>
						<td valign="top">
							<?php echo $data['customer_name'];?>
						</td>
					</tr>
				</table>
			</td>
			<td valign="top">
				<table>
					<tr>
						<td>Kode Transaksi</td>
						<td width="10px" align="center">:</td>
						<td><?php echo $data['code'];?></td>
					</tr>
					<tr>
						<td>Status Transaksi</td>
						<td align="center">:</td>
						<td><?php echo $data['transaction_group_status'];?></td>
					</tr>
					<tr>
						<td>Status Proses</td>
						<td align="center">:</td>
						<td><?php echo $data['process_status'];?></td>
					</tr>
					<?php 
						if (strlen($data['driver_name']) > 0 && $data['transaction_group_status'] == 'St Proses') {
					?>
					<tr>
						<td>Driver (Penjemputan)</td>
						<td align="center">:</td>
						<td><?php echo $data['driver_name'];?></td>
					</tr>
					<?php
						}
					?>
					<?php 
						if (strlen($data['driver_return_name']) > 0 && $data['transaction_group_status'] == 'St Bersih') {
					?>
					<tr>
						<td>Driver (Pengantaran)</td>
						<td align="center">:</td>
						<td><?php echo $data['driver_return_name'];?></td>
					</tr>
					<?php
						}
					?>
				</table>
			</td>
		</tr>
	</table>
	<br>
	<table class="table table-condensed">
		<?php 
			foreach ($trx as $key => $value) {
		?>
		<tr>
			<td>
				<div class="trx-item">
					<?php echo $value['item_code'].' - '.$value['product_name'];?>
				</div>
				<div class="trx-item-chs">
					<?php 
						if (strlen($value['colour']) > 0) {
							echo 'Warna: '.$value['colour'].'. ';
						}
						if (strlen($value['hue']) > 0) {
							echo 'Corak: '.$value['hue'].'. ';
						}
						if (strlen($value['spot']) > 0) {
							echo 'Noda: '.$value['spot'].'. ';
						}
						if (strlen($value['trx_note']) > 0) {
							echo 'Ket: '.$value['trx_note'];
						}
					?>
				</div>
				<div>
					<?php echo $value['img'];?>
				</div>
				<?php
						foreach ((array) $value['arr_cost'] as $cost_key => $cost_value) {
				?>
				<div>+ <?php echo $cost_value['name'];?></div>
				<?php
						}
				?>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<div style="border:1px dashed #e2e1e1;"></div>
			</td>
		</tr>
		<?php
			}
		?>
	</table>
</body>
</html>