<?php $ci = get_instance();?>
<div id="div_print" style="page-break-after: always;">
<style type="text/css">
	.img-valign {
	  vertical-align: middle;
	  margin-bottom: 0.75em;
	}
	.title{
		font-size: 20px;
		font-weight: bold;
		text-align: center;
	}
	.chinese{
		font-family: "KaiTi";
		font-size: 24px;
		font-weight: bold;
		text-align: center;
	}
	.chinese_small{
		font-family: "KaiTi";
		font-size: 14px;
		text-align: center;
	}
	.title_small{
		font-size: 12px;
		text-align: center;
	}
	.small{
		font-size: 10px;
	}

</style>

<div class="title">
	<table style="width:99%; margin-left: auto; margin-right: auto; font-size: 20px;" align="center" border="0">
		<tr>
		    <td rowspan="6" style="width: 25%;"><center><img class="img-valign" src="<?php echo base_url("assets/img/logo.png");?>" style="width: 80px; padding-right: 0px; padding-top: 10px;"></center></td>
		    <td style="padding-left: 0px; width: 500px;"><center><span class="chinese"><?php echo $company->CNAME;?></span></center></td>
		    <td rowspan="4" style="width: 25%;"></td>
	  	</tr>
	  	<tr>
	    	<td style="padding-left: 0px;"><center><span class="title"><?php echo $ci->fm->decrypt($this->company_name);?></span></center></td>
	  	</tr>
	  	<tr>
	    	<td style="padding-left: 0px;"><center><span class="small"><?php echo $company->ADD1;?></span></center></td>
	  	</tr>
	  	<tr>
	    	<td style="padding-left: 0px;"><center><span class="small">Tel: <?php echo $company->TEL;?>	H/P:<?php echo $company->HP;?></span></center></td>
	  	</tr>
	  	<tr>
		    <td style="padding-left: 0px;"><center><span class="small">Fax: <?php echo $company->FAX;?></span></center></td>
		    <td style="text-align: right; font-weight: bold;">ADJUSTMENT</td>
	  	</tr>
	  	<tr>
		    <td style="padding-left: 0px;"><center><span class="small">Co. Reg. No.<?php echo $company->CO_REG_NO;?> | GST Reg. No.<?php echo $company->GST_REG_NO;?></span></center></td>
		    <td style="text-align: right;"><span style="font-family: 'Courier'; font-size: 22px;"></span></td>
	  	</tr>
	  	<tr>
	  		<td colspan="2" style="padding-top: 15px; font-size: 16px;"></td>
	  		<td style="text-align: right; padding-top: 15px; font-size: 16px;"><span class="chinese_small" style="font-size: 16px;">日期</span> / Date: <?php if(isset($data)) echo date("Y-m-d",strtotime($data->DATE));?></td>
	  	</tr>
	</table>
</div>

<div class="report_table_content print_font border">
	<div style="padding-bottom: 30px; padding-top: 2px;">
			<table class="" style="width: 100%;" border="1">
				<thead>
				 	<tr style="" class="report_table_content">
				 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 5px;">
				 			<span class="title_small">No.</span>
				 		</th>
				 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 80px;">
				 			<span class="title_small">Gold</span>
				 		</th>
				 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
				 			<span class="title_small">Description</span>
				 		</th>
				 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 10px;">
				 			<span class="title_small">Weight</span>
				 		</th>
				 		<th class="R" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 80px;">
				 			<span class="title_small">Price</span>
				 		</th>
				 	</tr>
				</thead>
				<tbody>
				<?php if(count($list) > 0):?>
					<?php $no=1;?><tr></tr>
					<?php foreach($list as $x):?>
						<tr class="tr_data" style="font-size: 12px;">
							<td class="" style="white-space: nowrap; text-align: right; padding: 2px 10px;"><?php echo $no;?></td>
							<td class="" style="white-space: nowrap; text-align: right; padding: 2px 10px;"><?php echo $x->GOLD;?></td>
							<td class="" style="white-space: nowrap; text-align: left; padding: 2px 10px;"><?php echo $x->DESCRIPT;?></td>
							<td class="" style="white-space: nowrap; text-align: right; padding: 2px 10px;"><?php echo $x->WEIGHT;?></td>
							<td class="" style="white-space: nowrap; text-align: right; padding: 2px 10px;"><?php echo $x->GOLDPRICE;?></td>
						</tr>
					<?php $no++;?>
					<?php endforeach;?>
				<?php else:?>
				<?php endif;?>
				</tbody>
				<thead>
				 	<tr class="report_table_content">
						<th colspan="4" class="" style="text-align: right; padding: 2px 10px;">Total</th>
						<th style="font-size: 12px; text-align: right; padding: 2px 10px;"><?php echo number_format((float)$gold_total, 2, '.', '');?></th>
				 	</tr>
				</thead>
			<!-- <thead>
				<tr>
					<td>
						<table class="R_table" style="position:fixed;bottom:20mm;">
							<tr>
								<td>
									<table class="R_table" style="margin-top:100px;">
										<tr>
											<td class="R_td R_border_bottom" style="text-align: center; width:40%;">
											</td>
											<td style="width:10%;"></td>
											<td class="R_td R_border_bottom" style="text-align: center; width:40%;">
											</td>
										</tr>
										<tr>
											<td class="R_td" style="text-align: center;">
												<span class="chinese_small">收貨人簽名</span><br/><span class="title_small">Received By:</span><br/><br/>

											</td>
											<td></td>
											<td class="R_td" style="text-align: center;">
												<span class="chinese_small">經手人簽名</span><br/><span class="title_small">Issued By:</span><br/>
												<p style="font-size: 12px;"><?php echo $username;?></p>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</thead>
		</table>
		<table class="R_table" style="position:fixed;bottom:0mm;">
			<tr>
				<td>
					<table style="margin-top:20px;">
						<tr>
							<td class="small" style="text-align: left; padding-right: 10px; font-size: 10px; width: 50%;">
								The abovementioned goods which are handed over on the express condition that they remain the property of <span style="font-weight: bold;">KENG HENG GOLDTECH PTE LTD</span> until fully paid for and the recipientshang shall be held responsible for any loss or damage. Further the abovementioned goods must be returned immediately on demand.
							</td>
							<td class="chinese_small" style="text-align: left; font-size: 12px; width: 50%;">
								上述各貨如取貨人尚未清還銀額乃屬<span style="font-weight: bold;">京興金工私人有限公司</span>之物倘有損失破壞取貨人應當負完全責任如要討取核所收貨人當即可交回。
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table> -->
	</div>
</div>
</div>

<script>
	$(document).ready(function(){
		<?php if(isset($list)):?>
		$(".btn_print").show();
		$(".btn_excel").show();	
		<?php endif;?>	
	});

</script>