<!DOCTYPE html>
<html>
<head>
	<title>Marker</title>
	<style type="text/css">
		body {
			width: 5cm;
			/*border: 1px solid black;*/
			font-family: 'helvetica';
			font-size: 12px;
		}
		.tr-note td.lbl{
			font-size: 12px;
		}

		.ico-arrow {
			position: absolute;
			top: 7px;
			right: 0px;
			height: 23px;
		}

	</style>
	<script type="text/javascript" src="<?php echo base_url(); ?>assets/plugins/jquery/jquery.min.js"></script>
</head>
<body onload="window.print();">
	<table style="border-collapse: collapse;" cellpadding="2" width="100%">
		<?php 
			$tot = count($trx);
			$txt = '';
			
			foreach ($trx as $key => $value) {
				$is_row = false;
				$lspan = 3;
				if (strlen($value['trx_note']) > 0) {
					$is_row = true;
					$lspan = 4;
				}
				$is_row_cost = false;
				if (count($value['arr_cost']) > 0) {
					$is_row_cost = true;
					$lspan++;
				}
		?>
			<tr>
		       <td colspan="2">
                       
		          <div style="font-size:16px;text-align:center;font-weight:bold;"><?php echo $data['customer_name'];?>
	                 <?php echo'(' . $outlet['outlet_name'].')';?>
                   </div>
              </td>
			</tr>
			<tr>
				<td colspan="2">
					<div style="font-size:16px;text-align:center;font-weight:bold;"><?php echo $data['code'];?></div>
				</td>
			</tr
			<tr>
				<td colspan="2">
					<div style="font-size:12px;text-align:center;"><?php echo $value['item_code'];?></div>
				</td>
			</tr>
			<tr>
				<td width="50px;">
					<div style="font-size:16px;text-align:center;font-weight: bold;"><?php echo ($key + 1).'/'.$tot;?></div>
				</td>
				<td><?php echo $value['product_name'];?></td>
			</tr>
			<tr>
				<td colspan="2"><?php echo $value['colour'].', '.$value['hue'].', '.$value['spot'];?></td>
			</tr>
			<?php
				if ($is_row) {
			?>
			<tr>
				<td colspan="2"><?php echo $value['trx_note'];?></td>
			</tr>
			<?php
				}
			?>
			<?php
				if (($is_row_cost)) {
					$txt_cost = '';
					foreach ($value['arr_cost'] as $c_key => $c_value) {
						$comma = ', +';
						if ($c_key == 0) {
							$comma = '+';
						}
						$txt_cost .= $comma.$c_value['name'];
					}
			?>
			<tr>
				<td colspan="2"><?php echo $txt_cost;?></td>
			</tr>
			<?php
				}
			?>
			<tr>
				<td colspan="2">
				    <div style="font-size:14px;text-align:center;font-weight:bold;"><?php echo 'Sls : '.Date('d M (H:i)', strtotime($data['duedate']));?>
                     </div>
				
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<div style="border-bottom: 1px solid black;"></div><br>
				</td>
			</tr>
		<?php
			}
		?>
	</table>
</body>
</html>