<?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;
	}
	@media print{
		@page {
			size: landscape;
		}

	}
</style>

<div class="title">
	<table style="width:100%; margin-left: auto; margin-right: auto; font-size: 20px;" align="center" border="0">
		<tr>
		    <td 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;">
		    </td>
	    	<td style="padding-left: 0px;"><center><span class="chinese"><?php echo $company->CNAME;?></span><br/><span class="title"><?php echo $ci->fm->decrypt($this->company_name);?></span>
		    </center></td>
		    <td style="text-align: right; font-weight: bold; width: 25%;"></td>
	  	</tr>
	</table>
	<table style="font-size: 12px; width: 100%;" border="0">
		<tr>
			<td class="" style="white-space: nowrap; text-align: left;">Printed By: <?php echo "[".$userid."] ".$username;?></td>
			<td></td>
		</tr>
		<tr>
			<td class="" style="white-space: nowrap; text-align: left;">Print Date: <?php echo date("d M Y h:i A");?></td>
			<td style="text-align: right; font-weight: bold; font-size: 16px;">DEBTOR LIST</td>
		</tr>
	</table>
</div>

<div class="report_table_content print_font border">
	<div style="padding-bottom: 30px; padding-top: 10px;">
		<table class="" style="width: 100%; zoom:80%;" 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;">
			 			<span class="title_small">Code</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 200px;">
			 			<span class="title_small">Name</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px; width: 200px;">
			 			<span class="title_small">Short<br/>Name</span>
			 		</th>
			 		<th class="" style="text-align: center; padding: 2px 10px; width: 500px;">
			 			<span class="title_small">Address</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Tel</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Fax</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Email</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Contact</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Remarks</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Tax Code</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">Reg No.</span>
			 		</th>
			 		<th class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;">
			 			<span class="title_small">GST No.</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: center; padding: 2px 10px;"><?php echo $x->CODE;?></td>
						<td class="" style="text-align: center; padding: 2px 10px;"><?php echo $x->NAME;?></td>
						<td class="" style="text-align: left; padding: 2px 10px;"><?php echo $x->SNAME;?></td>
						<td class="" style="text-align: left; padding: 2px 10px;"><?php echo $x->ADD1;?></td>
						<td class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;"><?php echo $x->TEL1;?></td>
						<td class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;"><?php echo $x->FAX;?></td>
						<td class="" style="white-space: nowrap; text-align: left; padding: 2px 10px;"><?php echo $x->E_MAIL;?></td>
						<td class="" style="white-space: nowrap; text-align: left; padding: 2px 10px;"><?php echo $x->CONTACT;?></td>
						<td class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;"><?php echo $x->REMARKS;?></td>
						<td class="" style="white-space: nowrap; text-align: center; padding: 2px 10px;"><?php echo $x->TAXCODE;?></td>
						<td class="" style="white-space: nowrap; text-align: left; padding: 2px 10px;"><?php echo $x->REGNO;?></td>
						<td class="" style="white-space: nowrap; text-align: left; padding: 2px 10px;"><?php echo $x->GST_NO;?></td>
					</tr>
				<?php $no++;?>
				<?php endforeach;?>
			<?php else:?>
			<?php endif;?>
			</tbody>
		</table>
	</div>
</div>
</div>

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

</script>