<style>
	th, td { text-align: center; vertical-align: middle;}
	.table>thead>tr>th { text-align: center !important; vertical-align: middle !important;}
</style>
<div class="row">
	<div class="col-md-12">
		<div class="portlet box blue-hoki portlet-fit full-height-content full-height-content-scrollable">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-cogs"></i><strong>Warehouse Receive Note : <?php echo getSOData(getWADatafromWAID($id, "so_id"), "marking_no"); ?></strong> 
				</div>
			</div>
			<div class="portlet-body">
				<div class="form-horizontal">
					<div class="form-body">
						<div class="row">
							<div class="col-md-6">
								<div class="form-group">
									<label class="control-label col-md-6">Marking No :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getSOData(getWADatafromWAID($id, "so_id"), "marking_no"); ?>  </p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-6">Transport Company Name :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getWADatafromWAID($WAID, "transport_company_name"); ?>  </p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-6">Consigment Note No :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getWADatafromWAID($WAID, "consignment_note_no"); ?>  </p>
									</div>
								</div>
								<?php $remarks = json_decode(getWADatafromWAID($WAID, "remarks"), true); ?>
								<?php foreach($remarks as $key => $remark){ ?>
								<div class="form-group">
									<label class="control-label col-md-6"><?php echo $remark['form_name']; ?> :</label>
									<div class="col-md-6">
										<p class="form-control-static"> <?php echo $remark['form_value']; ?> </p>
									</div>
								</div>
								<?php } ?>
							</div>
							<div class="col-md-6">
								<div class="form-group">
									<label class="control-label col-md-6">Receive Date :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getWADatafromWAID($WAID, "receive_on"); ?>  </p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-6">Warehouse Receive Note No :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getWADatafromWAID($WAID, "warehouse_receive_note_no"); ?>   </p>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-6">Receiving Person :</label>
									<div class="col-md-6">
										<p class="form-control-static">  <?php echo getWADatafromWAID($WAID, "receiving_person"); ?>   </p>
									</div>
								</div>
							</div>
						</div>
						<table class="table table-striped table-hover table-bordered dataTable">
							<thead>
								<tr>
									<th> No   		          </th>
									<th> Product Description  </th>
									<th> Total Ctn (Nominal)  </th>
									<th> Total Ctn (Actual)   </th>
									<th> CBM (Nominal)		  </th>
									<th> CBM (Actual)         </th>
									<th> Weight (Nominal)     </th>
									<th> Weight (Actual)      </th>
									<th> Status           	  </th>
									<th> Photo           	  </th>
								</tr>
							</thead>
							<tbody>
								<?php $WAItems = getWAItems(getWADatafromWAID($id, "so_id")); $x = 1;?>
								<?php foreach($WAItems as $key => $WAItem){ ?>
								<tr>
									<td><?php echo $x; ?></td>
									<td><?php echo getSOItem($WAItem['so_item_id'], "description"); ?></td>
									<td><?php echo getSOItem($WAItem['so_item_id'], "packaging_quantity"); ?></td>
									<td><?php echo $WAItem['actual_ctn']; ?></td>
									<td><?php echo getSOItem($WAItem['so_item_id'], 'packaging_height') . "x" . getSOItem($WAItem['so_item_id'], 'packaging_width') . "x" . getSOItem($WAItem['so_item_id'], 'packaging_depth'); ?></td>
									<td><?php echo $WAItem['actual_height_ctn'] . "x" . $WAItem['actual_width_ctn'] . "x" . $WAItem['actual_depth_ctn']; ?></td>
									<td><?php echo getSOItem($WAItem['so_item_id'], "packaging_gross"); ?></td>
									<td><?php echo $WAItem['actual_weight_ctn']; ?></td>
									<td><?php echo ($WAItem['status'] == 1 ? "Unmatched" : "Matched")  ?></td>
									<td><img style="max-width: 100px; max-height: 100px;" src="<?php if($WAItem['image'] <> null){ echo $WAItem['image'];}else{ echo "http://www.placehold.it/200/EFEFEF/AAAAAA&amp;text=no+image";} ?>"></td>
								</tr>
								<?php $x++; ?>
								<?php } ?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>