<!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="1" 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:12px;text-align:center;font-weight:bold;"><?php echo $data['customer_name'];?>
	                 <?php echo'(' . $outlet['outlet_name'].')';?>
                   </div>
              </td>
			</tr>
			<tr>
				<td width="50px;">
					<div style="font-size:18.px;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">
					<div style="font-size:12px;text-align:center;font-weight:bold;">
					    <?php echo $data['code'];?>//
					    <?php echo $value['item_code'];?>
					    </div><br>
				</td>
			</tr>		
			<tr>
				<td colspan="2">
					<div style="border-bottom: 1px solid black;"></div>
				</td>
			</tr>
			<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>
				</td>
			</tr>
			<!--<tr>
				<td colspan="4" style="padding:1px;border-centre-style:none;">
					<table width="100%" cellpadding="1" style="border-collapse: collapse;">
						<tr>
							<td style="border-left-style:none;"><?php echo $value['item_code'];?></td>
				    		<td style="border-left-style:none;"><?php echo $value['item_code'];?></td>
				    		<td style="border-left-style:none;"><?php echo $value['item_code'];?></td>
						    <td style="border-left-style:none;"><?php echo $value['item_code'];?></td>
						</tr>
						<tr>
				<td>
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'A:'.$value['point_a'];?></div>
				</td>
				<td>
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'B:'.$value['point_b'];?></div>
				</td>
				<td>
				
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'C:'.$value['point_c'];?></div>
				</td>
				<td>
				
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'D:'.$value['point_d'];?></div>
				</td>
		</tr>-->
					<!--	<tr>
							<td align="center">C :</td>
							<td align="center"><?php echo $value['point_c'];?></td>
							<td align="center">B :</td>
							<td align="center"><?php echo $value['point_b'];?></td>
							<td align="center" >A :</td>
							<td align="center"><?php echo $value['point_a'];?></td>
						</tr>
					</table>
				</td>
			</tr>
			<!--<tr>
				<td>
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'A:'.$value['point_a'];?></div>
				</td>
				<td>
					<div style="font-size:16px;text-align:left;font-weight: bold;"><?php echo 'B:'.$value['point_b'];?></div>
				</td>
				<td>
				
					<div style="font-siz
					e:16px;text-align:left;font-weight: bold;"><?php echo 'C:'.$value['point_c'];?></div>
				</td>
		</tr>-->
			<tr>
				<td colspan="2">
					<div style="border-bottom: 1px solid black;"></div><br>
				</td>
			</tr>
		<?php
			}
		?>
	</table>
</body>
</html>